estimancy/projestimate

View on GitHub
app/views/auth_methods/index.html.erb

Summary

Maintainability
Test Coverage
<div class="tabs">
  <ul>
    <li><a href="#tabs-1"><%= I18n.t(:auth_methods) %></a></li>
  </ul>

  <div id="tabs-1">
    <table border="0" width="100%">
      <tr>
        <td style="text-align:right;">
          <%= link_to I18n.t('new_auth_method'), new_auth_method_path, :class => 'btn' %>
        </td>
      </tr>
    </table>
    <table id="table_list_1" class="table tablesorterPager table-striped table-bordered table-condensed">
      <thead>
      <tr>
        <th><%= I18n.t(:name) %></th>
        <th class="filter-select"><%= I18n.t(:record_status) %></th>
        <th class="action"><%= I18n.t(:actions) %></th>
      </tr>
      </thead>

      <tbody>
      <% @auth_methods.each do |auth_method| %>
          <tr>
            <td><%= auth_method.name %></td>
            <td><%= auth_method.record_status.name unless auth_method.record_status.nil? %> <%= auth_method.show_custom_value %></td>
            <td class="center">
              <%= link_to '', edit_auth_method_path(auth_method), :class => 'icon-pencil', :title => I18n.t('edit') %>
              <%= link_to '', auth_method, confirm: I18n.t('are_you_sure'), method: :delete, :class => 'icon-trash', :style => 'color:red', :title => I18n.t('delete') %>
              <% if is_master_instance? && !auth_method.is_local_record? %>
                  <% if auth_method.is_retired? %>
                      <%= link_to('', "auth_methods/#{auth_method.id}/restore_change", confirm: I18n.t('restoring'), :class => 'icon-undo', :style => 'color:orange', :title => I18n.t('restore_title')) %>
                  <% else %>
                      <% unless auth_method.is_defined? %>
                          <%= link_to('', "auth_methods/#{auth_method.id}/validate_change", confirm: I18n.t('validation'), :class => 'icon-ok', :style => 'color:green', :title => I18n.t('validate_title')) %>
                      <% end %>
                  <% end %>
              <% end %>
            </td>
          </tr>
      <% end %>
      <%= render :partial => 'layouts/footer_table' %>
      </tbody>
    </table>
  </div>
</div>