materio-d9/web/themes/custom/materiotheme/vuejs/components/User/UserTools.vue

71 lines
1.3 KiB
Vue
Raw Normal View History

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">
<span>{{ mail }}</span>
</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"
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'
import UserFlags from 'vuejs/components/User/UserFlags'
2019-04-10 10:47:45 +02:00
export default {
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,
isAdmin: state => state.User.isAdmin,
2021-08-05 22:39:38 +02:00
isAdherent: state => state.User.isAdherent,
flags: state => state.User.flags
2019-04-10 10:47:45 +02:00
})
},
methods: {
...mapActions({
userLogout: 'User/userLogout'
}),
onLogout () {
console.log('UserTools onLogout')
2019-04-10 10:47:45 +02:00
this.userLogout()
}
}
}
</script>
<style lang="css" scoped>
#user-tools{
margin-right:0.2em;
2019-07-16 11:28:40 +02:00
/* padding-right:0.5em; */
/* border-right:1px solid #222; */
}
2019-05-19 17:26:13 +02:00
h4{
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>