repo tab added. activities page for repo

This commit is contained in:
Dmitriy Zaporozhets 2011-12-30 22:56:13 +02:00
parent e33aab0b21
commit 0ae9ac155c
6 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,14 @@
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
end

View file

@ -33,4 +33,10 @@ module ProjectsHelper
:project_id => @project, :project_id => @project,
:id => @ref || @project.root_ref ) ? "current" : nil :id => @ref || @project.root_ref ) ? "current" : nil
end end
def repository_tab_class
if controller.controller_name == "repositories"
"current"
end
end
end end

View file

@ -24,6 +24,7 @@
.fixed .fixed
%aside %aside
= link_to "Project", project_path(@project), :class => project_tab_class = 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 "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 "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 = link_to "Network graph", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil

View file

@ -0,0 +1,19 @@
.merge-tabs.repository
= link_to project_repository_path(@project), :class => "tab #{'active' if current_page?(project_repository_path(@project)) }" do
%span
Activities
= link_to "#", :class => "tab" do
%span
Branches
= link_to "#", :class => "tab" do
%span
Tags
= link_to "#", :class => "tab" do
%span
Hooks
= link_to "#", :class => "tab" do
%span
Deploy Keys

View 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

View file

@ -46,6 +46,8 @@ Gitlab::Application.routes.draw do
get "files" get "files"
end end
resource :repository
resources :refs, :only => [], :path => "/" do resources :refs, :only => [], :path => "/" do
collection do collection do
get "switch" get "switch"