emailer/app/views/admin/emailers/_index.html.erb

67 lines
2.5 KiB
Plaintext
Raw Normal View History

2016-07-25 17:54:08 +00:00
<script>
if(document.querySelectorAll("#orbit-bar").length==0) location.reload();
</script>
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @emails.each do |email| %>
<tr>
2016-07-26 06:32:52 +00:00
<td><%= email.category.title rescue "" %></td>
2016-07-25 17:54:08 +00:00
<td>
<%= email.mail_subject %>
<div class="quick-edit">
<ul class="nav nav-pills">
<li><a href="#" class="detail-row" onclick="$('#<%= "#{email.id.to_s}-detail" %>').slideToggle(300); return false;"><%= t(:detail) %></a></li>
<% if can_edit_or_delete?(email) %>
<li><a href="/admin/emailers/<%=email.id.to_s%>/edit"><%= t(:edit) %></a></li>
<li><a data-confirm="Are you sure?" data-method="delete" href="/admin/emailers/<%= email.id.to_s %>" class="delete text-error" ><%= t(:delete_) %></a></li>
2016-07-26 06:32:52 +00:00
<% if !email.approved && user_can_approve? %>
2016-07-25 17:54:08 +00:00
<li><a href="/admin/emailers/<%=email.id.to_s%>/approve"><%= t("announcement.approve") %></a>
<% end %>
<% end %>
</ul>
</div>
</td>
<td>
<%= email.email_sentdate.strftime("%Y-%m-%d %H:%M") rescue "" %>
</td>
<td>
<%= User.find(email.create_user_id).name rescue "" %>
</td>
<td>
<label class="label label-info"><%= email.status_for_table %></label>
</td>
</tr>
<tr class="footable-row-detail">
2016-07-26 06:32:52 +00:00
<td class="footable-cell-detail" colspan="5">
2016-07-25 17:54:08 +00:00
<div id="<%= "#{email.id.to_s}-detail" %>" class="footable-row-detail-inner" style="display: none;">
<div>
<strong><%= t("emailer.email_to") %></strong> :
<% email.email_members.each do |member| %>
<span class="label"><%= member.name %></span>
<% end %>
<% unless email.other_mailaddress.nil? %>
<% email.other_mailaddress.split(';').each do |mailaddress| %>
<span class="label"><%= mailaddress %></span>
<% end %>
<% end %>
</div>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@emails), class: "pagination pagination-centered"
end
%>