PageSubNav.vue 1.7 KB
Newer Older
Mathias Bär's avatar
Mathias Bär committed
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
<template lang="pug">
  div
    template(v-if="getButtons()")
      q-btn.q-mr-sm(
      v-for="b in getButtons()",
      @click="$router.push({ name: b.name, params: { uuid: $route.params.uuid } })",
      :class="$route.name === b.name ? 'text-primary' : ''",
      :label="b.label",
      flat
      )

</template>

<script>

  export default {
    name: 'breadcrumb-nav',
    props: ['type'],
    components: {
    },
    data () {
      return {
        buttons: {
          timeline: [
            {
              name: 'piecemaker.timelines.show',
              label: 'Videos'
            },
            {
              name: 'piecemaker.timelines.annotate',
              label: 'Live Annotate'
            },
            {
              name: 'piecemaker.timelines.edit',
              label: 'Edit'
            },
            {
              name: 'piecemaker.timelines.search',
              label: 'Search'
            }
          ],
          video: [
            {
              name: 'piecemaker.videos.annotate',
              label: 'Annotate'
            },
            {
              name: 'piecemaker.videos.edit',
              label: 'Edit'
            },
            {
              name: 'piecemaker.videos.sync',
              label: 'Sync'
            }
          ]
        }
      }
    },
    computed: {
    },
    mounted () {
    },
    watch: {
    },
    methods: {
      toProperCase (t) {
        return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase()
      },
      getButtons () {
        if (this.type in this.buttons) {
          return this.buttons[this.type]
        }
        else return undefined
      }
    }
  }
</script>

<style scoped lang="stylus">
  @import '~variables'

</style>