This commit is contained in:
albert
2012-01-06 18:37:08 -05:00
parent 720ebdc877
commit fd300ad346
4 changed files with 18 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
class PostVotesController < ApplicationController
before_filter :member_only
before_filter :privileged_only
def create
@post = Post.find(params[:post_id])

View File

@@ -16,7 +16,7 @@
<strong>Score</strong>
<span>
<span id="score-for-post-<%= post.id %>"><%= post.score %></span>
<% 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 %>
</span>

View File

@@ -12,23 +12,23 @@
</li>
<li>Source: <%= post_source_tag(post) %></li>
<li>Rating: <%= post.pretty_rating %></li>
<li>Score: <span id="score-for-post-<%= post.id %>"><%= post.score %></span> (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 %>)</li>
<li>Score: <span id="score-for-post-<%= post.id %>"><%= post.score %></span> <% 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 %></li>
<li>
Status:
<% if post.is_pending? %>
<abbr title="Pending">P</abbr>
Pending
<% end %>
<% if post.is_deleted? %>
<abbr title="Deleted">D</abbr>
Deleted
<% end %>
<% if post.is_flagged? %>
<abbr title="Flagged">F</abbr>
Flagged
<% end %>
<% if !post.is_pending? && !post.is_deleted? %>
<abbr title="Active">A</abbr>
Active
<% end %>
</li>
</ul>

View File

@@ -8,15 +8,17 @@
<li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %></li>
<% end %>
<li><%= link_to "Translate", "#", :id => "translate", :title => "Shortcut is CTRL+N" %></li>
<li><%= link_to "Flag", new_post_flag_path(:post_id => post.id), :id => "flag" %></li>
<li><%= link_to "Appeal", new_post_appeal_path(:post_id => post.id), :id => "appeal" %></li>
<% if CurrentUser.is_janitor? && !post.is_status_locked? %>
<li><%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve" %></li>
<li><%= link_to "Disapprove", moderator_post_disapproval_path(:post_id => post.id), :remote => true, :method => :post, :id => "disapprove" %></li>
<% end %>
<% if CurrentUser.is_moderator? && !post.is_status_locked? %>
<li><%= link_to "Undelete", undelete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "undelete" %></li>
<li><%= link_to "Delete", delete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "delete" %></li>
<% unless post.is_status_locked? %>
<li><%= link_to "Flag", new_post_flag_path(:post_id => post.id), :id => "flag" %></li>
<li><%= link_to "Appeal", new_post_appeal_path(:post_id => post.id), :id => "appeal" %></li>
<% if CurrentUser.is_janitor? %>
<li><%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve" %></li>
<li><%= link_to "Disapprove", moderator_post_disapproval_path(:post_id => post.id), :remote => true, :method => :post, :id => "disapprove" %></li>
<% end %>
<% if CurrentUser.is_moderator? %>
<li><%= link_to "Undelete", undelete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "undelete" %></li>
<li><%= link_to "Delete", delete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "delete" %></li>
<% end %>
<% end %>
<% if CurrentUser.is_admin? %>