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

View file

@ -1,3 +1,3 @@
$('#notification-<%= @notification.id %> > a') $('#notification-<%= @notification.id %> .notification-read-unread > a')
.text('(read)') .text('(read)')
.attr('href', '<%= mark_unread_notification_path(@notification.id) %>') .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)') .text('(unread)')
.attr('href', '<%= mark_read_notification_path(@notification.id) %>') .attr('href', '<%= mark_read_notification_path(@notification.id) %>')