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
de6f2884
Unverified
Commit
de6f2884
authored
Feb 03, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort projects by last activity for project switcher in header
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
c8224f0b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
api.js.coffee
app/assets/javascripts/api.js.coffee
+2
-1
project_select.js.coffee
app/assets/javascripts/project_select.js.coffee
+2
-1
projects_helper.rb
app/helpers/projects_helper.rb
+4
-1
No files found.
app/assets/javascripts/api.js.coffee
View file @
de6f2884
...
...
@@ -47,7 +47,7 @@
callback
(
namespaces
)
# Return projects list. Filtered by query
projects
:
(
query
,
callback
)
->
projects
:
(
query
,
order
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
projects_path
)
$
.
ajax
(
...
...
@@ -55,6 +55,7 @@
data
:
private_token
:
gon
.
api_token
search
:
query
order_by
:
order
per_page
:
20
dataType
:
"json"
).
done
(
projects
)
->
...
...
app/assets/javascripts/project_select.js.coffee
View file @
de6f2884
...
...
@@ -3,6 +3,7 @@ class @ProjectSelect
$
(
'.ajax-project-select'
).
each
(
i
,
select
)
->
@
groupId
=
$
(
select
).
data
(
'group-id'
)
@
includeGroups
=
$
(
select
).
data
(
'include-groups'
)
@
orderBy
=
$
(
select
).
data
(
'order-by'
)
||
'id'
placeholder
=
"Search for project"
placeholder
+=
" or group"
if
@
includeGroups
...
...
@@ -28,7 +29,7 @@ class @ProjectSelect
if
@
groupId
Api
.
groupProjects
@
groupId
,
query
.
term
,
projectsCallback
else
Api
.
projects
query
.
term
,
projectsCallback
Api
.
projects
query
.
term
,
@
orderBy
,
projectsCallback
id
:
(
project
)
->
project
.
web_url
...
...
app/helpers/projects_helper.rb
View file @
de6f2884
...
...
@@ -57,7 +57,10 @@ module ProjectsHelper
link_output
=
simple_sanitize
(
project
.
name
)
link_output
+=
content_tag
:span
,
nil
,
{
class:
"fa fa-chevron-down dropdown-toggle-caret"
}
if
current_user
link_output
+=
project_select_tag
:project_path
,
class:
"project-item-select js-projects-dropdown"
,
data:
{
include_groups:
false
}
if
current_user
if
current_user
link_output
+=
project_select_tag
:project_path
,
class:
"project-item-select js-projects-dropdown"
,
data:
{
include_groups:
false
,
order_by:
'last_activity_at'
}
end
link_output
end
...
...
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