EvoBal/app/views/emails/_list_row.html.erb

28 lines
1.6 KiB
Plaintext

<tr class="<%= cycle('bg-white', 'bg-gray-50', :name => 'zebra') %>">
<td class="px-6 py-4 whitespace-nowrap"><%= email.date.strftime("%Y-%m-%d %H:%M") %></td>
<td class="px-6 py-4"><%= link_to email.from.join(', '), email, "data-turbo-frame": "_top" %></td>
<td class="px-6 py-4"><%= link_to email.subject, email, "data-turbo-frame": "_top" %></td>
<td class="px-2 py-1 space-y-1 space-x-1">
<% email.organisations.each do |organisation| %>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full email_attribute_organisation"><%= organisation %></span>
<% end if email.organisations %>
<% email.servers.each do |server| %>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full email_attribute_server"><%= server %></span>
<% end if email.servers %>
<% if email.cron? %>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full email_attribute_cron">cron</span>
<% end %>
<% if email.mailing_list? %>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full email_attribute_mailing_list">list</span>
<% end %>
<% if email.junk? %>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full email_attribute_junk">junk</span>
<% end %>
</td>
<td class="px-2 py-1">
<%= link_to 'Show', email, "data-turbo-frame": "_top", class: "flex" %>
<%= link_to 'Edit', edit_email_path(email), "data-turbo-frame": "_top", class: "flex" %>
<%= link_to 'Destroy', email, method: :delete, data: { confirm: 'Are you sure?' }, "data-turbo-frame": "_top", class: "flex" %>
</td>
</tr>