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

60 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
export default {
name: 'AssigneeTitle',
props: {
loading: {
type: Boolean,
required: false,
default: false,
},
numberOfAssignees: {
type: Number,
required: true,
},
editable: {
type: Boolean,
required: true,
},
2017-09-10 17:25:29 +05:30
showToggle: {
type: Boolean,
required: false,
default: false,
},
2017-08-17 22:00:37 +05:30
},
computed: {
assigneeTitle() {
const assignees = this.numberOfAssignees;
return assignees > 1 ? `${assignees} Assignees` : 'Assignee';
},
},
template: `
<div class="title hide-collapsed">
{{assigneeTitle}}
<i
v-if="loading"
aria-hidden="true"
class="fa fa-spinner fa-spin block-loading"
/>
<a
v-if="editable"
2018-03-17 18:26:18 +05:30
class="js-sidebar-dropdown-toggle edit-link pull-right"
2017-08-17 22:00:37 +05:30
href="#"
>
2018-03-17 18:26:18 +05:30
{{ __('Edit') }}
2017-08-17 22:00:37 +05:30
</a>
2017-09-10 17:25:29 +05:30
<a
v-if="showToggle"
aria-label="Toggle sidebar"
class="gutter-toggle pull-right js-sidebar-toggle"
href="#"
role="button"
>
<i
aria-hidden="true"
data-hidden="true"
class="fa fa-angle-double-right"
/>
</a>
2017-08-17 22:00:37 +05:30
</div>
`,
};