summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/components/ide_status_bar.vue
blob: 152a5f632ad73d860a577be44cd11d0b6dff2208 (plain)
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
<script>
import icon from '~/vue_shared/components/icon.vue';
import tooltip from '~/vue_shared/directives/tooltip';
import timeAgoMixin from '~/vue_shared/mixins/timeago';

export default {
  components: {
    icon,
  },
  directives: {
    tooltip,
  },
  mixins: [timeAgoMixin],
  props: {
    file: {
      type: Object,
      required: true,
    },
  },
};
</script>

<template>
  <div class="ide-status-bar">
    <div class="ref-name">
      <icon
        name="branch"
        :size="12"
      />
      {{ file.branchId }}
    </div>
    <div>
      <div v-if="file.lastCommit && file.lastCommit.id">
        Last commit:
        <a
          v-tooltip
          :title="file.lastCommit.message"
          :href="file.lastCommit.url"
        >
          {{ timeFormated(file.lastCommit.updatedAt) }} by
          {{ file.lastCommit.author }}
        </a>
      </div>
    </div>
    <div class="text-right">
      {{ file.name }}
    </div>
    <div class="text-right">
      {{ file.eol }}
    </div>
    <div
      class="text-right"
      v-if="!file.binary">
      {{ file.editorRow }}:{{ file.editorColumn }}
    </div>
    <div class="text-right">
      {{ file.fileLanguage }}
    </div>
  </div>
</template>