add edit link for admin

This commit is contained in:
axolotle
2021-08-01 15:41:31 +02:00
parent fab868c7ed
commit bdfb80e092
2 changed files with 16 additions and 1 deletions
+14 -1
View File
@@ -13,6 +13,14 @@
</b-badge>
</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">
<b-button :id="'siblings-' + node.id" variant="depart" class="btn-shadow siblings">
{{ $t('siblings') }}
@@ -63,6 +71,8 @@
</template>
<script>
import { mapGetters } from 'vuex'
import { toCommaList } from '@/helpers/common'
import { getRelation } from '@/store/utils'
import { NodeViewTitle, NodeViewBody } from '@/components/nodes'
@@ -85,6 +95,8 @@ export default {
},
computed: {
...mapGetters(['debug']),
authors () {
const authors = this.node.authors
if (!authors) return 'Pas d\'auteur⋅rices'
@@ -136,7 +148,8 @@ export default {
}
}
.btn-read {
.btn-read,
.btn-edit {
pointer-events: auto;
}
+2
View File
@@ -17,6 +17,7 @@ import {
export default {
state: {
debug: localStorage.getItem('debug') === 'true',
nodes: {},
history: [],
optionsVisible: true,
@@ -170,6 +171,7 @@ export default {
},
getters: {
debug: state => state.debug,
allNodes: state => state.nodes,
// Args getters
nodes: state => ids => ids.map(id => state.nodes[id]),