2019-09-09 09:31:08 +02:00
|
|
|
<template>
|
2020-03-12 14:29:21 +01:00
|
|
|
<section>
|
2019-09-12 11:34:01 +02:00
|
|
|
<h1 class="title">{{ $t('Administration') }}</h1>
|
2019-09-09 09:31:08 +02:00
|
|
|
<div class="tile is-ancestor" v-if="dashboard">
|
2020-03-12 14:29:21 +01:00
|
|
|
<div class="tile is-vertical">
|
2019-09-09 09:31:08 +02:00
|
|
|
<div class="tile">
|
|
|
|
<div class="tile is-parent is-vertical is-6">
|
|
|
|
<article class="tile is-child box">
|
2020-03-12 14:29:21 +01:00
|
|
|
<p class="dashboard-number">{{ dashboard.numberOfEvents }}</p>
|
2020-02-18 08:47:41 +01:00
|
|
|
<p>{{ $t('Published events')}}</p>
|
2019-09-09 09:31:08 +02:00
|
|
|
</article>
|
|
|
|
<article class="tile is-child box">
|
2020-03-12 14:29:21 +01:00
|
|
|
<p class="dashboard-number">{{ dashboard.numberOfComments}}</p>
|
2020-02-18 08:47:41 +01:00
|
|
|
<p>{{ $t('Comments')}}</p>
|
2019-09-09 09:31:08 +02:00
|
|
|
</article>
|
|
|
|
</div>
|
|
|
|
<div class="tile is-parent is-vertical">
|
|
|
|
<article class="tile is-child box">
|
2020-03-12 14:29:21 +01:00
|
|
|
<p class="dashboard-number">{{ dashboard.numberOfUsers }}</p>
|
2020-02-18 08:47:41 +01:00
|
|
|
<p>{{ $t('Users')}}</p>
|
2019-09-09 09:31:08 +02:00
|
|
|
</article>
|
2019-10-03 12:32:20 +02:00
|
|
|
<router-link :to="{ name: RouteName.REPORTS}">
|
2019-09-09 09:31:08 +02:00
|
|
|
<article class="tile is-child box">
|
2020-03-12 14:29:21 +01:00
|
|
|
<p class="dashboard-number">{{ dashboard.numberOfReports }}</p>
|
2020-02-18 08:47:41 +01:00
|
|
|
<p>{{ $t('Opened reports')}}</p>
|
2019-09-09 09:31:08 +02:00
|
|
|
</article>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tile is-parent" v-if="dashboard.lastPublicEventPublished">
|
2019-10-03 12:32:20 +02:00
|
|
|
<router-link :to="{ name: RouteName.EVENT, params: { uuid: dashboard.lastPublicEventPublished.uuid } }">
|
|
|
|
<article class="tile is-child box">
|
2020-03-12 14:29:21 +01:00
|
|
|
<p class="dashboard-number">{{ $t('Last published event') }}</p>
|
2019-10-03 12:32:20 +02:00
|
|
|
<p class="subtitle">{{ dashboard.lastPublicEventPublished.title }}</p>
|
|
|
|
<figure class="image is-4by3" v-if="dashboard.lastPublicEventPublished.picture">
|
|
|
|
<img :src="dashboard.lastPublicEventPublished.picture.url" />
|
|
|
|
</figure>
|
|
|
|
</article>
|
|
|
|
</router-link>
|
2019-09-09 09:31:08 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
import { DASHBOARD } from '@/graphql/admin';
|
|
|
|
import { IDashboard } from '@/types/admin.model';
|
2019-10-03 12:32:20 +02:00
|
|
|
import { RouteName } from '@/router';
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
apollo: {
|
|
|
|
dashboard: {
|
|
|
|
query: DASHBOARD,
|
|
|
|
},
|
|
|
|
},
|
2019-12-03 11:29:51 +01:00
|
|
|
metaInfo() {
|
|
|
|
return {
|
|
|
|
title: this.$t('Administration') as string,
|
|
|
|
titleTemplate: '%s | Mobilizon',
|
|
|
|
};
|
|
|
|
},
|
2019-09-09 09:31:08 +02:00
|
|
|
})
|
|
|
|
export default class Dashboard extends Vue {
|
|
|
|
dashboard!: IDashboard;
|
2019-10-03 12:32:20 +02:00
|
|
|
RouteName = RouteName;
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-03-12 14:29:21 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.dashboard-number {
|
|
|
|
color: #3C376E;
|
|
|
|
font-size: 40px;
|
|
|
|
font-weight: 700;
|
|
|
|
line-height: 1.125;
|
|
|
|
}
|
|
|
|
</style>
|