mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
ask confirmation to toggle admin status to an user
This commit is contained in:
parent
24efa270b6
commit
7255e791e8
3 changed files with 8 additions and 3 deletions
|
@ -23,8 +23,8 @@
|
|||
v-alert(type='info' :closable='false' :icon='mdiInformation') {{$t('admin.user_add_help')}}
|
||||
v-card-actions
|
||||
v-spacer
|
||||
v-btn(@click='newUserDialog=false' color='error') {{$t('common.cancel')}}
|
||||
v-btn(@click='createUser' :disabled='!valid' color='primary') {{$t('common.send')}}
|
||||
v-btn(@click='newUserDialog=false' color='error' outlined) {{$t('common.cancel')}}
|
||||
v-btn(@click='createUser' :disabled='!valid' color='primary' outlined) {{$t('common.send')}}
|
||||
|
||||
v-card-text
|
||||
//- USERS LIST
|
||||
|
@ -101,6 +101,9 @@ export default {
|
|||
},
|
||||
async toggleAdmin (user) {
|
||||
try {
|
||||
const configMsg = user.is_admin ? 'admin.disable_admin_user_confirm' : 'admin.enable_admin_user_confirm'
|
||||
const ret = await this.$root.$confirm(configMsg, { user: user.email })
|
||||
if (!ret) { return }
|
||||
user.is_admin = !user.is_admin
|
||||
await this.$axios.$put('/user', user)
|
||||
} catch (e) {
|
||||
|
|
|
@ -174,6 +174,8 @@
|
|||
"remove_admin": "Remove admin",
|
||||
"disable_user_confirm": "Are you sure you want to disable {user}?",
|
||||
"delete_user_confirm": "Are you sure you want to remove {user}?",
|
||||
"disable_admin_user_confirm": "Are you sure to remove admin permissions from {user}?",
|
||||
"enable_admin_user_confirm": "Are sure to add admin permissions to {user}",
|
||||
"user_remove_ok": "User removed",
|
||||
"user_create_ok": "User created",
|
||||
"event_remove_ok": "Event removed",
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
color='orange') {{$t('login.not_registered')}}
|
||||
|
||||
v-btn(color='success'
|
||||
type='submit'
|
||||
type='submit' outlined
|
||||
:disabled='!valid || loading' :loading='loading') {{$t('common.login')}}
|
||||
|
||||
</template>
|
||||
|
|
Loading…
Reference in a new issue