Remove old project load. Fix project routes. Fix wiki history avatar load. Refs #190

This commit is contained in:
Pavel Chipiga 2012-03-21 23:52:40 +02:00
parent 89f31e9782
commit 90e027b8a6
3 changed files with 2 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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