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

43 lines
1.2 KiB
Plaintext

<%= form_with model: @job, url: form_target, id: "job_form" do |f| %>
<%= error_messages_for @job %>
<div class="box tabular">
<p>
<label>Name <span class="required">*</span></label>
<%= f.text_field :name, required: true %>
<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 %>
<p>
<%= f.label :description %>
<%= f.text_area :description, required: true, cols: 60, rows: 15, class: "wiki-edit",
data: { auto_complete: true }, id: "job_description" %>
<%= 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>
<%= wikitoolbar_for 'job_description' %>
</div>
<%= f.submit %>
<% end %>