Use the same partial when rendering Issues or Merge Requests.

This commit is contained in:
Rubén Dávila 2016-02-23 21:17:14 -05:00
parent 7cc102a0e6
commit b6e5de2cfb
7 changed files with 10 additions and 59 deletions

View file

@ -19,7 +19,7 @@ li.milestone {
width: 105px;
}
.issue-row, .mr-row {
.issue-row, .merge_request-row {
.color-label {
border-radius: 2px;
padding: 3px !important;
@ -45,10 +45,10 @@ li.milestone {
}
.issues-sortable-list, .merge_requests-sortable-list {
.issue-detail, .merge-request-detail {
.issue-detail, .merge_request-detail {
display: block;
.issue-number, .merge-request-number {
.issue-number, .merge_request-number {
color: rgba(0,0,0,0.44);
margin-right: 5px;
}

View file

@ -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: ''

View file

@ -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

View file

@ -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 })

View file

@ -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: ''

View file

@ -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

View file

@ -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 })