Skip to content

Commit a34d4b7

Browse files
committed
fit the whole table in the viewport
1 parent b202886 commit a34d4b7

File tree

5 files changed

+42
-33
lines changed

5 files changed

+42
-33
lines changed

app/frontend/stylesheets/index.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,11 @@ body {
2424
background-position: center;
2525
background-attachment: fixed;
2626
}
27+
28+
td {
29+
font-size: 12px !important;
30+
}
31+
32+
th {
33+
font-size: 12px !important;
34+
}

app/views/job_applications/_job_application.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
safe_url(job_application.website_link),
2727
target: "_blank",
2828
rel: "noopener noreferrer",
29-
class: "px-3 py-1 rounded-md text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50",
29+
class: "px-3 py-1 rounded-md text-xs text-gray-700 bg-white border border-gray-300 hover:bg-gray-50",
3030
title: "Visit Website" %>
3131
<% end %>
3232
</td>
3333
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
3434
<div class="flex justify-start items-center">
35-
<%= 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" %>
36-
<%= 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" %>
35+
<%= 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" %>
36+
<%= 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" %>
3737
</div>
3838
</td>
3939
</tr>

app/views/job_applications/_job_applications_table.html.erb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22
<div class="overflow-x-auto bg-white shadow-md rounded-lg">
33
<% if @job_applications.any? %>
44
<table class="min-w-full leading-normal">
5-
<thead>
5+
<thead class="text-xs">
66
<tr>
77
<tr>
8-
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
9-
<%= sort_link_to 'Applied', 'date_applied' %>
8+
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left font-semibold text-gray-600 tracking-wider">
9+
<%= sort_link_to 'Date Applied', 'date_applied' %>
1010
</th>
11-
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
12-
<%= sort_link_to 'Company', 'company_name' %>
11+
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left font-semibold text-gray-600 tracking-wider">
12+
<%= sort_link_to 'Company Name', 'company_name' %>
1313
</th>
14-
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
14+
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left font-semibold text-gray-600 tracking-wider">
1515
<%= sort_link_to 'Position', 'position_title' %>
1616
</th>
17-
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
17+
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left font-semibold text-gray-600 tracking-wider">
1818
Type
1919
</th>
20-
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
20+
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left font-semibold text-gray-600 tracking-wider">
2121
Contact Method
2222
</th>
23-
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
23+
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left font-semibold text-gray-600 tracking-wider">
2424
P.o.C.
2525
</th>
26-
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
26+
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left font-semibold text-gray-600 tracking-wider">
2727
Email
2828
</th>
29-
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
29+
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left font-semibold text-gray-600 tracking-wider">
3030
Website
3131
</th>
32-
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
32+
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left font-semibold text-gray-600 tracking-wider">
3333
Actions
3434
</th>
3535
</tr>
Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
<% if @pagination_info[:total_pages] > 1 %>
2-
<div class="flex items-center justify-between border-t border-gray-200 bg-white px-4 py-3 sm:px-6 shadow appearance-none border rounded w-full text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
3-
<div class="text-sm text-gray-700">
4-
Showing <span class="font-medium"><%= @pagination_info[:offset] + 1 %></span> to <span class="font-medium"><%= [@pagination_info[:offset] + @pagination_info[:length], @job_application_count].min %></span> of <span class="font-medium"><%= @job_application_count %></span> results
1+
<div class="fixed bottom-0 left-0 w-full z-50">
2+
<% if @pagination_info[:total_pages] > 1 %>
3+
<div class="flex items-center justify-between border-t border-gray-200 bg-white px-4 py-3 sm:px-6 shadow appearance-none rounded w-full text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
4+
<div class="text-sm text-gray-700">
5+
</div>
6+
<div>
7+
<%= will_paginate @job_applications,
8+
renderer: CustomPaginationRenderer,
9+
previous_label: 'Previous',
10+
next_label: 'Next',
11+
inner_window: 0,
12+
outer_window: 0,
13+
class: 'pagination',
14+
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',
15+
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' %>
16+
</div>
517
</div>
6-
<div>
7-
<%= will_paginate @job_applications,
8-
renderer: CustomPaginationRenderer,
9-
previous_label: 'Previous',
10-
next_label: 'Next',
11-
inner_window: 0,
12-
outer_window: 0,
13-
class: 'pagination',
14-
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',
15-
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' %>
16-
</div>
17-
</div>
18-
<% end %>
18+
<% end %>
19+
</div>

app/views/layouts/application.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<%= vite_stylesheet_tag "application", data: {"turbo-track": "reload"} %>
1212
</head>
1313
<body class="bg-gray-100">
14-
<div class="container mx-auto px-4 py-8">
14+
<div class="container mx-auto px-4 py-4">
1515
<%= render 'flash_messages' %>
1616
<%= yield %>
1717
</div>

0 commit comments

Comments
 (0)