docbrown/app/views/moderations/index.html.erb
Arit Amana a78ccf2310
[deploy] [ModCenter] Fix "FlagUser" Modal functionality (#8995)
* Make FlagUserModal show up on click

* Explain extra div

* Make sure "Vomit All" reaction fires accurately

* Make test-file comment clearer

* Fix bug when 2 articles are open and the FlagUser modal does not open for the first article

* Still working it out ...

* Tests broken; need help

* Get rid of debugging alerts

* Fixed broken tests for <SingleArticle />

* Write tests for ModerationArticles component

* Complete tests for ModerationArticles component

* Employ safer Preact testing techniques

* Query all articles using "data-testid"

* Revert changes

* Got it working with portals for non-iframe implementation.

* wip tests

* Got mod tools flag user modal wprking on article page again.

* Added some documentation the code.

* Now confirm is disabled until you select an item in the flag user modal.

* Revert "wip tests"

This reverts commit fb7a0825039fd377cad04d9dedad9d1146b03978.

* test prep

* Fixed broken test.

* Refactored to use useRef hook.

* Rename a variable

* remove unnecessary comments

Co-authored-by: Nick Taylor <nick@dev.to>
2020-07-15 13:54:52 -04:00

37 lines
1.4 KiB
Text

<% title "Mod Center" %>
<%= javascript_packs_with_chunks_tag "modCenter", defer: true %>
<div id="moderation-page"></div>
<% if current_user&.trusted %>
<div class="crayons-layout crayons-layout--2-cols" id="mod-center">
<%= render "moderations/mod_sidebar_left" %>
<div class="mod-index-container articles-list crayons-layout__content">
<header class="mod-index-header">
<h2 class="tag-view fs-3xl fw-bold lh-base">
<%= @tag ? "##{@tag.name}" : "All topics" %>
</h2>
</header>
<header class="mod-index-list-header lh-tight">
<h2 class="fs-xs fw-medium">Post</h2>
<h2 class="fs-xs fw-medium">Author</h2>
<h2 class="fs-xs fw-medium">Date</h2>
</header>
<main class="mod-index-list" id="mod-index-list" data-articles="<%= @articles %>">
</main>
</div>
<div data-testid="flag-user-modal-container" class="flag-user-modal-container hidden"></div>
</div>
<% else %>
<div class="container" style="margin-top: 90px;">
<h1 style="text-align: center"><%= community_name %> Mods</h1>
<div class="body">
<p>We periodically award some <%= community_name %> members with heightened privileges to help moderate the community.</p>
<p>Email <%= email_link %> if you'd like to be considered right away.</p>
<% unless user_signed_in? %>
<p><em>P.S. You are not currently signed in.</em></p>
<% end %>
</div>
</div>
<% end %>