clarify post deletion/flag logic

This commit is contained in:
albert
2013-02-19 22:03:01 -05:00
parent 5202ee42f6
commit c5731298fb
12 changed files with 26 additions and 18 deletions

View File

@@ -4,7 +4,7 @@ module PostAppealsHelper
html << '<ul>'
post.appeals.each do |appeal|
html << '<li>' + appeal.reason + ' - ' + link_to(appeal.creator.name, user_path(appeal.creator)) + ' ' + time_ago_in_words_tagged(appeal.created_at) + ' ago</li>'
html << '<li>' + appeal.reason + ' - ' + link_to(appeal.creator.name, user_path(appeal.creator)) + ' ' + time_ago_in_words_tagged(appeal.created_at) + '</li>'
end
html << '</ul>'

View File

@@ -10,7 +10,7 @@ module PostFlagsHelper
html << ' - ' + link_to(flag.creator.name, user_path(flag.creator))
end
html << ' ' + time_ago_in_words_tagged(flag.created_at) + ' ago</li>'
html << ' ' + time_ago_in_words_tagged(flag.created_at) + '</li>'
end
html << '</ul>'

View File

@@ -21,7 +21,7 @@
<td><%= link_to h(artist_version.name), artist_versions_path(:artist_id => artist_version.artist_id) %></td>
<td><%= h artist_version.other_names %></td>
<td><%= h artist_version.group_name %></td>
<td><%= time_ago_in_words_tagged artist_version.created_at %> ago</td>
<td><%= time_ago_in_words_tagged artist_version.created_at %></td>
<td><%= link_to artist_version.updater_name, user_path(artist_version.updater_id) %></td>
<td><%= artist_version.is_active? %></td>
<td><%= artist_version.url_string %></td>

View File

@@ -15,7 +15,7 @@
<td><%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %></td>
<td><%= link_to truncate(forum_post.body, :length => 50), forum_post_path(forum_post) %></td>
<td><%= forum_post.creator.name %></td>
<td><%= time_ago_in_words_tagged forum_post.created_at %> ago</td>
<td><%= time_ago_in_words_tagged forum_post.created_at %></td>
</tr>
<% end %>
</tbody>

View File

@@ -12,7 +12,7 @@
<tr class="user-record-score-<%= record.category %>">
<td><%= link_to(record.user.name, user_path(record.user)) %></td>
<td><%= format_text(record.body) %></td>
<td><%= time_ago_in_words_tagged(record.created_at) %> ago</td>
<td><%= time_ago_in_words_tagged(record.created_at) %></td>
</tr>
<% end %>
</tbody>

View File

@@ -42,7 +42,7 @@
(<%= post.image_width %>x<%= post.image_height %>)
<% end %>
</li>
<li><strong>Uploader</strong>: <%= link_to(post.uploader.name, user_path(post.uploader_id)) %> <%= time_ago_in_words_tagged(post.created_at) %> ago</li>
<li><strong>Uploader</strong>: <%= link_to(post.uploader.name, user_path(post.uploader_id)) %> <%= time_ago_in_words_tagged(post.created_at) %></li>
<% if post.is_flagged? %>
<li><strong>Flagged</strong>: <%= post_flag_reasons(post) %></li>
<% end %>

View File

@@ -17,7 +17,7 @@
<tr>
<td><%= link_to note.post_id, post_path(note.post_id) %></td>
<td><%= link_to note.creator.name, user_path(note.creator_id) %></td>
<td><%= time_ago_in_words_tagged(note.created_at) %> ago</td>
<td><%= time_ago_in_words_tagged(note.created_at) %></td>
<td><%= note.is_active? %></td>
<td><%= format_text(note.body) %></td>
</tr>

View File

