68 lines
3.5 KiB
Text
68 lines
3.5 KiB
Text
- dashboard = local_assigns[:dashboard]
|
|
- custom_dom_id = dom_id(milestone.try(:milestones) ? milestone.milestones.first : milestone)
|
|
|
|
%li{ class: "milestone milestone-#{milestone.closed? ? 'closed' : 'open'}", id: custom_dom_id }
|
|
.row
|
|
.col-sm-6
|
|
%strong= link_to truncate(milestone.title, length: 100), milestone_path
|
|
- if milestone.group_milestone?
|
|
%span - Group Milestone
|
|
- else
|
|
%span - Project Milestone
|
|
|
|
.col-sm-6
|
|
.pull-right.light #{milestone.percent_complete(current_user)}% complete
|
|
.row
|
|
.col-sm-6
|
|
= link_to pluralize(milestone.total_issues_count(current_user), 'Issue'), issues_path
|
|
·
|
|
= link_to pluralize(milestone.merge_requests.size, 'Merge Request'), merge_requests_path
|
|
.col-sm-6= milestone_progress_bar(milestone)
|
|
- if milestone.is_a?(GlobalMilestone) || milestone.group_milestone?
|
|
.row
|
|
.col-sm-6
|
|
- if milestone.legacy_group_milestone?
|
|
.expiration= render('shared/milestone_expired', milestone: milestone)
|
|
.projects
|
|
- milestone.milestones.each do |milestone|
|
|
= link_to milestone_path(milestone) do
|
|
%span.label.label-gray
|
|
= dashboard ? milestone.project.name_with_namespace : milestone.project.name
|
|
- if @group
|
|
.col-sm-6.milestone-actions
|
|
- if can?(current_user, :admin_milestones, @group)
|
|
- if milestone.group_milestone?
|
|
= link_to edit_group_milestone_path(@group, milestone), class: "btn btn-xs btn-grouped" do
|
|
Edit
|
|
\
|
|
- if milestone.closed?
|
|
= link_to 'Reopen Milestone', group_milestone_route(milestone, {state_event: :activate }), method: :put, class: "btn btn-xs btn-grouped btn-reopen"
|
|
- else
|
|
= link_to 'Close Milestone', group_milestone_route(milestone, {state_event: :close }), method: :put, class: "btn btn-xs btn-grouped btn-close"
|
|
|
|
- if @project
|
|
.row
|
|
.col-sm-6
|
|
= render('shared/milestone_expired', milestone: milestone)
|
|
.col-sm-6.milestone-actions
|
|
- if can?(current_user, :admin_milestone, milestone.project) and milestone.active?
|
|
= link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-xs btn-grouped" do
|
|
Edit
|
|
\
|
|
|
|
- if @project.group
|
|
= link_to promote_project_milestone_path(milestone.project, milestone), title: "Promote to Group Milestone", class: 'btn btn-xs btn-grouped', data: { confirm: "Promoting #{milestone.title} will make it available for all projects inside #{@project.group.name}. Existing project milestones with the same name will be merged. This action cannot be reversed.", toggle: "tooltip" }, method: :post do
|
|
Promote
|
|
|
|
= link_to 'Close Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-xs btn-close btn-grouped"
|
|
|
|
%button.js-delete-milestone-button.btn.btn-xs.btn-grouped.btn-danger{ data: { toggle: 'modal',
|
|
target: '#delete-milestone-modal',
|
|
milestone_id: milestone.id,
|
|
milestone_title: markdown_field(milestone, :title),
|
|
milestone_url: project_milestone_path(milestone.project, milestone),
|
|
milestone_issue_count: milestone.issues.count,
|
|
milestone_merge_request_count: milestone.merge_requests.count },
|
|
disabled: true }
|
|
= _('Delete')
|
|
= icon('spin spinner', class: 'js-loading-icon hidden' )
|