debian-mirror-gitlab/app/assets/javascripts/groups/components/group_folder.vue

57 lines
1.1 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2018-03-17 18:26:18 +05:30
import { n__ } from '../../locale';
import { MAX_CHILDREN_COUNT } from '../constants';
2017-09-10 17:25:29 +05:30
export default {
props: {
2018-03-17 18:26:18 +05:30
parentGroup: {
2017-09-10 17:25:29 +05:30
type: Object,
required: false,
default: () => ({}),
},
2018-03-17 18:26:18 +05:30
groups: {
type: Array,
required: false,
default: () => ([]),
},
},
computed: {
hasMoreChildren() {
return this.parentGroup.childrenCount > MAX_CHILDREN_COUNT;
},
moreChildrenStats() {
return n__(
'One more item',
'%d more items',
this.parentGroup.childrenCount - this.parentGroup.children.length,
);
},
2017-09-10 17:25:29 +05:30
},
};
</script>
<template>
<ul class="content-list group-list-tree">
<group-item
v-for="(group, index) in groups"
:key="index"
:group="group"
2018-03-17 18:26:18 +05:30
:parent-group="parentGroup"
2017-09-10 17:25:29 +05:30
/>
2018-03-17 18:26:18 +05:30
<li
v-if="hasMoreChildren"
class="group-row">
<a
:href="parentGroup.relativePath"
class="group-row-contents has-more-items">
<i
class="fa fa-external-link"
aria-hidden="true"
>
</i>
{{ moreChildrenStats }}
</a>
</li>
2017-09-10 17:25:29 +05:30
</ul>
</template>