2023-11-26 20:25:27 +00:00
|
|
|
<%= form_with model: @job, url: form_target, id: "job_form" do |f| %>
|
2023-11-24 16:51:15 +00:00
|
|
|
<%= error_messages_for @job %>
|
2023-11-22 19:44:28 +00:00
|
|
|
<div class="box tabular">
|
2023-11-16 20:23:09 +00:00
|
|
|
<p>
|
|
|
|
<%= f.label :name %>
|
|
|
|
<%= f.text_field :name %>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<%= f.label :description %>
|
|
|
|
<%= f.text_area :description %>
|
|
|
|
|
2023-11-30 19:08:55 +00:00
|
|
|
<p>
|
|
|
|
<%= f.label :category %>
|
|
|
|
<%= f.collection_select :category_id, JobCategory.all, :id, :name %>
|
|
|
|
|
2023-11-16 20:23:09 +00:00
|
|
|
<p>
|
|
|
|
<%= f.label :starts_on %>
|
|
|
|
<%= f.date_field :starts_on %>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<%= f.label :ends_on %>
|
|
|
|
<%= f.date_field :ends_on %>
|
|
|
|
|
2023-11-24 16:51:15 +00:00
|
|
|
<%= f.hidden_field :project_id, value: @job.project.id %>
|
2023-11-16 20:23:09 +00:00
|
|
|
|
2023-11-24 15:05:38 +00:00
|
|
|
<fieldset>
|
2023-12-04 13:04:51 +00:00
|
|
|
<legend>Budget (hours)</legend>
|
2023-11-24 15:05:38 +00:00
|
|
|
<%= f.fields_for :time_budgets do |ff| %>
|
|
|
|
<p>
|
2023-11-30 17:37:54 +00:00
|
|
|
<%= ff.label :hours, ff.object.category&.name || "Unassigned" %>
|
2023-11-24 15:05:38 +00:00
|
|
|
<%= ff.number_field :hours %>
|
2023-11-30 17:37:54 +00:00
|
|
|
<%= ff.hidden_field :category_id %>
|
2023-11-24 15:05:38 +00:00
|
|
|
<%= ff.hidden_field :job_id %>
|
|
|
|
<%= ff.hidden_field :_destroy, value: false %>
|
|
|
|
<% end %>
|
|
|
|
</fieldset>
|
2023-11-16 20:23:09 +00:00
|
|
|
|
2023-11-22 19:44:28 +00:00
|
|
|
</div>
|
|
|
|
<%= f.submit %>
|
|
|
|
<% end %>
|