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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
a667c713
Commit
a667c713
authored
Dec 31, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repo branches and tags
parent
d8247012
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
5 deletions
+62
-5
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+1
-0
app/controllers/repositories_controller.rb
app/controllers/repositories_controller.rb
+8
-0
app/views/repositories/_head.html.haml
app/views/repositories/_head.html.haml
+4
-4
app/views/repositories/branches.html.haml
app/views/repositories/branches.html.haml
+10
-0
app/views/repositories/tags.html.haml
app/views/repositories/tags.html.haml
+10
-0
config/routes.rb
config/routes.rb
+6
-1
spec/requests/repositories_spec.rb
spec/requests/repositories_spec.rb
+23
-0
No files found.
app/assets/stylesheets/projects.css.scss
View file @
a667c713
...
...
@@ -598,6 +598,7 @@ h4.middle-panel {
}
}
}
.merge-tabs.repository
.tab
span
{
background
:
url("images.png")
no-repeat
-38px
-77px
;
}
.activities-tab
span
{
background
:
url("images.png")
no-repeat
-161px
-1px
;
}
.stat-tab
span
,
.team-tab
span
,
...
...
app/controllers/repositories_controller.rb
View file @
a667c713
...
...
@@ -11,4 +11,12 @@ class RepositoriesController < ApplicationController
def
show
@activities
=
@project
.
fresh_commits
(
20
)
end
def
branches
@branches
=
@project
.
repo
.
heads
.
sort_by
(
&
:name
)
end
def
tags
@tags
=
@project
.
repo
.
tags
.
sort_by
(
&
:name
).
reverse
end
end
app/views/repositories/_head.html.haml
View file @
a667c713
...
...
@@ -2,16 +2,16 @@
=
link_to
project_repository_path
(
@project
),
:class
=>
"activities-tab tab
#{
'active'
if
current_page?
(
project_repository_path
(
@project
))
}
"
do
%span
Activities
=
link_to
"#"
,
:class
=>
"tab
"
do
=
link_to
branches_project_repository_path
(
@project
),
:class
=>
"tab
#{
'active'
if
current_page?
(
branches_project_repository_path
(
@project
))
}
"
do
%span
Branches
=
link_to
"#"
,
:class
=>
"tab
"
do
=
link_to
tags_project_repository_path
(
@project
),
:class
=>
"tab
#{
'active'
if
current_page?
(
tags_project_repository_path
(
@project
))
}
"
do
%span
Tags
=
link_to
"#"
,
:class
=>
"tab"
do
-#
= link_to "#", :class => "tab" do
%span
Hooks
=
link_to
"#"
,
:class
=>
"tab"
do
-#
= link_to "#", :class => "tab" do
%span
Deploy Keys
...
...
app/views/repositories/branches.html.haml
0 → 100644
View file @
a667c713
=
render
"head"
-
unless
@branches
.
empty?
%div
.update-data.ui-box.ui-box-small
.data
-
@branches
.
each
do
|
branch
|
%a
.update-item
{
:href
=>
project_commits_path
(
@project
,
:ref
=>
branch
.
name
)}
%span
.update-title
{
:style
=>
"margin-bottom:0px;"
}
=
branch
.
name
-
else
%h3
No brances
app/views/repositories/tags.html.haml
0 → 100644
View file @
a667c713
=
render
"head"
-
unless
@tags
.
empty?
%div
.update-data.ui-box.ui-box-small
.data
-
@tags
.
each
do
|
tag
|
%a
.update-item
{
:href
=>
project_commits_path
(
@project
,
:ref
=>
tag
.
name
)}
%span
.update-title
{
:style
=>
"margin-bottom:0px;"
}
=
tag
.
name
-
else
%h3
No tags
config/routes.rb
View file @
a667c713
...
...
@@ -46,7 +46,12 @@ Gitlab::Application.routes.draw do
get
"files"
end
resource
:repository
resource
:repository
do
member
do
get
"branches"
get
"tags"
end
end
resources
:refs
,
:only
=>
[],
:path
=>
"/"
do
collection
do
...
...
spec/requests/repositories_spec.rb
View file @
a667c713
...
...
@@ -31,5 +31,28 @@ describe "Repository" do
page
.
all
(
:css
,
".project-update"
).
size
.
should
==
20
end
end
describe
"GET /:project_name/repository/branches"
do
before
do
visit
branches_project_repository_path
(
@project
)
end
it
"should have link to repo activities"
do
page
.
should
have_content
(
"Branches"
)
page
.
should
have_content
(
"master"
)
end
end
# TODO: Add new repo to seeds with tags list
describe
"GET /:project_name/repository/tags"
do
before
do
visit
tags_project_repository_path
(
@project
)
end
it
"should have link to repo activities"
do
page
.
should
have_content
(
"Tags"
)
page
.
should
have_content
(
"No tags"
)
end
end
end
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