BigW Consortium Gitlab

ide_status_bar.vue 1.39 KB
Newer Older
1
<script>
2 3 4 5
  import { mapState } from 'vuex';
  import icon from '../../vue_shared/components/icon.vue';
  import tooltip from '../../vue_shared/directives/tooltip';
  import timeAgoMixin from '../../vue_shared/mixins/timeago';
6

7 8 9
  export default {
    components: {
      icon,
10
    },
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    directives: {
      tooltip,
    },
    mixins: [
      timeAgoMixin,
    ],
    props: {
      file: {
        type: Object,
        required: true,
      },
    },
    computed: {
      ...mapState([
        'selectedFile',
      ]),
    },
  };
29 30 31
</script>

<template>
32
  <div class="ide-status-bar">
33 34 35
    <div>
      <icon
        name="branch"
36 37
        :size="12"
      />
38 39 40
      {{ selectedFile.branchId }}
    </div>
    <div>
41
      <div v-if="selectedFile.lastCommit && selectedFile.lastCommit.id">
42 43 44 45
        Last commit:
        <a
          v-tooltip
          :title="selectedFile.lastCommit.message"
46 47 48
          :href="selectedFile.lastCommit.url"
        >
          {{ timeFormated(selectedFile.lastCommit.updatedAt) }} by
49 50
          {{ selectedFile.lastCommit.author }}
        </a>
51
      </div>
52
    </div>
53
    <div class="text-right">
54 55
      {{ selectedFile.name }}
    </div>
56
    <div class="text-right">
57 58
      {{ selectedFile.eol }}
    </div>
59
    <div class="text-right">
60 61
      {{ file.editorRow }}:{{ file.editorColumn }}
    </div>
62
    <div class="text-right">
63 64 65 66
      {{ selectedFile.fileLanguage }}
    </div>
  </div>
</template>