debian-mirror-gitlab/app/views/shared/milestones/_milestone.html.haml

78 lines
4.2 KiB
Text
Raw Normal View History

2016-06-02 11:05:42 +05:30
- dashboard = local_assigns[:dashboard]
2019-02-15 15:39:39 +05:30
- custom_dom_id = dom_id(milestone.try(:milestone) ? milestone.milestone : milestone)
2018-11-08 19:23:39 +05:30
- milestone_type = milestone.group_milestone? ? 'Group Milestone' : 'Project Milestone'
2016-06-02 11:05:42 +05:30
2017-08-17 22:00:37 +05:30
%li{ class: "milestone milestone-#{milestone.closed? ? 'closed' : 'open'}", id: custom_dom_id }
2016-06-02 11:05:42 +05:30
.row
.col-sm-6
2018-11-08 19:23:39 +05:30
.append-bottom-5
%strong= link_to truncate(milestone.title, length: 100), milestone_path
- if @group
= " - #{milestone_type}"
2017-09-10 17:25:29 +05:30
2018-11-08 19:23:39 +05:30
- if @project || milestone.is_a?(GlobalMilestone) || milestone.group_milestone?
- if milestone.due_date || milestone.start_date
2019-12-26 22:10:19 +05:30
.text-tertiary.append-bottom-5
2018-11-08 19:23:39 +05:30
= milestone_date_range(milestone)
2019-12-26 22:10:19 +05:30
- recent_releases, total_count, more_count = recent_releases_with_counts(milestone)
- unless total_count.zero?
.text-tertiary.append-bottom-5.milestone-release-links
= icon('rocket')
= n_('Release', 'Releases', total_count)
- recent_releases.each do |release|
= link_to release.name, project_releases_path(release.project, anchor: release.tag)
- unless release == recent_releases.last
•
- if total_count > recent_releases.count
•
= link_to n_('%{count} more release', '%{count} more releases', more_count) % { count: more_count }, project_releases_path(milestone.project)
2018-11-08 19:23:39 +05:30
%div
= render('shared/milestone_expired', milestone: milestone)
2018-11-20 20:47:30 +05:30
- if milestone.group_milestone?
.label-badge.label-badge-blue.d-inline-block
= milestone.group.full_name
2018-11-08 19:23:39 +05:30
- if milestone.legacy_group_milestone?
.projects
2019-02-15 15:39:39 +05:30
- link_to milestone_path(milestone.milestone) do
%span.label-badge.label-badge-blue.d-inline-block.append-bottom-5
= dashboard ? milestone.project.full_name : milestone.project.name
- if milestone.project
.label-badge.label-badge-gray.d-inline-block
= milestone.project.full_name
2018-11-08 19:23:39 +05:30
.col-sm-4.milestone-progress
= milestone_progress_bar(milestone)
2017-08-17 22:00:37 +05:30
= link_to pluralize(milestone.total_issues_count(current_user), 'Issue'), issues_path
2020-01-01 13:55:28 +05:30
- if milestone.merge_requests_enabled?
·
= link_to pluralize(milestone.merge_requests_visible_to_user(current_user).size, 'Merge Request'), merge_requests_path
2018-11-08 19:23:39 +05:30
.float-lg-right.light #{milestone.percent_complete(current_user)}% complete
.col-sm-2
.milestone-actions.d-flex.justify-content-sm-start.justify-content-md-end
- if @project
2018-11-29 20:51:05 +05:30
- if can_admin_project_milestones? and milestone.active?
- if can_admin_group_milestones?
2018-11-08 19:23:39 +05:30
%button.js-promote-project-milestone-button.btn.btn-blank.btn-sm.btn-grouped.has-tooltip{ title: _('Promote to Group Milestone'),
disabled: true,
type: 'button',
data: { url: promote_project_milestone_path(milestone.project, milestone),
milestone_title: milestone.title,
group_name: @project.group.name,
target: '#promote-milestone-modal',
container: 'body',
toggle: 'modal' } }
= sprite_icon('level-up', size: 14)
= link_to 'Close Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-sm btn-close btn-grouped"
- unless milestone.active?
2019-07-07 11:18:12 +05:30
= link_to 'Reopen Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :activate }), method: :put, class: "btn btn-grouped btn-reopen"
2018-11-08 19:23:39 +05:30
- if @group
2018-11-20 20:47:30 +05:30
- if can?(current_user, :admin_milestone, @group)
2016-06-02 11:05:42 +05:30
- if milestone.closed?
2018-11-08 19:23:39 +05:30
= link_to 'Reopen Milestone', group_milestone_route(milestone, {state_event: :activate }), method: :put, class: "btn btn-sm btn-grouped btn-reopen"
2016-06-02 11:05:42 +05:30
- else
2018-11-08 19:23:39 +05:30
= link_to 'Close Milestone', group_milestone_route(milestone, {state_event: :close }), method: :put, class: "btn btn-sm btn-grouped btn-close"
- if dashboard
2019-02-15 15:39:39 +05:30
.label-badge.label-badge-gray
2018-11-08 19:23:39 +05:30
= milestone_type