debian-mirror-gitlab/app/assets/javascripts/sidebar/components/assignees/assignee_title.vue

63 lines
1.3 KiB
Vue
Raw Normal View History

2018-05-09 12:01:36 +05:30
<script>
2020-04-08 14:13:33 +05:30
import { GlLoadingIcon } from '@gitlab/ui';
2019-09-30 21:07:59 +05:30
import { n__ } from '~/locale';
2018-05-09 12:01:36 +05:30
export default {
name: 'AssigneeTitle',
2020-04-08 14:13:33 +05:30
components: {
GlLoadingIcon,
},
2018-05-09 12:01:36 +05:30
props: {
loading: {
type: Boolean,
required: false,
default: false,
},
numberOfAssignees: {
type: Number,
required: true,
},
editable: {
type: Boolean,
required: true,
},
showToggle: {
type: Boolean,
required: false,
default: false,
},
},
computed: {
assigneeTitle() {
const assignees = this.numberOfAssignees;
2019-09-30 21:07:59 +05:30
return n__('Assignee', `%d Assignees`, assignees);
2018-05-09 12:01:36 +05:30
},
},
};
</script>
<template>
2020-01-01 13:55:28 +05:30
<div class="title hide-collapsed">
2018-05-09 12:01:36 +05:30
{{ assigneeTitle }}
2020-04-08 14:13:33 +05:30
<gl-loading-icon v-if="loading" inline class="align-bottom" />
2019-12-04 20:38:33 +05:30
<a
v-if="editable"
class="js-sidebar-dropdown-toggle edit-link float-right"
href="#"
2019-12-21 20:55:43 +05:30
data-track-event="click_edit_button"
data-track-label="right_sidebar"
data-track-property="assignee"
2019-12-04 20:38:33 +05:30
>
2018-05-09 12:01:36 +05:30
{{ __('Edit') }}
</a>
<a
v-if="showToggle"
2019-09-30 21:07:59 +05:30
:aria-label="__('Toggle sidebar')"
2018-11-08 19:23:39 +05:30
class="gutter-toggle float-right js-sidebar-toggle"
2018-05-09 12:01:36 +05:30
href="#"
role="button"
>
2019-09-30 21:07:59 +05:30
<i aria-hidden="true" data-hidden="true" class="fa fa-angle-double-right"></i>
2018-05-09 12:01:36 +05:30
</a>
</div>
</template>