From 90e027b8a6375a667802654f5b34fe3cde14d953 Mon Sep 17 00:00:00 2001 From: Pavel Chipiga Date: Wed, 21 Mar 2012 23:52:40 +0200 Subject: [PATCH] Remove old project load. Fix project routes. Fix wiki history avatar load. Refs #190 --- app/controllers/git/base_controller.rb | 5 ----- app/views/wiki/_history.html.haml | 2 +- config/routes.rb | 3 +-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/controllers/git/base_controller.rb b/app/controllers/git/base_controller.rb index 601400a59..21f761b5d 100644 --- a/app/controllers/git/base_controller.rb +++ b/app/controllers/git/base_controller.rb @@ -3,7 +3,6 @@ class Git::BaseController < ApplicationController before_filter :authenticate_user! load_and_authorize_resource :project - before_filter :find_project before_filter :find_git_repository before_filter :find_tags before_filter :find_branches @@ -12,10 +11,6 @@ class Git::BaseController < ApplicationController before_filter :set_current_branch protected - def find_project - @project ||= Project.find(params[:project_id] || params[:id]) # TODO remove? - end - def find_git_repository @git_repository = @project.git_repository end diff --git a/app/views/wiki/_history.html.haml b/app/views/wiki/_history.html.haml index 35fe7bb73..09a0781ff 100644 --- a/app/views/wiki/_history.html.haml +++ b/app/views/wiki/_history.html.haml @@ -10,7 +10,7 @@ - user = User.where(:email => v.author.email).first .avatar = link_to user_path_by_user(user) do - %img.mini-gravatar{:src => gravatar_url(v.author.email), :alt => "avatar: #{v.author.name}"} + = image_tag avatar_url_by_email(v.author.email), :alt => "avatar: #{v.author.name}", :class => 'mini-gravatar' .name = link_to user_path_by_user(user) do %span.username= user.present? ? "#{user.uname} (#{user.name})" : v.author.name diff --git a/config/routes.rb b/config/routes.rb index ac0b2785e..c9173eb76 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -101,7 +101,6 @@ Rosa::Application.routes.draw do resources :categories, :only => [:index, :show] end - resources :projects, :only => [:new] resources :projects, :except => [:show] do resources :wiki do collection do @@ -155,7 +154,6 @@ Rosa::Application.routes.draw do member do post :fork - get :show, :controller => 'git/trees', :action => :show get :sections post :sections delete :remove_user @@ -201,6 +199,7 @@ Rosa::Application.routes.draw do match 'product_status', :to => 'product_build_lists#status_build' # Tree + get '/projects/:project_id' => "git/trees#show", :as => :project get '/projects/:project_id/tree/:treeish(/*path)' => "git/trees#show", :defaults => {:treeish => :master}, :as => :tree # Commits get '/projects/:project_id/commits/:treeish(/*path)' => "git/commits#index", :defaults => {:treeish => :master}, :as => :commits, :format => false