Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
- index 31c103a..865fc77 100644
- --- a/app/controllers/users_controller.rb
- +++ b/app/controllers/users_controller.rb
- @@ -93,6 +93,13 @@ class UsersController < ApplicationController
- redirect_to '/'
- return
- end
- +
- + @comment_count = Post.paginate(:select => 'posts.*, topics.title as topic_title, scripts.name as script_name',
- + :joins => 'inner join topics on posts.topic_id = topics.id inner join scripts on topics.forumable_id = scripts.id',
- + :order => 'posts.created_at desc',
- + :conditions => ['posts.user_id = ? and posts.forumable_type = ?', @user.id, 'Script'],
- + :per_page => 1,
- + :page => params[:page]).count
- respond_to do |format|
- format.html
- diff --git a/app/views/scripts/_heading.html.haml b/app/views/scripts/_heading.html.haml
- index 985490c..f39da98 100644
- --- a/app/views/scripts/_heading.html.haml
- +++ b/app/views/scripts/_heading.html.haml
- @@ -1,6 +1,6 @@
- #heading{:class => ('icon' if @script.icon?)}
- - if @script.icon?
- - = link_to image_tag(@script.icon.url(:thumb)), @script.icon.url(:large), :title => @script.name, :id => "icon", :rel => "lightbox"
- + = link_to image_tag(@script.icon.url(:large), :width => 125), @script.icon.url(:large), :title => @script.name, :id => "icon", :rel => "lightbox"
- - else
- = link_to(avatar_for(@script.user, 64), user_path(@script.user), :title => @script.user.display_name, :id => 'avatar') rescue nil
- diff --git a/app/views/users/reviews.html.haml b/app/views/users/reviews.html.haml
- index 097bd19..13bbabc 100644
- --- a/app/views/users/reviews.html.haml
- +++ b/app/views/users/reviews.html.haml
- @@ -1,4 +1,4 @@
- -- @page_title = "#{@user.display_name}'s guides"
- +- @page_title = "#{@user.display_name}'s reviews"
- - @wide = true
- = render :partial => 'nav'
- diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
- index 47dfcca..ff2db7c 100644
- --- a/app/views/users/show.html.haml
- +++ b/app/views/users/show.html.haml
- @@ -149,3 +149,41 @@
- - if @user.reviews_count > 0
- - reviews = @user.reviews.find(:all, :limit => 6, :order => 'updated_at desc')
- = render :partial => 'reviews/item', :collection => reviews, :locals => {:show_script => true}
- +<<<<<<< HEAD
- +=======
- + - if @user.reviews_count > 5
- + %p
- + and
- + = link_to pluralize(@user.reviews_count-5, 'more reviews'), reviews_user_path(@user)
- +
- +.side
- + - if @user.favorite_scripts_count > 0
- + .box
- + %h4 Favorite scripts
- + %ul
- + - @user.favorite_scripts(5).each do |s|
- + %li= link_to h(s.name), script_path(s)
- + - if @user.favorite_scripts_count > 5
- + %p
- + and
- + = link_to pluralize(@user.favorite_scripts_count-5, 'more script'), favorites_user_path(@user)
- +
- + - if @user.comments_count > 0
- + .box
- + %h4 Comments posted
- + %p.subtitle
- + = pluralize(@comment_count, 'comment')
- + (
- + = link_to 'view all', comments_user_path(@user)
- + )
- +
- + .box
- + %h4 Forums activity
- + %p.subtitle
- + %span
- + = pluralize @user.topics.count, 'topic'
- + |
- + = pluralize @user.posts_count, 'post'
- + |
- + = link_to "view posts", user_posts_path(@user)
- +>>>>>>> jake/userfixes
Add Comment
Please, Sign In to add comment