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
8e8eb978
Commit
8e8eb978
authored
Jun 13, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes pending delete from filter scopes
parent
9da107f0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
7 deletions
+6
-7
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+2
-2
app/models/project.rb
app/models/project.rb
+2
-3
app/views/shared/projects/_list.html.haml
app/views/shared/projects/_list.html.haml
+1
-1
No files found.
app/controllers/projects_controller.rb
View file @
8e8eb978
...
...
@@ -97,7 +97,7 @@ class ProjectsController < Projects::ApplicationController
end
if
@project
.
pending_delete?
flash
[
:alert
]
=
_
(
"Project '%{project_name}' queued for deletion."
)
%
{
project_name:
@project
.
name
}
flash
.
now
[
:alert
]
=
_
(
"Project '%{project_name}' queued for deletion."
)
%
{
project_name:
@project
.
name
}
end
respond_to
do
|
format
|
...
...
app/helpers/search_helper.rb
View file @
8e8eb978
...
...
@@ -97,8 +97,8 @@ module SearchHelper
# Autocomplete results for the current user's projects
def
projects_autocomplete
(
term
,
limit
=
5
)
current_user
.
authorized_projects
.
search_by_title
(
term
)
.
sorted_by_stars
.
non_archived
.
limit
(
limit
).
map
do
|
p
|
current_user
.
authorized_projects
.
search_by_title
(
term
)
.
sorted_by_stars
.
non_archived
.
limit
(
limit
).
map
do
|
p
|
{
category:
"Projects"
,
id:
p
.
id
,
...
...
app/models/project.rb
View file @
8e8eb978
...
...
@@ -222,9 +222,8 @@ class Project < ActiveRecord::Base
has_many
:uploads
,
as: :model
,
dependent: :destroy
# Scopes
default_scope
{
where
(
pending_delete:
false
)
}
scope
:with_deleted
,
->
{
unscope
(
where: :pending_delete
)
}
scope
:with_deleted
,
->
{
where
(
pending_delete:
true
)
}
scope
:without_deleted
,
->
{
where
(
pending_delete:
false
)
}
scope
:sorted_by_activity
,
->
{
reorder
(
last_activity_at: :desc
)
}
scope
:sorted_by_stars
,
->
{
reorder
(
'projects.star_count DESC'
)
}
...
...
app/views/shared/projects/_list.html.haml
View file @
8e8eb978
...
...
@@ -13,7 +13,7 @@
-
if
projects
.
any?
%ul
.projects-list
-
projects
.
each_with_index
do
|
project
,
i
|
-
css_class
=
(
i
>=
projects_limit
)
?
'hide'
:
nil
-
css_class
=
(
i
>=
projects_limit
)
||
project
.
pending_delete?
?
'hide'
:
nil
=
render
"shared/projects/project"
,
project:
project
,
skip_namespace:
skip_namespace
,
avatar:
avatar
,
stars:
stars
,
css_class:
css_class
,
ci:
ci
,
use_creator_avatar:
use_creator_avatar
,
forks:
forks
,
show_last_commit_as_description:
show_last_commit_as_description
...
...
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