summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/gl_bootstrap.scss4
-rw-r--r--app/helpers/projects_helper.rb25
-rw-r--r--app/views/projects/_issuable_filter.html.haml39
-rw-r--r--app/views/projects/issues/index.html.haml11
-rw-r--r--app/views/projects/merge_requests/index.html.haml30
-rw-r--r--app/views/shared/_project_filter.html.haml64
6 files changed, 59 insertions, 114 deletions
diff --git a/app/assets/stylesheets/gl_bootstrap.scss b/app/assets/stylesheets/gl_bootstrap.scss
index 9c5e76ab8e2..2a68d922bb7 100644
--- a/app/assets/stylesheets/gl_bootstrap.scss
+++ b/app/assets/stylesheets/gl_bootstrap.scss
@@ -148,6 +148,10 @@ $list-group-active-bg: $bg_primary;
color: #666;
}
+.nav-compact > li > a {
+ padding: 6px 12px;
+}
+
.nav-small > li > a {
padding: 3px 5px;
font-size: 12px;
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index fb5470d98e5..6568f438e25 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -68,31 +68,6 @@ module ProjectsHelper
project_nav_tabs.include? name
end
- def selected_label?(label_name)
- params[:label_name].to_s.split(',').include?(label_name)
- end
-
- def labels_filter_path(label_name)
- label_name =
- if selected_label?(label_name)
- params[:label_name].split(',').reject { |l| l == label_name }.join(',')
- elsif params[:label_name].present?
- "#{params[:label_name]},#{label_name}"
- else
- label_name
- end
-
- project_filter_path(label_name: label_name)
- end
-
- def label_filter_class(label_name)
- if selected_label?(label_name)
- 'label-filter-item active'
- else
- 'label-filter-item light'
- end
- end
-
def project_filter_path(options={})
exist_opts = {
state: params[:state],
diff --git a/app/views/projects/_issuable_filter.html.haml b/app/views/projects/_issuable_filter.html.haml
index b3e5efd938f..45b5137a1b3 100644
--- a/app/views/projects/_issuable_filter.html.haml
+++ b/app/views/projects/_issuable_filter.html.haml
@@ -1,4 +1,19 @@
.issues-filters
+ .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
+ %i.fa.fa-exclamation-circle
+ Open
+ %li{class: ("active" if params[:state] == 'closed')}
+ = link_to project_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
+ %i.fa.fa-compass
+ All
+
.dropdown.inline
%a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
%i.fa.fa-user
@@ -68,5 +83,29 @@
%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
+ 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
+ %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/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml
index 8db6241f21f..0d00d6bfded 100644
--- a/app/views/projects/issues/index.html.haml
+++ b/app/views/projects/issues/index.html.haml
@@ -1,9 +1,4 @@
= render "projects/issues_nav"
-.row
- .fixed.fixed.sidebar-expand-button.hidden-lg.hidden-md.hidden-xs
- %i.fa.fa-list.fa-2x
- .col-md-3.responsive-side
- = render 'shared/project_filter', project_entities_path: project_issues_path(@project),
- labels: true, redirect: 'issues', entity: 'issue'
- .col-md-9.issues-holder
- = render "issues"
+
+.issues-holder
+ = render "issues"
diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml
index b93e0f9da3e..6a615266ca3 100644
--- a/app/views/projects/merge_requests/index.html.haml
+++ b/app/views/projects/merge_requests/index.html.haml
@@ -1,23 +1,19 @@
= render "projects/issues_nav"
-.row
- .col-md-3.responsive-side
- = render 'shared/project_filter', project_entities_path: project_merge_requests_path(@project),
- labels: true, redirect: 'merge_requests', entity: 'merge_request'
- .col-md-9
- .append-bottom-10
- = render 'projects/issuable_filter'
- .panel.panel-default
- %ul.well-list.mr-list
- = render @merge_requests
- - if @merge_requests.blank?
- %li
- .nothing-here-block No merge requests to show
- - if @merge_requests.present?
- .pull-right
- %span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter
+.merge-requests-holder
+ .append-bottom-10
+ = render 'projects/issuable_filter'
+ .panel.panel-default
+ %ul.well-list.mr-list
+ = render @merge_requests
+ - if @merge_requests.blank?
+ %li
+ .nothing-here-block No merge requests to show
+ - if @merge_requests.present?
+ .pull-right
+ %span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter
- = paginate @merge_requests, theme: "gitlab"
+ = paginate @merge_requests, theme: "gitlab"
:javascript
$(merge_requestsPage);
diff --git a/app/views/shared/_project_filter.html.haml b/app/views/shared/_project_filter.html.haml
deleted file mode 100644
index ea6a49e1501..00000000000
--- a/app/views/shared/_project_filter.html.haml
+++ /dev/null
@@ -1,64 +0,0 @@
-.side-filters
- = form_tag project_entities_path, method: 'get' do
- - if current_user
- %fieldset
- %ul.nav.nav-pills.nav-stacked
- %li{class: ("active" if params[:scope] == 'all')}
- = link_to project_filter_path(scope: 'all') do
- Everyone's
- %span.pull-right
- = authorized_entities_count(current_user, entity, @project)
- %li{class: ("active" if params[:scope] == 'assigned-to-me')}
- = link_to project_filter_path(scope: 'assigned-to-me') do
- Assigned to me
- %span.pull-right
- = assigned_entities_count(current_user, entity, @project)
- %li{class: ("active" if params[:scope] == 'created-by-me')}
- = link_to project_filter_path(scope: 'created-by-me') do
- Created by me
- %span.pull-right
- = authored_entities_count(current_user, entity, @project)
-
- %fieldset
- %legend State
- %ul.nav.nav-pills
- %li{class: ("active" if params[:state] == 'opened')}
- = link_to project_filter_path(state: 'opened') do
- Open
- %li{class: ("active" if params[:state] == 'closed')}
- = link_to project_filter_path(state: 'closed') do
- Closed
- %li{class: ("active" if params[:state] == 'all')}
- = link_to project_filter_path(state: 'all') do
- All
-
- - if defined?(labels)
- %fieldset
- %legend
- Labels
- %small.pull-right
- = link_to project_labels_path(@project), class: 'light' do
- %i.fa.fa-pencil-square-o
- %ul.nav.nav-pills.nav-stacked.nav-small.labels-filter
- - @project.labels.order_by_name.each do |label|
- %li{class: label_filter_class(label.name)}
- = link_to labels_filter_path(label.name) do
- = render_colored_label(label)
- - if selected_label?(label.name)
- .pull-right
- %i.fa.fa-times
-
- - if @project.labels.empty?
- .light-well
- Create first label at
- = link_to 'labels page', project_labels_path(@project)
- %br
- or #{link_to 'generate', generate_project_labels_path(@project, redirect: redirect), method: :post} default set of labels
-
- %fieldset
- - if %w(state scope milestone_id assignee_id label_name).select { |k| params[k].present? }.any?
- = link_to project_entities_path, class: 'cgray pull-right' do
- %i.fa.fa-times
- %strong Clear filter
-
-