From fd300ad34662dfba29a975518abc16a997476b8f Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 6 Jan 2012 18:37:08 -0500 Subject: [PATCH] fixes #203 --- app/controllers/post_votes_controller.rb | 2 +- .../comments/partials/index/_header.html.erb | 2 +- .../posts/partials/show/_information.html.erb | 10 +++++----- .../posts/partials/show/_options.html.erb | 20 ++++++++++--------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/controllers/post_votes_controller.rb b/app/controllers/post_votes_controller.rb index 12b64ca4b..ff17d60aa 100644 --- a/app/controllers/post_votes_controller.rb +++ b/app/controllers/post_votes_controller.rb @@ -1,5 +1,5 @@ class PostVotesController < ApplicationController - before_filter :member_only + before_filter :privileged_only def create @post = Post.find(params[:post_id]) diff --git a/app/views/comments/partials/index/_header.html.erb b/app/views/comments/partials/index/_header.html.erb index 9b0811a2c..f099de942 100644 --- a/app/views/comments/partials/index/_header.html.erb +++ b/app/views/comments/partials/index/_header.html.erb @@ -16,7 +16,7 @@ Score <%= post.score %> - <% if CurrentUser.user.is_privileged? %> + <% if CurrentUser.is_privileged? %> (vote <%= link_to("up", post_votes_path(:score => "up", :post_id => post.id), :remote => true, :method => :post) %>/<%= link_to("down", post_votes_path(:score => "down", :post_id => post.id), :remote => true, :method => :post) %>) <% end %> diff --git a/app/views/posts/partials/show/_information.html.erb b/app/views/posts/partials/show/_information.html.erb index 1d0fc73ba..54b4755c0 100644 --- a/app/views/posts/partials/show/_information.html.erb +++ b/app/views/posts/partials/show/_information.html.erb @@ -12,23 +12,23 @@
  • Source: <%= post_source_tag(post) %>
  • Rating: <%= post.pretty_rating %>
  • -
  • Score: <%= post.score %> (vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %>)
  • +
  • Score: <%= post.score %> <% if CurrentUser.is_privileged? %>(vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %>)<% end %>
  • Status: <% if post.is_pending? %> - P + Pending <% end %> <% if post.is_deleted? %> - D + Deleted <% end %> <% if post.is_flagged? %> - F + Flagged <% end %> <% if !post.is_pending? && !post.is_deleted? %> - A + Active <% end %>
  • \ No newline at end of file diff --git a/app/views/posts/partials/show/_options.html.erb b/app/views/posts/partials/show/_options.html.erb index 1c8de2dbd..b14d385f6 100644 --- a/app/views/posts/partials/show/_options.html.erb +++ b/app/views/posts/partials/show/_options.html.erb @@ -8,15 +8,17 @@
  • <%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %>
  • <% end %>
  • <%= link_to "Translate", "#", :id => "translate", :title => "Shortcut is CTRL+N" %>
  • -
  • <%= link_to "Flag", new_post_flag_path(:post_id => post.id), :id => "flag" %>
  • -
  • <%= link_to "Appeal", new_post_appeal_path(:post_id => post.id), :id => "appeal" %>
  • - <% if CurrentUser.is_janitor? && !post.is_status_locked? %> -
  • <%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve" %>
  • -
  • <%= link_to "Disapprove", moderator_post_disapproval_path(:post_id => post.id), :remote => true, :method => :post, :id => "disapprove" %>
  • - <% end %> - <% if CurrentUser.is_moderator? && !post.is_status_locked? %> -
  • <%= link_to "Undelete", undelete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "undelete" %>
  • -
  • <%= link_to "Delete", delete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "delete" %>
  • + <% unless post.is_status_locked? %> +
  • <%= link_to "Flag", new_post_flag_path(:post_id => post.id), :id => "flag" %>
  • +
  • <%= link_to "Appeal", new_post_appeal_path(:post_id => post.id), :id => "appeal" %>
  • + <% if CurrentUser.is_janitor? %> +
  • <%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve" %>
  • +
  • <%= link_to "Disapprove", moderator_post_disapproval_path(:post_id => post.id), :remote => true, :method => :post, :id => "disapprove" %>
  • + <% end %> + <% if CurrentUser.is_moderator? %> +
  • <%= link_to "Undelete", undelete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "undelete" %>
  • +
  • <%= link_to "Delete", delete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "delete" %>
  • + <% end %> <% end %> <% if CurrentUser.is_admin? %>