estimancy/projestimate

View on GitHub
app/views/organizations/_profiles.html.erb

Summary

Maintainability
Test Coverage

<%= hidden_field_tag "organization_id", params[:id] %>

<% if can? :manage, OrganizationProfile %>
    <table border="0" width="100%">
      <tr>
        <td style="text-align:right;">
          <%= link_to I18n.t('new_profile'), new_organization_organization_profile_path(@organization), :class => 'btn' %>
        </td>
      </tr>
    </table>
<% end %>

<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><%= I18n.t(:cost_per_hour) %></th>
    <th class="action" colspan="2"><%= I18n.t(:actions) %></th>
  </tr>
  </thead>

  <tbody>

  <% @organization_profiles.each do |profile| %>
    <tr>
      <td class="td_min_width"><%= profile.name %></td>
      <td><%= profile.description %></td>
      <td><%= profile.cost_per_hour %></td>

      <td class="align-center">
        <%= link_to '', edit_organization_profile_path(profile), :class => 'icon-pencil', :title => I18n.t('edit') %>
        <% if can? :manage, OrganizationProfile %>
          <%= link_to '', profile, confirm: I18n.t('are_you_sure'), method: :delete, :class => 'icon-trash', :style => 'color:red', :title => I18n.t('delete') %>
        <% end %>
      </td>
    </tr>
  <% end %>
  <%= render :partial => 'layouts/footer_table' %>
  </tbody>
</table>


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