app/views/organization_technologies/_factors_abacus.html.erb
<%= form_tag 'set_abacus', :method => 'POST', :class => 'simple_form' do %>
<table>
<tr>
<td>
<b><%= I18n.t(:text_organization_abacus) %></b>
</td>
<td> </td>
<td>
<%= select_tag 'technology', options_for_select(@organization.organization_technologies.map { |i| [i.name, i.id] }, :selected => @ot.nil? ? '' : @ot.id) %>
</td>
</tr>
</table>
<br/>
<table id="table_list_8" class="table table-striped table-bordered table-condensed permissions">
<tr>
<th style="text-align:left;"><%= I18n.t(:organization_abacus) %></th>
<% @complexities.each do |ouc| %>
<th class="text-center">
<% if ouc.state == 'retired' %>
<span class="attribute_tooltip" style="font-style:italic; color:Red" title='<%= ouc.description %>'>
<%= ouc.name %>
</span>
<% elsif ouc.state == 'draft' %>
<span class="attribute_tooltip" style="font-style:italic; color:DarkOrange " title='<%= ouc.description %>'>
<%= ouc.name %>
</span>
<% else %>
<span class="attribute_tooltip" title='<%= ouc.description %>'>
<%= ouc.name %>
</span>
<% end %>
</th>
<% end %>
</tr>
<% if @factors %>
<% @factors.each do |factor| %>
<tr>
<td style="text-align: right;">
<% if factor.state == 'retired' %>
<span class="attribute_tooltip" style="font-style:italic; color:Red" title='<%= factor.description %>'>
<%= factor.name %>
</span>
<% elsif factor.state == 'draft' %>
<span class="attribute_tooltip" style="font-style:italic; color:DarkOrange" title='<%= factor.description %>'>
<%= factor.name %>
</span>
<% else %>
<span class="attribute_tooltip" style="font-weight:bold" title='<%= factor.description %>'>
<%= factor.name %>
</span>
<% end %>
</td>
<% @complexities.each do |c| %>
<td style="text-align: center;">
<% a = AbacusOrganization.where(:factor_id => factor.id,
:organization_uow_complexity_id => c.id,
:organization_technology_id => @ot.id,
:organization_id => @organization.id).first %>
<%= text_field_tag "abacus[#{factor.id}][#{c.id}]", a.nil? ? '' : a.value, :class => 'span' %>
</td>
<% end %>
</tr>
<% end %>
<% end %>
</table>
<% if can? :edit_organizations, Organization %>
<%= submit_tag I18n.t('save'), :class => 'btn' %>
<%= submit_tag I18n.t('apply'), :class => 'btn' %>
<a href="#myAbacusImportModal" role="button" class="btn" data-toggle="modal"><%= I18n.t('import') %></a>
<% end %>
<%= link_to I18n.t('export'), export_abacus_path(@organization.id), :class => 'btn' %>
<% end %>
<div id="myAbacusImportModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<%= form_tag import_abacus_path(@organization.id), :multipart => true, :class => 'simple_form' do %>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel"><%= I18n.t(:import) %> <%= I18n.t(:organization_abacus) %></h3>
</div>
<div class="modal-body">
<label><%= I18n.t(:file_xls) %></label>
<%= file_field_tag :file %>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= I18n.t(:cancel) %></button>
<%= submit_tag I18n.t(:import), :class => 'btn btn-primary', :onclick => "$('.loading').show();" %>
</div>
<div class="loading span11 hide">
<h4><%= I18n.t(:please_wait_import) %><%= image_tag 'ajax-loader.gif' %> </h4>
</div>
<% end %>
</div>