update css classes
This commit is contained in:
parent
11bbcb242f
commit
79a3059ca3
4 changed files with 14 additions and 7 deletions
5
app/assets/stylesheets/notifications.scss
Normal file
5
app/assets/stylesheets/notifications.scss
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
.controller-notifications {
|
||||||
|
ul.notifications {
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 %>
|
||||||
|
|
|
@ -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) %>')
|
||||||
|
|
|
@ -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) %>')
|
||||||
|
|
Loading…
Add table
Reference in a new issue