estimancy/projestimate

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

Summary

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

  <div id="tabs-1">
    <table border="0" width="100%">
      <tr>
        <td style="text-align:right;">
          <%= link_to I18n.t('new_currency'), new_currency_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>Alias</th>
            <th><%= I18n.t(:description) %></th>
            <th><%= I18n.t(:iso_code) %></th>
            <th><%= I18n.t(:currency_sign) %></th>
            <th><%= I18n.t(:conversion_rate) %></th>
            <th class="filter-select"><%= I18n.t(:record_status) %></th>
            <th  class="action"><%= I18n.t(:actions) %></th>
          </tr>
      </thead>

      <tbody>
      <% @currencies.each do |currency| %>
          <tr>
            <td><%= currency.name %></td>
            <td><%= currency.alias %></td>
            <td><%= currency.description %></td>
            <td><%= currency.iso_code %></td>
            <td><%= currency.sign %></td>
            <td><%= currency.conversion_rate %></td>
            <td><%= currency.record_status.name unless currency.record_status.nil? %> <%= currency.show_custom_value %></td>
            <td class="center">
              <%= link_to '', edit_currency_path(currency), :class => 'icon-pencil', :title => I18n.t('edit') %>
              <%= link_to '', currency, confirm: I18n.t('are_you_sure'), method: :delete, :class => 'icon-trash', :style => 'color:red', :title => I18n.t('delete') %>
              <% if is_master_instance? && !currency.is_local_record? %>
                  <% if currency.is_retired? %>
                      <%= link_to('', "currencies/#{currency.id}/restore_change", confirm: I18n.t('restoring'), :class => 'icon-undo', :style => 'color:orange', :title => I18n.t('restore_title')) %>
                  <% else %>
                      <% unless currency.is_defined? %>
                          <%= link_to('', "currencies/#{currency.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>

<script>
    <%= render :partial => 'layouts/sort_date', :handlers => [:erb], :formats => [:js] %>
</script>