From 12fffc37603f56dc667f01ca84c6a212bfbeef08 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 7 Jun 2017 21:30:44 -0500 Subject: [PATCH] modqueue: factor out modqueue posts into partial. --- .../moderator/post/queues/_post.html.erb | 40 ++++++++++++++++++ .../moderator/post/queues/random.html.erb | 40 +----------------- app/views/moderator/post/queues/show.html.erb | 41 +------------------ 3 files changed, 42 insertions(+), 79 deletions(-) create mode 100644 app/views/moderator/post/queues/_post.html.erb diff --git a/app/views/moderator/post/queues/_post.html.erb b/app/views/moderator/post/queues/_post.html.erb new file mode 100644 index 000000000..9e564458a --- /dev/null +++ b/app/views/moderator/post/queues/_post.html.erb @@ -0,0 +1,40 @@ +
> + + +
+
    +
  • +

    + <%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :class => "approve-link" %> + | <%= link_to "Breaks Rules", moderator_post_disapproval_path(:post_id => post.id, :reason => "breaks_rules"), :remote => true, :method => :post, :class => "disapprove-link" %> + | <%= link_to "Poor Quality", moderator_post_disapproval_path(:post_id => post.id, :reason => "poor_quality"), :remote => true, :method => :post, :class => "disapprove-link" %> + | <%= link_to "No Interest", moderator_post_disapproval_path(:post_id => post.id, :reason => "disinterest"), :remote => true, :method => :post, :class => "disapprove-link" %> + | <%= link_to "Detailed Rejection", "#", "data-post-id" => post.id, :class => "detailed-rejection-link" %> +

    +
  • +
  • Rating: <%= post.pretty_rating %>
  • +
  • Score: <%= post.score %>
  • +
  • + Size: + <%= number_to_human_size(post.file_size) %> + <% if post.has_dimensions? %> + (<%= post.image_width %>x<%= post.image_height %>) + <% end %> +
  • +
  • Uploader: <%= link_to_user(post.uploader) %> <%= time_ago_in_words_tagged(post.created_at) %>
  • + <% if post.is_flagged? %> +
  • Flagged: <%= post_flag_reasons(post) %>
  • + <% end %> + <% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %> +
  • Appeals: <%= post_appeal_reasons(post) %>
  • + <% end %> +
  • + Hidden: <%= render "post_disapprovals/compact_counts", :disapprovals => post.disapprovals, :post => post %> +
  • +
  • Source: <%= post.source %>
  • +
  • Tags: <%= post.presenter.inline_tag_list_html(self) %>
  • +
+
+
diff --git a/app/views/moderator/post/queues/random.html.erb b/app/views/moderator/post/queues/random.html.erb index 261dc21ba..d95a164b0 100644 --- a/app/views/moderator/post/queues/random.html.erb +++ b/app/views/moderator/post/queues/random.html.erb @@ -13,45 +13,7 @@ <% @posts.each do |post| %> -
> - - -
-
    -
  • -

    - <%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :class => "approve-link" %> - | <%= link_to "Breaks Rules", moderator_post_disapproval_path(:post_id => post.id, :reason => "breaks_rules"), :remote => true, :method => :post, :class => "disapprove-link" %> - | <%= link_to "Poor Quality", moderator_post_disapproval_path(:post_id => post.id, :reason => "poor_quality"), :remote => true, :method => :post, :class => "disapprove-link" %> - | <%= link_to "No Interest", moderator_post_disapproval_path(:post_id => post.id, :reason => "disinterest"), :remote => true, :method => :post, :class => "disapprove-link" %> - | <%= link_to "Detailed Rejection", "#", "data-post-id" => post.id, :class => "detailed-rejection-link" %> -

    -
  • -
  • Rating: <%= post.pretty_rating %>
  • -
  • Score: <%= post.score %>
  • -
  • - Size: - <%= number_to_human_size(post.file_size) %> - <% if post.has_dimensions? %> - (<%= post.image_width %>x<%= post.image_height %>) - <% end %> -
  • -
  • Uploader: <%= link_to_user(post.uploader) %> <%= time_ago_in_words_tagged(post.created_at) %>
  • - <% if post.is_flagged? %> -
  • Flagged: <%= post_flag_reasons(post) %>
  • - <% end %> - <% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %> -
  • Appeals: <%= post_appeal_reasons(post) %>
  • - <% end %> -
  • - Hidden: <%= render "post_disapprovals/compact_counts", :disapprovals => post.disapprovals, :post => post %> -
  • -
  • Tags: <%= post.tag_string %>
  • -
-
-
+ <%= render "post", post: post %> <% end %> diff --git a/app/views/moderator/post/queues/show.html.erb b/app/views/moderator/post/queues/show.html.erb index d59893763..14a83da03 100644 --- a/app/views/moderator/post/queues/show.html.erb +++ b/app/views/moderator/post/queues/show.html.erb @@ -24,46 +24,7 @@ <% @posts.each do |post| %> -
> - - -
-
    -
  • -

    - <%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :class => "approve-link" %> - | <%= link_to "Breaks Rules", moderator_post_disapproval_path(:post_id => post.id, :reason => "breaks_rules"), :remote => true, :method => :post, :class => "disapprove-link" %> - | <%= link_to "Poor Quality", moderator_post_disapproval_path(:post_id => post.id, :reason => "poor_quality"), :remote => true, :method => :post, :class => "disapprove-link" %> - | <%= link_to "No Interest", moderator_post_disapproval_path(:post_id => post.id, :reason => "disinterest"), :remote => true, :method => :post, :class => "disapprove-link" %> - | <%= link_to "Detailed Rejection", "#", "data-post-id" => post.id, :class => "detailed-rejection-link" %> -

    -
  • -
  • Rating: <%= post.pretty_rating %>
  • -
  • Score: <%= post.score %>
  • -
  • - Size: - <%= number_to_human_size(post.file_size) %> - <% if post.has_dimensions? %> - (<%= post.image_width %>x<%= post.image_height %>) - <% end %> -
  • -
  • Uploader: <%= link_to_user(post.uploader) %> <%= time_ago_in_words_tagged(post.created_at) %>
  • - <% if post.is_flagged? %> -
  • Flagged: <%= post_flag_reasons(post) %>
  • - <% end %> - <% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %> -
  • Appeals: <%= post_appeal_reasons(post) %>
  • - <% end %> -
  • - Hidden: <%= render "post_disapprovals/compact_counts", :disapprovals => post.disapprovals, :post => post %> -
  • -
  • Source: <%= post.source %>
  • -
  • Tags: <%= post.presenter.inline_tag_list_html(self) %>
  • -
-
-
+ <%= render "post", post: post %> <% end %>