App.vue 1.84 KB
Newer Older
1
2
<template>
  <div id="app">
3
4
5
6
7
8
    <app-header
      :modules="modules"
      :user="user"
    />
    <router-view />
    <app-footer />
9
10
11
12
  </div>
</template>

<script>
13
14
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
15
16
17
18
import header from './components/Header.vue'
import footer from './components/Footer.vue'

export default {
19
  name: 'App',
20
21
22
23
24
25
  components: {
    'app-header': header,
    'app-footer': footer
  },
  data () {
    return {
26
27
28
29
      modules_logged_out: [
        { slug: 'home', title: 'Home' },
      ],
      modules_logged_in: [
30
31
32
33
34
35
36
37
38
        { slug: 'home', title: 'Home' },
        { slug: 'shows', title: 'Shows' },
        { slug: 'files', title: 'Files & Playlists' },
      ],
      modules_logged_in_superuser : [
        { slug: 'home', title: 'Home' },
        { slug: 'shows', title: 'Shows' },
        { slug: 'files', title: 'Files & Playlists' },
        { slug: 'emissions', title: 'Emissions' },
39
40
      ],
    }
41
42
  },
  computed: {
43
44
    userOIDC () { return this.$store.state.auth.userOIDC },
    user () { return this.$store.state.auth.user },
45
    modules: function () {
46
47
48
49
50
51
52
53
54
      if (this.user.logged_in === true) {
        if (this.user.steeringUser && this.user.steeringUser.is_superuser) {
          return this.modules_logged_in_superuser
        } else {
          return this.modules_logged_in
        }
      } else {
        return this.modules_logged_out
      }
55
56
    }
  },
57
  created () {
58
    this.$store.dispatch('auth/oidcInit')
59
  },
60
61
  methods: {
    signIn () {
62
      this.$store.dispatch('auth/signinRedirect')
63
64
    },
    signOut () {
65
      this.$store.dispatch('auth/signoutRedirect')
66
    },
67
68
69
70
71
  }
}
</script>

<style>
72
73
74
html, body, #app {
  height: 100%;
}
75
#app {
76
  color: #2e3436;
77
78
  display: flex;
  flex-direction: column;
79
}
80
/*
81
82
83
84
85
#app .content-width {
  margin: auto;
  width: 920px;
  max-width: 920px;
}
86
*/
87
</style>