docbrown/app/views/moderations/index.html.erb
Arit Amana 1679fbf47d
Allow Moderator Role to Unpublish Single Post (#17795)
* relocate btn; build functionality for admin only

* remove commented code

* add explanatory comment

* refactor

* build unpublish and feature-post policies

* mod role in policies fails specs 😓

* fix failing specs

* add end-to-end tests

* fix hardcoded name in modal  😓
2022-06-03 12:48:20 -04:00

47 lines
2.2 KiB
Text

<% title t("views.moderations.heading") %>
<%= javascript_packs_with_chunks_tag "modCenter", defer: true %>
<div id="moderation-page" aria-hidden="true"></div>
<% if current_user&.trusted? %>
<div class="crayons-layout crayons-layout--2-cols" id="mod-center">
<%= render "moderations/mod_sidebar_left" %>
<main class="mod-index-container articles-list crayons-layout__content">
<header class="mod-index-header hidden m:block">
<h2 class="crayons-subtitle-1">
<%= @tag ? "##{@tag.accessible_name}" : t("views.moderations.all") %>
</h2>
</header>
<section class="mod-index-body">
<div class="mod-index-list-header lh-tight hidden m:grid">
<h2 class="mod-index-list-header__label"><%= t("views.moderations.post") %></h2>
<h2 class="mod-index-list-header__label"><%= t("views.moderations.author") %></h2>
<h2 class="mod-index-list-header__label align-center"><%= t("views.moderations.date") %></h2>
</div>
<div class="mod-index-list" id="mod-index-list" data-articles="<%= @articles %>">
</div>
</section>
</div>
<div data-testid="flag-user-modal-container" class="flag-user-modal-container hidden"></div>
<div data-testid="unpublish-post-modal-container" class="unpublish-post-modal-container hidden"></div>
</main>
<% else %>
<div class="container" style="margin-top: 90px;">
<h1 class="pt-5" style="text-align: center"><%= t("views.moderations.notice.subtitle", community: community_name) %></h1>
<div class="body">
<p><%= t("views.moderations.notice.desc1_html", community: community_name) %></p>
<p>
<%= t("views.moderations.notice.desc2_html", code: link_to(t("views.moderations.notice.code_of_conduct"), code_of_conduct_path), trusted: link_to(t("views.moderations.notice.trusted"), community_moderation_path),
tag: link_to(t("views.moderations.notice.tag"), tag_moderation_path)) %>
</p>
<p><%= t("views.moderations.notice.desc3_html", email: mail_to(contact_link, contact_link)) %></p>
<% unless user_signed_in? %>
<p><em><%= t("views.moderations.notice.desc4") %></em></p>
<% end %>
</div>
</div>
<% end %>