diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-02-24 04:12:10 +0300 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-03-05 06:37:03 +0300 |
commit | 7cc102a0e6568fdfa08e63ba3a0b31ced2c30a7e (patch) | |
tree | fde3bf11765f9e981b638bef300407f974d1c4ef /app/views/shared/milestones | |
parent | e0a18829ee7f1d681500002a2b6bda122b64b4c7 (diff) |
Make Merge Requests tab have the same look as Issues.
Diffstat (limited to 'app/views/shared/milestones')
-rw-r--r-- | app/views/shared/milestones/_merge_request.html.haml | 14 | ||||
-rw-r--r-- | app/views/shared/milestones/_merge_requests.html.haml | 7 | ||||
-rw-r--r-- | app/views/shared/milestones/_merge_requests_tab.haml | 15 |
3 files changed, 22 insertions, 14 deletions
diff --git a/app/views/shared/milestones/_merge_request.html.haml b/app/views/shared/milestones/_merge_request.html.haml index 66e2a2955da..7b6c6606460 100644 --- a/app/views/shared/milestones/_merge_request.html.haml +++ b/app/views/shared/milestones/_merge_request.html.haml @@ -2,10 +2,16 @@ - 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.str-truncated - = link_to [project.namespace.becomes(Namespace), project, merge_request] do - %span.cgray ##{merge_request.iid} + %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 - .pull-right.assignee-icon + .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 index c8df6c2e280..71991516e90 100644 --- a/app/views/shared/milestones/_merge_requests.html.haml +++ b/app/views/shared/milestones/_merge_requests.html.haml @@ -1,5 +1,8 @@ -.panel.panel-default +- 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 + = 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 5797aeb8295..d912e607963 100644 --- a/app/views/shared/milestones/_merge_requests_tab.haml +++ b/app/views/shared/milestones/_merge_requests_tab.haml @@ -1,13 +1,12 @@ +- args = { show_project_name: local_assigns.fetch(:show_project_name, false), + show_full_project_name: local_assigns.fetch(:show_full_project_name, false) } + .row.prepend-top-default .col-md-3 - = render('shared/milestones/merge_requests', title: 'Work in progress (open and unassigned)', merge_requests: unassigned, id: 'unassigned') + = render 'shared/milestones/merge_requests', args.merge({ title: 'Work in progress (open and unassigned)', merge_requests: unassigned, id: 'unassigned' }) .col-md-3 - = render('shared/milestones/merge_requests', title: 'Waiting for merge (open and assigned)', merge_requests: assigned, id: 'ongoing') + = render 'shared/milestones/merge_requests', args.merge({ title: 'Waiting for merge (open and assigned)', merge_requests: assigned, id: 'ongoing' }) .col-md-3 - = render('shared/milestones/merge_requests', title: 'Rejected (closed)', merge_requests: closed, id: 'closed') + = render 'shared/milestones/merge_requests', args.merge({ title: 'Rejected (closed)', merge_requests: closed, id: 'closed' }) .col-md-3 - .panel.panel-primary - .panel-heading Merged - %ul.well-list - - merged.each do |merge_request| - = render 'shared/milestones/merge_request', merge_request: merge_request + = render 'shared/milestones/merge_requests', args.merge({ title: 'Merged', merge_requests: merged, id: 'merged', primary: true }) |