@@ -1,6 +1,6 @@
<ul>
<li>Uploader: <%= link_to_unless(post.uploader.nil?, post.uploader_name, user_path(post.uploader)) %></li>
<li>Date: <time datetime="<%= post.created_at.iso8601 %>" title="<%= post.created_at.to_date %>"><%= raw time_ago_in_words_tagged(post.created_at).gsub(/about/, "") %> ago</time></li>
<li>Date: <time datetime="<%= post.created_at.iso8601 %>" title="<%= post.created_at.to_date %>"><%= raw time_ago_in_words_tagged(post.created_at).gsub(/about/, "") %></time></li>
<% if post.approver %>
<li>Approver: <%= link_to(post.approver.name, user_path(post.approver_id)) %></li>
<% end %>

View File

@@ -1,12 +1,20 @@
<% if post.is_deleted? %>
<div class="ui-corner-all ui-state-error notice">
This post has been deleted
<% if post.is_flagged? && !post.is_deleted? && post.flags.any? %>
<div class="ui-corner-all ui-state-highlight notice">
<p>This post was flagged for deletion: </p>
<%= post_flag_reasons(post) %>
</div>
<% end %>
<% if (post.is_flagged? || post.is_deleted?) && post.flags.any? %>
<% if post.is_deleted? && post.flags.empty? %>
<div class="ui-corner-all ui-state-error notice">
This post was deleted
</div>
<% end %>
<% if post.is_deleted? && post.flags.any? %>
<div class="ui-corner-all ui-state-highlight notice">
<p>This post has been flagged for deletion: </p>
<p>This post was deleted for the following reasons: </p>
<%= post_flag_reasons(post) %>
</div>
@@ -19,7 +27,7 @@
<% if CurrentUser.is_janitor? && !post.disapproved_by?(CurrentUser.user) %>
<div class="quick-mod">
<% unless post.is_status_locked? %>
<%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :method => :post, :remote => true, :class => "btn" %>
<%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :method => :post, :remote => true, :class => "btn" %> |
<% end %>
<%= link_to "Hide from queue", moderator_post_disapproval_path(:post_id => post.id), :method => :post, :remote => true, :class => "btn" %>
</div>
@@ -29,7 +37,7 @@
<% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %>
<div class="ui-corner-all ui-state-highlight notice">
<p>This post has been appealed:</p>
<p>This post was appealed:</p>
<%= post_appeal_reasons(post) %>
</div>
<% end %>

View File

@@ -18,7 +18,7 @@
<td><%= feedback.category %></td>
<td><%= link_to feedback.user_name, user_path(feedback.user_id) %></td>
<td><%= link_to feedback.creator_name, user_path(feedback.creator_id) %></td>
<td><%= time_ago_in_words_tagged(feedback.created_at) %> ago</td>
<td><%= time_ago_in_words_tagged(feedback.created_at) %></td>
<td><%= format_text(feedback.body) %></td>
</tr>
<% end %>

View File

@@ -46,7 +46,7 @@
<% end %>
<td><%= link_to user.note_versions.count, note_versions_path(:search => {:updater_id => user.id}) %></td>
<td><%= user.level_string %></td>
<td><span title="<%= user.created_at %>"><%= time_ago_in_words_tagged user.created_at %> ago</span></td>
<td><span title="<%= user.created_at %>"><%= time_ago_in_words_tagged user.created_at %></span></td>
</tr>
<% end %>
</tbody>

View File

@@ -3,7 +3,7 @@
<%= render "wiki_pages/sidebar" %>
<section id="content">
<h1 id="wiki-page-title"><%= @wiki_page_version.pretty_title %> <span class="version">(<%= time_ago_in_words_tagged(@wiki_page_version.updated_at) %> ago)</span></h1>
<h1 id="wiki-page-title"><%= @wiki_page_version.pretty_title %> <span class="version">(<%= time_ago_in_words_tagged(@wiki_page_version.updated_at) %>)</span></h1>
<div id="wiki-page-body" class="dtext">
<%= format_text(@wiki_page_version.body) %>