Activate restitution carto debate

This commit is contained in:
Henintsoa 2021-11-25 17:26:39 +03:00
parent 77f9c7a6a3
commit ff4da8ec86
3 changed files with 97 additions and 0 deletions

View file

@ -55,6 +55,10 @@
</div>
</template>
<template v-slot:action.1="{ value: debate }">
<router-link v-bind:to="debate.id+'/restitution'" append class="waves-effect waves-light btn">Restitution</router-link>
</template>
<template v-slot:action.2="{ value: debate }">
<router-link v-bind:to="''+debate.id" append class="waves-effect waves-light btn">Aller au débat</router-link>
</template>

View file

@ -26,6 +26,7 @@ const router = new VueRouter({
{path: '/documents-debats-sur-cartes/:id', component: vueLoader('views/documentDebatesSurCarte')},
{path: '/debats-sur-cartes', component: vueLoader('views/debatesSurCarte')},
{path: '/debats-sur-cartes/:id', component: vueLoader('views/debateSurCarte')},
{path: '/debats-sur-cartes/:id/restitution', component: vueLoader('views/restitutionDebateSurCarte')},
{path: '*', component: vueLoader('views/404')},
]
});

View file

@ -0,0 +1,92 @@
<template>
<base-layout v-if="debate"
id="restitution">
<template v-slot:title>
<h1>Débat - {{ debate.document.name }} </h1>
<label class="author">{{ $t("by").toLowerCase() }} <span>{{ debate.document.author }}</span> </label>
</template>
<template v-slot:right>
<label class="details">
<p>{{ $t('proposed_by') }} : {{ debate.owner.fullName() }}</p>
<p>{{ $t('with') }} : {{ debate.teams.map( t => t.name ).join(", ") }}</p>
</label>
</template>
<tabs-layout
v-if="debate"
v-bind:tabs="[
{id: 'tree', label:$t('debate_tree')},
{id: 'pie', label:$t('comment_repartition')},
{id: 'sunburst', label:$t('debate_sunburst')},
{id: 'tags', label:$t('tags'), hidden: !debate.idfixLink},
]"
v-bind:with-link="true">
<template v-slot:tab.1>
<d3-tree ref="debateTree"
v-bind:debate="debate"
@bullet="$router.push({ path: '../' + debate.id , query: { comment: $event.id } })">
</d3-tree>
</template>
<template v-slot:tab.2>
<d3-pie ref="debatePie"
v-bind:debate="debate">
</d3-pie>
</template>
<template v-slot:tab.3>
<d3-sunburst ref="debateSunburst"
v-bind:debate="debate">
</d3-sunburst>
</template>
<template v-slot:tab.4>
<tags-restitution ref="tagsRestitution"
v-bind:debate="debate">
</tags-restitution>
</template>
</tabs-layout>
<template v-slot:addons>
</template>
</base-layout>
</template>
<script>
module.exports = {
data() {
return {
debate: false,
debateUsers: [],
debateOpinions: [],
byLetter: false,
byOpinion: false,
totalChar: 0,
totalComment: 0
}
},
mounted() {
this.fetchData();
},
methods: {
fetchData() {
ArenService.Debates.get({
id: this.$route.params.id,
onSuccess: (debate) => {
this.debate = debate;
},
onError: () => {
this.$router.push("/404");
}
});
}
},
components: {
'd3-tree': vueLoader('components/widgets/D3Tree'),
'd3-pie': vueLoader('components/widgets/D3Pie'),
'd3-sunburst': vueLoader('components/widgets/D3Sunburst'),
'tags-restitution': vueLoader('components/widgets/tagsRestitution'),
'debate-print': vueLoader('components/widgets/debatePrint')
}
};
</script>