temporary fix

This commit is contained in:
Connor Turland 2017-02-09 15:36:54 +00:00
parent 14cd1f95d0
commit 147fe6d566
2 changed files with 6 additions and 5 deletions

View file

@ -39,13 +39,13 @@ class NotificationService
def self.text_for_notification(notification)
if notification.notification_code == MAILBOXER_CODE_ACCESS_REQUEST
map = notification.notified_object&.map
map = notification.notified_object.map
'wants permission to map with you on <span class="in-bold">' + map.name + '</span>&nbsp;&nbsp;<div class="action">Offer a response</div>'
elsif notification.notification_code == MAILBOXER_CODE_ACCESS_APPROVED
map = notification.notified_object&.map
map = notification.notified_object.map
'granted your request to edit map <span class="in-bold">' + map.name + '</span>'
elsif notification.notification_code == MAILBOXER_CODE_INVITE_TO_EDIT
map = notification.notified_object&.map
map = notification.notified_object.map
'gave you edit access to map <span class="in-bold">' + map.name + '</span>'
elsif notification.notification_code == MAILBOXER_CODE_MESSAGE_FROM_DEVS
notification.subject

View file

@ -7,7 +7,8 @@
<h2 class="title">Notifications</h4>
</header>
<ul class="notifications">
<% @notifications.each do |notification| %>
<% notifications = @notifications.to_a.delete_if{|n| n.notified_object.nil? || n.notified_object.map.nil? }%>
<% notifications.each do |notification| %>
<% receipt = @receipts.find_by(notification_id: notification.id) %>
<li class="notification <%= receipt.is_read? ? 'read' : 'unread' %>" id="notification-<%= notification.id %>">
<%= link_to notification_path(notification.id) do %>
@ -32,7 +33,7 @@
<div class="clearfloat"></div>
</li>
<% end %>
<% if @notifications.count == 0 %>
<% if notifications.count == 0 %>
<div class="emptyInbox">
You have no notifications. More time for dancing.
</div>