fix invited to edit mailer's notified_object, and fix css/view for notifications#show
This commit is contained in:
parent
f010bbe6c9
commit
9865a1e063
4 changed files with 19 additions and 10 deletions
|
@ -30,7 +30,7 @@ $unread_notifications_dot_size: 8px;
|
||||||
margin-top: 1em + $menu_bar_height;
|
margin-top: 1em + $menu_bar_height;
|
||||||
font-family: 'din-regular', Sans-Serif;
|
font-family: 'din-regular', Sans-Serif;
|
||||||
|
|
||||||
& > .title {
|
& > .notification-title {
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
padding-bottom: 0.25em;
|
padding-bottom: 0.25em;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
|
@ -42,7 +42,7 @@ $unread_notifications_dot_size: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.notification {
|
.notificationsPage .notification {
|
||||||
.notification-subject {
|
.notification-subject {
|
||||||
width: 25%;
|
width: 25%;
|
||||||
}
|
}
|
||||||
|
@ -68,4 +68,10 @@ $unread_notifications_dot_size: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notificationPage .notification-body {
|
||||||
|
p, div {
|
||||||
|
margin: 1em auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,9 +36,8 @@ class AccessController < ApplicationController
|
||||||
@map.add_new_collaborators(user_ids).each do |user_id|
|
@map.add_new_collaborators(user_ids).each do |user_id|
|
||||||
# add_new_collaborators returns array of added users,
|
# add_new_collaborators returns array of added users,
|
||||||
# who we then send an email to
|
# who we then send an email to
|
||||||
user = User.find(user_id)
|
|
||||||
mail = MapMailer.invite_to_edit_email(@map, current_user, User.find(user_id))
|
mail = MapMailer.invite_to_edit_email(@map, current_user, User.find(user_id))
|
||||||
user.notify(mail.subject, 'invite to edit', @map, true, MAILBOXER_CODE_INVITED_TO_EDIT)
|
user.notify(mail.subject, 'invite to edit', UserMap.find_by(user_id: user_id, map: @map), true, MAILBOXER_CODE_INVITED_TO_EDIT)
|
||||||
end
|
end
|
||||||
@map.remove_old_collaborators(user_ids)
|
@map.remove_old_collaborators(user_ids)
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@ class ApplicationMailer < ActionMailer::Base
|
||||||
request = notification.notified_object
|
request = notification.notified_object
|
||||||
MapMailer.access_request_email(request, request.map)
|
MapMailer.access_request_email(request, request.map)
|
||||||
elsif notification.notification_code == MAILBOXER_CODE_INVITED_TO_EDIT
|
elsif notification.notification_code == MAILBOXER_CODE_INVITED_TO_EDIT
|
||||||
map = notification.notified_object
|
user_map = notification.notified_object
|
||||||
MapMailer.invite_to_edit_email(map, map.user, 'TODO invited user')
|
MapMailer.invite_to_edit_email(user_map.map, user_map.map.user, user_map.user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,12 +3,16 @@
|
||||||
|
|
||||||
<div id="yield">
|
<div id="yield">
|
||||||
<div class="centerContent notificationPage">
|
<div class="centerContent notificationPage">
|
||||||
<h2 class="title"><%= @notification.subject %></h4>
|
<h2 class="notification-title"><%= @notification.subject %></h4>
|
||||||
<%= raw @notification.body %>
|
<div class="notification-body">
|
||||||
<div class="back">
|
<%= raw @notification.body %>
|
||||||
<%= link_to 'Back', notifications_path %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="centerContent back">
|
||||||
|
<%= link_to 'Back', notifications_path %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= render partial: 'shared/back_to_mapping' %>
|
<%= render partial: 'shared/back_to_mapping' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue