Commit 8de19b259ec4f451852ffaaaf7f1010dc05a6c2b

Authored by Dmitriy Zaporozhets
1 parent 5e69ad2c

proper name for issue partial

app/views/dashboard/issues.html.haml
... ... @@ -17,7 +17,7 @@
17 17 = link_to_project project
18 18 %ul.well-list.issues_table
19 19 - group[1].each do |issue|
20   - = render(partial: 'issues/show', locals: {issue: issue})
  20 + = render issue
21 21 %hr
22 22 = paginate @issues, theme: "gitlab"
23 23 - else
... ...
app/views/groups/issues.html.haml
... ... @@ -16,7 +16,7 @@
16 16 = link_to_project project
17 17 %ul.well-list.issues_table
18 18 - group[1].each do |issue|
19   - = render(partial: 'issues/show', locals: {issue: issue})
  19 + = render issue
20 20 %hr
21 21 = paginate @issues, theme: "gitlab"
22 22 - else
... ...
app/views/issues/_issue.html.haml 0 → 100644
... ... @@ -0,0 +1,39 @@
  1 +%li{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) }
  2 + - if controller.controller_name == 'issues'
  3 + .issue_check
  4 + = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue)
  5 + .pull-right
  6 + - if issue.notes.any?
  7 + %span.btn.btn-small.disabled.grouped
  8 + %i.icon-comment
  9 + = issue.notes.count
  10 + - if can? current_user, :modify_issue, issue
  11 + - if issue.closed?
  12 + = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-small grouped reopen_issue", remote: true
  13 + - else
  14 + = link_to 'Close', project_issue_path(issue.project, issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-small grouped close_issue", remote: true
  15 + = link_to edit_project_issue_path(issue.project, issue), class: "btn btn-small edit-issue-link grouped" do
  16 + %i.icon-edit
  17 + Edit
  18 +
  19 + - if issue.assignee
  20 + = image_tag gravatar_icon(issue.assignee_email), class: "avatar"
  21 + - else
  22 + = image_tag "no_avatar.png", class: "avatar"
  23 +
  24 + %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title"
  25 +
  26 + %span.update-author
  27 + %span.cdark= "##{issue.id}"
  28 + - if issue.assignee
  29 + assigned to #{issue.assignee_name}
  30 + - else
  31 +  
  32 +
  33 + - if issue.votes_count > 0
  34 + = render 'votes/votes_inline', votable: issue
  35 + %span
  36 + - issue.labels.each do |label|
  37 + %span.label
  38 + %i.icon-tag
  39 + = label.name
... ...
app/views/issues/_issues.html.haml
1   -- @issues.each do |issue|
2   - = render(partial: 'issues/show', locals: {issue: issue})
  1 += render @issues
3 2  
4 3 - if @issues.present?
5 4 %li.bottom
... ...
app/views/issues/_show.html.haml
... ... @@ -1,39 +0,0 @@
1   -%li{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) }
2   - - if controller.controller_name == 'issues'
3   - .issue_check
4   - = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue)
5   - .pull-right
6   - - if issue.notes.any?
7   - %span.btn.btn-small.disabled.grouped
8   - %i.icon-comment
9   - = issue.notes.count
10   - - if can? current_user, :modify_issue, issue
11   - - if issue.closed?
12   - = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-small grouped reopen_issue", remote: true
13   - - else
14   - = link_to 'Close', project_issue_path(issue.project, issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-small grouped close_issue", remote: true
15   - = link_to edit_project_issue_path(issue.project, issue), class: "btn btn-small edit-issue-link grouped" do
16   - %i.icon-edit
17   - Edit
18   -
19   - - if issue.assignee
20   - = image_tag gravatar_icon(issue.assignee_email), class: "avatar"
21   - - else
22   - = image_tag "no_avatar.png", class: "avatar"
23   -
24   - %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title"
25   -
26   - %span.update-author
27   - %span.cdark= "##{issue.id}"
28   - - if issue.assignee
29   - assigned to #{issue.assignee_name}
30   - - else
31   -  
32   -
33   - - if issue.votes_count > 0
34   - = render 'votes/votes_inline', votable: issue
35   - %span
36   - - issue.labels.each do |label|
37   - %span.label
38   - %i.icon-tag
39   - = label.name
app/views/teams/issues.html.haml
... ... @@ -16,7 +16,7 @@
16 16 = link_to_project @project
17 17 %ul.well-list.issues_table
18 18 - group[1].each do |issue|
19   - = render(partial: 'issues/show', locals: {issue: issue})
  19 + = render issue
20 20 %hr
21 21 = paginate @issues, theme: "gitlab"
22 22 - else
... ...