Guest User

Untitled

a guest
Jul 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
  2. index 31c103a..865fc77 100644
  3. --- a/app/controllers/users_controller.rb
  4. +++ b/app/controllers/users_controller.rb
  5. @@ -93,6 +93,13 @@ class UsersController < ApplicationController
  6. redirect_to '/'
  7. return
  8. end
  9. +
  10. + @comment_count = Post.paginate(:select => 'posts.*, topics.title as topic_title, scripts.name as script_name',
  11. + :joins => 'inner join topics on posts.topic_id = topics.id inner join scripts on topics.forumable_id = scripts.id',
  12. + :order => 'posts.created_at desc',
  13. + :conditions => ['posts.user_id = ? and posts.forumable_type = ?', @user.id, 'Script'],
  14. + :per_page => 1,
  15. + :page => params[:page]).count
  16.  
  17. respond_to do |format|
  18. format.html
  19. diff --git a/app/views/scripts/_heading.html.haml b/app/views/scripts/_heading.html.haml
  20. index 985490c..f39da98 100644
  21. --- a/app/views/scripts/_heading.html.haml
  22. +++ b/app/views/scripts/_heading.html.haml
  23. @@ -1,6 +1,6 @@
  24. #heading{:class => ('icon' if @script.icon?)}
  25. - if @script.icon?
  26. - = link_to image_tag(@script.icon.url(:thumb)), @script.icon.url(:large), :title => @script.name, :id => "icon", :rel => "lightbox"
  27. + = link_to image_tag(@script.icon.url(:large), :width => 125), @script.icon.url(:large), :title => @script.name, :id => "icon", :rel => "lightbox"
  28. - else
  29. = link_to(avatar_for(@script.user, 64), user_path(@script.user), :title => @script.user.display_name, :id => 'avatar') rescue nil
  30.  
  31. diff --git a/app/views/users/reviews.html.haml b/app/views/users/reviews.html.haml
  32. index 097bd19..13bbabc 100644
  33. --- a/app/views/users/reviews.html.haml
  34. +++ b/app/views/users/reviews.html.haml
  35. @@ -1,4 +1,4 @@
  36. -- @page_title = "#{@user.display_name}'s guides"
  37. +- @page_title = "#{@user.display_name}'s reviews"
  38. - @wide = true
  39.  
  40. = render :partial => 'nav'
  41. diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
  42. index 47dfcca..ff2db7c 100644
  43. --- a/app/views/users/show.html.haml
  44. +++ b/app/views/users/show.html.haml
  45. @@ -149,3 +149,41 @@
  46. - if @user.reviews_count > 0
  47. - reviews = @user.reviews.find(:all, :limit => 6, :order => 'updated_at desc')
  48. = render :partial => 'reviews/item', :collection => reviews, :locals => {:show_script => true}
  49. +<<<<<<< HEAD
  50. +=======
  51. + - if @user.reviews_count > 5
  52. + %p
  53. + and
  54. + = link_to pluralize(@user.reviews_count-5, 'more reviews'), reviews_user_path(@user)
  55. +
  56. +.side
  57. + - if @user.favorite_scripts_count > 0
  58. + .box
  59. + %h4 Favorite scripts
  60. + %ul
  61. + - @user.favorite_scripts(5).each do |s|
  62. + %li= link_to h(s.name), script_path(s)
  63. + - if @user.favorite_scripts_count > 5
  64. + %p
  65. + and
  66. + = link_to pluralize(@user.favorite_scripts_count-5, 'more script'), favorites_user_path(@user)
  67. +
  68. + - if @user.comments_count > 0
  69. + .box
  70. + %h4 Comments posted
  71. + %p.subtitle
  72. + = pluralize(@comment_count, 'comment')
  73. + (
  74. + = link_to 'view all', comments_user_path(@user)
  75. + )
  76. +
  77. + .box
  78. + %h4 Forums activity
  79. + %p.subtitle
  80. + %span
  81. + = pluralize @user.topics.count, 'topic'
  82. + |
  83. + = pluralize @user.posts_count, 'post'
  84. + |
  85. + = link_to "view posts", user_posts_path(@user)
  86. +>>>>>>> jake/userfixes
Add Comment
Please, Sign In to add comment