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
3ddfde08e7e5
Commit
3ddfde08
authored
Aug 10, 2015
by
Artem Sidorenko
Browse files
Allow listing of archived projects
Resolves #9285
parent
8cea909589bd
Changes
5
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
3ddfde08
...
...
@@ -5,6 +5,7 @@
- Better performance for web editor (switched from satellites to rugged)
- Faster merge
- Ability to fetch merge requests from refs/merge-requests/:id
- Allow displaying of archived projects in the admin interface (Artem Sidorenko)
v 7.14.0 (unreleased)
- Update default robots.txt rules to disallow crawling of irrelevant pages (Ben Bodenmiller)
...
...
app/controllers/admin/projects_controller.rb
View file @
3ddfde08
...
...
@@ -9,6 +9,7 @@
@projects
=
@projects
.
where
(
"visibility_level IN (?)"
,
params
[
:visibility_levels
])
if
params
[
:visibility_levels
].
present?
@projects
=
@projects
.
with_push
if
params
[
:with_push
].
present?
@projects
=
@projects
.
abandoned
if
params
[
:abandoned
].
present?
@projects
=
@projects
.
non_archived
unless
params
[
:with_archived
].
present?
@projects
=
@projects
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
...
...
app/controllers/explore/projects_controller.rb
View file @
3ddfde08
...
...
@@ -7,6 +7,7 @@
@tags
=
@projects
.
tags_on
(
:tags
)
@projects
=
@projects
.
tagged_with
(
params
[
:tag
])
if
params
[
:tag
].
present?
@projects
=
@projects
.
where
(
visibility_level:
params
[
:visibility_level
])
if
params
[
:visibility_level
].
present?
@projects
=
@projects
.
non_archived
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
...
...
@@ -14,6 +15,7 @@
def
trending
@trending_projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@trending_projects
=
@trending_projects
.
non_archived
@trending_projects
=
@trending_projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
...
...
app/models/project.rb
View file @
3ddfde08
...
...
@@ -215,7 +215,7 @@
end
def
search
(
query
)
joins
(
:namespace
).
where
(
'projects.archived = ?'
,
false
).
joins
(
:namespace
).
where
(
'LOWER(projects.name) LIKE :query OR
LOWER(projects.path) LIKE :query OR
LOWER(namespaces.name) LIKE :query OR
...
...
app/views/admin/projects/index.html.haml
View file @
3ddfde08
...
...
@@ -23,6 +23,10 @@
=
label_tag
:abandoned
do
=
check_box_tag
:abandoned
,
1
,
params
[
:abandoned
]
%span
No activity over 6 month
.checkbox
=
label_tag
:with_archived
do
=
check_box_tag
:with_archived
,
1
,
params
[
:with_archived
]
%span
Show archived projects
%fieldset
%strong
Visibility level:
...
...
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