Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
47634e39
Commit
47634e39
authored
Dec 23, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor issues and merge requests lists
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
32eb5de5
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
140 additions
and
210 deletions
+140
-210
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+42
-0
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+4
-8
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+4
-14
app/controllers/projects/application_controller.rb
app/controllers/projects/application_controller.rb
+0
-27
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+3
-3
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+3
-3
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+18
-0
app/helpers/dashboard_helper.rb
app/helpers/dashboard_helper.rb
+0
-14
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+0
-17
app/views/dashboard/issues.html.haml
app/views/dashboard/issues.html.haml
+3
-7
app/views/dashboard/merge_requests.html.haml
app/views/dashboard/merge_requests.html.haml
+3
-7
app/views/groups/issues.html.haml
app/views/groups/issues.html.haml
+3
-7
app/views/groups/merge_requests.html.haml
app/views/groups/merge_requests.html.haml
+3
-7
app/views/layouts/nav/_group.html.haml
app/views/layouts/nav/_group.html.haml
+2
-2
app/views/projects/_issues_nav.html.haml
app/views/projects/_issues_nav.html.haml
+9
-2
app/views/projects/issues/_issues.html.haml
app/views/projects/issues/_issues.html.haml
+1
-1
app/views/projects/merge_requests/index.html.haml
app/views/projects/merge_requests/index.html.haml
+1
-1
app/views/shared/_filter.html.haml
app/views/shared/_filter.html.haml
+0
-50
app/views/shared/_issuable_filter.html.haml
app/views/shared/_issuable_filter.html.haml
+35
-34
app/views/shared/_sort_dropdown.html.haml
app/views/shared/_sort_dropdown.html.haml
+6
-6
No files found.
app/controllers/application_controller.rb
View file @
47634e39
...
...
@@ -239,4 +239,46 @@ class ApplicationController < ActionController::Base
redirect_to
profile_path
,
notice:
'Please complete your profile with email address'
and
return
end
end
def
set_filters_defaults
params
[
:sort
]
||=
'newest'
params
[
:scope
]
=
'all'
if
params
[
:scope
].
blank?
params
[
:state
]
=
'opened'
if
params
[
:state
].
blank?
@sort
=
params
[
:sort
].
humanize
if
@project
params
[
:project_id
]
=
@project
.
id
elsif
@group
params
[
:group_id
]
=
@group
.
id
else
params
[
:authorized_only
]
=
true
unless
params
[
:assignee_id
].
present?
params
[
:assignee_id
]
=
current_user
.
id
end
end
end
def
set_filter_values
(
collection
)
assignee_id
=
params
[
:assignee_id
]
author_id
=
params
[
:author_id
]
milestone_id
=
params
[
:milestone_id
]
@assignees
=
User
.
where
(
id:
collection
.
pluck
(
:assignee_id
))
@authors
=
User
.
where
(
id:
collection
.
pluck
(
:author_id
))
@milestones
=
Milestone
.
where
(
id:
collection
.
pluck
(
:milestone_id
))
if
assignee_id
.
present?
&&
!
assignee_id
.
to_i
.
zero?
@assignee
=
@assignees
.
find
(
assignee_id
)
end
if
author_id
.
present?
&&
!
author_id
.
to_i
.
zero?
@author
=
@authors
.
find
(
author_id
)
end
if
milestone_id
.
present?
&&
!
milestone_id
.
to_i
.
zero?
@milestone
=
@milestones
.
find
(
milestone_id
)
end
end
end
app/controllers/dashboard_controller.rb
View file @
47634e39
...
...
@@ -3,8 +3,6 @@ class DashboardController < ApplicationController
before_filter
:load_projects
,
except:
[
:projects
]
before_filter
:event_filter
,
only: :show
before_filter
:default_filter
,
only:
[
:issues
,
:merge_requests
]
def
show
# Fetch only 30 projects.
...
...
@@ -55,13 +53,17 @@ class DashboardController < ApplicationController
end
def
merge_requests
set_filters_defaults
@merge_requests
=
MergeRequestsFinder
.
new
.
execute
(
current_user
,
params
)
set_filter_values
(
@merge_requests
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
end
def
issues
set_filters_defaults
@issues
=
IssuesFinder
.
new
.
execute
(
current_user
,
params
)
set_filter_values
(
@issues
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
...
...
@@ -76,10 +78,4 @@ class DashboardController < ApplicationController
def
load_projects
@projects
=
current_user
.
authorized_projects
.
sorted_by_activity
.
non_archived
end
def
default_filter
params
[
:scope
]
=
'assigned-to-me'
if
params
[
:scope
].
blank?
params
[
:state
]
=
'opened'
if
params
[
:state
].
blank?
params
[
:authorized_only
]
=
true
end
end
app/controllers/groups_controller.rb
View file @
47634e39
...
...
@@ -11,8 +11,6 @@ class GroupsController < ApplicationController
# Load group projects
before_filter
:load_projects
,
except:
[
:new
,
:create
,
:projects
,
:edit
,
:update
]
before_filter
:default_filter
,
only:
[
:issues
,
:merge_requests
]
layout
:determine_layout
before_filter
:set_title
,
only:
[
:new
,
:create
]
...
...
@@ -47,13 +45,17 @@ class GroupsController < ApplicationController
end
def
merge_requests
set_filters_defaults
@merge_requests
=
MergeRequestsFinder
.
new
.
execute
(
current_user
,
params
)
set_filter_values
(
@merge_requests
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
end
def
issues
set_filters_defaults
@issues
=
IssuesFinder
.
new
.
execute
(
current_user
,
params
)
set_filter_values
(
@issues
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
...
...
@@ -148,18 +150,6 @@ class GroupsController < ApplicationController
end
end
def
default_filter
if
params
[
:scope
].
blank?
if
current_user
params
[
:scope
]
=
'assigned-to-me'
else
params
[
:scope
]
=
'all'
end
end
params
[
:state
]
=
'opened'
if
params
[
:state
].
blank?
params
[
:group_id
]
=
@group
.
id
end
def
group_params
params
.
require
(
:group
).
permit
(
:name
,
:description
,
:path
,
:avatar
)
end
...
...
app/controllers/projects/application_controller.rb
View file @
47634e39
...
...
@@ -29,31 +29,4 @@ class Projects::ApplicationController < ApplicationController
redirect_to
project_tree_path
(
@project
,
@ref
),
notice:
"This action is not allowed unless you are on top of a branch"
end
end
def
set_filter_variables
(
collection
)
params
[
:sort
]
||=
'newest'
params
[
:scope
]
=
'all'
if
params
[
:scope
].
blank?
params
[
:state
]
=
'opened'
if
params
[
:state
].
blank?
@sort
=
params
[
:sort
].
humanize
assignee_id
=
params
[
:assignee_id
]
author_id
=
params
[
:author_id
]
milestone_id
=
params
[
:milestone_id
]
if
assignee_id
.
present?
&&
!
assignee_id
.
to_i
.
zero?
@assignee
=
@project
.
team
.
find
(
assignee_id
)
end
if
author_id
.
present?
&&
!
author_id
.
to_i
.
zero?
@author
=
@project
.
team
.
find
(
assignee_id
)
end
if
milestone_id
.
present?
&&
!
milestone_id
.
to_i
.
zero?
@milestone
=
@project
.
milestones
.
find
(
milestone_id
)
end
@assignees
=
User
.
where
(
id:
collection
.
pluck
(
:assignee_id
))
@authors
=
User
.
where
(
id:
collection
.
pluck
(
:author_id
))
end
end
app/controllers/projects/issues_controller.rb
View file @
47634e39
...
...
@@ -18,9 +18,9 @@ class Projects::IssuesController < Projects::ApplicationController
def
index
terms
=
params
[
'issue_search'
]
set_filter
_variables
(
@project
.
issues
)
@issues
=
IssuesFinder
.
new
.
execute
(
current_user
,
params
.
merge
(
project_id:
@project
.
id
)
)
set_filter
s_defaults
@issues
=
IssuesFinder
.
new
.
execute
(
current_user
,
params
)
set_filter_values
(
@issues
)
@issues
=
@issues
.
full_search
(
terms
)
if
terms
.
present?
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
47634e39
...
...
@@ -17,9 +17,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController
before_filter
:authorize_modify_merge_request!
,
only:
[
:close
,
:edit
,
:update
,
:sort
]
def
index
set_filter
_variables
(
@project
.
merge_requests
)
@merge_requests
=
MergeRequestsFinder
.
new
.
execute
(
current_user
,
params
.
merge
(
project_id:
@project
.
id
)
)
set_filter
s_defaults
@merge_requests
=
MergeRequestsFinder
.
new
.
execute
(
current_user
,
params
)
set_filter_values
(
@merge_requests
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
end
...
...
app/helpers/application_helper.rb
View file @
47634e39
...
...
@@ -275,4 +275,22 @@ module ApplicationHelper
def
promo_url
'https://'
+
promo_host
end
def
page_filter_path
(
options
=
{})
exist_opts
=
{
state:
params
[
:state
],
scope:
params
[
:scope
],
label_name:
params
[
:label_name
],
milestone_id:
params
[
:milestone_id
],
assignee_id:
params
[
:assignee_id
],
author_id:
params
[
:author_id
],
sort:
params
[
:sort
],
}
options
=
exist_opts
.
merge
(
options
)
path
=
request
.
path
path
<<
"?
#{
options
.
to_param
}
"
path
end
end
app/helpers/dashboard_helper.rb
View file @
47634e39
module
DashboardHelper
def
filter_path
(
entity
,
options
=
{})
exist_opts
=
{
state:
params
[
:state
],
scope:
params
[
:scope
],
project_id:
params
[
:project_id
],
}
options
=
exist_opts
.
merge
(
options
)
path
=
request
.
path
path
<<
"?
#{
options
.
to_param
}
"
path
end
def
entities_per_project
(
project
,
entity
)
case
entity
.
to_sym
when
:issue
then
@issues
.
where
(
project_id:
project
.
id
)
...
...
app/helpers/projects_helper.rb
View file @
47634e39
...
...
@@ -68,23 +68,6 @@ module ProjectsHelper
project_nav_tabs
.
include?
name
end
def
project_filter_path
(
options
=
{})
exist_opts
=
{
state:
params
[
:state
],
scope:
params
[
:scope
],
label_name:
params
[
:label_name
],
milestone_id:
params
[
:milestone_id
],
assignee_id:
params
[
:assignee_id
],
sort:
params
[
:sort
],
}
options
=
exist_opts
.
merge
(
options
)
path
=
request
.
path
path
<<
"?
#{
options
.
to_param
}
"
path
end
def
project_active_milestones
@project
.
milestones
.
active
.
order
(
"due_date, title ASC"
)
end
...
...
app/views/dashboard/issues.html.haml
View file @
47634e39
...
...
@@ -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'
app/views/dashboard/merge_requests.html.haml
View file @
47634e39
...
...
@@ -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'
app/views/groups/issues.html.haml
View file @
47634e39
...
...
@@ -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'
app/views/groups/merge_requests.html.haml
View file @
47634e39
...
...
@@ -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'
app/views/layouts/nav/_group.html.haml
View file @
47634e39
...
...
@@ -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
...
...
app/views/projects/_issues_nav.html.haml
View file @
47634e39
...
...
@@ -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
...
...
app/views/projects/issues/_issues.html.haml
View file @
47634e39
.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
...
...
app/views/projects/merge_requests/index.html.haml
View file @
47634e39
...
...
@@ -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
...
...
app/views/shared/_filter.html.haml
deleted
100644 → 0
View file @
32eb5de5
.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
app/views/
projects
/_issuable_filter.html.haml
→
app/views/
shared
/_issuable_filter.html.haml
View file @
47634e39
...
...
@@ -2,15 +2,15 @@
.pull-left.append-right-20
%ul
.nav.nav-pills.nav-compact
%li
{
class:
(
"active"
if
params
[
:state
]
==
'opened'
)}
=
link_to
p
roject
_filter_path
(
state:
'opened'
)
do
=
link_to
p
age
_filter_path
(
state:
'opened'
)
do
%i
.fa.fa-exclamation-circle
Open
%li
{
class:
(
"active"
if
params
[
:state
]
==
'closed'
)}
=
link_to
p
roject
_filter_path
(
state:
'closed'
)
do
=
link_to
p
age
_filter_path
(
state:
'closed'
)
do
%i
.fa.fa-check-circle
Closed
%li
{
class:
(
"active"
if
params
[
:state
]
==
'all'
)}
=
link_to
p
roject
_filter_path
(
state:
'all'
)
do
=
link_to
p
age
_filter_path
(
state:
'all'
)
do
%i
.fa.fa-compass
All
...
...
@@ -27,13 +27,13 @@
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
p
roject
_filter_path
(
assignee_id:
nil
)
do
=
link_to
p
age
_filter_path
(
assignee_id:
nil
)
do
Any
=
link_to
p
roject
_filter_path
(
assignee_id:
0
)
do
=
link_to
p
age
_filter_path
(
assignee_id:
0
)
do
Unassigned
-
@assignees
.
sort_by
(
&
:name
).
each
do
|
user
|
%li
=
link_to
p
roject
_filter_path
(
assignee_id:
user
.
id
)
do
=
link_to
p
age
_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
p
roject
_filter_path
(
author_id:
nil
)
do
=
link_to
p
age
_filter_path
(
author_id:
nil
)
do
Any
=
link_to
p
roject
_filter_path
(
author_id:
0
)
do
=
link_to
p
age
_filter_path
(
author_id:
0
)
do
Unassigned
-
@authors
.
sort_by
(
&
:name
).
each
do
|
user
|
%li
=
link_to
p
roject
_filter_path
(
author_id:
user
.
id
)
do
=
link_to
p
age
_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
p
roject
_filter_path
(
milestone_id:
nil
)
do
=
link_to
p
age
_filter_path
(
milestone_id:
nil
)
do
Any
=
link_to
p
roject
_filter_path
(
milestone_id:
0
)
do
=
link_to
p
age
_filter_path
(
milestone_id:
0
)
do
None (backlog)
-
project_active_
milestones
.
each
do
|
milestone
|
-
@
milestones
.
each
do
|
milestone
|
%li
=
link_to
p
roject
_filter_path
(
milestone_id:
milestone
.
id
)
do
=
link_to
p
age
_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'
app/views/shared/_sort_dropdown.html.haml
View file @
47634e39
...
...
@@ -8,15 +8,15 @@
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
p
roject
_filter_path
(
sort:
'newest'
)
do
=
link_to
p
age
_filter_path
(
sort:
'newest'
)
do
=
sort_title_recently_created
=
link_to
p
roject
_filter_path
(
sort:
'oldest'
)
do
=
link_to
p
age
_filter_path
(
sort:
'oldest'
)
do
=
sort_title_oldest_created
=
link_to
p
roject
_filter_path
(
sort:
'recently_updated'
)
do
=
link_to
p
age
_filter_path
(
sort:
'recently_updated'
)
do
=
sort_title_recently_updated
=
link_to
p
roject
_filter_path
(
sort:
'last_updated'
)
do
=
link_to
p
age
_filter_path
(
sort:
'last_updated'
)
do
=
sort_title_oldest_updated
=
link_to
p
roject
_filter_path
(
sort:
'milestone_due_soon'
)
do
=
link_to
p
age
_filter_path
(
sort:
'milestone_due_soon'
)
do
Milestone due soon
=
link_to
p
roject
_filter_path
(
sort:
'milestone_due_later'
)
do
=
link_to
p
age
_filter_path
(
sort:
'milestone_due_later'
)
do
Milestone due later
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment