From 79a3059ca3a09251af254622a2cd645034db8fed Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Thu, 24 Nov 2016 15:36:48 -0500 Subject: [PATCH] update css classes --- app/assets/stylesheets/notifications.scss | 5 +++++ app/views/notifications/index.html.erb | 12 +++++++----- app/views/notifications/mark_read.js.erb | 2 +- app/views/notifications/mark_unread.js.erb | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 app/assets/stylesheets/notifications.scss diff --git a/app/assets/stylesheets/notifications.scss b/app/assets/stylesheets/notifications.scss new file mode 100644 index 00000000..74b5db42 --- /dev/null +++ b/app/assets/stylesheets/notifications.scss @@ -0,0 +1,5 @@ +.controller-notifications { + ul.notifications { + list-style: none; + } +} diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb index a1f5f832..65cb52b2 100644 --- a/app/views/notifications/index.html.erb +++ b/app/views/notifications/index.html.erb @@ -4,15 +4,17 @@

Notifications

-
    +
      <% @notifications.each do |notification| %> <% receipt = @receipts.find_by(notification_id: notification.id) %> -
    • - +
    • + <%= link_to notification.subject, notification_path(notification.id) %> - <%= notification.body.truncate(140) %> - + + <%= notification.body.truncate(140) %> + + <% if receipt.is_read? %> <%= link_to '(read)', mark_unread_notification_path(notification.id), remote: true, method: :put %> <% else %> diff --git a/app/views/notifications/mark_read.js.erb b/app/views/notifications/mark_read.js.erb index 63b2965e..2083516e 100644 --- a/app/views/notifications/mark_read.js.erb +++ b/app/views/notifications/mark_read.js.erb @@ -1,3 +1,3 @@ -$('#notification-<%= @notification.id %> > a') +$('#notification-<%= @notification.id %> .notification-read-unread > a') .text('(read)') .attr('href', '<%= mark_unread_notification_path(@notification.id) %>') diff --git a/app/views/notifications/mark_unread.js.erb b/app/views/notifications/mark_unread.js.erb index 12fa138b..ca8267b9 100644 --- a/app/views/notifications/mark_unread.js.erb +++ b/app/views/notifications/mark_unread.js.erb @@ -1,3 +1,3 @@ -$('#notification-<%= @notification.id %> > a') +$('#notification-<%= @notification.id %> .notification-read-unread > a') .text('(unread)') .attr('href', '<%= mark_read_notification_path(@notification.id) %>')