fiuba/alfred

View on GitHub
admin/views/courses/index.erb

Summary

Maintainability
Test Coverage
<ul class="nav nav-tabs">
  <li class=active> <%= link_to tag_icon(:list, pat(:list)), url(:courses, :index) %></li>
  <li> <%= link_to tag_icon(:plus, pat(:new)), url(:courses, :new) %></li>
</ul>
<div class=tabs-content>
  <table id=list class="table table-striped table-hover table-condensed">
    <thead>
      <tr>
        <th class="header list-menu">
          <div class=dropdown>
            <a href="#" class="list-menu-toggle dropdown-toggle" data-toggle='dropdown'>
              <%= tag_icon :magic %> <span class=caret></span>
            </a>
            <ul class="list-menu dropdown-menu" role=menu>
              <li class=ist-menu-wrapper>
                <%= link_to tag_icon(:check, pat(:select_all)), '#', :id => 'select-all', :class => 'list-menu-link' %>
              </li>
              <li class=list-menu-wrapper.list-menu-wrapper-disabled>
                <%= link_to tag_icon('check-empty', pat(:deselect_all)), '#', :id => 'deselect-all', :class => 'list-menu-link list-menu-link-disabled' %>
              </li>
              <li class="list-menu-divider divider"></li>
              <li class=list-menu-wrapper.list-menu-wrapper-disabled>
                <%=link_to tag_icon(:trash, pat(:delete_selected)), '#', :id => 'delete-selected', :class => 'list-menu-link list-menu-link-disabled' %>
                <div class='list-menu-popover-delete-selected popover right'>
                  <div class=arrow></div>
                  <h3 class=popover-title><%= pat(:delete_selected_title) %></h3>
                  <div class=popover-content>
                    <% form_tag url(:courses, :destroy_many), :method => :delete do %>
                      <%=hidden_field_tag :course_ids, :'data-delete-many-ids' => true %>
                      <%=submit_tag pat(:delete), :class =>'list-menu-popover-delete-selected-btn btn btn-danger btn-small' %>
                      <div class='btn btn-small cancel'><%= pat(:cancel) %></div>
                    <% end %>
                  </div>
                </div>
              </li>
            </ul>
          </div>
        </th>
                <th class=header> <%= :id %></th>
                <th class=header> <%= :name %></th>
                <th class=header> <%= :active %></th>
                <th class="header list-row-action-header"></th>
    </thead>

    <tbody>
      <% @courses.each do |course| %>
        <tr class=list-row>
          <td class="list-column list-selectable">
            <%= check_box_tag 'course_ids[]', :value => course.id, :class => 'list-selectable-checkbox' %>
           </td>
          <td class=list-column> <%= course.id %> </td>
          <td class=list-column> <%= course.name %> </td>
          <td class=list-column> <%= course.active ? tag_icon(:ok) : tag_icon(:remove) %> </td>
          <td class="list-column list-row-action">
            <div class='list-row-action-wrapper'>
               <%= link_to tag_icon(:edit), :href => url(:courses, :edit, :id => course.id), :rel => :tooltip, :title => "#{pat(:edit)} course", :class => 'list-row-action-wrapper-link' %>
               <%= link_to tag_icon(:trash), :rel => :tooltip, :title => "#{pat(:delete)} course", :class => 'list-row-action-delete-one list-row-action-wrapper-link' %>
               <div class="popover list-row-action-popover-delete-one left">
                 <div class=arrow> </div>
                 <h3 class=popover-title><%= pat(:delete, :model => "course") %></h3>
                 <div class=popover-content>
                   <%- form_tag url(:courses, :destroy, :id => course.id), :method => :delete do %>
                     <%= submit_tag pat(:delete), :class =>'list-row-action-popover-delete-one-btn btn btn-danger btn-small' %>
                     <div class="btn btn-small cancel"><%= pat(:cancel) %></div>
                   <% end %>
               </div>
             </div>
          </td>
      <% end %>
    </tbody>
  </table>
</div>