estimancy/projestimate

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

Summary

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

  <div id="tabs-1">
    <table border="0" width="100%">
      <tr>
        <td style="text-align:right;">
          <%= link_to I18n.t('new_language'), new_language_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><%= I18n.t(:local) %></th>
        <th class="filter-select"><%= I18n.t(:record_status) %></th>
        <th class="action"><%= I18n.t(:actions) %></th>
      </tr>
      </thead>
      <tbody>
      <% @languages.each do |language| %>
          <tr>
            <td><%= language.name %></td>
            <td><%= language.locale %></td>
            <td><%= language.record_status.name unless language.record_status.nil? %> <%= language.show_custom_value %></td>
            <td class="center">
              <%= link_to '', edit_language_path(language), :class => 'icon-pencil', :title => I18n.t('edit') %>
              <% unless language.is_defined? %>
                <%= link_to '', language, confirm: I18n.t('are_you_sure'), method: :delete, :class => 'icon-trash', :style => 'color:red', :title => I18n.t('delete') %>
              <% end %>
              <% if is_master_instance? && !language.is_local_record? %>
                  <% if language.is_retired? %>
                      <%= link_to('', "languages/#{language.id}/restore_change", confirm: I18n.t('restoring'), :class => 'icon-undo', :style => 'color:orange', :title => I18n.t('restore_title')) %>
                  <% else %>
                      <% unless language.is_defined? %>
                          <%= link_to('', "languages/#{language.id}/validate_change", confirm: I18n.t('validation'), :class => 'icon-ok', :style => 'color:green', :title => I18n.t('validate_title')) %>
                      <% end %>
                  <% end %>
              <% end %>
            </td>
          </tr>
      <% end %>
      </tbody>

      <%= render :partial => 'layouts/footer_table' %>
    </table>

  </div>
</div>