New objects are now created through association
Added Sources to sidebar
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
<h3><%= t ".heading_common" %></h3>
|
||||
<ul>
|
||||
<li><%= link_to t(".link_sources"), project_sources_path(@project) %></li>
|
||||
<li><%= link_to t(".link_quantities"), project_quantities_path(@project) %></li>
|
||||
<li><%= link_to t(".link_units"), project_units_path(@project) %></li>
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box tabular">
|
||||
<p><%= f.text_field :name, size: 40, required: true %></p>
|
||||
<p>
|
||||
<%= f.number_field :ref_amount, size: 8, required: true, min: 0 %>
|
||||
<%= f.number_field :ref_amount, size: 8, required: true, min: 0, label: :field_reference %>
|
||||
<%= f.select :ref_unit_id, unit_options, {label: '', required: true} %>
|
||||
</p>
|
||||
<p><%= f.select :group, group_options, required: true %></p>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</div>
|
||||
|
||||
<h2><%= t ".heading" %></h2>
|
||||
<% if @ingredients.any? %>
|
||||
<% if @ingredients.many? %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -59,6 +59,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @ingredients.each do |i| %>
|
||||
<% next if i.new_record? %>
|
||||
<tr id="ingredient-<%= i.id %>" class="ingredient <%= 'hidden' if i.hidden %>">
|
||||
<td class="name"><%= i.name %></td>
|
||||
<td class="reference"><%= i.ref_amount %> [<%= i.ref_unit.shortname %>]</td>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
|
||||
<h2><%= t ".heading" %></h2>
|
||||
<% if @quantities.any? %>
|
||||
<% if @quantities.many? %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -35,6 +35,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<% Quantity.each_with_level(@quantities) do |q, level| %>
|
||||
<% next if q.new_record? %>
|
||||
<tr id="quantity-<%= q.id %>"
|
||||
class="quantity <%= "project idnt idnt-#{level}" if level > 0 %>">
|
||||
<td class="name"><span><%= q.name %></span></td>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
|
||||
<h2><%= t ".heading" %></h2>
|
||||
<% if @units.any? %>
|
||||
<% if @units.many? %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -34,6 +34,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @units.each do |u| %>
|
||||
<% next if u.new_record? %>
|
||||
<tr id="unit-<%= u.id %>" class="unit">
|
||||
<td class="shortname"><%= u.shortname %></td>
|
||||
<td class="unitname"><%= u.name %></td>
|
||||
|
||||
Reference in New Issue
Block a user