2016-03-06 23:07:19 -05:00
- dashboard = local_assigns[:dashboard]
2018-12-20 06:14:33 -05:00
- custom_dom_id = dom_id(milestone.try(:milestone) ? milestone.milestone : milestone)
2020-05-18 20:07:58 -04:00
- milestone_type = milestone.group_milestone? ? s_('Milestones|Group Milestone') : s_('Milestones|Project Milestone')
2016-03-06 23:07:19 -05:00
2016-12-26 05:47:16 -05:00
%li{ class: "milestone milestone-#{milestone.closed? ? 'closed' : 'open'}", id: custom_dom_id }
2016-03-06 23:07:19 -05:00
.row
.col-sm-6
2020-06-30 02:08:49 -04:00
.gl-mb-2
2020-07-03 05:08:53 -04:00
%strong{ data: { qa_selector: "milestone_link", qa_milestone_title: milestone.title } }
= link_to truncate(milestone.title, length: 100), milestone_path(milestone)
2020-09-11 08:08:50 -04:00
- if @group || dashboard
2018-06-20 18:22:44 -04:00
= " - #{milestone_type}"
2017-07-07 11:08:49 -04:00
2020-05-28 08:08:10 -04:00
- if milestone.due_date || milestone.start_date
2020-06-30 02:08:49 -04:00
.text-tertiary.gl-mb-2
2020-05-28 08:08:10 -04:00
= milestone_date_range(milestone)
- recent_releases, total_count, more_count = recent_releases_with_counts(milestone)
2020-07-30 14:09:39 -04:00
- unless total_count == 0
2020-06-30 02:08:49 -04:00
.text-tertiary.gl-mb-2.milestone-release-links
2020-06-15 17:08:35 -04:00
= sprite_icon("rocket", size: 12)
2020-05-28 08:08:10 -04:00
= 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
2019-11-04 10:07:36 -05:00
•
2020-05-28 08:08:10 -04:00
- if total_count > recent_releases.count
•
2021-03-03 13:11:16 -05:00
- more_text = n_('%{count} more release', '%{count} more releases', more_count) % { count: more_count }
- if milestone.project_milestone?
= link_to more_text, project_releases_path(milestone.project)
- else
= more_text
2020-05-28 08:08:10 -04:00
%div
= render('shared/milestone_expired', milestone: milestone)
- if milestone.group_milestone?
2021-12-06 13:14:09 -05:00
= gl_badge_tag milestone.group.full_name, variant: :info
2020-05-28 08:08:10 -04:00
- if milestone.project_milestone?
2021-12-06 13:14:09 -05:00
= gl_badge_tag milestone.project.full_name, variant: :muted
2018-06-18 12:14:10 -04:00
2018-06-19 07:09:33 -04:00
.col-sm-4.milestone-progress
2018-06-18 10:12:44 -04:00
= milestone_progress_bar(milestone)
2020-05-18 20:07:58 -04:00
= link_to pluralize(milestone.total_issues_count, _('Issue')), issues_path
2019-12-03 13:06:49 -05:00
- if milestone.merge_requests_enabled?
·
2021-04-08 14:09:32 -04:00
= link_to pluralize(milestone.total_merge_requests_count, _('Merge request')), merge_requests_path
2020-03-06 19:08:25 -05:00
.float-lg-right.light #{milestone.percent_complete}% complete
2018-06-18 10:12:44 -04:00
.col-sm-2
2018-06-18 12:14:10 -04:00
.milestone-actions.d-flex.justify-content-sm-start.justify-content-md-end
2020-05-28 08:08:10 -04:00
- if @project # if in milestones list on project level
- if can_admin_group_milestones?
2021-04-01 02:09:29 -04:00
%button.js-promote-project-milestone-button.btn.gl-button.btn-icon.btn-default-tertiary.btn-sm.has-tooltip{ title: s_('Milestones|Promote to Group Milestone'),
2020-05-28 08:08:10 -04:00
disabled: true,
type: 'button',
data: { url: promote_project_milestone_path(milestone.project, milestone),
milestone_title: milestone.title,
2021-01-14 19:10:45 -05:00
group_name: @project.group.name } }
2021-04-01 02:09:29 -04:00
= sprite_icon('level-up', size: 14, css_class: 'gl-button-icon gl-icon')
2020-05-28 08:08:10 -04:00
- if can?(current_user, :admin_milestone, milestone)
- if milestone.closed?
2021-04-01 02:09:29 -04:00
= link_to s_('Milestones|Reopen Milestone'), milestone_path(milestone, milestone: { state_event: :activate }), method: :put, class: "btn gl-button btn-sm gl-ml-3"
2020-05-28 08:08:10 -04:00
- else
2021-04-01 02:09:29 -04:00
= link_to s_('Milestones|Close Milestone'), milestone_path(milestone, milestone: { state_event: :close }), method: :put, class: "btn gl-button btn-default btn-default-secondary btn-sm gl-ml-3"