gitlab-org--gitlab-foss/app/views/shared/milestones/_milestone.html.haml

55 lines
2.7 KiB
Text
Raw Normal View History

2016-03-06 23:07:19 -05:00
- dashboard = local_assigns[:dashboard]
2017-07-07 11:08:49 -04:00
- custom_dom_id = dom_id(milestone.try(:milestones) ? milestone.milestones.first : milestone)
2016-03-06 23:07:19 -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
%strong= link_to truncate(milestone.title, length: 100), milestone_path
- if milestone.group_milestone?
2017-07-07 11:08:49 -04:00
%span - Group Milestone
- else
%span - Project Milestone
2016-03-06 23:07:19 -05:00
.col-sm-6
.pull-right.light #{milestone.percent_complete(current_user)}% complete
2016-03-06 23:07:19 -05:00
.row
.col-sm-6
= link_to pluralize(milestone.total_issues_count(current_user), 'Issue'), issues_path
2016-03-06 23:07:19 -05:00
·
= 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?
2016-03-06 23:07:19 -05:00
.row
.col-sm-6
- if milestone.legacy_group_milestone?
2017-07-07 11:08:49 -04:00
.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
2016-03-06 23:07:19 -05:00
- if @group
2017-07-07 11:08:49 -04:00
.col-sm-6.milestone-actions
2016-03-06 23:07:19 -05:00
- 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
2017-07-07 11:08:49 -04:00
Edit
\
2016-03-06 23:07:19 -05:00
- if milestone.closed?
2017-07-07 11:08:49 -04:00
= link_to 'Reopen Milestone', group_milestone_route(milestone, {state_event: :activate }), method: :put, class: "btn btn-xs btn-grouped btn-reopen"
2016-03-06 23:07:19 -05:00
- else
2017-07-07 11:08:49 -04:00
= link_to 'Close Milestone', group_milestone_route(milestone, {state_event: :close }), method: :put, class: "btn btn-xs btn-grouped btn-close"
2016-03-06 23:07:19 -05:00
- if @project
.row
2017-07-07 11:08:49 -04:00
.col-sm-6
= render('shared/milestone_expired', milestone: milestone)
2016-08-22 18:58:28 -04:00
.col-sm-6.milestone-actions
2016-03-06 23:07:19 -05:00
- 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
2016-03-06 23:07:19 -05:00
Edit
\
= 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"
= link_to project_milestone_path(milestone.project, milestone), data: { confirm: 'Are you sure?' }, method: :delete, class: "btn btn-xs btn-remove btn-grouped" do
2016-03-06 23:07:19 -05:00
Delete