diff --git a/Gemfile b/Gemfile
index 845ae90..0b71dab 100644
--- a/Gemfile
+++ b/Gemfile
@@ -16,6 +16,7 @@ gem "phlex-rails", "~> 1.2"
gem "devise", "~> 4.9"
gem "will_paginate", "~> 4.0"
gem "validate_url", "~> 1.0"
+gem "rexml", ">= 3.3.2"
group :development, :test do
gem "debug", "~> 1.9", ">= 1.9.2", platforms: %i[mri windows]
diff --git a/Gemfile.lock b/Gemfile.lock
index cae456f..dcfca61 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -261,8 +261,8 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
- rexml (3.2.8)
- strscan (>= 3.0.9)
+ rexml (3.3.2)
+ strscan
rubocop (1.64.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
@@ -366,6 +366,7 @@ DEPENDENCIES
phlex-rails (~> 1.2)
puma (~> 6.4, >= 6.4.2)
rails (~> 7.1, >= 7.1.3.4)
+ rexml (>= 3.3.2)
rubocop (~> 1.63, >= 1.63.5)
rubocop-factory_bot (~> 2.25, >= 2.25.1)
rubocop-minitest (~> 0.35.0)
diff --git a/README.md b/README.md
index 097b74a..4d1a6ba 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@
Job Tracker is a simple, powerful, and user-friendly web application designed to help job seekers efficiently manage their job search process. Built with Ruby on Rails and enhanced with modern web technologies, this tool streamlines the often overwhelming task of tracking multiple job applications.
-
+
## Key Features
diff --git a/app/controllers/job_applications_controller.rb b/app/controllers/job_applications_controller.rb
index 2139285..c56b68f 100644
--- a/app/controllers/job_applications_controller.rb
+++ b/app/controllers/job_applications_controller.rb
@@ -1,5 +1,6 @@
class JobApplicationsController < ApplicationController
- before_action :set_job_application, only: [:create, :update, :destroy]
+ include ActionView::RecordIdentifier
+ before_action :set_job_application, only: [:edit, :update, :destroy]
def index
@job_applications = filter_and_sort_job_applications
@@ -22,6 +23,17 @@ def index
def new
@job_application = JobApplication.new
+ respond_to do |format|
+ format.html
+ format.turbo_stream { render turbo_stream: turbo_stream.replace("new_job_application", partial: "form", locals: {job_application: @job_application, title: "New"}) }
+ end
+ end
+
+ def edit
+ respond_to do |format|
+ format.html
+ format.turbo_stream { render turbo_stream: turbo_stream.replace(dom_id(@job_application), partial: "form", locals: {job_application: @job_application, title: "Edit"}) }
+ end
end
def create
@@ -29,18 +41,19 @@ def create
respond_to do |format|
if @job_application.save
- format.html { redirect_to job_applications_path, notice: "Job application was successfully created." }
- format.turbo_stream {
- flash.now[:notice] = "Job application was successfully created."
- render turbo_stream: [
- turbo_stream.prepend("job_applications", partial: "job_application", locals: {job_application: @job_application}),
- turbo_stream.update("flash_messages", partial: "flash_messages"),
- turbo_stream.replace("new_job_application", partial: "form", locals: {job_application: JobApplication.new})
- ]
- }
+ format.html { redirect_to root_path, success: "Job application was successfully created." }
+ format.turbo_stream do
+ render turbo_stream: turbo_stream.redirect_advanced(root_path)
+ flash[:success] = "Job application was successfully created."
+ end
else
format.html { render :new, status: :unprocessable_entity }
- format.turbo_stream { render turbo_stream: turbo_stream.replace(@job_application, partial: "form", locals: {job_application: @job_application}) }
+ format.turbo_stream do
+ render turbo_stream: [
+ turbo_stream.replace("new_job_application", partial: "form", locals: {job_application: @job_application, title: "New"}),
+ turbo_stream.update("flash_messages", partial: "flash_messages")
+ ]
+ end
end
end
end
@@ -48,17 +61,13 @@ def create
def update
respond_to do |format|
if @job_application.update(job_application_params)
- format.html { redirect_to job_applications_path, notice: "Job application was successfully updated." }
- format.turbo_stream {
- flash.now[:notice] = "Job application was successfully updated."
- render turbo_stream: [
- turbo_stream.replace(@job_application, partial: "job_application", locals: {job_application: @job_application}),
- turbo_stream.update("flash_messages", partial: "flash_messages")
- ]
- }
+ format.html { redirect_to root_path, success: "Job application was successfully updated." }
+ format.turbo_stream do
+ render turbo_stream: turbo_stream.redirect_advanced(root_path)
+ flash[:success] = "Job application was successfully updated."
+ end
else
format.html { render :edit, status: :unprocessable_entity }
- format.turbo_stream { render turbo_stream: turbo_stream.replace(@job_application, partial: "form", locals: {job_application: @job_application}) }
end
end
end
@@ -66,9 +75,9 @@ def update
def destroy
@job_application.destroy
respond_to do |format|
- format.html { redirect_to job_applications_url, notice: "Job application was successfully deleted." }
+ format.html { redirect_to root_path, success: "Job application was successfully deleted." }
format.turbo_stream {
- flash.now[:notice] = "Job application was successfully deleted."
+ flash.now[:success] = "Job application was successfully deleted."
render turbo_stream: [
turbo_stream.remove(@job_application),
turbo_stream.update("job_application_count", JobApplication.count),
@@ -82,6 +91,8 @@ def destroy
def set_job_application
@job_application = JobApplication.find(params[:id])
+ rescue ActiveRecord::RecordNotFound
+ redirect_to root_path, alert: "Job application not found."
end
def job_application_params
@@ -97,11 +108,18 @@ def filter_and_sort_job_applications
sort_column = sort_column(params[:sort])
sort_direction = sort_direction(params[:direction])
- job_applications.order(sort_column => sort_direction)
+
+ if sort_column == "created_at" || params[:sort].blank?
+ # If sorting by created_at or no sorting specified, always use desc order
+ job_applications.order(created_at: :desc)
+ else
+ # For other columns, use the specified sort direction
+ job_applications.order(sort_column => sort_direction)
+ end
end
def sort_column(column)
- %w[date_applied company_name position_title].include?(column) ? column : "date_applied"
+ %w[date_applied company_name position_title created_at].include?(column) ? column : "created_at"
end
def sort_direction(direction)
diff --git a/app/frontend/controllers/flash_message_controller.js b/app/frontend/controllers/flash_message_controller.js
index fced9ca..6786f55 100644
--- a/app/frontend/controllers/flash_message_controller.js
+++ b/app/frontend/controllers/flash_message_controller.js
@@ -10,7 +10,17 @@ export default class extends Controller {
show() {
this.element.classList.remove('hidden');
setTimeout(() => {
- this.element.classList.add('hidden');
- }, 5000);
+ this.fadeOut();
+ }, 2000);
+ }
+
+ fadeOut() {
+ const flashMessage = this.element.querySelector('.flash-message');
+ if (flashMessage) {
+ flashMessage.classList.add('fade-out');
+ setTimeout(() => {
+ this.element.classList.add('hidden');
+ }, 500);
+ }
}
}
diff --git a/app/frontend/entrypoints/application.js b/app/frontend/entrypoints/application.js
index 644acc4..a8e14c6 100644
--- a/app/frontend/entrypoints/application.js
+++ b/app/frontend/entrypoints/application.js
@@ -1,5 +1,5 @@
import "~/controllers";
-import "@hotwired/turbo-rails";
+import { Turbo } from "@hotwired/turbo-rails"
// To see this message, add the following to the `
` section in your
// views/layouts/application.html.erb
//
@@ -20,7 +20,7 @@ console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify
Turbo.start();
-document.addEventListener("turbo:load", function () {
+document.addEventListener("turbo:load", () => {
console.log("turbo:load");
});
//
@@ -32,3 +32,9 @@ document.addEventListener("turbo:load", function () {
// Example: Import a stylesheet in app/frontend/index.css
// import '~/index.css'
+
+Turbo.StreamActions.redirect_advanced = function () {
+ const url = this.getAttribute('url') || '/'
+ // Turbo.visit(url, { frame: '_top', action: 'advance' })
+ Turbo.visit(url)
+}
diff --git a/app/frontend/stylesheets/index.css b/app/frontend/stylesheets/index.css
index 4e88c4c..4343340 100644
--- a/app/frontend/stylesheets/index.css
+++ b/app/frontend/stylesheets/index.css
@@ -24,3 +24,11 @@ body {
background-position: center;
background-attachment: fixed;
}
+
+td {
+ font-size: 12px !important;
+}
+
+th {
+ font-size: 12px !important;
+}
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index f578809..27a777f 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,12 +1,34 @@
module ApplicationHelper
def flash_class(type)
+ base_class = "border-l-4 p-4 mb-4 rounded-md"
case type.to_sym
- when :notice then "bg-blue-100 border-blue-500 text-blue-700"
- when :success then "bg-green-100 border-green-500 text-green-700"
- when :error then "bg-red-100 border-red-500 text-red-700"
- when :alert then "bg-yellow-100 border-yellow-500 text-yellow-700"
- else "bg-gray-100 border-gray-500 text-gray-700"
- end + " border-l-4 p-4 mb-4"
+ when :notice
+ "bg-blue-100 border-blue-500 text-blue-700 #{base_class}"
+ when :success
+ "bg-green-100 border-green-500 text-green-700 #{base_class}"
+ when :error
+ "bg-red-100 border-red-500 text-red-700 #{base_class}"
+ when :alert
+ "bg-yellow-100 border-yellow-500 text-yellow-700 #{base_class}"
+ else
+ "bg-gray-100 border-gray-500 text-gray-700 #{base_class}"
+ end
+ end
+
+ def progress_bar_class(type)
+ base_class = "rounded-md"
+ case type.to_sym
+ when :notice
+ "bg-blue-500 #{base_class}"
+ when :success
+ "bg-green-500 #{base_class}"
+ when :error
+ "bg-red-500 #{base_class}"
+ when :alert
+ "bg-yellow-500 #{base_class}"
+ else
+ "bg-gray-500 #{base_class}"
+ end
end
def sort_link_to(name, column)
diff --git a/app/helpers/turbo_stream_actions_helper.rb b/app/helpers/turbo_stream_actions_helper.rb
new file mode 100644
index 0000000..dace92d
--- /dev/null
+++ b/app/helpers/turbo_stream_actions_helper.rb
@@ -0,0 +1,8 @@
+module TurboStreamActionsHelper
+ # render turbo_stream: turbo_stream.redirect_advanced(projects_path)
+ def redirect_advanced(url)
+ turbo_stream_action_tag :redirect_advanced, url: url
+ end
+end
+
+Turbo::Streams::TagBuilder.prepend(TurboStreamActionsHelper)
diff --git a/app/views/application/_flash_messages.html.erb b/app/views/application/_flash_messages.html.erb
index 8a365e4..f189164 100644
--- a/app/views/application/_flash_messages.html.erb
+++ b/app/views/application/_flash_messages.html.erb
@@ -1,6 +1,36 @@
-
+
+
<% flash.each do |type, message| %>
-
+
<% end %>
diff --git a/app/views/job_applications/_form.html.erb b/app/views/job_applications/_form.html.erb
index a7909aa..251ec95 100644
--- a/app/views/job_applications/_form.html.erb
+++ b/app/views/job_applications/_form.html.erb
@@ -1,51 +1,62 @@
<%= turbo_frame_tag dom_id(job_application) do %>
- <%= form_with(model: job_application, local: false) do |form| %>
- <% if job_application.errors.any? %>
-
-
Error:
-
<%= pluralize(job_application.errors.count, "error") %> prohibited this job application from being saved:
-
- <% job_application.errors.full_messages.each do |message| %>
- - <%= message %>
+
+
+
+
<%= "#{title} Job Application" %>
+
Please fill in the relevant details of your recent job application.
+
+
+ <%= form_with(model: job_application, local: false, class: "space-y-6") do |form| %>
+ <% if job_application.errors.any? %>
+
+
<%= pluralize(job_application.errors.count, "error") %>
+
+ <% job_application.errors.full_messages.each do |message| %>
+ - <%= message %>
+ <% end %>
+
+
<% end %>
-
+
+
+ <%= form.label :date_applied, class: 'block text-sm font-medium text-gray-700 mb-2' %>
+ <%= 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' %>
+
+
+ <%= form.label :company_name, class: 'block text-sm font-medium text-gray-700 mb-2' %>
+ <%= 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' %>
+
+
+ <%= form.label :method_of_contact, class: 'block text-sm font-medium text-gray-700 mb-2' %>
+ <%= 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' %>
+
+
+ <%= form.label :email_address, class: 'block text-sm font-medium text-gray-700 mb-2' %>
+ <%= 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' %>
+
+
+ <%= form.label :point_of_contact, class: 'block text-sm font-medium text-gray-700 mb-2' %>
+ <%= 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' %>
+
+
+ <%= form.label :website_link, class: 'block text-sm font-medium text-gray-700 mb-2' %>
+ <%= 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' %>
+
+
+ <%= form.label :position_type, class: 'block text-sm font-medium text-gray-700 mb-2' %>
+ <%= 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' %>
+
+
+ <%= form.label :position_title, class: 'block text-sm font-medium text-gray-700 mb-2' %>
+ <%= 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' %>
+
+
+
+ <%= 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" } %>
+ <%= 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' %>
+
+ <% end %>
- <% end %>
-
- <%= form.label :date_applied, class: 'block text-gray-700 text-sm font-bold mb-2' %>
- <%= 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' %>
-
-
- <%= form.label :company_name, class: 'block text-gray-700 text-sm font-bold mb-2' %>
- <%= 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' %>
-
-
- <%= form.label :method_of_contact, class: 'block text-gray-700 text-sm font-bold mb-2' %>
- <%= 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' %>
-
-
- <%= form.label :email_address, class: 'block text-gray-700 text-sm font-bold mb-2' %>
- <%= 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' %>
-
-
- <%= form.label :point_of_contact, class: 'block text-gray-700 text-sm font-bold mb-2' %>
- <%= 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' %>
-
-
- <%= form.label :website_link, class: 'block text-gray-700 text-sm font-bold mb-2' %>
- <%= 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' %>
-
-
- <%= form.label :position_type, class: 'block text-gray-700 text-sm font-bold mb-2' %>
- <%= 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' %>
-
-
- <%= form.label :position_title, class: 'block text-gray-700 text-sm font-bold mb-2' %>
- <%= 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' %>
-
-
- <%= 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' %>
- <%= link_to 'Back', root_path, class: 'inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800' %>
- <% end %>
+
<% end %>
diff --git a/app/views/job_applications/_job_application.html.erb b/app/views/job_applications/_job_application.html.erb
index 5483e63..b6c5de1 100644
--- a/app/views/job_applications/_job_application.html.erb
+++ b/app/views/job_applications/_job_application.html.erb
@@ -26,14 +26,14 @@
safe_url(job_application.website_link),
target: "_blank",
rel: "noopener noreferrer",
- class: "px-3 py-1 rounded-md text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50",
+ class: "px-3 py-1 rounded-md text-xs text-gray-700 bg-white border border-gray-300 hover:bg-gray-50",
title: "Visit Website" %>
<% end %>
- <%= link_to 'Edit', edit_job_application_path(job_application), class: 'px-3 py-1 rounded-md text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50 mr-2', data: { turbo_frame: "_top" }, title: "Edit Application" %>
- <%= button_to 'Delete', job_application_path(job_application), method: :delete, form: { data: { turbo_confirm: 'Are you sure?' } }, class: 'px-3 py-1 rounded-md text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50', data: { turbo_frame: "_top" }, title: "Delete Application" %>
+ <%= link_to 'Edit', edit_job_application_path(job_application), class: 'px-3 py-1 rounded-md text-xs text-gray-700 bg-white border border-gray-300 hover:bg-gray-50 mr-2', data: { turbo_frame: "_top" }, title: "Edit Application" %>
+ <%= button_to 'Delete', job_application_path(job_application), method: :delete, form: { data: { turbo_confirm: 'Are you sure?' } }, class: 'px-3 py-1 rounded-md text-xs text-gray-700 bg-white border border-gray-300 hover:bg-gray-50', data: { turbo_frame: "_top" }, title: "Delete Application" %>
|
diff --git a/app/views/job_applications/_job_applications_table.html.erb b/app/views/job_applications/_job_applications_table.html.erb
index 2bfa83c..3ce9c0c 100644
--- a/app/views/job_applications/_job_applications_table.html.erb
+++ b/app/views/job_applications/_job_applications_table.html.erb
@@ -2,34 +2,34 @@
<% if @job_applications.any? %>
-
+
- |
- <%= sort_link_to 'Applied', 'date_applied' %>
+ |
+ <%= sort_link_to 'Date Applied', 'date_applied' %>
|
-
- <%= sort_link_to 'Company', 'company_name' %>
+ |
+ <%= sort_link_to 'Company Name', 'company_name' %>
|
-
+ |
<%= sort_link_to 'Position', 'position_title' %>
|
-
+ |
Type
|
-
+ |
Contact Method
|
-
+ |
P.o.C.
|
-
+ |
Email
|
-
+ |
Website
|
-
+ |
Actions
|
diff --git a/app/views/job_applications/_pagination.html.erb b/app/views/job_applications/_pagination.html.erb
index dadee7a..bc65968 100644
--- a/app/views/job_applications/_pagination.html.erb
+++ b/app/views/job_applications/_pagination.html.erb
@@ -1,18 +1,19 @@
-<% if @pagination_info[:total_pages] > 1 %>
-
-
- Showing
<%= @pagination_info[:offset] + 1 %> to
<%= [@pagination_info[:offset] + @pagination_info[:length], @job_application_count].min %> of
<%= @job_application_count %> results
+
+ <% if @pagination_info[:total_pages] > 1 %>
+
+
+
+
+ <%= will_paginate @job_applications,
+ renderer: CustomPaginationRenderer,
+ previous_label: 'Previous',
+ next_label: 'Next',
+ inner_window: 0,
+ outer_window: 0,
+ class: 'pagination',
+ previous_page_class: 'px-3 py-1 rounded-md text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50',
+ next_page_class: 'px-3 py-1 rounded-md text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50' %>
+
-
- <%= will_paginate @job_applications,
- renderer: CustomPaginationRenderer,
- previous_label: 'Previous',
- next_label: 'Next',
- inner_window: 0,
- outer_window: 0,
- class: 'pagination',
- previous_page_class: 'px-3 py-1 rounded-md text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50',
- next_page_class: 'px-3 py-1 rounded-md text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50' %>
-
-
-<% end %>
+ <% end %>
+
diff --git a/app/views/job_applications/edit.html.erb b/app/views/job_applications/edit.html.erb
index 565366b..839e7c2 100644
--- a/app/views/job_applications/edit.html.erb
+++ b/app/views/job_applications/edit.html.erb
@@ -1,10 +1,3 @@
<%= turbo_frame_tag dom_id(@job_application) do %>
-
-
-
Edit Job Application
-
- <%= render 'form', job_application: @job_application %>
- <%= link_to 'Back', root_path, class: 'inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800' %>
- <%= link_to 'Back to Job Applications', job_applications_path, class: 'mt-4 inline-block text-blue-500 hover:text-blue-700' %>
-
+ <%= render 'form', job_application: @job_application, title: "Edit" %>
<% end %>
diff --git a/app/views/job_applications/index.html.erb b/app/views/job_applications/index.html.erb
index dcd8ba9..b558b65 100644
--- a/app/views/job_applications/index.html.erb
+++ b/app/views/job_applications/index.html.erb
@@ -1,44 +1,57 @@
-
- <%= turbo_frame_tag "flash_messages" do %>
+<%= turbo_frame_tag "job_applications_index" do %>
+
<%= render 'flash_messages' %>
- <% end %>
-
-
- Job Tracker
-
- <%= link_to 'Add New Job Application', new_job_application_path, class: 'text-sm bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded cursor-pointer', data: { turbo_frame: "_top" } %>
- <%= form_with url: job_applications_path, method: :get, data: { controller: "job-filter", turbo_frame: "job_applications_table" } do |form| %>
-
-
- <%= 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" } %>
+
+
+
+ <%= image_tag(asset_path('apple-touch-icon.png'),
+ height: '32',
+ width: '32',
+ class: "rounded-full object-cover shadow-sm border-2 border-gray-200 mr-2",
+ aria: { label: "Job Tracker logo" },
+ title: "Job Tracker logo") %>
+
+ Job Tracker
+
-
- <%= form.select :method_of_contact,
- options_for_select([["All Contact Methods", ""]] + JobApplication.method_of_contacts.map { |k, v| [k.humanize, v] }, params[:method_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",
- data: { action: "change->job-filter#submit" }
- %>
-
-
- <%= form.select :position_type,
- options_for_select([["All Position Types", ""]] + JobApplication.position_types.map { |k, v| [k.humanize, v] }, params[:position_type]),
- {},
- class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline",
- data: { action: "change->job-filter#submit" }
- %>
+ <%= 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" } %>
+
+ <%= form_with url: job_applications_path, method: :get, data: { controller: "job-filter", turbo_frame: "job_applications_table" } do |form| %>
+
+
+ <%= form.label :search, "Search", class: "sr-only" %>
+ <%= 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" } %>
+
+
+ <%= form.label :method_of_contact, "Contact Method", class: "sr-only" %>
+ <%= form.select :method_of_contact,
+ options_for_select([["All Contact Methods", ""]] + JobApplication.method_of_contacts.map { |k, v| [k.humanize, v] }, params[:method_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",
+ data: { action: "change->job-filter#submit" }
+ %>
+
+
+ <%= form.label :position_type, "Position Type", class: "sr-only" %>
+ <%= form.select :position_type,
+ options_for_select([["All Position Types", ""]] + JobApplication.position_types.map { |k, v| [k.humanize, v] }, params[:position_type]),
+ {},
+ class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline",
+ data: { action: "change->job-filter#submit" }
+ %>
+
+
+ <%= 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" } %>
+
-
- <%= form.button "Reset Filters", type: "button", class: "w-full bg-gray-400 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded cursor-pointer", data: { action: "click->job-filter#reset" } %>
+ <% end %>
+ <%= turbo_frame_tag "job_applications_table" do %>
+ <%= render partial: "job_applications_table", locals: { job_applications: @job_applications } %>
+
-
- <% end %>
- <%= turbo_frame_tag "job_applications_table" do %>
- <%= render partial: "job_applications_table", locals: { job_applications: @job_applications } %>
-
- <% end %>
- <%= turbo_frame_tag "new_job_application" %>
-
+ <% end %>
+ <%= turbo_frame_tag "new_job_application" %>
+
+<% end %>
diff --git a/app/views/job_applications/new.html.erb b/app/views/job_applications/new.html.erb
index f667adf..f992cab 100644
--- a/app/views/job_applications/new.html.erb
+++ b/app/views/job_applications/new.html.erb
@@ -1,9 +1,3 @@
-
-
-
New Job Application
-
- <%= turbo_frame_tag "new_job_application" do %>
- <%= render 'form', job_application: @job_application %>
- <% end %>
- <%= link_to 'Back to Job Applications', job_applications_path, class: 'mt-4 inline-block text-blue-500 hover:text-blue-700' %>
-
+<%= turbo_frame_tag "new_job_application" do %>
+ <%= render 'form', job_application: @job_application, title: "New" %>
+<% end %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index a697828..9c47e3e 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -11,8 +11,7 @@
<%= vite_stylesheet_tag "application", data: {"turbo-track": "reload"} %>
-
- <%= render 'flash_messages' %>
+
<%= yield %>