2017-11-30 15:46:30 +00:00
|
|
|
<template>
|
|
|
|
|
2017-12-04 10:56:02 +00:00
|
|
|
<div id='HEADER'>
|
2017-12-01 14:47:14 +00:00
|
|
|
|
|
|
|
<!-- Header Icon+Title -->
|
2017-12-04 10:56:02 +00:00
|
|
|
<div id='header-icon' @click='gstore.func.toggleMenuSize'>
|
2017-12-01 14:47:14 +00:00
|
|
|
<div class='header-title'>{{ gstore.header_title }}</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Header Info -->
|
2017-12-03 15:02:18 +00:00
|
|
|
<div id='header-info' v-show='gstore.info.active' :class='gstore.info.type'>{{ gstore.info.message }}</div>
|
2017-12-01 14:47:14 +00:00
|
|
|
|
|
|
|
<!-- Header Notif -->
|
|
|
|
<div id='header-notif'>
|
2017-12-07 17:17:32 +00:00
|
|
|
<div v-for='(notif, link) in gstore.notif' @click='show_notif(link)' :class='"hnotif " + notif.class' :data-count='notif.count'></div>
|
2017-12-08 00:22:03 +00:00
|
|
|
<div v-if='!is_connected' @click='show_login()' class='hnotif login'></div>
|
|
|
|
<div v-if='is_connected' @click='logout()' class='hnotif logout'></div>
|
2017-12-01 14:47:14 +00:00
|
|
|
</div>
|
|
|
|
|
2017-11-30 15:46:30 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2017-12-01 14:47:14 +00:00
|
|
|
name: 'HEADER',
|
2017-12-08 00:22:03 +00:00
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
gstore: gstore.data,
|
|
|
|
is_connected: _SERVER.session.connected
|
|
|
|
};
|
|
|
|
},
|
2017-12-03 15:02:18 +00:00
|
|
|
methods: {
|
2017-12-05 13:00:27 +00:00
|
|
|
show_notif(uri){
|
2017-12-05 17:41:39 +00:00
|
|
|
this.gstore.func.nav(this.$router, uri);
|
2017-12-07 21:25:58 +00:00
|
|
|
},
|
|
|
|
show_login() {
|
2017-12-07 22:40:29 +00:00
|
|
|
this.gstore.signupform = false;
|
|
|
|
this.gstore.loginform = !this.gstore.loginform;
|
2017-12-08 00:22:03 +00:00
|
|
|
},
|
|
|
|
logout() {
|
|
|
|
api.call('DELETE user/logout', null, function() {
|
|
|
|
document.location = '';
|
|
|
|
});
|
2017-12-03 15:02:18 +00:00
|
|
|
}
|
|
|
|
}
|
2017-11-30 15:46:30 +00:00
|
|
|
}
|
|
|
|
</script>
|