diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index affe01a..539c576 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -17,7 +17,7 @@ = link_to_project project %ul.well-list.issues_table - group[1].each do |issue| - = render(partial: 'issues/show', locals: {issue: issue}) + = render issue %hr = paginate @issues, theme: "gitlab" - else diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 94682bd..96aa2a1 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -16,7 +16,7 @@ = link_to_project project %ul.well-list.issues_table - group[1].each do |issue| - = render(partial: 'issues/show', locals: {issue: issue}) + = render issue %hr = paginate @issues, theme: "gitlab" - else diff --git a/app/views/issues/_issue.html.haml b/app/views/issues/_issue.html.haml new file mode 100644 index 0000000..3d1ecd4 --- /dev/null +++ b/app/views/issues/_issue.html.haml @@ -0,0 +1,39 @@ +%li{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) } + - if controller.controller_name == 'issues' + .issue_check + = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) + .pull-right + - if issue.notes.any? + %span.btn.btn-small.disabled.grouped + %i.icon-comment + = issue.notes.count + - if can? current_user, :modify_issue, issue + - if issue.closed? + = 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 + - else + = 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 + = link_to edit_project_issue_path(issue.project, issue), class: "btn btn-small edit-issue-link grouped" do + %i.icon-edit + Edit + + - if issue.assignee + = image_tag gravatar_icon(issue.assignee_email), class: "avatar" + - else + = image_tag "no_avatar.png", class: "avatar" + + %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title" + + %span.update-author + %span.cdark= "##{issue.id}" + - if issue.assignee + assigned to #{issue.assignee_name} + - else +   + + - if issue.votes_count > 0 + = render 'votes/votes_inline', votable: issue + %span + - issue.labels.each do |label| + %span.label + %i.icon-tag + = label.name diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index 3bbd293..dc7db90 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -1,5 +1,4 @@ -- @issues.each do |issue| - = render(partial: 'issues/show', locals: {issue: issue}) += render @issues - if @issues.present? %li.bottom diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml deleted file mode 100644 index 3d1ecd4..0000000 --- a/app/views/issues/_show.html.haml +++ /dev/null @@ -1,39 +0,0 @@ -%li{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) } - - if controller.controller_name == 'issues' - .issue_check - = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) - .pull-right - - if issue.notes.any? - %span.btn.btn-small.disabled.grouped - %i.icon-comment - = issue.notes.count - - if can? current_user, :modify_issue, issue - - if issue.closed? - = 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 - - else - = 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 - = link_to edit_project_issue_path(issue.project, issue), class: "btn btn-small edit-issue-link grouped" do - %i.icon-edit - Edit - - - if issue.assignee - = image_tag gravatar_icon(issue.assignee_email), class: "avatar" - - else - = image_tag "no_avatar.png", class: "avatar" - - %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title" - - %span.update-author - %span.cdark= "##{issue.id}" - - if issue.assignee - assigned to #{issue.assignee_name} - - else -   - - - if issue.votes_count > 0 - = render 'votes/votes_inline', votable: issue - %span - - issue.labels.each do |label| - %span.label - %i.icon-tag - = label.name diff --git a/app/views/teams/issues.html.haml b/app/views/teams/issues.html.haml index c6a68c3..5b17c5d 100644 --- a/app/views/teams/issues.html.haml +++ b/app/views/teams/issues.html.haml @@ -16,7 +16,7 @@ = link_to_project @project %ul.well-list.issues_table - group[1].each do |issue| - = render(partial: 'issues/show', locals: {issue: issue}) + = render issue %hr = paginate @issues, theme: "gitlab" - else -- libgit2 0.21.2