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>
|
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>
|
2020-11-19 17:09:48 +01:00
|
|
|
<UserFlags/>
|
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 {
|
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,
|
2020-11-18 13:22:30 +01:00
|
|
|
isAdmin: state => state.User.isAdmin,
|
|
|
|
flags: state => state.User.flags
|
2019-04-10 10:47:45 +02:00
|
|
|
})
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions({
|
|
|
|
userLogout: 'User/userLogout'
|
|
|
|
}),
|
|
|
|
onLogout () {
|
2020-11-18 13:22:30 +01: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{
|
|
|
|
margin-right:0.5em;
|
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>
|