BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
bebf34aa
Commit
bebf34aa
authored
Mar 04, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make projects sort dropdown shared so it can be reused for other pages
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
acb21121
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
23 deletions
+15
-23
explore_helper.rb
app/helpers/explore_helper.rb
+2
-10
_projects_head.html.haml
app/views/dashboard/_projects_head.html.haml
+1
-1
_filter.html.haml
app/views/explore/projects/_filter.html.haml
+5
-5
_dropdown.html.haml
app/views/shared/projects/_dropdown.html.haml
+7
-7
No files found.
app/helpers/explore_helper.rb
View file @
bebf34aa
module
ExploreHelper
def
explore_projects_filter
_path
(
options
=
{})
def
filter_projects
_path
(
options
=
{})
exist_opts
=
{
sort:
params
[
:sort
],
scope:
params
[
:scope
],
...
...
@@ -9,15 +9,7 @@ module ExploreHelper
}
options
=
exist_opts
.
merge
(
options
)
path
=
if
explore_controller?
explore_projects_path
elsif
current_action?
(
:starred
)
starred_dashboard_projects_path
else
dashboard_projects_path
end
path
=
request
.
path
path
<<
"?
#{
options
.
to_param
}
"
path
end
...
...
app/views/dashboard/_projects_head.html.haml
View file @
bebf34aa
...
...
@@ -15,7 +15,7 @@
.nav-controls
=
form_tag
request
.
original_url
,
method: :get
,
class:
'project-filter-form'
,
id:
'project-filter-form'
do
|
f
|
=
search_field_tag
:filter_projects
,
params
[
:filter_projects
],
placeholder:
'Filter by name...'
,
class:
'project-filter-form-field form-control input-short projects-list-filter'
,
spellcheck:
false
,
id:
'project-filter-form-field'
,
tabindex:
"2"
=
render
'
explore
/projects/dropdown'
=
render
'
shared
/projects/dropdown'
-
if
current_user
.
can_create_project?
=
link_to
new_project_path
,
class:
'btn btn-new'
do
=
icon
(
'plus'
)
...
...
app/views/explore/projects/_filter.html.haml
View file @
bebf34aa
...
...
@@ -10,11 +10,11 @@
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
explore_projects_filter
_path
(
visibility_level:
nil
)
do
=
link_to
filter_projects
_path
(
visibility_level:
nil
)
do
Any
-
Gitlab
::
VisibilityLevel
.
values
.
each
do
|
level
|
%li
{
class:
(
level
.
to_s
==
params
[
:visibility_level
])
?
'active'
:
'light'
}
=
link_to
explore_projects_filter
_path
(
visibility_level:
level
)
do
=
link_to
filter_projects
_path
(
visibility_level:
level
)
do
=
visibility_level_icon
(
level
)
=
visibility_level_label
(
level
)
...
...
@@ -30,11 +30,11 @@
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
explore_projects_filter
_path
(
tag:
nil
)
do
=
link_to
filter_projects
_path
(
tag:
nil
)
do
Any
-
@tags
.
each
do
|
tag
|
%li
{
class:
(
tag
.
name
==
params
[
:tag
])
?
'active'
:
'light'
}
=
link_to
explore_projects_filter
_path
(
tag:
tag
.
name
)
do
%i
.fa.fa-tag
=
link_to
filter_projects
_path
(
tag:
tag
.
name
)
do
=
icon
(
'tag'
)
=
tag
.
name
app/views/
explore
/projects/_dropdown.html.haml
→
app/views/
shared
/projects/_dropdown.html.haml
View file @
bebf34aa
...
...
@@ -8,21 +8,21 @@
%b
.caret
%ul
.dropdown-menu.dropdown-menu-align-right
%li
=
link_to
explore_projects_filter
_path
(
sort:
sort_value_name
)
do
=
link_to
filter_projects
_path
(
sort:
sort_value_name
)
do
=
sort_title_name
=
link_to
explore_projects_filter
_path
(
sort:
sort_value_recently_created
)
do
=
link_to
filter_projects
_path
(
sort:
sort_value_recently_created
)
do
=
sort_title_recently_created
=
link_to
explore_projects_filter
_path
(
sort:
sort_value_oldest_created
)
do
=
link_to
filter_projects
_path
(
sort:
sort_value_oldest_created
)
do
=
sort_title_oldest_created
=
link_to
explore_projects_filter
_path
(
sort:
sort_value_recently_updated
)
do
=
link_to
filter_projects
_path
(
sort:
sort_value_recently_updated
)
do
=
sort_title_recently_updated
=
link_to
explore_projects_filter
_path
(
sort:
sort_value_oldest_updated
)
do
=
link_to
filter_projects
_path
(
sort:
sort_value_oldest_updated
)
do
=
sort_title_oldest_updated
%li
.divider
%li
-
if
params
[
:archived
].
present?
=
link_to
explore_projects_filter
_path
(
sort:
@sort
,
archived:
nil
)
do
=
link_to
filter_projects
_path
(
sort:
@sort
,
archived:
nil
)
do
Hide archived projects
-
else
=
link_to
explore_projects_filter
_path
(
sort:
@sort
,
archived:
true
)
do
=
link_to
filter_projects
_path
(
sort:
@sort
,
archived:
true
)
do
Show archived projects
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