<template>
<v-container>
<v-navigation-drawer
absolute
permanent
left
>
<template v-slot:prepend>
<v-list-item two-line>
<v-list-item-avatar>
<img src="https://randomuser.me/api/portraits/women/81.jpg">
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title>Jane Smith</v-list-item-title>
<v-list-item-subtitle>Logged In</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</template>
{{dataauthorisation}}
<!--<button class="btn btn-default" @click="onSubmit" :style="styling" >Click me</button>-->
<v-btn color="#42cead" dark
@click="onSubmit"
:style="styling"
>Выход</v-btn>
<v-divider></v-divider>
<v-list dense>
<v-list-item
v-for="item in items"
:key="item.title"
:to="item.url"
>
<v-list-item-icon>
<v-icon>{{ item.icon }}</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
</v-navigation-drawer>
<v-card
class="mx-auto"
max-width="800"
tile
>
<v-list-item>
<v-list-item-content>
<v-list-item-title><h1>Адресная книга (список баз)</h1></v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-data-table
v-model="selected"
:headers="headers"
:items="fio"
item-key="first_name"
show-select
class="elevation-1"
>
</v-data-table>
<div class="text-center pt-5 pb-5">
<v-btn color="primary" class="mr-5">Создать базу</v-btn> <v-btn color="error">Удалить базу</v-btn>
</div>
</v-card>
</v-container>
</template>
<script>
import firebase from 'firebase/app'
export default {
data()
{
return {
items: [
{ title: 'Создать рассылку', icon: 'mail_outline', url: '/create_mailing' },
{ title: 'Адресная книга (базы)', icon: 'book', url: '/book_list'},
{ title: 'Адресная книга (внутр)', icon: 'book', url: '/book' },
],
headers: [
{
text: 'ФИО',
align: 'left',
sortable: false,
value: 'first_name',
},
{ text: 'Email', value: 'email' },
{ text: 'День рождения', value: 'birthday' },
],
fio: [
{
first_name: 'Konstantin',
email: 'student@gmail.com',
birthday: '21/06/92' ,
},
{
first_name: 'Misha',
email: 'boy@bk.ru',
birthday: '21/06/92' ,
},
{
first_name: 'Yana',
email: 'girl@mailru' ,
birthday: '21/06/92' ,
},
],
}
},
computed: {dataauthorisation: function () {
var user = firebase.auth().currentUser;
if (user != null) {
return user.email;
//return user.uid;
}
else {
return 'Не авторизованы';
}
},
styling: function() {
var user = firebase.auth().currentUser;
if (user != null) {
return {
visibility: 'visible'
}
}
else {
return {
visibility: 'hidden'
}
}
},
},
methods: {
onSubmit () {
firebase.auth().signOut().then(function() {
alert("Вы вышли из аккаунта");
}).catch(function(error) {
alert("Ошибка выхода");
});
}
}
}
</script>
<?php
$args = array(
'category' => 5,
);
$posts = get_posts( $args );
echo '<div class="col-12 col-md-6 pblock">';
echo '<div class="pblock_inside">';
$thumb = get_the_post_thumbnail_url($post->ID);
echo '<div class="pimg" style="background-image: url('.$thumb.');">';
echo '</div>';
echo '<div class="pdata">';
echo '<a href="'.get_permalink($post->ID).'" class="posta">'.$post->post_title.'</a>';
echo '<div class="pdate">';
echo date('d.m.Y - H:i', strtotime($post->post_date)).' | <?php single_cat_title(); ?>';
echo '</div>';
$content = trim(strip_tags($post->post_content));
$content = mb_substr($content, 0, 150);
echo '<div class="ptext">'.$content.'</div>';
echo '</div>';
echo '</div>';
echo '</div>';
?>