Commit f1ec62f465711c136d9ffc84b328f7c55e68fa9c

Authored by Dmitriy Zaporozhets
1 parent 47937802

Add reopened tab to milestone issues. Add ids and data to milestone issues to enable dragging

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/assets/stylesheets/main/mixins.scss
... ... @@ -124,7 +124,7 @@
124 124 margin-bottom: 10px;
125 125 }
126 126  
127   -@mixin str-truncated($max_width: "82%") {
  127 +@mixin str-truncated($max_width: 82%) {
128 128 display: inline-block;
129 129 overflow: hidden;
130 130 text-overflow: ellipsis;
... ...
app/assets/stylesheets/sections/milestone.scss 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +.issues-sortable-list .str-truncated {
  2 + max-width: 70%;
  3 +}
... ...
app/controllers/projects/issues_controller.rb
... ... @@ -87,6 +87,11 @@ class Projects::IssuesController &lt; Projects::ApplicationController
87 87 render :edit
88 88 end
89 89 end
  90 + format.json do
  91 + render json: {
  92 + saved: @issue.valid?,
  93 + }
  94 + end
90 95 end
91 96 end
92 97  
... ...
app/views/projects/milestones/_issue.html.haml 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +%li{ 'data-iid' => issue.iid, 'data-url' => project_issue_path(@project, issue) }
  2 + %span.str-truncated
  3 + = link_to [@project, issue] do
  4 + %span.cgray ##{issue.iid}
  5 + = link_to_gfm issue.title, [@project, issue]
  6 + - if issue.assignee
  7 + .pull-right
  8 + = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16"
  9 +
... ...
app/views/projects/milestones/_issues.html.haml
1 1 .panel.panel-default
2 2 .panel-heading= title
3   - %ul.well-list
  3 + %ul{ class: "well-list issues-sortable-list", id: "issues-list-#{id}", "data-state" => id }
4 4 - issues.each do |issue|
5   - %li
6   - = link_to [@project, issue] do
7   - %span.label{class: issue.closed? ? 'label-danger' : 'label-info'} ##{issue.iid}
8   - = link_to_gfm truncate(issue.title, length: 40), [@project, issue]
9   - - if issue.assignee
10   - .pull-right
11   - = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16"
  5 + = render 'issue', issue: issue
  6 + %li.light Drag and drop available
... ...
app/views/projects/milestones/show.html.haml
... ... @@ -35,6 +35,12 @@
35 35 %h4.title
36 36 = gfm escape_once(@milestone.title)
37 37  
  38 + - if @milestone.description.present?
  39 + .description
  40 + .wiki
  41 + = preserve do
  42 + = markdown @milestone.description
  43 +
38 44 .context
39 45 %p
40 46 Progress:
... ... @@ -45,11 +51,6 @@
45 51 .progress.progress-info
46 52 .progress-bar{style: "width: #{@milestone.percent_complete}%;"}
47 53  
48   - - if @milestone.description.present?
49   - .description
50   - .wiki
51   - = preserve do
52   - = markdown @milestone.description
53 54  
54 55 %ul.nav.nav-tabs
55 56 %li.active
... ... @@ -74,12 +75,14 @@
74 75 .tab-content
75 76 .tab-pane.active#tab-issues
76 77 .row
77   - .col-md-4
78   - = render('issues', title: 'Unstarted Issues (open and unassigned)', issues: @issues.opened.unassigned)
79   - .col-md-4
80   - = render('issues', title: 'Ongoing Issues (open and assigned)', issues: @issues.opened.assigned)
81   - .col-md-4
82   - = render('issues', title: 'Completed Issues (closed)', issues: @issues.closed)
  78 + .col-md-3
  79 + = render('issues', title: 'Unstarted Issues (open and unassigned)', issues: @issues.only_opened.unassigned, id: 'unassigned')
  80 + .col-md-3
  81 + = render('issues', title: 'Ongoing Issues (open and assigned)', issues: @issues.only_opened.assigned, id: 'ongoing')
  82 + .col-md-3
  83 + = render('issues', title: 'Completed Issues (closed)', issues: @issues.closed, id: 'closed')
  84 + .col-md-3
  85 + = render('issues', title: 'Reopened Issues (reopened)', issues: @issues.only_reopened, id: 'reopened')
83 86  
84 87 .tab-pane#tab-merge-requests
85 88 .row
... ...