diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-02-24 05:17:14 +0300 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-03-05 06:37:03 +0300 |
commit | b6e5de2cfbc396ae4f59de2c2bb56432e705d695 (patch) | |
tree | 553d2a7e6f03ad8e0b29e7855f627e613a4325d9 /app/views/shared/milestones | |
parent | 7cc102a0e6568fdfa08e63ba3a0b31ced2c30a7e (diff) |
Use the same partial when rendering Issues or Merge Requests.
Diffstat (limited to 'app/views/shared/milestones')
6 files changed, 7 insertions, 56 deletions
diff --git a/app/views/shared/milestones/_issue.html.haml b/app/views/shared/milestones/_issue.html.haml deleted file mode 100644 index dbef742ebe8..00000000000 --- a/app/views/shared/milestones/_issue.html.haml +++ /dev/null @@ -1,17 +0,0 @@ --# @project is present when viewing Project's milestone -- project = @project || issue.project - -%li{ id: dom_id(issue, 'sortable'), class: 'issue-row', 'data-iid' => issue.iid, 'data-url' => issue_path(issue) } - %span - - if show_project_name - %strong #{project.name} · - - elsif show_full_project_name - %strong #{project.name_with_namespace} · - = link_to_gfm issue.title, [project.namespace.becomes(Namespace), project, issue], title: issue.title - .issue-detail - = link_to [project.namespace.becomes(Namespace), project, issue] do - %span.issue-number ##{issue.iid} - - issue.labels.each do |label| - = render_colored_label(label) - - if issue.assignee - = image_tag avatar_icon(issue.assignee, 16), class: "avatar s24", alt: '' diff --git a/app/views/shared/milestones/_issues.html.haml b/app/views/shared/milestones/_issues.html.haml deleted file mode 100644 index 04053eb854b..00000000000 --- a/app/views/shared/milestones/_issues.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -.panel.panel-default - .panel-heading - = title - .pull-right= issues.size - %ul{ class: "well-list issues-sortable-list", id: "issues-list-#{id}", "data-state" => id } - - issues.sort_by(&:position).each do |issue| - = render 'shared/milestones/issue', issue: issue, show_project_name: show_project_name, show_full_project_name: show_full_project_name diff --git a/app/views/shared/milestones/_issues_tab.html.haml b/app/views/shared/milestones/_issues_tab.html.haml index 277cd81677b..44a221114bb 100644 --- a/app/views/shared/milestones/_issues_tab.html.haml +++ b/app/views/shared/milestones/_issues_tab.html.haml @@ -3,8 +3,8 @@ .row.prepend-top-default .col-md-4 - = render 'shared/milestones/issues', args.merge({ title: 'Unstarted Issues (open and unassigned)', issues: unassigned, id: 'unassigned' }) + = render 'shared/milestones/records', args.merge({ title: 'Unstarted Issues (open and unassigned)', records: unassigned, id: 'unassigned', show_counter: true }) .col-md-4 - = render 'shared/milestones/issues', args.merge({ title: 'Ongoing Issues (open and assigned)', issues: assigned, id: 'ongoing' }) + = render 'shared/milestones/records', args.merge({ title: 'Ongoing Issues (open and assigned)', records: assigned, id: 'ongoing', show_counter: true }) .col-md-4 - = render 'shared/milestones/issues', args.merge({ title: 'Completed Issues (closed)', issues: closed, id: 'closed' }) + = render 'shared/milestones/records', args.merge({ title: 'Completed Issues (closed)', records: closed, id: 'closed', show_counter: true }) diff --git a/app/views/shared/milestones/_merge_request.html.haml b/app/views/shared/milestones/_merge_request.html.haml deleted file mode 100644 index 7b6c6606460..00000000000 --- a/app/views/shared/milestones/_merge_request.html.haml +++ /dev/null @@ -1,17 +0,0 @@ --# @project is present when viewing Project's milestone -- project = @project || merge_request.project - -%li{ id: dom_id(merge_request, 'sortable'), class: 'mr-row', 'data-iid' => merge_request.iid, 'data-url' => merge_request_path(merge_request) } - %span - - if show_project_name - %strong #{project.name} · - - elsif show_full_project_name - %strong #{project.name_with_namespace} · - = link_to_gfm merge_request.title, [project.namespace.becomes(Namespace), project, merge_request], title: merge_request.title - .merge-request-detail - = link_to [project.namespace.becomes(Namespace), project, merge_request] do - %span.merge-request-number ##{merge_request.iid} - - merge_request.labels.each do |label| - = render_colored_label(label) - - if merge_request.assignee - = image_tag avatar_icon(merge_request.assignee, 16), class: "avatar s16", alt: '' diff --git a/app/views/shared/milestones/_merge_requests.html.haml b/app/views/shared/milestones/_merge_requests.html.haml deleted file mode 100644 index 71991516e90..00000000000 --- a/app/views/shared/milestones/_merge_requests.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -- primary = local_assigns.fetch(:primary, false) -- panel_class = primary ? 'panel-primary' : 'panel-default' - -.panel{ class: panel_class } - .panel-heading= title - %ul{ class: "well-list merge_requests-sortable-list", id: "merge_requests-list-#{id}", "data-state" => id } - - merge_requests.sort_by(&:position).each do |merge_request| - = render 'shared/milestones/merge_request', merge_request: merge_request, show_project_name: show_project_name, show_full_project_name: show_full_project_name diff --git a/app/views/shared/milestones/_merge_requests_tab.haml b/app/views/shared/milestones/_merge_requests_tab.haml index d912e607963..15b2876c32d 100644 --- a/app/views/shared/milestones/_merge_requests_tab.haml +++ b/app/views/shared/milestones/_merge_requests_tab.haml @@ -3,10 +3,10 @@ .row.prepend-top-default .col-md-3 - = render 'shared/milestones/merge_requests', args.merge({ title: 'Work in progress (open and unassigned)', merge_requests: unassigned, id: 'unassigned' }) + = render 'shared/milestones/records', args.merge({ title: 'Work in progress (open and unassigned)', records: unassigned, id: 'unassigned' }) .col-md-3 - = render 'shared/milestones/merge_requests', args.merge({ title: 'Waiting for merge (open and assigned)', merge_requests: assigned, id: 'ongoing' }) + = render 'shared/milestones/records', args.merge({ title: 'Waiting for merge (open and assigned)', records: assigned, id: 'ongoing' }) .col-md-3 - = render 'shared/milestones/merge_requests', args.merge({ title: 'Rejected (closed)', merge_requests: closed, id: 'closed' }) + = render 'shared/milestones/records', args.merge({ title: 'Rejected (closed)', records: closed, id: 'closed' }) .col-md-3 - = render 'shared/milestones/merge_requests', args.merge({ title: 'Merged', merge_requests: merged, id: 'merged', primary: true }) + = render 'shared/milestones/records', args.merge({ title: 'Merged', records: merged, id: 'merged', primary: true }) |