1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
2019-12-27 23:54:27 +01:00

32 lines
949 B
Plaintext

<div class="contextual">
<% if User.current.allowed_to?(:manage_common, @project) %>
<%= link_to t(".link_new_quantity"), '#', class: 'icon icon-add',
onclick: '$("#add-quantity").toggle(); $("#quantity_name").focus(); return false;' %>
<% end %>
</div>
<div id="add-quantity" <%= 'style=display:none;' if @quantity.errors.empty? %>>
<h2><%= t ".heading_new_quantity" %></h2>
<%= labelled_form_for @quantity,
url: project_quantities_path(@project),
html: {id: 'quantity-add-form', name: 'quantity-add-form'} do |f| %>
<%= render partial: 'quantities/form', locals: {f: f} %>
<div class="tabular">
<p>
<%= submit_tag l(:button_create) %>
<%= link_to l(:button_cancel), "#",
onclick: '$("#add-quantity").hide(); return false;' %>
</p>
</div>
<% end %>
<hr>
</div>
<h2><%= t ".heading" %></h2>
<div id='quantities'>
<%= render partial: 'quantities/index' %>
</div>