|
1 | | -<div id="flash_messages"> |
2 | | - <%= render 'flash_messages' %> |
3 | | -</div> |
4 | | -<div class="my-2 md:my-8"> |
5 | | - <div class="mb-8 flex justify-between items-center"> |
6 | | - <h2 class="hidden md:block md:text-2xl font-semibold text-gray-700 shadow-2xl"> |
7 | | - Job Tracker |
8 | | - </h2> |
9 | | - <%= link_to 'New Job Application', new_job_application_path, class: 'text-sm bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded cursor-pointer', data: { turbo_frame: "_top" } %> |
| 1 | +<%= turbo_frame_tag "job_applications_index" do %> |
| 2 | + <div id="flash_messages"> |
| 3 | + <%= render 'flash_messages' %> |
10 | 4 | </div> |
11 | | - <%= form_with url: job_applications_path, method: :get, data: { controller: "job-filter", turbo_frame: "job_applications_table" } do |form| %> |
12 | | - <div class="flex flex-wrap -mx-2 mb-4"> |
13 | | - <div class="w-full md:w-1/4 px-2 mb-4 md:mb-0"> |
14 | | - <%= form.label :search, "Search", class: "sr-only" %> |
15 | | - <%= form.text_field :search, value: params[:search], class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline", placeholder: "Search by company or position", data: { action: "input->job-filter#submit" } %> |
16 | | - </div> |
17 | | - <div class="w-full md:w-1/4 px-2 mb-4 md:mb-0"> |
18 | | - <%= form.label :method_of_contact, "Contact Method", class: "sr-only" %> |
19 | | - <%= form.select :method_of_contact, |
| 5 | + <div class="my-2 md:my-8"> |
| 6 | + <div class="mb-8 flex justify-between items-center"> |
| 7 | + <h2 class="hidden md:block md:text-2xl font-semibold text-gray-700 shadow-2xl"> |
| 8 | + Job Tracker |
| 9 | + </h2> |
| 10 | + <%= link_to 'New Job Application', new_job_application_path, class: 'text-sm bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded cursor-pointer', data: { turbo_frame: "_top" } %> |
| 11 | + </div> |
| 12 | + <%= form_with url: job_applications_path, method: :get, data: { controller: "job-filter", turbo_frame: "job_applications_table" } do |form| %> |
| 13 | + <div class="flex flex-wrap -mx-2 mb-4"> |
| 14 | + <div class="w-full md:w-1/4 px-2 mb-4 md:mb-0"> |
| 15 | + <%= form.label :search, "Search", class: "sr-only" %> |
| 16 | + <%= form.text_field :search, value: params[:search], class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline", placeholder: "Search by company or position", data: { action: "input->job-filter#submit" } %> |
| 17 | + </div> |
| 18 | + <div class="w-full md:w-1/4 px-2 mb-4 md:mb-0"> |
| 19 | + <%= form.label :method_of_contact, "Contact Method", class: "sr-only" %> |
| 20 | + <%= form.select :method_of_contact, |
20 | 21 | options_for_select([["All Contact Methods", ""]] + JobApplication.method_of_contacts.map { |k, v| [k.humanize, v] }, params[:method_of_contact]), |
21 | 22 | {}, |
22 | 23 | class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline", |
23 | 24 | data: { action: "change->job-filter#submit" } |
24 | 25 | %> |
25 | | - </div> |
26 | | - <div class="w-full md:w-1/4 px-2"> |
27 | | - <%= form.label :position_type, "Position Type", class: "sr-only" %> |
28 | | - <%= form.select :position_type, |
| 26 | + </div> |
| 27 | + <div class="w-full md:w-1/4 px-2"> |
| 28 | + <%= form.label :position_type, "Position Type", class: "sr-only" %> |
| 29 | + <%= form.select :position_type, |
29 | 30 | options_for_select([["All Position Types", ""]] + JobApplication.position_types.map { |k, v| [k.humanize, v] }, params[:position_type]), |
30 | 31 | {}, |
31 | 32 | class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline", |
32 | 33 | data: { action: "change->job-filter#submit" } |
33 | 34 | %> |
| 35 | + </div> |
| 36 | + <div class="w-full md:w-1/4 px-2 mt-4 md:mt-0"> |
| 37 | + <%= form.button "Reset Filters", type: "button", class: "w-full bg-gray-600 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded cursor-pointer", data: { action: "click->job-filter#reset" } %> |
| 38 | + </div> |
34 | 39 | </div> |
35 | | - <div class="w-full md:w-1/4 px-2 mt-4 md:mt-0"> |
36 | | - <%= form.button "Reset Filters", type: "button", class: "w-full bg-gray-600 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded cursor-pointer", data: { action: "click->job-filter#reset" } %> |
| 40 | + <% end %> |
| 41 | + <%= turbo_frame_tag "job_applications_table" do %> |
| 42 | + <%= render partial: "job_applications_table", locals: { job_applications: @job_applications } %> |
| 43 | + <div id="pagination" class="mt-4"> |
| 44 | + <%= render partial: "pagination", locals: { job_applications: @job_applications, job_application_count: @job_application_count } %> |
37 | 45 | </div> |
38 | | - </div> |
39 | | - <% end %> |
40 | | - <%= turbo_frame_tag "job_applications_table" do %> |
41 | | - <%= render partial: "job_applications_table", locals: { job_applications: @job_applications } %> |
42 | | - <div id="pagination" class="mt-4"> |
43 | | - <%= render partial: "pagination", locals: { job_applications: @job_applications, job_application_count: @job_application_count } %> |
44 | | - </div> |
45 | | - <% end %> |
46 | | - <%= turbo_frame_tag "new_job_application" %> |
47 | | -</div> |
| 46 | + <% end %> |
| 47 | + <%= turbo_frame_tag "new_job_application" %> |
| 48 | + </div> |
| 49 | +<% end %> |
0 commit comments