41 lines
1022 B
Plaintext
41 lines
1022 B
Plaintext
<%= form_with model: @job, url: form_target, id: "job_form" do |f| %>
|
|
<%= error_messages_for @job %>
|
|
<div class="box tabular">
|
|
<p>
|
|
<%= f.label :name %>
|
|
<%= f.text_field :name %>
|
|
|
|
<p>
|
|
<%= f.label :description %>
|
|
<%= f.text_area :description %>
|
|
|
|
<p>
|
|
<%= f.label :category %>
|
|
<%= f.collection_select :category_id, JobCategory.all, :id, :name %>
|
|
|
|
<p>
|
|
<%= f.label :starts_on %>
|
|
<%= f.date_field :starts_on %>
|
|
|
|
<p>
|
|
<%= f.label :ends_on %>
|
|
<%= f.date_field :ends_on %>
|
|
|
|
<%= f.hidden_field :project_id, value: @job.project.id %>
|
|
|
|
<fieldset>
|
|
<legend>Budget (hours)</legend>
|
|
<%= f.fields_for :time_budgets do |ff| %>
|
|
<p>
|
|
<%= ff.label :hours, ff.object.category&.name || "Unassigned" %>
|
|
<%= ff.number_field :hours %>
|
|
<%= ff.hidden_field :category_id %>
|
|
<%= ff.hidden_field :job_id %>
|
|
<%= ff.hidden_field :_destroy, value: false %>
|
|
<% end %>
|
|
</fieldset>
|
|
|
|
</div>
|
|
<%= f.submit %>
|
|
<% end %>
|