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
iv
gitlab-ce
Commits
2c1b06a1
Commit
2c1b06a1
authored
Dec 31, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/repository_tab'
parents
d34904b8
a667c713
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
153 additions
and
0 deletions
+153
-0
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+1
-0
app/controllers/repositories_controller.rb
app/controllers/repositories_controller.rb
+22
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+6
-0
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+1
-0
app/views/repositories/_head.html.haml
app/views/repositories/_head.html.haml
+19
-0
app/views/repositories/branches.html.haml
app/views/repositories/branches.html.haml
+10
-0
app/views/repositories/show.html.haml
app/views/repositories/show.html.haml
+7
-0
app/views/repositories/tags.html.haml
app/views/repositories/tags.html.haml
+10
-0
config/routes.rb
config/routes.rb
+7
-0
db/schema.rb
db/schema.rb
+12
-0
spec/requests/repositories_spec.rb
spec/requests/repositories_spec.rb
+58
-0
No files found.
app/assets/stylesheets/projects.css.scss
View file @
2c1b06a1
...
...
@@ -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
0 → 100644
View file @
2c1b06a1
class
RepositoriesController
<
ApplicationController
before_filter
:project
# Authorize
before_filter
:add_project_abilities
before_filter
:authorize_read_project!
before_filter
:require_non_empty_project
layout
"project"
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/helpers/projects_helper.rb
View file @
2c1b06a1
...
...
@@ -33,4 +33,10 @@ module ProjectsHelper
:project_id
=>
@project
,
:id
=>
@ref
||
@project
.
root_ref
)
?
"current"
:
nil
end
def
repository_tab_class
if
controller
.
controller_name
==
"repositories"
"current"
end
end
end
app/views/layouts/project.html.haml
View file @
2c1b06a1
...
...
@@ -24,6 +24,7 @@
.fixed
%aside
=
link_to
"Project"
,
project_path
(
@project
),
:class
=>
project_tab_class
=
link_to
"Repository"
,
project_repository_path
(
@project
),
:class
=>
repository_tab_class
=
link_to
"Tree"
,
tree_project_ref_path
(
@project
,
@project
.
root_ref
),
:class
=>
tree_tab_class
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"commits"
,
:action
=>
"index"
,
:project_id
=>
@project
)
?
"current"
:
nil
=
link_to
"Network graph"
,
graph_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"graph"
,
:id
=>
@project
)
?
"current"
:
nil
...
...
app/views/repositories/_head.html.haml
0 → 100644
View file @
2c1b06a1
.merge-tabs.repository
=
link_to
project_repository_path
(
@project
),
:class
=>
"activities-tab tab
#{
'active'
if
current_page?
(
project_repository_path
(
@project
))
}
"
do
%span
Activities
=
link_to
branches_project_repository_path
(
@project
),
:class
=>
"tab
#{
'active'
if
current_page?
(
branches_project_repository_path
(
@project
))
}
"
do
%span
Branches
=
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
%span
Hooks
-#= link_to "#", :class => "tab" do
%span
Deploy Keys
app/views/repositories/branches.html.haml
0 → 100644
View file @
2c1b06a1
=
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/show.html.haml
0 → 100644
View file @
2c1b06a1
-
content_for
(
:body_class
,
"project-page dashboard"
)
=
render
"head"
#news-feed
.news-feed
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
-
@activities
.
each
do
|
update
|
=
render
"projects/feed"
,
:update
=>
update
,
:project
=>
@project
app/views/repositories/tags.html.haml
0 → 100644
View file @
2c1b06a1
=
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 @
2c1b06a1
...
...
@@ -46,6 +46,13 @@ Gitlab::Application.routes.draw do
get
"files"
end
resource
:repository
do
member
do
get
"branches"
get
"tags"
end
end
resources
:refs
,
:only
=>
[],
:path
=>
"/"
do
collection
do
get
"switch"
...
...
db/schema.rb
View file @
2c1b06a1
...
...
@@ -13,6 +13,18 @@
ActiveRecord
::
Schema
.
define
(
:version
=>
20111220190817
)
do
create_table
"features"
,
:force
=>
true
do
|
t
|
t
.
string
"name"
t
.
string
"branch_name"
t
.
integer
"assignee_id"
t
.
integer
"author_id"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
string
"version"
t
.
integer
"status"
,
:default
=>
0
,
:null
=>
false
end
create_table
"issues"
,
:force
=>
true
do
|
t
|
t
.
string
"title"
t
.
integer
"assignee_id"
...
...
spec/requests/repositories_spec.rb
0 → 100644
View file @
2c1b06a1
require
'spec_helper'
describe
"Repository"
do
before
do
@user
=
Factory
:user
@project
=
Factory
:project
@project
.
add_access
(
@user
,
:read
,
:write
)
login_with
@user
end
describe
"GET /:project_name/repository"
do
before
do
visit
project_repository_path
(
@project
)
end
it
"should be on projects page"
do
current_path
.
should
==
project_repository_path
(
@project
)
end
it
"should have link to repo activities"
do
page
.
should
have_content
(
"Activities"
)
end
it
"should have link to last commit for activities tab"
do
page
.
should
have_content
(
@project
.
commit
.
safe_message
[
0
..
20
])
page
.
should
have_content
(
@project
.
commit
.
author_name
)
end
it
"should show commits list"
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