estimancy/projestimate

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

Summary

Maintainability
Test Coverage
<div class="alert alert-info">
  <span>
    <i class="icon icon-info"></i>
    For each size's types, configure nominal effort by technology/unit of work/complexity
  </span>
</div>

<%= form_tag '/set_technology_uow_synthesis', :method => 'POST', :class => 'simple_form' do %>

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

    <table class="table table-striped table-bordered table-condensed permissions">
      <tr>
        <th>Technology</th>
        <th>Unit of Work</th>
        <th>Complexity</th>
        <% @organization.size_unit_types.each do |sut| %>
          <th><%= link_to "#{sut.name}", edit_size_unit_type_path(sut, organization_id: @organization.id) %></th>
        <% end %>
      </tr>

      <% @organization.organization_technologies.each do |ot| %>
        <% ot.unit_of_works.each do |uow| %>
          <% OrganizationUowComplexity.where(organization_technology_id: ot.id, unit_of_work_id: uow.id).all.each do |cplx| %>
            <tr>
              <td>
                <%= link_to ot.name, edit_organization_technology_path(ot, organization_id: @organization.id) %>
              </td>

              <td>
                <%= link_to uow.name, edit_unit_of_work_path(uow, organization_id: @organization.id) %>
              </td>

              <td>
                <%= link_to cplx, edit_organization_uow_complexity_path(cplx, organization_id: @organization.id, uo_id: uow.id) %>
              </td>

              <% @organization.size_unit_types.each do |sut| %>
                <td class="center">
                  <% sutc = SizeUnitTypeComplexity.where(size_unit_type_id: sut.id, organization_uow_complexity_id: cplx.id).first %>
                  <% if sutc %>
                    <%= text_field_tag "abacus[#{sut.id}][#{ot.id}][#{uow.id}][#{cplx.id}]", sutc.value %>
                  <% else %>
                     <%= text_field_tag "abacus[#{sut.id}][#{ot.id}][#{uow.id}][#{cplx.id}]", nil %>
                  <% end %>
                </td>
              <% end %>
            </tr>
          <% end %>
        <% end %>
      <% end %>
    </table>

    <% if can? :manage_modules_instances, ModuleProject %>
      <%= submit_tag I18n.t('apply'), :class => 'btn' %>
    <% end %>
    <%= link_to "Liste des Technologies", organization_setting_path(organization_id: @organization, anchor: "tabs-technology"), class: "btn" %>
    <%= link_to "Liste des Unités d'Oeuvres", unit_of_works_path(organization_id: @organization), class: "btn" %>
    <%= link_to "Liste des Types d'Acquisitions", organization_setting_path(organization_id: @organization, anchor: "tabs-size_unit"), class: "btn" %>

<% end %>