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.
cryptogopher c96cea5ca6 New objects are now created through association
Added Sources to sidebar
2019-09-23 15:35:43 +02:00

52 lines
1.8 KiB
Plaintext

<% content_for :sidebar do %>
<%= render :partial => 'body_trackers/sidebar' %>
<% end %>
<div class="contextual">
<% if User.current.allowed_to?(:manage_common, @project) %>
<%= link_to t(".heading_new_quantity"), '#', :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-quantity", "quantity_name"); 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-form'} do |f| %>
<%= render :partial => 'quantities/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-quantity").hide()' %>
<% end %>
<hr>
</div>
<h2><%= t ".heading" %></h2>
<% if @quantities.many? %>
<table class="list">
<thead>
<tr>
<th><%= l(:field_name) %></th>
<th><%= l(:field_domain) %></th>
<th><%= l(:field_description) %></th>
<th style="width:15%"><%= l(:field_action) %></th>
</tr>
</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>
<td class="domain"><%= q.domain %></td>
<td class="description"><%= q.description %></td>
<td><%= delete_link quantity_path(q), data: {} %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>