rails-engine/mails

View on GitHub
app/views/innbox/messages/index.html.erb

Summary

Maintainability
Test Coverage
<ol class="breadcrumb">
  <li><a href="<%= innbox.root_path %>"><%= t('innbox.nav.home') %></a></li>
  <li class="active"><%= t('innbox.nav.pm') %></li>
</ol>

<p><a class="btn btn-primary-outline" href="<%= innbox.new_message_path %>"><i class="fa fa-plus"></i> <%= t('innbox.nav.new_pm') %></a></p>

<div class="pms">
  <table class="table">
    <thead class="thead-default">
      <tr class="pm">
        <th class="sender"><%= t('activerecord.attributes.message.sender')%></th>
        <th class="title"><%= t('activerecord.attributes.message.title')%></th>
        <th class="activity"><%= t('activerecord.attributes.message.created_at')%></th>
      </tr>
    </thad>
    <tbody>
      <% if @items.blank? %>
        <tr>
          <th>
            <span class="text-mutted">
              <%= t('innbox.pms.empty') %>
            </span>
          </td>
        </tr>
      <% else %>
        <% @items.each do |item| %>
          <tr class="pm">
            <td class="sender">
              <%= item.sender.send(Innbox.config.user_name_method) %>
            </td>
            <td class="title">
              <%= link_to(item.title, innbox.message_path(item)) %>
            </td>
            <td class="activity">
              <%= timeago item.created_at %>
            </td>
          </tr>
        <% end %>
      <% end %>
    </tbody>
  </table>

  <%= will_paginate @items %>
</div>