Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pierre-Yves Gicquel
albiziapp
Commits
d173b078
Commit
d173b078
authored
Jun 25, 2019
by
gick
Browse files
setting menu
parent
54dffc7d
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/pages/Admin.vue
View file @
d173b078
...
...
@@ -53,7 +53,7 @@
<v-ons-list-item>
<div
class=
"center"
>
{{
$t
(
'
gamificationMode
'
)
}}
</div>
<div
class=
"right"
>
<v-ons-switch
v-model=
"
$store.state.user.
gamificationMode"
></v-ons-switch>
<v-ons-switch
v-model=
"gamificationMode"
></v-ons-switch>
</div>
</v-ons-list-item>
<v-ons-list-item>
...
...
@@ -185,6 +185,15 @@ export default {
scores
()
{
return
this
.
$store
.
state
.
user
.
scores
;
},
gamificationMode
:{
get
(){
return
this
.
$store
.
state
.
user
.
gamificationMode
},
set
(
val
){
this
.
$store
.
commit
(
"
user/setGamificationMode
"
,
val
);
}
},
identificationMode
:
{
get
()
{
return
this
.
$store
.
state
.
commonData
.
identification
;
...
...
@@ -277,11 +286,6 @@ export default {
},
loadUserData
()
{
axios
.
get
(
"
/api/verification
"
).
then
(
function
(
response
)
{
this
.
verificationsByUser
=
this
.
formatResult
(
response
.
data
);
}.
bind
(
this
)
);
axios
.
get
(
"
/api/identification
"
).
then
(
function
(
response
)
{
this
.
identificationByUser
=
this
.
formatResult
(
response
.
data
);
...
...
src/pages/Home.vue
View file @
d173b078
...
...
@@ -159,6 +159,7 @@ export default {
},
'
uid
'
:{
handler
(){
this
.
$store
.
commit
(
'
user/setGamificationMode
'
,
this
.
backup
.
gamificationMode
)
if
(
this
.
backup
&&
this
.
backup
.
mission
){
this
.
$store
.
commit
(
'
user/restoreBackup
'
)
if
(
this
.
backup
.
time
&&
this
.
backup
.
time
.
duration
>
0
){
...
...
src/pages/Menu.vue
View file @
d173b078
...
...
@@ -14,6 +14,7 @@
<div
class=
"center"
>
{{
item
.
title
}}
</div>
</v-ons-list-item>
<v-ons-list-item
@
click=
"logout"
>
{{
$t
(
'
logout
'
)
}}
</v-ons-list-item>
<v-ons-list-item
@
click=
"settings"
>
Settings
</v-ons-list-item>
<v-ons-list-item
@
click=
"admin"
>
Admin
</v-ons-list-item>
<v-ons-list-item>
{{
$t
(
'
language
'
)
}}
<select
v-model=
"$i18n.locale"
>
...
...
@@ -28,6 +29,8 @@
<
script
>
import
Admin
from
"
./Admin.vue
"
;
import
Settings
from
"
./Settings.vue
"
;
export
default
{
methods
:
{
loadView
(
index
)
{
...
...
@@ -41,6 +44,20 @@ export default {
this
.
$store
.
dispatch
(
"
user/logout
"
);
window
.
location
.
reload
()
},
settings
(){
this
.
$store
.
commit
(
"
navigator/push
"
,
{
extends
:
Settings
,
data
()
{
return
{
toolbarInfo
:
{
backLabel
:
"
Home
"
,
title
:
"
key
"
}
};
}
});
},
admin
()
{
if
(
this
.
isAdmin
){
this
.
$store
.
commit
(
"
navigator/push
"
,
{
...
...
src/pages/Settings.vue
0 → 100644
View file @
d173b078
<
template
>
<v-ons-page>
<custom-toolbar
backLabel=
"Retour"
></custom-toolbar>
<div
class=
"content"
>
<v-ons-list>
<v-ons-list-title>
Settings
</v-ons-list-title>
<v-ons-list-item>
<div
class=
"center"
>
Groupe test
</div>
<div
class=
"right"
>
<v-ons-switch
v-model=
"gamificationMode"
></v-ons-switch>
</div>
</v-ons-list-item>
</v-ons-list>
<v-ons-list>
<v-ons-list-title>
{{
$t
(
'
usersConnected
'
)
}}
</v-ons-list-title>
<v-ons-list-item
v-for=
"(user,index) in userList"
v-bind:key=
"index"
>
<div
class=
"center"
>
{{
user
.
info
.
name
}}
</div>
</v-ons-list-item>
</v-ons-list>
</div>
</v-ons-page>
</
template
>
<
style
>
</
style
>
<
script
>
export
default
{
data
()
{
return
{};
},
computed
:
{
userList
()
{
return
this
.
$store
.
state
.
users
.
userList
;
},
gamificationMode
:
{
get
()
{
return
this
.
$store
.
state
.
user
.
gamificationMode
;
},
set
(
val
)
{
this
.
$store
.
commit
(
"
user/setGamificationMode
"
,
val
);
}
}
}
};
</
script
>
src/store/backupPlugin.js
View file @
d173b078
...
...
@@ -5,6 +5,10 @@ let restoreSession=(oldState,state)=>{
delete
oldState
.
_id
delete
oldState
.
__v
_
.
forOwn
(
oldState
,(
value
,
key
)
=>
{
if
(
key
==
'
gamificationMode
'
){
state
.
user
[
key
]
=
value
}
if
(
value
){
if
(
!
key
.
includes
(
'
_
'
)){
//restoring state/user module
if
(
key
==
'
actionsTransActivite
'
){
...
...
@@ -54,7 +58,7 @@ let backupPlugin = store => {
case
'
user/setActivityStatus
'
:
backup
(
'
activities
'
,
state
.
user
.
activities
)
break
case
'
user/
g
amificationMode
'
:
case
'
user/
setG
amificationMode
'
:
backup
(
'
gamificationMode
'
,
state
.
user
.
gamificationMode
)
break
case
'
user/updateProgression
'
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment