update
This commit is contained in:
parent
79a24f6ae7
commit
e6bceb9d71
24 changed files with 122 additions and 24 deletions
|
|
@ -8,12 +8,37 @@
|
|||
>
|
||||
<v-toolbar-title>{{ $store.state.delegateAdminName }}</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn outlined class="mr-3">
|
||||
<v-btn outlined class="mr-3" @click="openPublishModal()">
|
||||
Publier
|
||||
</v-btn>
|
||||
<v-menu bottom close-on-content-click>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn
|
||||
class="mr-2"
|
||||
icon
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon>more_vert</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-list>
|
||||
<v-list-item @click="goToPage()">
|
||||
<v-list-item-title>Ouvrir la page publique</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item @click="logout()">
|
||||
<v-list-item-title>Se déconnecter</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<!--
|
||||
<v-btn icon @click="goToPage()">
|
||||
<v-icon>open_in_new</v-icon>
|
||||
</v-btn>
|
||||
<v-btn icon @click="logout()">
|
||||
<v-icon>exit_to_app</v-icon>
|
||||
</v-btn>
|
||||
</v-btn> -->
|
||||
<template v-slot:extension>
|
||||
<v-tabs
|
||||
v-model="tab"
|
||||
|
|
@ -83,6 +108,23 @@
|
|||
</v-card-actions>
|
||||
</v-card>
|
||||
</div>
|
||||
<v-dialog v-model="publishModal">
|
||||
<v-card max-width="700px">
|
||||
<v-card-title>
|
||||
Publier les modifications apportés à votre association
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<p>
|
||||
Aliquyam est dolores voluptua consetetur stet erat eos sit. Est eirmod ut et voluptua, et sed eos sanctus sit erat.
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn color="primary" text @click="publishModal = false">Fermer</v-btn>
|
||||
<v-spacer />
|
||||
<v-btn :disabled="!canPublish" text @click="askApproval()">Demander une vérification</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-main>
|
||||
</template>
|
||||
|
||||
|
|
@ -94,13 +136,16 @@ export default {
|
|||
token: '',
|
||||
loadingHandle: null,
|
||||
isSaving: false,
|
||||
tab: 0
|
||||
tab: 0,
|
||||
slug: '',
|
||||
canPublish: false,
|
||||
publishModal: false
|
||||
}),
|
||||
created () {
|
||||
this.init()
|
||||
},
|
||||
watch: {
|
||||
$route (to, from) {
|
||||
$route (to) {
|
||||
this.selectRoute(to)
|
||||
}
|
||||
},
|
||||
|
|
@ -163,13 +208,18 @@ export default {
|
|||
this.loading = false
|
||||
this.enabled = true
|
||||
const organization = res.data.data.organization
|
||||
const proposedVersion = res.data.data.organization.proposedVersion
|
||||
const tags = res.data.data.tags
|
||||
if (organization.proposedVersion.tag !== undefined && organization.proposedVersion.tag !== null) {
|
||||
organization.proposedVersion.tag = organization.proposedVersion.tag._id
|
||||
if (
|
||||
proposedVersion.tag !== undefined &&
|
||||
proposedVersion.tag !== null
|
||||
) {
|
||||
proposedVersion.tag = proposedVersion.tag._id
|
||||
}
|
||||
this.slug = organization.slug
|
||||
this.$store.commit('SET_DELEGATE_ADMIN_NAME', organization.adminName)
|
||||
this.$store.commit('SET_DELEGATE_EMAIL', organization.email)
|
||||
this.$store.commit('SET_DATA', organization.proposedVersion)
|
||||
this.$store.commit('SET_DATA', proposedVersion)
|
||||
this.$store.commit('SET_TAGS', tags)
|
||||
this.$nextTick(() => {
|
||||
setTimeout(this.$refs.tabs.callSlider, 200)
|
||||
|
|
@ -178,7 +228,8 @@ export default {
|
|||
setTimeout(this.$refs.tabs.callSlider, 1000)
|
||||
setTimeout(this.$refs.tabs.callSlider, 1500)
|
||||
})
|
||||
}).catch(() => {
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
clearTimeout(this.loadingHandle)
|
||||
this.loading = false
|
||||
if (this.token !== '' || inUrl) {
|
||||
|
|
@ -216,7 +267,8 @@ export default {
|
|||
color: 'success',
|
||||
text: 'Vos changements ont été sauvegardés !'
|
||||
})
|
||||
}).catch(() => {
|
||||
}).catch(err => {
|
||||
console.log(err.data)
|
||||
this.isSaving = false
|
||||
this.$store.commit('ADD_ALERT', {
|
||||
color: 'error',
|
||||
|
|
@ -233,6 +285,16 @@ export default {
|
|||
if (this.token !== '') {
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
goToPage () {
|
||||
window.open(process.env.VUE_APP_BASE_URL + '/association/' + this.slug, '_blank').focus()
|
||||
},
|
||||
openPublishModal () {
|
||||
// compute if the user can ask approval
|
||||
this.publishModal = true
|
||||
},
|
||||
askApproval () {
|
||||
this.publishModal = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue