-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjob_task_form_component.html.erb
More file actions
105 lines (88 loc) · 3.99 KB
/
job_task_form_component.html.erb
File metadata and controls
105 lines (88 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<%= helpers.webawesome_form_with(model: form, url: form_url) do |f| %>
<%= f.fieldset do %>
<%= f.fieldset_title(icon: icon_set.job_task_icon, title: t("dispatcher.job_tasks.form.title")) %>
<%= f.input_component(:label) do |component|
component.with_label {
f.field_title(icon: icon_set.job_task_label_icon, title: "Task")
}
component.with_field {
f.text_field(:label,
placeholder: t("dispatcher.placeholders.job_task_label"),
autofocus: true,
autocomplete: "none",
required: true,
data: {"focusout-validation": true}
)
}
end %>
<%= f.input_component(:onsite) do |component|
component.with_label{
f.field_title(icon: icon_set.onsite_icon, title: "Assigned to onsite")
}
component.with_field {
f.select(:onsite, helpers.onsite_options(onsites: form.available_onsites, selected_onsite: form.onsite), data: {"focusout-validation": true})
}
end %>
<%= f.input_component(:estimated_duration) do |component| %>
<% component.with_label do %>
<% tooltip_id = helpers.dom_id(form, :estimated_duration_help) %>
<span class="wa-cluster">
<%= f.field_title(icon: icon_set.estimated_duration_icon, title: "Estimated Duration") %>
<%= render icon_set.help_icon_with_tooltip(id: tooltip_id) %>
<%= tag.wa_tooltip(for: tooltip_id) do %>
<table>
<caption>
<aside class="wa-center"><%= t("dispatcher.job_tasks.form.estimated_duration_popover.title") %></aside>
</caption>
<tr>
<th><code>1:20</code></th>
<td>1 hour, 20 minutes</td>
</tr>
<tr>
<th><code>90</code></th>
<td>90 minutes</td>
</tr>
<tr>
<th><code>1:</code></th>
<td>1 hour</td>
</tr>
</table>
<% end %>
</span>
<% end %>
<% component.with_field do %>
<%= f.text_field(:estimated_duration,
placeholder: t("dispatcher.placeholders.estimated_duration"),
autocomplete: "none",
required: true,
data: {"focusout-validation": true}
) %>
<% end %>
<% end %>
<%= f.fieldset("aria-required": true, id: f.field_id(:status)) do %>
<%= f.legend do %>
<%= helpers.icon_text(icon: helpers.icon_set.status_icon, text: "Status") %>
<%= f.field_errors(:status, class: 'visually-hidden', id!: f.field_id(:status, :errors_aria)) %>
<% end %>
<%= f.required_radio_collection_wrapper(:status, "validation-message": form.job_task.errors.generate_message(:status, :blank), class: "wa-stack") do %>
<%= f.radio_collection(field_method: :status, options: helpers.v2_job_task_status_options) %>
<% end %>
<%= f.field_errors :status, "aria-hidden": true, id!: f.field_id(:status, :errors) %>
<% end %>
<%= f.fieldset("aria-required": true, id: f.field_id(:task_type)) do %>
<%= f.legend do %>
<%= helpers.icon_text(icon: helpers.icon_set.job_task_type_label_icon, text: "Task Type") %>
<%= f.field_errors(:task_type, class: 'visually-hidden', id!: f.field_id(:task_type, :errors_aria)) %>
<% end %>
<%= f.required_radio_collection_wrapper(:task_type, "validation-message": form.job_task.errors.generate_message(:task_type, :blank), class: "wa-stack") do %>
<%= f.radio_collection(field_method: :task_type, options: helpers.v2_job_task_type_options) %>
<% end %>
<%= f.field_errors :task_type, "aria-hidden": true, id!: f.field_id(:task_type, :errors) %>
<% end %>
<section>
<%= f.button_component(type: :submit, color_variant: :success, options: {data: {disable: true}}) do %>
<%= helpers.icon_text(icon: helpers.icon_set.save_icon, text: t("dispatcher.job_tasks.form.submit_button_title")) %>
<% end %>
</section>
<% end %>
<% end %>