estimancy/projestimate

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

Summary

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

  <div id="tabs-1">
    <table border="0" width="100%">
      <tr>
        <td style="text-align:right;">
          <%= link_to I18n.t('new_technology'), new_technology_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(:description) %></th>
        <th class="filter-select"><%= I18n.t(:record_status) %></th>
        <th class="action"><%= I18n.t(:actions) %></th>
      </tr>
      </thead>
      <tbody>
      <% @technologies.each do |technology| %>
        <tr>
          <td><%= technology.name %></td>
          <td><%= technology.description %></td>
          <td><%= technology.record_status.name unless technology.record_status.nil? %> <%= technology.show_custom_value %></td>
          <td class="center">
            <%= link_to '', edit_technology_path(technology), :class => 'icon-pencil', :title => I18n.t('edit') %>
            <%= link_to '', technology, confirm: I18n.t('are_you_sure'), method: :delete, :class => 'icon-trash', :style => 'color:red', :title => I18n.t('delete') %>

            <%# unless technology.is_defined? %>
              <%#= link_to '', technology, confirm: I18n.t('are_you_sure'), method: :delete, :class => 'icon-remove', :style => 'color:red', :title => I18n.t('delete') %>
            <%# end %>
            <% if is_master_instance? && !technology.is_local_record? %>
              <% if technology.is_retired? %>
                <%= link_to('', "technologies/#{technology.id}/restore_change", confirm: I18n.t('restoring'), :class => 'icon-undo', :style => 'color:orange', :title => I18n.t('restore_title')) %>
              <% else %>
                <% unless technology.is_defined? %>
                  <%= link_to('', "technologies/#{technology.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>