Redmine-Jobs/app/views/jobs/_form.html.erb

37 lines
903 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 :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</legend>
<%= f.fields_for :time_budgets do |ff| %>
<p>
<%= ff.label :hours, ff.object.activity&.name || "Unassigned" %>
<%= ff.number_field :hours %>
<%= ff.hidden_field :activity_id %>
<%= ff.hidden_field :job_id %>
<%= ff.hidden_field :_destroy, value: false %>
<% end %>
</fieldset>
</div>
<%= f.submit %>
<% end %>