add edit link for admin
This commit is contained in:
@@ -13,6 +13,14 @@
|
|||||||
</b-badge>
|
</b-badge>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<b-button
|
||||||
|
v-if="debug"
|
||||||
|
variant="kit" class="btn-edit"
|
||||||
|
:href="`/api/node/${node.id}/edit?destination=/api/node/${node.id}`" target="_blank"
|
||||||
|
>
|
||||||
|
Éditer
|
||||||
|
</b-button>
|
||||||
|
|
||||||
<div v-if="mode === 'view' && node.siblings && node.siblings.length">
|
<div v-if="mode === 'view' && node.siblings && node.siblings.length">
|
||||||
<b-button :id="'siblings-' + node.id" variant="depart" class="btn-shadow siblings">
|
<b-button :id="'siblings-' + node.id" variant="depart" class="btn-shadow siblings">
|
||||||
{{ $t('siblings') }}
|
{{ $t('siblings') }}
|
||||||
@@ -63,6 +71,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
import { toCommaList } from '@/helpers/common'
|
import { toCommaList } from '@/helpers/common'
|
||||||
import { getRelation } from '@/store/utils'
|
import { getRelation } from '@/store/utils'
|
||||||
import { NodeViewTitle, NodeViewBody } from '@/components/nodes'
|
import { NodeViewTitle, NodeViewBody } from '@/components/nodes'
|
||||||
@@ -85,6 +95,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters(['debug']),
|
||||||
|
|
||||||
authors () {
|
authors () {
|
||||||
const authors = this.node.authors
|
const authors = this.node.authors
|
||||||
if (!authors) return 'Pas d\'auteur⋅rices'
|
if (!authors) return 'Pas d\'auteur⋅rices'
|
||||||
@@ -136,7 +148,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-read {
|
.btn-read,
|
||||||
|
.btn-edit {
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
state: {
|
state: {
|
||||||
|
debug: localStorage.getItem('debug') === 'true',
|
||||||
nodes: {},
|
nodes: {},
|
||||||
history: [],
|
history: [],
|
||||||
optionsVisible: true,
|
optionsVisible: true,
|
||||||
@@ -170,6 +171,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
|
debug: state => state.debug,
|
||||||
allNodes: state => state.nodes,
|
allNodes: state => state.nodes,
|
||||||
// Args getters
|
// Args getters
|
||||||
nodes: state => ids => ids.map(id => state.nodes[id]),
|
nodes: state => ids => ids.map(id => state.nodes[id]),
|
||||||
|
|||||||
Reference in New Issue
Block a user