86 lines
5.0 KiB
Plaintext
86 lines
5.0 KiB
Plaintext
<div id="notification_types_list">
|
|
<table style="margin: 10px auto; border-collapse: collapse;">
|
|
<thead>
|
|
<tr>
|
|
<th rowspan="2" style="font-size: 1.2em; border-bottom: 1px solid #ccc;"><%= t :notification_type, "Notification Type" %></th>
|
|
<th colspan="4" style="text-align: center;"><%= t :send_to_facebook, "Send to Facebook?" %></th>
|
|
</tr>
|
|
<tr>
|
|
<th style="border-bottom: 1px solid #ccc; padding: 2px 10px;"><%= t :right_away, "Right Away" %></th>
|
|
<th style="border-bottom: 1px solid #ccc; padding: 2px 10px;"><%= t :daily, "Daily" %></th>
|
|
<th style="border-bottom: 1px solid #ccc; padding: 2px 10px;"><%= t :weekly, "Weekly" %></th>
|
|
<th style="border-bottom: 1px solid #ccc; padding: 2px 10px;"><%= t :never, "Never" %></th>
|
|
</tr>
|
|
</thead>
|
|
<% @notification_categories.each do |category| %>
|
|
<tr style="text-align: center;">
|
|
<% policy = @policies.find_by_notification_id(category.id) %>
|
|
<td style="padding-right: 50px;"><%= category.category %> <%= t :alerts, "Alerts" %></td>
|
|
<td style="text-align: center;">
|
|
<% if policy && policy.frequency == 'immediately' %>
|
|
<%= image_tag "checked.png" %>
|
|
<% end %>
|
|
</td><td>
|
|
<% if policy && policy.frequency == 'daily' %>
|
|
<%= image_tag "checked.png" %>
|
|
<% end %>
|
|
</td><td>
|
|
<% if policy && policy.frequency == 'weekly' %>
|
|
<%= image_tag "checked.png" %>
|
|
<% end %>
|
|
</td><td>
|
|
<% if !policy || policy.frequency == 'never' %>
|
|
<%= image_tag "checked.png" %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
<div style="text-align: right;">
|
|
<a href="#" class="btn settings_link"><%= t :change_settings, "Change Settings" %></a>
|
|
</div>
|
|
</div>
|
|
<form id="notification_types_form" action="<%= facebook_notification_preferences_url %>" method="post" style="display: none;">
|
|
<div id="notification_types_loading" style="text-align: center; margin: 5px 0; font-size: 1.2em; display: none;">
|
|
<%= t :updating_preferences, "Updating Preferences..." %><br/>
|
|
<%= image_tag "ajax-loader-bar.gif", :alt => t(:loading, "loading...") %>
|
|
</div>
|
|
<table style="margin: 10px auto; border-collapse: collapse;">
|
|
<thead>
|
|
<tr>
|
|
<th rowspan="2" style="font-size: 1.2em; border-bottom: 1px solid #ccc;"><%= t :notification_type, "Notification Type" %></th>
|
|
<th colspan="4" style="text-align: center;"><%= t :send_to_facebook, "Send to Facebook?" %></th>
|
|
</tr>
|
|
<tr>
|
|
<th style="border-bottom: 1px solid #ccc; padding: 2px 10px; text-align: center;"><%= t :right_away, "Right Away" %></th>
|
|
<th style="border-bottom: 1px solid #ccc; padding: 2px 10px; text-align: center;"><%= t :daily, "Daily" %></th>
|
|
<th style="border-bottom: 1px solid #ccc; padding: 2px 10px; text-align: center;"><%= t :weekly, "Weekly" %></th>
|
|
<th style="border-bottom: 1px solid #ccc; padding: 2px 10px; text-align: center;"><%= t :never, "Never" %></th>
|
|
</tr>
|
|
</thead>
|
|
<% @notification_categories.each do |category| %>
|
|
<tr>
|
|
<% policy = @policies.find_by_notification_id(category.id) %>
|
|
<td style="padding-right: 50px;"><%= t 'labels.alerts_for_category', '%{category_name} Alerts', :category_name => category.category %></td>
|
|
<td style="white-space: nowrap; padding: 1px 10px;">
|
|
<input type="radio" <%= 'checked' if policy && policy.frequency == 'immediately' %> name="types[<%= category.category %>]" value="immediately" id="notification_type_<%= category.id %>_immediately"/>
|
|
<label for="notification_type_<%= category.id %>_immediately"><%= t :right_away, "Right Away" %></label>
|
|
</td><td style="white-space: nowrap; padding: 1px 10px;">
|
|
<input type="radio" <%= 'checked' if policy && policy.frequency == 'daily' %> name="types[<%= category.category %>]" value="daily" id="notification_type_<%= category.id %>_daily"/>
|
|
<label for="notification_type_<%= category.id %>_daily"><%= t :daily, "Daily" %></label>
|
|
</td><td style="white-space: nowrap; padding: 1px 10px;">
|
|
<input type="radio" <%= 'checked' if policy && policy.frequency == 'weekly' %> name="types[<%= category.category %>]" value="weekly" id="notification_type_<%= category.id %>_weekly"/>
|
|
<label for="notification_type_<%= category.id %>_weekly"><%= t :weekly, "Weekly" %></label>
|
|
</td><td style="white-space: nowrap; padding: 1px 10px;">
|
|
<input type="radio" <%= 'checked' if !policy || policy.frequency == 'never' %> name="types[<%= category.category %>]" value="never" id="notification_type_<%= category.id %>_never"/>
|
|
<label for="notification_type_<%= category.id %>_never"><%= t :never, "Never" %></label>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
<div style="text-align: right;">
|
|
<button type="submit" class="btn"><%= t :update_preferences, "Update Preferences" %></button>
|
|
<a href="#" class="btn btn button-secondary cancel_button"><%= t :cancel, "Cancel" %></a>
|
|
</div>
|
|
</form>
|