docbrown/app/views/comments/settings.html.erb
Lisa Sy 36e271e1cb
Deprecate old button stylings with Crayons buttons (#10694) [deploy]
* Deprecate old buttons.scss file

* Replace outdated button styles with Crayons button styling

* Update additional views after removing old button styling

* Update tests

* Update test

* Update test

* Fix button placements
2020-10-14 07:28:41 -07:00

47 lines
2.1 KiB
Text

<% title "Comment Settings" %>
<div class="crayons-layout crayons-layout--limited">
<div class="crayons-card text-padding">
<h1 class="pb-4">
Comment Settings
</h1>
<div class="comments-settings__row">
<% if @notification_subscription.persisted? %>
<div class="grid">
<h4 class="comments-settings__row--title">
Showing thread notifications
</h4>
<p class="comments-settings__row--subtitle">
You will receive all notifications for this comment and any of your comments in this chain.
</p>
</div>
<% else %>
<div class="grid">
<h4 class="comments-settings__row--title">
Muting thread notifications
</h4>
<p class="comments-settings__row--subtitle">
All notifications for this comment and any of your comments in the thread are currently muted.
</p>
</div>
<% end %>
<%= form_for(@notification_subscription, url: "/notification_subscriptions/Comment/#{@comment.id}", method: "post", html: { class: "mute-form" }) do |f| %>
<input type="hidden" name="config" value="<%= @notification_subscription.persisted? ? "not_subscribed" : "all_comments" %>">
<%= f.submit @notification_subscription.persisted? ? "Mute notifications" : "Unmute notifications", class: "crayons-btn #{@notification_subscription.persisted? ? 'mute' : 'unmute'}" %>
<% end %>
</div>
<% if NotificationSubscription.where(user_id: current_user, notifiable_type: "Article", notifiable_id: @comment.commentable_id, config: "all_comments").any? %>
<p>
You are still subscribed to all comments in the broader thread, which will mean you will still receive notifications for replies to this comment.
</p>
<%= form_for(@notification_subscription, url: "/notification_subscriptions/Article/#{@comment.commentable_id}", method: "post", html: { class: "mute-form" }) do |f| %>
<input type="hidden" name="config" value="not_subscribed">
<%= f.submit "Unsubscribe from parent post", class: "crayons-btn crayons-btn--secondary" %>
<% end %>
<% end %>
</div>
</div>