2016-11-01 03:18:27 +00:00
|
|
|
<% content_for :title, 'Notifications | Metamaps' %>
|
|
|
|
<% content_for :mobile_title, 'Notifications' %>
|
|
|
|
|
|
|
|
<div id="yield">
|
2016-12-15 22:34:42 +00:00
|
|
|
<div class="centerContent withPadding back">
|
|
|
|
<%= link_to 'Back to notifications', notifications_path %>
|
|
|
|
</div>
|
2016-11-01 03:18:27 +00:00
|
|
|
<div class="centerContent notificationPage">
|
2017-02-11 14:06:01 +00:00
|
|
|
<h2 class="notification-title">
|
|
|
|
<% case @notification.notification_code
|
|
|
|
when MAP_ACCESS_REQUEST
|
2017-10-13 17:58:21 +00:00
|
|
|
request = @notification.notified_object
|
2017-02-11 14:06:01 +00:00
|
|
|
map = request.map %>
|
|
|
|
<%= image_tag @notification.sender.image(:thirtytwo), class: 'thirty-two-avatar' %> <span style='font-weight:bold;' class='requesterName'><%= request.user.name %></span> wants to collaborate on map <span style='font-weight:bold;'><%= map.name %></span>
|
|
|
|
<% else %>
|
|
|
|
<%= @notification.subject %>
|
|
|
|
<% end %>
|
|
|
|
</h2>
|
|
|
|
<% case @notification.notification_code
|
|
|
|
when MAP_ACCESS_REQUEST %>
|
|
|
|
<div class="notification-body">
|
|
|
|
<p class="main-text">
|
|
|
|
<% if false && request.answered %>
|
|
|
|
<% if request.approved %>
|
|
|
|
You already responded to this access request, and allowed access.
|
|
|
|
<% elsif !request.approved %>
|
2017-10-13 17:58:21 +00:00
|
|
|
You already responded to this access request, and declined access. If you changed your mind, you can still grant
|
2017-02-11 14:06:01 +00:00
|
|
|
them access by going to the map and adding them as a collaborator.
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<%= image_tag asset_path('ellipsis.gif'), class: 'hidden' %>
|
|
|
|
<%= link_to 'Allow', approve_access_post_map_path(id: map.id, request_id: request.id), remote: true, method: :post, class: 'button allow' %>
|
|
|
|
<%= link_to 'Decline', deny_access_post_map_path(id: map.id, request_id: request.id), remote: true, method: :post, class: 'button decline' %>
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('.notification-body .button').click(function() {
|
|
|
|
$(this).html('<img src="<%= asset_path('ellipsis.gif') %>" />')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
<%= link_to 'Go to map', map_url(map) %>
|
|
|
|
<%= link_to 'View mapper profile', explore_path(id: request.user.id) %>
|
|
|
|
</div>
|
|
|
|
<% else %>
|
|
|
|
<div class="notification-body">
|
|
|
|
<%= raw @notification.body %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-11-01 03:18:27 +00:00
|
|
|
</div>
|
|
|
|
</div>
|