Commit a667c713 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

repo branches and tags

parent d8247012
...@@ -598,6 +598,7 @@ h4.middle-panel { ...@@ -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; } .activities-tab span { background: url("images.png") no-repeat -161px -1px; }
.stat-tab span, .stat-tab span,
.team-tab span, .team-tab span,
......
...@@ -11,4 +11,12 @@ class RepositoriesController < ApplicationController ...@@ -11,4 +11,12 @@ class RepositoriesController < ApplicationController
def show def show
@activities = @project.fresh_commits(20) @activities = @project.fresh_commits(20)
end end
def branches
@branches = @project.repo.heads.sort_by(&:name)
end
def tags
@tags = @project.repo.tags.sort_by(&:name).reverse
end
end end
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
= link_to project_repository_path(@project), :class => "activities-tab tab #{'active' if current_page?(project_repository_path(@project)) }" do = link_to project_repository_path(@project), :class => "activities-tab tab #{'active' if current_page?(project_repository_path(@project)) }" do
%span %span
Activities 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 %span
Branches 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 %span
Tags Tags
= link_to "#", :class => "tab" do -#= link_to "#", :class => "tab" do
%span %span
Hooks Hooks
= link_to "#", :class => "tab" do -#= link_to "#", :class => "tab" do
%span %span
Deploy Keys Deploy Keys
......
= 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
= 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
...@@ -46,7 +46,12 @@ Gitlab::Application.routes.draw do ...@@ -46,7 +46,12 @@ Gitlab::Application.routes.draw do
get "files" get "files"
end end
resource :repository resource :repository do
member do
get "branches"
get "tags"
end
end
resources :refs, :only => [], :path => "/" do resources :refs, :only => [], :path => "/" do
collection do collection do
......
...@@ -31,5 +31,28 @@ describe "Repository" do ...@@ -31,5 +31,28 @@ describe "Repository" do
page.all(:css, ".project-update").size.should == 20 page.all(:css, ".project-update").size.should == 20
end end
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 end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment