Commit 0ae9ac155c2d6d91060e0b0a3d528681aeb0dfe2
1 parent
e33aab0b
Exists in
master
and in
4 other branches
repo tab added. activities page for repo
Showing
6 changed files
with
49 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
| 1 | +class RepositoriesController < ApplicationController | ||
| 2 | + before_filter :project | ||
| 3 | + | ||
| 4 | + # Authorize | ||
| 5 | + before_filter :add_project_abilities | ||
| 6 | + before_filter :authorize_read_project! | ||
| 7 | + before_filter :require_non_empty_project | ||
| 8 | + | ||
| 9 | + layout "project" | ||
| 10 | + | ||
| 11 | + def show | ||
| 12 | + @activities = @project.fresh_commits(20) | ||
| 13 | + end | ||
| 14 | +end |
app/helpers/projects_helper.rb
| @@ -33,4 +33,10 @@ module ProjectsHelper | @@ -33,4 +33,10 @@ module ProjectsHelper | ||
| 33 | :project_id => @project, | 33 | :project_id => @project, |
| 34 | :id => @ref || @project.root_ref ) ? "current" : nil | 34 | :id => @ref || @project.root_ref ) ? "current" : nil |
| 35 | end | 35 | end |
| 36 | + | ||
| 37 | + def repository_tab_class | ||
| 38 | + if controller.controller_name == "repositories" | ||
| 39 | + "current" | ||
| 40 | + end | ||
| 41 | + end | ||
| 36 | end | 42 | end |
app/views/layouts/project.html.haml
| @@ -24,6 +24,7 @@ | @@ -24,6 +24,7 @@ | ||
| 24 | .fixed | 24 | .fixed |
| 25 | %aside | 25 | %aside |
| 26 | = link_to "Project", project_path(@project), :class => project_tab_class | 26 | = link_to "Project", project_path(@project), :class => project_tab_class |
| 27 | + = link_to "Repository", project_repository_path(@project), :class => repository_tab_class | ||
| 27 | = link_to "Tree", tree_project_ref_path(@project, @project.root_ref), :class => tree_tab_class | 28 | = link_to "Tree", tree_project_ref_path(@project, @project.root_ref), :class => tree_tab_class |
| 28 | = link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil | 29 | = link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil |
| 29 | = link_to "Network graph", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil | 30 | = link_to "Network graph", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil |
| @@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
| 1 | +.merge-tabs.repository | ||
| 2 | + = link_to project_repository_path(@project), :class => "tab #{'active' if current_page?(project_repository_path(@project)) }" do | ||
| 3 | + %span | ||
| 4 | + Activities | ||
| 5 | + = link_to "#", :class => "tab" do | ||
| 6 | + %span | ||
| 7 | + Branches | ||
| 8 | + = link_to "#", :class => "tab" do | ||
| 9 | + %span | ||
| 10 | + Tags | ||
| 11 | + = link_to "#", :class => "tab" do | ||
| 12 | + %span | ||
| 13 | + Hooks | ||
| 14 | + = link_to "#", :class => "tab" do | ||
| 15 | + %span | ||
| 16 | + Deploy Keys | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + |
| @@ -0,0 +1,7 @@ | @@ -0,0 +1,7 @@ | ||
| 1 | +- content_for(:body_class, "project-page dashboard") | ||
| 2 | += render "head" | ||
| 3 | + | ||
| 4 | +#news-feed.news-feed | ||
| 5 | + .project-box.project-updates.ui-box.ui-box-small.ui-box-big | ||
| 6 | + - @activities.each do |update| | ||
| 7 | + = render "projects/feed", :update => update, :project => @project |
config/routes.rb
| @@ -46,6 +46,8 @@ Gitlab::Application.routes.draw do | @@ -46,6 +46,8 @@ Gitlab::Application.routes.draw do | ||
| 46 | get "files" | 46 | get "files" |
| 47 | end | 47 | end |
| 48 | 48 | ||
| 49 | + resource :repository | ||
| 50 | + | ||
| 49 | resources :refs, :only => [], :path => "/" do | 51 | resources :refs, :only => [], :path => "/" do |
| 50 | collection do | 52 | collection do |
| 51 | get "switch" | 53 | get "switch" |