Merge branch 'feature/repository_tab'
This commit is contained in:
commit
2c1b06a10f
11 changed files with 153 additions and 0 deletions
|
@ -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,
|
||||
|
|
22
app/controllers/repositories_controller.rb
Normal file
22
app/controllers/repositories_controller.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
19
app/views/repositories/_head.html.haml
Normal file
19
app/views/repositories/_head.html.haml
Normal file
|
@ -0,0 +1,19 @@
|
|||
.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
|
||||
|
||||
|
||||
|
10
app/views/repositories/branches.html.haml
Normal file
10
app/views/repositories/branches.html.haml
Normal file
|
@ -0,0 +1,10 @@
|
|||
= 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
|
7
app/views/repositories/show.html.haml
Normal file
7
app/views/repositories/show.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
|||
- 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
|
10
app/views/repositories/tags.html.haml
Normal file
10
app/views/repositories/tags.html.haml
Normal file
|
@ -0,0 +1,10 @@
|
|||
= 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
|
Loading…
Add table
Add a link
Reference in a new issue