Header.vue 2.37 KB
Newer Older
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
41
42
43
44
45
46
47
48
49
50
51
52
<template>
  <header>
    <div class="content-width header-branding section group">
      <div class="col span_3_of_4">
        <span class="header-title">AUTOradio dashboard</span>
      </div>
      <div class="col span_1_of_4">
        <img class="header-logo" src="../assets/logo.jpg" />
      </div>
    </div>
    <div class="content-width section group">
      <div class="col span_1_of_4">
        <router-link to="help"><img src="../assets/help-browser-32x32.png" alt="Help symbol"></router-link>
      </div>
      <div class="col span_2_of_4">
        <nav>
          Go to:
          <select v-model="activeModule.route" v-on:change="activateModule" v-on:click="activateModule">
            <option v-for="mod in modules" v-bind:value="'/' + mod.slug">{{ mod.title }}</option>
          </select>
        </nav>
      </div>
      <div class="col span_1_of_4">
        <div v-if="user.logged_in">
          Logged in as: {{ user.name }}
          <router-link v-bind:to="{ name: 'login', params: { action: 'logout'} }">(Log out)</router-link>
        </div>
        <div v-if="! user.logged_in">
          You are not logged in. <router-link to="login">Log in</router-link>
        </div>
      </div>
    </div>
  </header>
</template>

<script>
export default {
  props: {
    modules: { type: Array, required: true },
    activeModule: { type: Object, required: true },
    user: { type: Object, required: true }
  },
  methods: {
    activateModule () {
      this.$router.push(this.activeModule.route)
    }
  }
}
</script>

<style>
header {
53
54
55
56
57
58
59
  background: #ad7fa8; /* for browsers that don't support gradients */
/*  background: linear-gradient(#ad7fa8, #888a85); /* light magenta to light alu */
/*  background: linear-gradient(#ad7fa8, #555753); /* light magenta to medium alu */
/*  background: linear-gradient(#ad7fa8, #5c3566); /* light magenta to dark magenta */
/*  background: linear-gradient(#ad7fa8, #75507b); /* light magenta to medium magenta */
/*  background: linear-gradient(#5c3566, #555753); /* dark magenta to light alu */
  background: linear-gradient(#5c3566, #ad7fa8); /* dark magenta to light magenta */
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
  border-bottom: 1px solid #5c3566;
}
nav {
  text-align: left;
}
.header-branding {
  height: 75px;
  line-height: 75px;
}
.header-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 3em;
  vertical-align: middle;
}
.header-logo {
  width: 75px;
  height: 75px;
}

</style>