jamesrwhite/minicron

View on GitHub
server/lib/minicron/hub/views/hosts/index.erb

Summary

Maintainability
Test Coverage
<header class="clearfix">
  <h2 class="pull-left">Hosts</h2>
  <a href="<%= "#{route_prefix}/hosts/new" %>" class="pull-right btn btn-success btn-sm">Add New Host</a>
</header>
<hr/>

<% if @hosts.length > 0 %>
  <table class="table table-striped table-hover">
    <thead>
      <tr>
        <th>Name</th>
        <th>Hostname</th>
        <th>Actions</th>
      </tr>
    </thead>

    <tbody>
      <% @hosts.each do |host| %>
        <tr>
          <td><%= host.name %></td>
          <td><%= host.hostname %></td>
          <td>
            <a href="<%= "#{route_prefix}/host/#{host.id}" %>" class="btn btn-info btn-xs">View</a>
            <a href="<%= "#{route_prefix}/host/#{host.id}/edit" %>" class="btn btn-warning btn-xs">Edit</a>
            <a href="<%= "#{route_prefix}/host/#{host.id}/delete" %>" class="btn btn-danger btn-xs">Delete</a>
          </th>
        </tr>
      <% end %>
    </tbody>
  </table>
<% end %>