Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
74223547479e
Commit
74223547
authored
Jun 13, 2017
by
Tiago Botelho
Browse files
Removes pending delete from filter scopes
parent
129138986594
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/controllers/projects_controller.rb
View file @
74223547
...
...
@@ -97,7 +97,7 @@
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 @
74223547
...
...
@@ -97,8 +97,8 @@
# 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 @
74223547
...
...
@@ -222,9 +222,8 @@
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 @
74223547
...
...
@@ -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
Supports
Markdown
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