|
1 | 1 | <%= turbo_frame_tag dom_id(job_application) do %> |
2 | | - <%= form_with(model: job_application, local: false) do |form| %> |
3 | | - <% if job_application.errors.any? %> |
4 | | - <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4" role="alert"> |
5 | | - <strong class="font-bold">Error:</strong> |
6 | | - <span class="block sm:inline"><%= pluralize(job_application.errors.count, "error") %> prohibited this job application from being saved:</span> |
7 | | - <ul class="list-disc list-inside"> |
8 | | - <% job_application.errors.full_messages.each do |message| %> |
9 | | - <li><%= message %></li> |
| 2 | + <div class="flex justify-center items-center w-full max-h-screen p-2 md:p-4"> |
| 3 | + <div class="w-full md:w-[800px] bg-white shadow-lg rounded-lg overflow-hidden"> |
| 4 | + <div class="px-4 md:px-8 py-3 md:py-6 bg-gray-50 border-b border-gray-200"> |
| 5 | + <h2 class="text-2xl font-bold text-gray-900"><%= "#{title} Job Application" %></h2> |
| 6 | + <p class="mt-1 text-sm text-gray-600">Please fill in the relevant details of your recent job application.</p> |
| 7 | + </div> |
| 8 | + <div class="px-8 py-6"> |
| 9 | + <%= form_with(model: job_application, local: false, class: "space-y-6") do |form| %> |
| 10 | + <% if job_application.errors.any? %> |
| 11 | + <div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4" role="alert"> |
| 12 | + <p class="font-bold">Error:</p> |
| 13 | + <p><%= pluralize(job_application.errors.count, "error") %> prohibited this job application from being saved:</p> |
| 14 | + <ul class="list-disc list-inside"> |
| 15 | + <% job_application.errors.full_messages.each do |message| %> |
| 16 | + <li><%= message %></li> |
| 17 | + <% end %> |
| 18 | + </ul> |
| 19 | + </div> |
10 | 20 | <% end %> |
11 | | - </ul> |
| 21 | + <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
| 22 | + <div> |
| 23 | + <%= form.label :date_applied, class: 'block text-sm font-medium text-gray-700 mb-2' %> |
| 24 | + <%= form.date_field :date_applied, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
| 25 | + </div> |
| 26 | + <div> |
| 27 | + <%= form.label :company_name, class: 'block text-sm font-medium text-gray-700 mb-2' %> |
| 28 | + <%= form.text_field :company_name, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
| 29 | + </div> |
| 30 | + <div> |
| 31 | + <%= form.label :method_of_contact, class: 'block text-sm font-medium text-gray-700 mb-2' %> |
| 32 | + <%= form.select :method_of_contact, JobApplication.method_of_contacts.keys.map { |k| [k.humanize, k] }, { include_blank: 'Select a method' }, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
| 33 | + </div> |
| 34 | + <div> |
| 35 | + <%= form.label :email_address, class: 'block text-sm font-medium text-gray-700 mb-2' %> |
| 36 | + <%= form.email_field :email_address, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
| 37 | + </div> |
| 38 | + <div> |
| 39 | + <%= form.label :point_of_contact, class: 'block text-sm font-medium text-gray-700 mb-2' %> |
| 40 | + <%= form.text_field :point_of_contact, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
| 41 | + </div> |
| 42 | + <div> |
| 43 | + <%= form.label :website_link, class: 'block text-sm font-medium text-gray-700 mb-2' %> |
| 44 | + <%= form.url_field :website_link, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
| 45 | + </div> |
| 46 | + <div> |
| 47 | + <%= form.label :position_type, class: 'block text-sm font-medium text-gray-700 mb-2' %> |
| 48 | + <%= form.select :position_type, JobApplication.position_types.keys.map { |k| [k.humanize, k] }, { include_blank: 'Select a type' }, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
| 49 | + </div> |
| 50 | + <div> |
| 51 | + <%= form.label :position_title, class: 'block text-sm font-medium text-gray-700 mb-2' %> |
| 52 | + <%= form.text_field :position_title, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | + <div class="flex items-center justify-end mt-6"> |
| 56 | + <%= link_to 'Cancel', root_path, class: 'bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline mr-2', data: { turbo_frame: "_top" } %> |
| 57 | + <%= form.submit "Save", class: 'bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline' %> |
| 58 | + </div> |
| 59 | + <% end %> |
12 | 60 | </div> |
13 | | - <% end %> |
14 | | - <div class="mb-4"> |
15 | | - <%= form.label :date_applied, class: 'block text-gray-700 text-sm font-bold mb-2' %> |
16 | | - <%= form.date_field :date_applied, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
17 | | - </div> |
18 | | - <div class="mb-4"> |
19 | | - <%= form.label :company_name, class: 'block text-gray-700 text-sm font-bold mb-2' %> |
20 | | - <%= form.text_field :company_name, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
21 | | - </div> |
22 | | - <div class="mb-4"> |
23 | | - <%= form.label :method_of_contact, class: 'block text-gray-700 text-sm font-bold mb-2' %> |
24 | | - <%= form.select :method_of_contact, JobApplication.method_of_contacts.keys.map { |k| [k.humanize, k] }, { include_blank: 'Select a method' }, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
25 | | - </div> |
26 | | - <div class="mb-4"> |
27 | | - <%= form.label :email_address, class: 'block text-gray-700 text-sm font-bold mb-2' %> |
28 | | - <%= form.email_field :email_address, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
29 | | - </div> |
30 | | - <div class="mb-4"> |
31 | | - <%= form.label :point_of_contact, class: 'block text-gray-700 text-sm font-bold mb-2' %> |
32 | | - <%= form.text_field :point_of_contact, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
33 | | - </div> |
34 | | - <div class="mb-4"> |
35 | | - <%= form.label :website_link, class: 'block text-gray-700 text-sm font-bold mb-2' %> |
36 | | - <%= form.url_field :website_link, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
37 | | - </div> |
38 | | - <div class="mb-4"> |
39 | | - <%= form.label :position_type, class: 'block text-gray-700 text-sm font-bold mb-2' %> |
40 | | - <%= form.select :position_type, JobApplication.position_types.keys.map { |k| [k.humanize, k] }, { include_blank: 'Select a type' }, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
41 | | - </div> |
42 | | - <div class="mb-6"> |
43 | | - <%= form.label :position_title, class: 'block text-gray-700 text-sm font-bold mb-2' %> |
44 | | - <%= form.text_field :position_title, class: 'shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline' %> |
45 | | - </div> |
46 | | - <div class="flex items-center justify-between"> |
47 | | - <%= form.submit class: 'bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline cursor-pointer' %> |
48 | | - <%= link_to 'Back', root_path, class: 'inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800' %> |
49 | 61 | </div> |
50 | | - <% end %> |
| 62 | + </div> |
51 | 63 | <% end %> |
0 commit comments