docbrown/app/views/articles/discussion_lock_confirm.html.erb
Alex b02d43ca2d
Create DiscussionLocks (#13905)
* Create DiscussionLocks

* Fix specs

* Update nullify_blank_notes_and_reason

* Update before_validation call

* Updated DiscussionLockPolicy for clarity

* Move permitted_attributes to a constant

* Update route

* Apply suggestions from code review for frontend

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Add title tags

* Wrap unlock confirm in main element

* Wrap flash messages up in div

* Actually fix title tags

* Hide comment reply button when discussion is locked

* Add E2E tests

* Try to fix E2E tests

* Cypress...you work locally but not in CI...why!?

* PR feedback

* Update E2E tests

* More E2E updates 😭

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-06-10 11:04:33 -04:00

35 lines
1.8 KiB
Text

<% title("Confirm Discussion Lock") %>
<main id="main-content" class="crayons-layout crayons-layout--limited-l gap-0">
<div class="crayons-card crayons-card--secondary text-styles text-styles--secondary text-padding -mb-1 mx-3 m:mx-6 mt-3">
<%= @article.title %>
</div>
<div class="crayons-card text-padding">
<h1 class="crayons-subtitle-1 mb-2">Are you sure you want to lock the discussion on this post?</h1>
<p class="fs-l mb-4">
Users will not be able to add new comments. This will <em class="fw-bold">not</em> remove
existing comments. You can unlock the discussion at any time to allow users to leave comments
again.
</p>
<%= form_for @discussion_lock, method: :post do |f| %>
<div class="form-group">
<%= f.hidden_field :article_id, value: @article.id %>
<div class="crayons-field mb-5">
<%= f.label :reason, "Reason for locking the discussion (optional) - this will be publicly displayed", class: "crayons-field__label" %>
<%= f.text_field :reason,
placeholder: "The reason why you're locking this discussion.",
required: false,
class: "crayons-textfield" %>
<div class="crayons-field">
<%= f.label :notes, "Notes (optional) - this is only visible to you and admins", class: "crayons-field__label" %>
<%= f.text_field :notes,
placeholder: "More details as to why you locked the discussion.",
required: false,
class: "crayons-textfield" %>
</div>
</div>
<%= f.submit "Lock discussion", class: "crayons-btn crayons-btn--danger" %>
<a data-no-instant href="<%= dashboard_path %>" class="crayons-btn crayons-btn--ghost">Cancel</a>
<% end %>
</div>
</main>