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

77 lines
3.6 KiB
Text
Raw Normal View History

2016-06-02 11:05:42 +05:30
- dashboard = local_assigns[:dashboard]
2017-09-10 17:25:29 +05:30
- custom_dom_id = dom_id(milestone.try(:milestones) ? milestone.milestones.first : 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
2017-09-10 17:25:29 +05:30
%strong= link_to truncate(milestone.title, length: 100), milestone_path
2018-03-17 18:26:18 +05:30
- if milestone.group_milestone?
2017-09-10 17:25:29 +05:30
%span - Group Milestone
- else
%span - Project Milestone
2016-06-02 11:05:42 +05:30
.col-sm-6
.pull-right.light #{milestone.percent_complete(current_user)}% complete
.row
.col-sm-6
2017-08-17 22:00:37 +05:30
= link_to pluralize(milestone.total_issues_count(current_user), 'Issue'), issues_path
2016-06-02 11:05:42 +05:30
·
= link_to pluralize(milestone.merge_requests.size, 'Merge Request'), merge_requests_path
.col-sm-6= milestone_progress_bar(milestone)
2018-03-17 18:26:18 +05:30
- if milestone.is_a?(GlobalMilestone) || milestone.group_milestone?
2016-06-02 11:05:42 +05:30
.row
.col-sm-6
2018-03-17 18:26:18 +05:30
- if milestone.legacy_group_milestone?
2017-09-10 17:25:29 +05:30
.expiration= render('shared/milestone_expired', milestone: milestone)
.projects
- milestone.milestones.each do |milestone|
= link_to milestone_path(milestone) do
%span.label.label-gray
2018-03-27 19:54:05 +05:30
= dashboard ? milestone.project.full_name : milestone.project.name
2016-06-02 11:05:42 +05:30
- if @group
2017-09-10 17:25:29 +05:30
.col-sm-6.milestone-actions
2016-06-02 11:05:42 +05:30
- if can?(current_user, :admin_milestones, @group)
2018-03-17 18:26:18 +05:30
- if milestone.group_milestone?
2017-09-10 17:25:29 +05:30
= link_to edit_group_milestone_path(@group, milestone), class: "btn btn-xs btn-grouped" do
Edit
\
2016-06-02 11:05:42 +05:30
- if milestone.closed?
2017-09-10 17:25:29 +05:30
= link_to 'Reopen Milestone', group_milestone_route(milestone, {state_event: :activate }), method: :put, class: "btn btn-xs btn-grouped btn-reopen"
2016-06-02 11:05:42 +05:30
- else
2017-09-10 17:25:29 +05:30
= link_to 'Close Milestone', group_milestone_route(milestone, {state_event: :close }), method: :put, class: "btn btn-xs btn-grouped btn-close"
2016-06-02 11:05:42 +05:30
- if @project
.row
2017-09-10 17:25:29 +05:30
.col-sm-6
= render('shared/milestone_expired', milestone: milestone)
2016-11-03 12:29:30 +05:30
.col-sm-6.milestone-actions
2016-06-02 11:05:42 +05:30
- if can?(current_user, :admin_milestone, milestone.project) and milestone.active?
2017-09-10 17:25:29 +05:30
= link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-xs btn-grouped" do
2016-06-02 11:05:42 +05:30
Edit
\
2018-03-17 18:26:18 +05:30
- if @project.group
2018-03-27 19:54:05 +05:30
%button.js-promote-project-milestone-button.btn.btn-xs.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,
2018-05-01 15:08:00 +05:30
group_name: @project.group.name,
2018-03-27 19:54:05 +05:30
target: '#promote-milestone-modal',
container: 'body',
toggle: 'modal' } }
= _('Promote')
2018-03-17 18:26:18 +05:30
2017-09-10 17:25:29 +05:30
= 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"
2018-03-17 18:26:18 +05:30
2018-03-27 19:54:05 +05:30
%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' )