-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue_forum.html
40 lines (38 loc) · 1.16 KB
/
vue_forum.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<script>
var compForum = Vue.component('forum', {
props: ['forumId'],
data() {
return {
sharedState: store.state,
}
},
created() {
this.sharedState.searchVisible = true;
this.sharedState.forumsButtonVisible = true;
this.sharedState.isSpinnerVisible = true;
google.script.run.withSuccessHandler((data) => {
this.sharedState.forum = data;
this.sharedState.isSpinnerVisible = false;
})
.withFailureHandler((e) => {
this.sharedState.isSpinnerVisible = false;
console.log('error');
console.log(e);
console.log(e.message);
}).getForumData(this.forumId);
},
template:
`
<div>
<v-new-topic/>
<router-view v-if="sharedState.forum && sharedState.forum.id"></router-view>
<div class="notification is-warning" v-if="sharedState.forum && sharedState.forum.accessDenied">
This forum is private. To access it please ask the owner for access rights.
</div>
<div class="notification is-warning" v-if="sharedState.forum && sharedState.forum.isClosed">
This forum is closed.
</div>
</div>
`
});
</script>