sanger/sequencescape

View on GitHub
app/views/admin/custom_texts/index.html.erb

Summary

Maintainability
Test Coverage

<% add :about, "Custom texts." %>
<% add :menu, "Create custom texts" => url_for(controller: :custom_texts, action: :new) %>
<%= page_title "Custom Text", "List" %>
<div id="custom_texts">
  <table class="sortable table">
    <thead>
      <tr>
        <th>ID</th>
        <th>Identifier</th>
        <th>Differential</th>
        <th>Content type</th>
        <th>Content</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
      </tr>
    </thead>
    <tbody>
      <% @custom_texts.each do |custom_text| %>
        <tr id="<%= custom_text.name %>-details" class="<%= cycle("rowodd", "roweven") %>">
          <td><%= link_to custom_text.id, admin_custom_text_path(custom_text) %></td>
          <td><%= custom_text.identifier %></td>
          <td><%= custom_text.differential %></td>
          <td><%= custom_text.content_type %></td>
          <td><%= custom_text.content %></td>
          <% if can? :manage, CustomText %>
            <td>
            <%= link_to "Edit", edit_admin_custom_text_path(custom_text) %>
            </td>
            <td><%= link_to content_tag(:span,"[Delete]",style:"color:red;"), admin_custom_text_path(custom_text), method: :delete, confirm: "Are you sure?" %></td>
          <% end %>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>