temporary fix
This commit is contained in:
parent
14cd1f95d0
commit
147fe6d566
2 changed files with 6 additions and 5 deletions
|
@ -39,13 +39,13 @@ class NotificationService
|
||||||
|
|
||||||
def self.text_for_notification(notification)
|
def self.text_for_notification(notification)
|
||||||
if notification.notification_code == MAILBOXER_CODE_ACCESS_REQUEST
|
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> <div class="action">Offer a response</div>'
|
'wants permission to map with you on <span class="in-bold">' + map.name + '</span> <div class="action">Offer a response</div>'
|
||||||
elsif notification.notification_code == MAILBOXER_CODE_ACCESS_APPROVED
|
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>'
|
'granted your request to edit map <span class="in-bold">' + map.name + '</span>'
|
||||||
elsif notification.notification_code == MAILBOXER_CODE_INVITE_TO_EDIT
|
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>'
|
'gave you edit access to map <span class="in-bold">' + map.name + '</span>'
|
||||||
elsif notification.notification_code == MAILBOXER_CODE_MESSAGE_FROM_DEVS
|
elsif notification.notification_code == MAILBOXER_CODE_MESSAGE_FROM_DEVS
|
||||||
notification.subject
|
notification.subject
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
<h2 class="title">Notifications</h4>
|
<h2 class="title">Notifications</h4>
|
||||||
</header>
|
</header>
|
||||||
<ul class="notifications">
|
<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) %>
|
<% receipt = @receipts.find_by(notification_id: notification.id) %>
|
||||||
<li class="notification <%= receipt.is_read? ? 'read' : 'unread' %>" id="notification-<%= notification.id %>">
|
<li class="notification <%= receipt.is_read? ? 'read' : 'unread' %>" id="notification-<%= notification.id %>">
|
||||||
<%= link_to notification_path(notification.id) do %>
|
<%= link_to notification_path(notification.id) do %>
|
||||||
|
@ -32,7 +33,7 @@
|
||||||
<div class="clearfloat"></div>
|
<div class="clearfloat"></div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @notifications.count == 0 %>
|
<% if notifications.count == 0 %>
|
||||||
<div class="emptyInbox">
|
<div class="emptyInbox">
|
||||||
You have no notifications. More time for dancing.
|
You have no notifications. More time for dancing.
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue