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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
be17a32d
Commit
be17a32d
authored
Jul 29, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'improve/public_area' of /home/git/repositories/gitlab/gitlabhq
parents
b55e22e2
4de1db11
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
148 additions
and
17 deletions
+148
-17
app/assets/stylesheets/sections/projects.scss
app/assets/stylesheets/sections/projects.scss
+13
-3
app/controllers/public/projects_controller.rb
app/controllers/public/projects_controller.rb
+11
-0
app/views/layouts/errors.html.haml
app/views/layouts/errors.html.haml
+1
-1
app/views/layouts/public.html.haml
app/views/layouts/public.html.haml
+7
-1
app/views/public/projects/_tree.html.haml
app/views/public/projects/_tree.html.haml
+5
-0
app/views/public/projects/index.html.haml
app/views/public/projects/index.html.haml
+10
-12
app/views/public/projects/show.html.haml
app/views/public/projects/show.html.haml
+46
-0
config/routes.rb
config/routes.rb
+2
-0
features/public/public_projects.feature
features/public/public_projects.feature
+14
-0
features/steps/public/projects_feature.rb
features/steps/public/projects_feature.rb
+35
-0
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+4
-0
No files found.
app/assets/stylesheets/sections/projects.scss
View file @
be17a32d
...
@@ -81,9 +81,11 @@ ul.nav.nav-projects-tabs {
...
@@ -81,9 +81,11 @@ ul.nav.nav-projects-tabs {
.public-projects
{
.public-projects
{
li
{
li
{
margin-top
:
8px
;
.project-title
{
margin-bottom
:
5px
;
font-size
:
14px
;
border-bottom
:
1px
solid
#eee
;
line-height
:
2
;
font-weight
:
normal
;
}
.description
{
.description
{
margin-left
:
15px
;
margin-left
:
15px
;
...
@@ -92,6 +94,14 @@ ul.nav.nav-projects-tabs {
...
@@ -92,6 +94,14 @@ ul.nav.nav-projects-tabs {
}
}
}
}
.public-clone
{
background
:
#333
;
color
:
#f5f5f5
;
padding
:
5px
10px
;
margin
:
1px
;
font-weight
:
normal
;
}
.new-tag-btn
{
.new-tag-btn
{
position
:
relative
;
position
:
relative
;
top
:
-5px
;
top
:
-5px
;
...
...
app/controllers/public/projects_controller.rb
View file @
be17a32d
...
@@ -10,4 +10,15 @@ class Public::ProjectsController < ApplicationController
...
@@ -10,4 +10,15 @@ class Public::ProjectsController < ApplicationController
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
20
)
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
20
)
end
end
def
show
@project
=
Project
.
public_only
.
find_with_namespace
(
params
[
:id
])
render_404
and
return
unless
@project
@repository
=
@project
.
repository
@recent_tags
=
@repository
.
tags
.
first
(
10
)
@commit
=
@repository
.
commit
(
params
[
:ref
])
@tree
=
Tree
.
new
(
@repository
,
@commit
.
id
)
end
end
end
app/views/layouts/errors.html.haml
View file @
be17a32d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
%html
{
lang:
"en"
}
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
"Error"
=
render
"layouts/head"
,
title:
"Error"
%body
{
class:
"#{app_theme} application"
}
%body
{
class:
"#{app_theme} application"
}
=
render
"layouts/head_panel"
,
title:
""
=
render
"layouts/head_panel"
,
title:
""
if
current_user
=
render
"layouts/flash"
=
render
"layouts/flash"
.container
.container
.content
.content
...
...
app/views/layouts/public.html.haml
View file @
be17a32d
...
@@ -10,10 +10,16 @@
...
@@ -10,10 +10,16 @@
.container
.container
%div
.app_logo
%div
.app_logo
%span
.separator
%span
.separator
=
link_to
root_path
,
class:
"home"
do
=
link_to
public_
root_path
,
class:
"home"
do
%h1
GITLAB
%h1
GITLAB
%span
.separator
%span
.separator
%h1
.project_name
Public Projects
%h1
.project_name
Public Projects
%ul
.nav
%li
%a
%div
.hide.turbolink-spinner
%i
.icon-refresh.icon-spin
Loading...
.container.navless-container
.container.navless-container
.content
.content
...
...
app/views/public/projects/_tree.html.haml
0 → 100644
View file @
be17a32d
-
if
tree
.
readme
=
render
"projects/tree/readme"
,
readme:
tree
.
readme
-
else
.alert
%h3
.nothing_here_message
This project does not have README file
app/views/public/projects/index.html.haml
View file @
be17a32d
...
@@ -11,20 +11,18 @@
...
@@ -11,20 +11,18 @@
=
search_field_tag
:search
,
params
[
:search
],
placeholder:
"gitlab-ci"
,
class:
"span3 search-text-input"
,
id:
"projects_search"
=
search_field_tag
:search
,
params
[
:search
],
placeholder:
"gitlab-ci"
,
class:
"span3 search-text-input"
,
id:
"projects_search"
=
submit_tag
'Search'
,
class:
"btn btn-primary wide"
=
submit_tag
'Search'
,
class:
"btn btn-primary wide"
%hr
.public-projects
.public-projects
%ul
.
unstyled
%ul
.
bordered-list
-
@projects
.
each
do
|
project
|
-
@projects
.
each
do
|
project
|
%li
.clearfix
%li
%div
.project-title
%i
.icon-share
%i
.icon-share.cgray
-
if
current_user
=
link_to
public_project_path
(
project
)
do
=
link_to_project
project
-
else
=
project
.
name_with_namespace
=
project
.
name_with_namespace
.pull-right
.pull-right
%pre
.dark.tiny
git clone
#{
project
.
http_url_to_repo
}
%pre
.public-clone
git clone
#{
project
.
http_url_to_repo
}
-
if
project
.
description
.
present?
%div
.description
%div
.description
=
project
.
description
=
project
.
description
-
unless
@projects
.
present?
-
unless
@projects
.
present?
...
...
app/views/public/projects/show.html.haml
0 → 100644
View file @
be17a32d
%h3
.page-title
=
@project
.
name_with_namespace
.pull-right
%pre
.public-clone
git clone
#{
@project
.
http_url_to_repo
}
.pull-right
-
if
current_user
=
link_to
'Browse project'
,
@project
,
class:
'btn btn-create append-right-10'
%div
=
link_to
public_root_path
do
←
To projects list
.pull-right
%span
.light
=
@project
.
description
%br
.row
.span9
=
render
'tree'
,
tree:
@tree
.span3
%h5
Repository:
%div
%p
%span
.light
Bare size is
#{
@project
.
repository
.
size
}
MB
%p
=
pluralize
(
@repository
.
round_commit_count
,
'commit'
)
%p
=
pluralize
(
@repository
.
branch_names
.
count
,
'branch'
)
%p
=
pluralize
(
@repository
.
tag_names
.
count
,
'tag'
)
-
if
@recent_tags
.
present?
%hr
%h5
Most Recent Tags:
%ul
.unstyled
-
@recent_tags
.
each
do
|
tag
|
%li
%p
%i
.icon-tag
%strong
=
tag
.
name
%small
.light.pull-right
%i
.icon-calendar
=
time_ago_in_words
(
tag
.
commit
.
committed_date
)
ago
config/routes.rb
View file @
be17a32d
...
@@ -55,6 +55,8 @@ Gitlab::Application.routes.draw do
...
@@ -55,6 +55,8 @@ Gitlab::Application.routes.draw do
#
#
namespace
:public
do
namespace
:public
do
resources
:projects
,
only:
[
:index
]
resources
:projects
,
only:
[
:index
]
resources
:projects
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
},
only:
[
:show
]
root
to:
"projects#index"
root
to:
"projects#index"
end
end
...
...
features/public/public_projects.feature
0 → 100644
View file @
be17a32d
Feature
:
Public Projects Feature
Background
:
Given
public project
"Community"
And
private project
"Enterprise"
Scenario
:
I
visit public area
When
I visit the public projects area
Then
I should see project
"Community"
And
I should not see project
"Enterprise"
Scenario
:
I
visit public project page
When
I visit public page for
"Community"
project
Then
I should see public project details
And
I should see project readme
features/steps/public/projects_feature.rb
0 → 100644
View file @
be17a32d
class
Spinach::Features::PublicProjectsFeature
<
Spinach
::
FeatureSteps
include
SharedPaths
step
'I should see project "Community"'
do
page
.
should
have_content
"Community"
end
step
'I should not see project "Enterprise"'
do
page
.
should_not
have_content
"Enterprise"
end
step
'I should see public project details'
do
page
.
should
have_content
'32 branches'
page
.
should
have_content
'16 tags'
end
step
'I should see project readme'
do
page
.
should
have_content
'README.md'
end
step
'public project "Community"'
do
create
:project_with_code
,
name:
'Community'
,
public:
true
end
step
'private project "Enterprise"'
do
create
:project
,
name:
'Enterprise'
end
private
def
project
@project
||=
Project
.
find_by_name
(
"Community"
)
end
end
features/steps/shared/paths.rb
View file @
be17a32d
...
@@ -275,6 +275,10 @@ module SharedPaths
...
@@ -275,6 +275,10 @@ module SharedPaths
visit
public_root_path
visit
public_root_path
end
end
step
'I visit public page for "Community" project'
do
visit
public_project_path
(
Project
.
find_by_name
(
"Community"
))
end
# ----------------------------------------
# ----------------------------------------
# Snippets
# Snippets
# ----------------------------------------
# ----------------------------------------
...
...
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