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
367445fd
Unverified
Commit
367445fd
authored
Jul 23, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor explore area
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
1df0345e
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
61 additions
and
83 deletions
+61
-83
groups_controller.rb
app/controllers/explore/groups_controller.rb
+2
-2
projects_controller.rb
app/controllers/explore/projects_controller.rb
+9
-2
projects_controller.rb
app/controllers/public/projects_controller.rb
+0
-14
index.html.haml
app/views/explore/groups/index.html.haml
+6
-6
_project.html.haml
app/views/explore/projects/_project.html.haml
+20
-0
index.html.haml
app/views/explore/projects/index.html.haml
+1
-26
trending.html.haml
app/views/explore/projects/trending.html.haml
+3
-10
_head_panel.html.haml
app/views/layouts/_head_panel.html.haml
+1
-1
devise.html.haml
app/views/layouts/devise.html.haml
+1
-1
explore.html.haml
app/views/layouts/explore.html.haml
+5
-5
public_groups.html.haml
app/views/layouts/public_groups.html.haml
+0
-11
routes.rb
config/routes.rb
+13
-5
No files found.
app/controllers/
public
/groups_controller.rb
→
app/controllers/
explore
/groups_controller.rb
View file @
367445fd
class
Public
::
GroupsController
<
ApplicationController
class
Explore
::
GroupsController
<
ApplicationController
skip_before_filter
:authenticate_user!
,
:reject_blocked
,
:set_current_user_for_observers
,
:add_abilities
layout
"
public
"
layout
"
explore
"
def
index
@groups
=
GroupsFinder
.
new
.
execute
(
current_user
)
...
...
app/controllers/
public/explore
_controller.rb
→
app/controllers/
explore/projects
_controller.rb
View file @
367445fd
class
Public
::
Explore
Controller
<
ApplicationController
class
Explore
::
Projects
Controller
<
ApplicationController
skip_before_filter
:authenticate_user!
,
:reject_blocked
,
:add_abilities
layout
"public"
layout
'explore'
def
index
@projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
]).
per
(
20
)
end
def
trending
@trending_projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@trending_projects
=
@trending_projects
.
page
(
params
[
:page
]).
per
(
10
)
end
...
...
app/controllers/public/projects_controller.rb
deleted
100644 → 0
View file @
1df0345e
class
Public
::
ProjectsController
<
ApplicationController
skip_before_filter
:authenticate_user!
,
:reject_blocked
,
:set_current_user_for_observers
,
:add_abilities
layout
'public'
def
index
@projects
=
Project
.
publicish
(
current_user
)
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
]).
per
(
20
)
end
end
app/views/
public
/groups/index.html.haml
→
app/views/
explore
/groups/index.html.haml
View file @
367445fd
.clearfix
.pull-left
=
form_tag
public
_groups_path
,
method: :get
,
class:
'form-inline form-tiny'
do
|
f
|
=
form_tag
explore
_groups_path
,
method: :get
,
class:
'form-inline form-tiny'
do
|
f
|
.form-group
=
search_field_tag
:search
,
params
[
:search
],
placeholder:
"Filter by name"
,
class:
"form-control search-text-input input-mn-300"
,
id:
"groups_search"
.form-group
...
...
@@ -17,15 +17,15 @@
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
public
_groups_path
(
sort:
nil
)
do
=
link_to
explore
_groups_path
(
sort:
nil
)
do
Name
=
link_to
public
_groups_path
(
sort:
'newest'
)
do
=
link_to
explore
_groups_path
(
sort:
'newest'
)
do
Newest
=
link_to
public
_groups_path
(
sort:
'oldest'
)
do
=
link_to
explore
_groups_path
(
sort:
'oldest'
)
do
Oldest
=
link_to
public
_groups_path
(
sort:
'recently_updated'
)
do
=
link_to
explore
_groups_path
(
sort:
'recently_updated'
)
do
Recently updated
=
link_to
public
_groups_path
(
sort:
'last_updated'
)
do
=
link_to
explore
_groups_path
(
sort:
'last_updated'
)
do
Last updated
%hr
...
...
app/views/explore/projects/_project.html.haml
0 → 100644
View file @
367445fd
%li
%h4
.project-title
.project-access-icon
=
visibility_level_icon
(
project
.
visibility_level
)
=
link_to
project
.
name_with_namespace
,
project
-
if
project
.
description
.
present?
%p
.project-description.str-truncated
=
project
.
description
.repo-info
-
unless
project
.
empty_repo?
=
link_to
pluralize
(
project
.
repository
.
round_commit_count
,
'commit'
),
project_commits_path
(
project
,
project
.
default_branch
)
·
=
link_to
pluralize
(
project
.
repository
.
branch_names
.
count
,
'branch'
),
project_branches_path
(
project
)
·
=
link_to
pluralize
(
project
.
repository
.
tag_names
.
count
,
'tag'
),
project_tags_path
(
project
)
-
else
%i
.icon-warning-sign
Empty repository
app/views/
public
/projects/index.html.haml
→
app/views/
explore
/projects/index.html.haml
View file @
367445fd
...
...
@@ -31,32 +31,7 @@
%hr
.public-projects
%ul
.bordered-list.top-list
-
@projects
.
each
do
|
project
|
%li
%h4
=
link_to
project_path
(
project
)
do
=
project
.
name_with_namespace
-
if
project
.
internal?
%small
.access-icon
=
internal_icon
Internal
.pull-right.hidden-sm.hidden-xs
%pre
.public-clone
git clone
#{
project
.
http_url_to_repo
}
-
if
project
.
description
.
present?
%p
=
project
.
description
.repo-info
-
unless
project
.
empty_repo?
=
link_to
pluralize
(
project
.
repository
.
round_commit_count
,
'commit'
),
project_commits_path
(
project
,
project
.
default_branch
)
·
=
link_to
pluralize
(
project
.
repository
.
branch_names
.
count
,
'branch'
),
project_branches_path
(
project
)
·
=
link_to
pluralize
(
project
.
repository
.
tag_names
.
count
,
'tag'
),
project_tags_path
(
project
)
-
else
%i
.icon-warning-sign
Empty repository
=
render
@projects
-
unless
@projects
.
present?
.nothing-here-block
No public projects
...
...
app/views/
public/explore/index
.html.haml
→
app/views/
explore/projects/trending
.html.haml
View file @
367445fd
...
...
@@ -3,16 +3,9 @@
%i
.icon-comments-alt
See most discussed projects for last month
%hr
%ul
.bordered-list
-
@trending_projects
.
each
do
|
project
|
%li
%h4
.project-title
.project-access-icon
=
visibility_level_icon
(
project
.
visibility_level
)
=
link_to
project
.
name_with_namespace
,
project
.project-description
=
project
.
description
.public-projects
%ul
.bordered-list
=
render
@trending_projects
.center
=
link_to
'Show all projects'
,
public_projects_path
,
class:
'btn btn-primary'
app/views/layouts/_head_panel.html.haml
View file @
367445fd
...
...
@@ -24,7 +24,7 @@
'data-original-title'
=>
'Help'
do
%i
.icon-question-sign
%li
=
link_to
public_root_path
,
title:
"Public area
"
,
class:
'has_bottom_tooltip'
,
'data-original-title'
=>
'Public area'
do
=
link_to
explore_root_path
,
title:
"Explore
"
,
class:
'has_bottom_tooltip'
,
'data-original-title'
=>
'Public area'
do
%i
.icon-globe
%li
=
link_to
user_snippets_path
(
current_user
),
title:
"My snippets"
,
class:
'has_bottom_tooltip'
,
'data-original-title'
=>
'My snippets'
do
...
...
app/views/layouts/devise.html.haml
View file @
367445fd
...
...
@@ -33,6 +33,6 @@
%hr
.container
.footer-links
=
link_to
"Explore"
,
public_explore
_path
=
link_to
"Explore"
,
explore_root
_path
=
link_to
"Documentation"
,
"http://doc.gitlab.com/"
=
link_to
"About GitLab"
,
"https://about.gitlab.com/"
app/views/layouts/
public
.html.haml
→
app/views/layouts/
explore
.html.haml
View file @
367445fd
...
...
@@ -18,11 +18,11 @@
%ul
.nav.nav-tabs
=
nav_link
(
controller: :explore
)
do
=
link_to
'Trending Projects'
,
public_explore
_path
=
nav_link
(
controller: :projects
)
do
=
link_to
'All Projects'
,
public
_projects_path
=
nav_link
(
path:
'projects#trending'
)
do
=
link_to
'Trending Projects'
,
explore_root
_path
=
nav_link
(
path:
'projects#index'
)
do
=
link_to
'All Projects'
,
explore
_projects_path
=
nav_link
(
controller: :groups
)
do
=
link_to
'All Groups'
,
public
_groups_path
=
link_to
'All Groups'
,
explore
_groups_path
=
yield
app/views/layouts/public_groups.html.haml
deleted
100644 → 0
View file @
1df0345e
!!! 5
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
"Public Groups"
%body
{
class:
"#{app_theme} application"
,
:'data-page'
=>
body_data_page
}
=
render
"layouts/broadcast"
-
if
current_user
=
render
"layouts/head_panel"
,
title:
"Public Groups"
-
else
=
render
"layouts/public_head_panel"
,
title:
"Public Groups"
.container.navless-container
.content
=
yield
config/routes.rb
View file @
367445fd
...
...
@@ -47,15 +47,23 @@ Gitlab::Application.routes.draw do
get
"/s/:username"
=>
"snippets#user_index"
,
as: :user_snippets
,
constraints:
{
username:
/.*/
}
#
#
Public namespace
#
Explroe area
#
namespace
:public
do
resources
:projects
,
only:
[
:index
]
namespace
:explore
do
resources
:projects
,
only:
[
:index
]
do
collection
do
get
:trending
end
end
resources
:groups
,
only:
[
:index
]
get
'explore'
=>
'explore#index'
root
to:
"explore#index"
root
to:
"projects#trending"
end
# Compatibility with old routing
get
'public'
=>
"explore/projects#index"
get
'public/projects'
=>
"explore/projects#index"
#
# Attachments serving
#
...
...
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