-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest.html.erb
More file actions
58 lines (52 loc) · 3.16 KB
/
test.html.erb
File metadata and controls
58 lines (52 loc) · 3.16 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
<div class="flex flex-col items-center p-4">
<div class="max-w-md">
<div class="p-4 my-4" data-controller="time-tasks">
<h1 class="font-bold text-2xl mb-4">New Time Entry:</h1>
<%= form_with(model: @time_reg) do |form| %>
<div class="mb-4">
<%= form.label :project_id, class: 'block text-gray-700 text-sm font-bold mb-2' %>
<%= form.collection_select :project_id, @projects, :id, :name, { include_blank: "Select a project:" }, { class: 'w-full rounded-md p-2 border border-gray-300 focus:ring-1 focus:ring-seaGreenDark focus:border-seaGreenDark ring-offset-1 ring-offset-white' } %>
<% @time_reg.errors.full_messages_for(:project_id).each do |message| %>
<div class="text-red-600 text-xs italic mt-1"><%= message %></div>
<% end %>
</div>
<div class="mb-4">
<%= form.label :assigned_task_id, class: 'block text-gray-700 text-sm font-bold mb-2' %>
<%= form.collection_select :assigned_task_id, {}, :id, :name, {}, { class: 'w-full rounded-md p-2 border border-gray-300 focus:ring-1 focus:ring-seaGreenDark focus:border-seaGreenDark ring-offset-1 ring-offset-white' } %>
<% @time_reg.errors.full_messages_for(:assigned_task_id).each do |message| %>
<div class="text-red-600 text-xs italic mt-1"><%= message %></div>
<% end %>
</div>
<div class="mb-4">
<%= form.label :notes, class: 'block text-gray-700 text-sm font-bold mb-2' %>
<% @time_reg.errors.full_messages_for(:notes).each do |message| %>
<div class="text-red-600 text-xs italic mt-1"><%= message %></div>
<% end %>
<br>
<%= form.text_area :notes, class: 'w-full rounded-md p-2 border border-gray-300 focus:ring-1 focus:ring-seaGreenDark focus:border-seaGreenDark ring-offset-1 ring-offset-white' %>
</div>
<div class="mb-4">
<%= form.label :minutes, class: 'block text-gray-700 text-sm font-bold mb-2' %>
<% @time_reg.errors.full_messages_for(:minutes).each do |message| %>
<div class="text-gray-600 text-sm italic mt-1"><%= message %></div>
<% end %>
<br>
<%= form.number_field :minutes, value: 0, class: 'w-full rounded-md p-2 border border-gray-300 focus:ring-1 focus:ring-seaGreenDark focus:border-seaGreenDark ring-offset-1 ring-offset-white' %>
</div>
<div class="mb-4">
<%= form.label :date_worked, class: 'block text-gray-700 text-sm font-bold mb-2' %>
<br>
<div class="flex justify-between">
<%= form.date_select :date_worked, {}, class: "w-32 rounded-md p-2 border border-gray-300 focus:ring-1 focus:ring-seaGreenDark focus:border-seaGreenDark ring-offset-1 ring-offset-white" %>
</div>
</div>
<div class="flex justify-center">
<%= form.submit class: 'bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600' %>
<div data-action="click->modal#toggle" class="cursor-pointer bg-red-500 text-white px-4 py-2 rounded-md ml-4 hover:bg-red-600">
Cancel
</div>
</div>
<% end %>
</div>
</div>
</div>