One column issue/mr lists for project
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
9a8ac2accc
commit
32eb5de510
6 changed files with 59 additions and 114 deletions
|
@ -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;
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
Loading…
Reference in a new issue