docbrown/app/views/comments/settings.html.erb
ludwiczakpawel 70706d0a62
Comments UI update (#11283)
* tooltips 1.0.1

* tooltips 1.0.1

* init

* .

* drop not needed files

* .

* init

* init

* .

* comments

* border

* missing bits

* build comment JS

* .

* .

* specs

* sloan avatar fix

* bunch of fixes

* specs and fixes

* specs

* .

* swap order of links

* contrast

* js for dropdown

* icons

* op-author

* three dots icon

* reverts

* test: capybara- make sure that we click the dropdown before clicking on edit

* permalink --> link

* tiny fixes

* aria-label on form

* proper alt on user's avatar

* aria has popup

* use UL > LI instead of DIV

* add aria-labels to dropdown items

* another aria-label

* better links: nav

* contrast

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-11-18 18:21:19 -05:00

36 lines
2.1 KiB
Text

<% title "Comment Settings" %>
<div class="crayons-layout crayons-layout--limited-m gap-0">
<div class="crayons-card text-padding">
<h1 class="crayons-title mb-4">Comment Settings</h1>
<div class="flex">
<div class="pr-4 m:pr-8 flex-1">
<% if @notification_subscription.persisted? %>
<p class="fw-bold">Showing thread notifications</p>
<p class="fs-s color-base-60">You will receive all notifications for this comment and any of your comments in this chain.</p>
<% else %>
<p class="fw-bold">Muting thread notifications</p>
<p class="fs-s color-base-60">All notifications for this comment and any of your comments in the thread are currently muted.</p>
<% end %>
</div>
<%= form_for(@notification_subscription, url: "/notification_subscriptions/Comment/#{@comment.id}", method: "post", html: { class: "mute-form shrink-0" }) 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 crayons-btn--secondary #{@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? %>
<div class="flex pt-6">
<div class="pr-4 m:pr-8 flex-1">
<p class="fw-bold">Subscription</p>
<p class="fs-s color-base-60">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>
</div>
<%= 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 %>
</div>
<% end %>
</div>
</div>