diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-23 19:49:39 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-23 19:49:39 +0300 |
commit | 47634e392fab457dd0634225961944804bc04efe (patch) | |
tree | 8d70528e0a9a1d18264e9937c10054d5507462a0 /app/views | |
parent | 32eb5de510a7e32d9bb886595aa47d95dc00490f (diff) |
Refactor issues and merge requests lists
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/dashboard/issues.html.haml | 10 | ||||
-rw-r--r-- | app/views/dashboard/merge_requests.html.haml | 10 | ||||
-rw-r--r-- | app/views/groups/issues.html.haml | 10 | ||||
-rw-r--r-- | app/views/groups/merge_requests.html.haml | 10 | ||||
-rw-r--r-- | app/views/layouts/nav/_group.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/_issues_nav.html.haml | 11 | ||||
-rw-r--r-- | app/views/projects/issues/_issues.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/merge_requests/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/_filter.html.haml | 50 | ||||
-rw-r--r-- | app/views/shared/_issuable_filter.html.haml (renamed from app/views/projects/_issuable_filter.html.haml) | 69 | ||||
-rw-r--r-- | app/views/shared/_sort_dropdown.html.haml | 12 |
11 files changed, 66 insertions, 124 deletions
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 7c1f1ddbb80..db19a46cb26 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -5,10 +5,6 @@ List all issues from all projects you have access to. %hr -.row - .fixed.sidebar-expand-button.hidden-lg.hidden-md - %i.fa.fa-list.fa-2x - .col-md-3.responsive-side - = render 'shared/filter', entity: 'issue' - .col-md-9 - = render 'shared/issues' +.append-bottom-20 + = render 'shared/issuable_filter' += render 'shared/issues' diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index c96584c7b6b..97a42461b4e 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -5,10 +5,6 @@ %p.light List all merge requests from all projects you have access to. %hr -.row - .fixed.sidebar-expand-button.hidden-lg.hidden-md - %i.fa.fa-list.fa-2x - .col-md-3.responsive-side - = render 'shared/filter', entity: 'merge_request' - .col-md-9 - = render 'shared/merge_requests' +.append-bottom-20 + = render 'shared/issuable_filter' += render 'shared/merge_requests' diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 1932ba2f644..6c0d89c4e7c 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -9,10 +9,6 @@ To see all issues you should visit #{link_to 'dashboard', issues_dashboard_path} page. %hr -.row - .fixed.sidebar-expand-button.hidden-lg.hidden-md - %i.fa.fa-list.fa-2x - .col-md-3.responsive-side - = render 'shared/filter', entity: 'issue' - .col-md-9 - = render 'shared/issues' +.append-bottom-20 + = render 'shared/issuable_filter' += render 'shared/issues' diff --git a/app/views/groups/merge_requests.html.haml b/app/views/groups/merge_requests.html.haml index 86d5acdaa32..1ad74905636 100644 --- a/app/views/groups/merge_requests.html.haml +++ b/app/views/groups/merge_requests.html.haml @@ -8,10 +8,6 @@ - if current_user To see all merge requests you should visit #{link_to 'dashboard', merge_requests_dashboard_path} page. %hr -.row - .fixed.sidebar-expand-button.hidden-lg.hidden-md - %i.fa.fa-list.fa-2x - .col-md-3.responsive-side - = render 'shared/filter', entity: 'merge_request' - .col-md-9 - = render 'shared/merge_requests' +.append-bottom-20 + = render 'shared/issuable_filter' += render 'shared/merge_requests' diff --git a/app/views/layouts/nav/_group.html.haml b/app/views/layouts/nav/_group.html.haml index 78d6b768155..3c8f47a7bea 100644 --- a/app/views/layouts/nav/_group.html.haml +++ b/app/views/layouts/nav/_group.html.haml @@ -13,13 +13,13 @@ %i.fa.fa-exclamation-circle Issues - if current_user - %span.count= current_user.assigned_issues.opened.of_group(@group).count + %span.count= Issue.opened.of_group(@group).count = nav_link(path: 'groups#merge_requests') do = link_to merge_requests_group_path(@group) do %i.fa.fa-tasks Merge Requests - if current_user - %span.count= current_user.cared_merge_requests.opened.of_group(@group).count + %span.count= MergeRequest.opened.of_group(@group).count = nav_link(path: 'groups#members') do = link_to members_group_path(@group) do %i.fa.fa-users diff --git a/app/views/projects/_issues_nav.html.haml b/app/views/projects/_issues_nav.html.haml index 18628eb6207..4e2ef3202f9 100644 --- a/app/views/projects/_issues_nav.html.haml +++ b/app/views/projects/_issues_nav.html.haml @@ -2,15 +2,22 @@ - if project_nav_tab? :issues = nav_link(controller: :issues) do = link_to project_issues_path(@project), class: "tab" do + %i.fa.fa-exclamation-circle Issues - if project_nav_tab? :merge_requests = nav_link(controller: :merge_requests) do = link_to project_merge_requests_path(@project), class: "tab" do + %i.fa.fa-tasks Merge Requests = nav_link(controller: :milestones) do - = link_to 'Milestones', project_milestones_path(@project), class: "tab" + = link_to project_milestones_path(@project), class: "tab" do + %i.fa.fa-clock-o + Milestones = nav_link(controller: :labels) do - = link_to 'Labels', project_labels_path(@project), class: "tab" + = link_to project_labels_path(@project), class: "tab" do + %i.fa.fa-tags + Labels + - if current_controller?(:milestones) %li.pull-right diff --git a/app/views/projects/issues/_issues.html.haml b/app/views/projects/issues/_issues.html.haml index 15c84c7ced2..010ca3b68b3 100644 --- a/app/views/projects/issues/_issues.html.haml +++ b/app/views/projects/issues/_issues.html.haml @@ -1,7 +1,7 @@ .append-bottom-10 .check-all-holder = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left" - = render 'projects/issuable_filter' + = render 'shared/issuable_filter' .clearfix .issues_bulk_update.hide diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index 6a615266ca3..2654ea70990 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -2,7 +2,7 @@ .merge-requests-holder .append-bottom-10 - = render 'projects/issuable_filter' + = render 'shared/issuable_filter' .panel.panel-default %ul.well-list.mr-list = render @merge_requests diff --git a/app/views/shared/_filter.html.haml b/app/views/shared/_filter.html.haml deleted file mode 100644 index d366dd97a71..00000000000 --- a/app/views/shared/_filter.html.haml +++ /dev/null @@ -1,50 +0,0 @@ -.side-filters - = form_tag filter_path(entity), method: 'get' do - - if current_user - %fieldset.scope-filter - %ul.nav.nav-pills.nav-stacked - %li{class: ("active" if params[:scope] == 'assigned-to-me')} - = link_to filter_path(entity, scope: 'assigned-to-me') do - Assigned to me - %span.pull-right - = assigned_entities_count(current_user, entity, @group) - %li{class: ("active" if params[:scope] == 'authored')} - = link_to filter_path(entity, scope: 'authored') do - Created by me - %span.pull-right - = authored_entities_count(current_user, entity, @group) - %li{class: ("active" if params[:scope] == 'all')} - = link_to filter_path(entity, scope: 'all') do - Everyone's - %span.pull-right - = authorized_entities_count(current_user, entity, @group) - - %fieldset.status-filter - %legend State - %ul.nav.nav-pills - %li{class: ("active" if params[:state] == 'opened')} - = link_to filter_path(entity, state: 'opened') do - Open - %li{class: ("active" if params[:state] == 'closed')} - = link_to filter_path(entity, state: 'closed') do - Closed - %li{class: ("active" if params[:state] == 'all')} - = link_to filter_path(entity, state: 'all') do - All - - %fieldset - %legend Projects - %ul.nav.nav-pills.nav-stacked.nav-small - - @projects.each do |project| - - unless entities_per_project(project, entity).zero? - %li{class: ("active" if params[:project_id] == project.id.to_s)} - = link_to filter_path(entity, project_id: project.id) do - = project.name_with_namespace - %small.pull-right= entities_per_project(project, entity) - - %fieldset - - if params[:state].present? || params[:project_id].present? - = link_to filter_path(entity, state: nil, project_id: nil), class: 'pull-right cgray' do - %i.fa.fa-times - %strong Clear filter - diff --git a/app/views/projects/_issuable_filter.html.haml b/app/views/shared/_issuable_filter.html.haml index 45b5137a1b3..56d58a52686 100644 --- a/app/views/projects/_issuable_filter.html.haml +++ b/app/views/shared/_issuable_filter.html.haml @@ -2,15 +2,15 @@ .pull-left.append-right-20 %ul.nav.nav-pills.nav-compact %li{class: ("active" if params[:state] == 'opened')} - = link_to project_filter_path(state: 'opened') do + = link_to page_filter_path(state: 'opened') do %i.fa.fa-exclamation-circle Open %li{class: ("active" if params[:state] == 'closed')} - = link_to project_filter_path(state: 'closed') do + = link_to page_filter_path(state: 'closed') do %i.fa.fa-check-circle Closed %li{class: ("active" if params[:state] == 'all')} - = link_to project_filter_path(state: 'all') do + = link_to page_filter_path(state: 'all') do %i.fa.fa-compass All @@ -27,13 +27,13 @@ %b.caret %ul.dropdown-menu %li - = link_to project_filter_path(assignee_id: nil) do + = link_to page_filter_path(assignee_id: nil) do Any - = link_to project_filter_path(assignee_id: 0) do + = link_to page_filter_path(assignee_id: 0) do Unassigned - @assignees.sort_by(&:name).each do |user| %li - = link_to project_filter_path(assignee_id: user.id) do + = link_to page_filter_path(assignee_id: user.id) do = image_tag avatar_icon(user.email), class: "avatar s16", alt: '' = user.name @@ -50,13 +50,13 @@ %b.caret %ul.dropdown-menu %li - = link_to project_filter_path(author_id: nil) do + = link_to page_filter_path(author_id: nil) do Any - = link_to project_filter_path(author_id: 0) do + = link_to page_filter_path(author_id: 0) do Unassigned - @authors.sort_by(&:name).each do |user| %li - = link_to project_filter_path(author_id: user.id) do + = link_to page_filter_path(author_id: user.id) do = image_tag avatar_icon(user.email), class: "avatar s16", alt: '' = user.name @@ -73,39 +73,40 @@ %b.caret %ul.dropdown-menu %li - = link_to project_filter_path(milestone_id: nil) do + = link_to page_filter_path(milestone_id: nil) do Any - = link_to project_filter_path(milestone_id: 0) do + = link_to page_filter_path(milestone_id: 0) do None (backlog) - - project_active_milestones.each do |milestone| + - @milestones.each do |milestone| %li - = link_to project_filter_path(milestone_id: milestone.id) do + = link_to page_filter_path(milestone_id: milestone.id) do %strong= milestone.title %small.light= milestone.expires_at - .dropdown.inline.prepend-left-10 - %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} - %i.fa.fa-user - %span.light label: - - if params[:label_name].present? - %strong= params[:label_name] - - else - Any - %b.caret - %ul.dropdown-menu - %li - = link_to project_filter_path(label_name: nil) do + - if @project + .dropdown.inline.prepend-left-10 + %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} + %i.fa.fa-tags + %span.light label: + - if params[:label_name].present? + %strong= params[:label_name] + - else Any - - if @project.labels.any? - - @project.labels.order_by_name.each do |label| - %li - = link_to project_filter_path(label_name: label.name) do - = render_colored_label(label) - - else + %b.caret + %ul.dropdown-menu %li - = link_to generate_project_labels_path(@project, redirect: request.original_url), method: :post do - %i.fa.fa-plus-circle - Create default labels + = link_to page_filter_path(label_name: nil) do + Any + - if @project.labels.any? + - @project.labels.order_by_name.each do |label| + %li + = link_to page_filter_path(label_name: label.name) do + = render_colored_label(label) + - else + %li + = link_to generate_project_labels_path(@project, redirect: request.original_url), method: :post do + %i.fa.fa-plus-circle + Create default labels .pull-right = render 'shared/sort_dropdown' diff --git a/app/views/shared/_sort_dropdown.html.haml b/app/views/shared/_sort_dropdown.html.haml index 54f59245690..93ed9b67336 100644 --- a/app/views/shared/_sort_dropdown.html.haml +++ b/app/views/shared/_sort_dropdown.html.haml @@ -8,15 +8,15 @@ %b.caret %ul.dropdown-menu %li - = link_to project_filter_path(sort: 'newest') do + = link_to page_filter_path(sort: 'newest') do = sort_title_recently_created - = link_to project_filter_path(sort: 'oldest') do + = link_to page_filter_path(sort: 'oldest') do = sort_title_oldest_created - = link_to project_filter_path(sort: 'recently_updated') do + = link_to page_filter_path(sort: 'recently_updated') do = sort_title_recently_updated - = link_to project_filter_path(sort: 'last_updated') do + = link_to page_filter_path(sort: 'last_updated') do = sort_title_oldest_updated - = link_to project_filter_path(sort: 'milestone_due_soon') do + = link_to page_filter_path(sort: 'milestone_due_soon') do Milestone due soon - = link_to project_filter_path(sort: 'milestone_due_later') do + = link_to page_filter_path(sort: 'milestone_due_later') do Milestone due later |