1
0

Added new Unit form

This commit is contained in:
cryptogopher
2019-08-10 23:31:20 +02:00
parent 2cd9900cea
commit b0789e6217
10 changed files with 65 additions and 17 deletions

View File

@@ -0,0 +1,7 @@
<%= error_messages_for @unit %>
<div class="box tabular">
<p><%= f.text_field :name, :required => true, :size => 40 %></p>
<p><%= f.text_field :shortname, :required => true, :size => 10 %></p>
<p><%#= f.select :summary, :cols => 60, :rows => 2 %></p>
</div>

View File

@@ -0,0 +1,26 @@
<% content_for :sidebar do %>
<%= render :partial => 'body_trackers/sidebar' %>
<% end %>
<div class="contextual">
<% if @project && User.current.allowed_to?(:manage_units, @project) %>
<%= link_to t(".heading_new_unit"), new_project_unit_path(@project),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-unit", "unit_name"); return false;' %>
<% end %>
</div>
<div id="add-unit" style="display:none;">
<h2><%= t ".heading_new_unit" %></h2>
<%= labelled_form_for @unit,
:url => project_units_path(@project),
:html => { :id => 'unit-form', :multipart => true } do |f| %>
<%= render :partial => 'units/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-unit").hide()' %>
<% end %>
<hr>
</div>
<h2><%= t ".heading" %></h2>