2019-04-10 10:47:45 +02:00
|
|
|
<template lang="html">
|
|
|
|
<div id="user-tools">
|
2021-03-18 23:13:50 +01:00
|
|
|
<!-- <h4
|
|
|
|
|
|
|
|
> -->
|
|
|
|
<a class="mdi mdi-account" href="/user">
|
2022-03-12 21:57:35 +01:00
|
|
|
<span>{{ name }}</span>
|
|
|
|
<!-- <span v-else>{{ mail }}</span> -->
|
2021-01-11 21:16:42 +01:00
|
|
|
</a>
|
2021-03-18 23:13:50 +01:00
|
|
|
<!-- </h4> -->
|
2019-05-17 18:57:24 +02:00
|
|
|
<a href="/admin/content/materials"
|
|
|
|
v-if="isAdmin"
|
2019-05-19 17:26:13 +02:00
|
|
|
class="mdi mdi-settings"
|
2019-05-20 18:49:31 +02:00
|
|
|
title="admin"
|
2019-05-19 17:26:13 +02:00
|
|
|
></a>
|
2019-04-10 10:47:45 +02:00
|
|
|
<a href="/user/logout"
|
|
|
|
@click.prevent="onLogout()"
|
2019-05-19 17:26:13 +02:00
|
|
|
class="mdi mdi-logout"
|
|
|
|
title="logout"
|
|
|
|
></a>
|
2021-08-05 22:39:38 +02:00
|
|
|
<UserFlags v-if="isAdherent"/>
|
2019-04-10 10:47:45 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapState, mapActions } from 'vuex'
|
|
|
|
|
2020-11-18 13:22:30 +01:00
|
|
|
import UserFlags from 'vuejs/components/User/UserFlags'
|
|
|
|
|
2019-04-10 10:47:45 +02:00
|
|
|
export default {
|
2022-03-08 22:46:14 +01:00
|
|
|
watch: {
|
|
|
|
},
|
2020-11-18 13:22:30 +01:00
|
|
|
components: {
|
|
|
|
UserFlags
|
|
|
|
},
|
2019-04-10 10:47:45 +02:00
|
|
|
// data () {
|
|
|
|
// return {
|
|
|
|
// mail: "Hello User!"
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
computed: {
|
|
|
|
...mapState({
|
2019-05-17 18:57:24 +02:00
|
|
|
mail: state => state.User.mail,
|
2022-03-08 22:46:14 +01:00
|
|
|
name: state => state.User.name,
|
2020-11-18 13:22:30 +01:00
|
|
|
isAdmin: state => state.User.isAdmin,
|
2021-08-05 22:39:38 +02:00
|
|
|
isAdherent: state => state.User.isAdherent,
|
2020-11-18 13:22:30 +01:00
|
|
|
flags: state => state.User.flags
|
2019-04-10 10:47:45 +02:00
|
|
|
})
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions({
|
|
|
|
userLogout: 'User/userLogout'
|
|
|
|
}),
|
|
|
|
onLogout () {
|
2021-03-31 18:42:05 +02:00
|
|
|
console.log('UserTools onLogout')
|
2019-04-10 10:47:45 +02:00
|
|
|
this.userLogout()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="css" scoped>
|
2019-05-21 14:56:34 +02:00
|
|
|
#user-tools{
|
2021-03-31 22:00:37 +02:00
|
|
|
margin-right:0.2em;
|
2019-07-16 11:28:40 +02:00
|
|
|
/* padding-right:0.5em; */
|
|
|
|
/* border-right:1px solid #222; */
|
2019-05-21 14:56:34 +02:00
|
|
|
}
|
2019-05-19 17:26:13 +02:00
|
|
|
h4{
|
2019-05-21 14:56:34 +02:00
|
|
|
margin:0;
|
2019-05-19 17:26:13 +02:00
|
|
|
display:inline-block;
|
|
|
|
font-size:inherited;
|
2020-11-19 21:43:56 +01:00
|
|
|
vertical-align: top;
|
2019-05-19 17:26:13 +02:00
|
|
|
}
|
2019-04-10 10:47:45 +02:00
|
|
|
</style>
|