update css classes

This commit is contained in:
Devin Howard 2016-11-24 15:36:48 -05:00
parent 11bbcb242f
commit 79a3059ca3
4 changed files with 14 additions and 7 deletions

View file

@ -0,0 +1,5 @@
.controller-notifications {
ul.notifications {
list-style: none;
}
}

View file

@ -4,15 +4,17 @@
<div id="yield">
<div class="centerContent">
<h4>Notifications</h4>
<ul>
<ul class="notifications">
<% @notifications.each do |notification| %>
<% receipt = @receipts.find_by(notification_id: notification.id) %>
<li>
<strong>
<li class="notification" id="notification-<%= notification.id %>">
<strong class="notification-subject">
<%= link_to notification.subject, notification_path(notification.id) %>
</strong>
<%= notification.body.truncate(140) %>
<span id="notification-<%= notification.id %>" class="read-unread">
<span class="notification-body">
<%= notification.body.truncate(140) %>
</span>
<span class="notification-read-unread">
<% if receipt.is_read? %>
<%= link_to '(read)', mark_unread_notification_path(notification.id), remote: true, method: :put %>
<% else %>

View file

@ -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) %>')

View file

@ -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) %>')