From 85a832cb5de58d42616eb83f3d71b3302f3f30ca Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 22 Feb 2013 15:21:53 -0500 Subject: [PATCH] layout tweaks --- app/helpers/application_helper.rb | 4 ++-- app/presenters/user_presenter.rb | 4 ++++ app/views/posts/partials/index/_related.html.erb | 2 +- app/views/users/_secondary_links.html.erb | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f5395acdf..9c8a6c81e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -116,7 +116,7 @@ module ApplicationHelper protected def nav_link_match(controller, url) url =~ case controller - when "sessions", "users", "maintenance/user/login_reminders", "maintenance/user/password_resets", "admin/users" + when "sessions", "users", "maintenance/user/login_reminders", "maintenance/user/password_resets", "admin/users", "tag_subscriptions" /^\/(session|users)/ when "forum_posts" @@ -128,7 +128,7 @@ protected when "notes", "note_versions" /^\/notes/ - when "posts", "uploads", "post_versions", "explore/posts", "moderator/post/dashboards", "favorites", "tag_subscriptions" + when "posts", "uploads", "post_versions", "explore/posts", "moderator/post/dashboards", "favorites" /^\/post/ when "artists", "artist_versions" diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb index a8914e5de..0112937f2 100644 --- a/app/presenters/user_presenter.rb +++ b/app/presenters/user_presenter.rb @@ -42,6 +42,10 @@ class UserPresenter end def upload_limit + if user.is_contributor? + return "none" + end + deleted_count = Post.for_user(user.id).deleted.count pending_count = Post.for_user(user.id).pending.count approved_count = Post.where("is_flagged = false and is_pending = false and is_deleted = false and uploader_id = ?", user.id).count diff --git a/app/views/posts/partials/index/_related.html.erb b/app/views/posts/partials/index/_related.html.erb index 76aeb1d25..22a9a0e96 100644 --- a/app/views/posts/partials/index/_related.html.erb +++ b/app/views/posts/partials/index/_related.html.erb @@ -6,7 +6,7 @@ <% end %> <% if @post_set.is_tag_subscription? %> -
  • <%= link_to "Edit tag subscription", tag_subscriptions_path %>
  • +
  • <%= link_to "Edit subscriptions", tag_subscriptions_path %>
  • <% end %> diff --git a/app/views/users/_secondary_links.html.erb b/app/views/users/_secondary_links.html.erb index 731f4a4bf..62210137c 100644 --- a/app/views/users/_secondary_links.html.erb +++ b/app/views/users/_secondary_links.html.erb @@ -9,6 +9,9 @@
  • |
  • <% if @user.id == CurrentUser.id %>
  • <%= link_to "Settings", edit_user_path(CurrentUser.user) %>
  • + <% if @user.is_privileged? %> +
  • <%= link_to "Edit subscriptions", tag_subscriptions_path %>
  • + <% end %>
  • <%= link_to "Profile", user_path(CurrentUser.user) %>
  • <%= link_to "Messages #{CurrentUser.dmail_count}", dmails_path(:search => {:owner_id => CurrentUser.id, :to_id => CurrentUser.id}) %>
  • <% else %>