Worked on layout, added model funktions, changed database

Changes to the migration file make it necessary to reimport the
database: db:drop, db:create, db:migrate, db:seed
This commit is contained in:
2024-08-01 00:27:55 +02:00
parent 40ea1910c7
commit e3d5d97c6c
9 changed files with 137 additions and 34 deletions

View File

@@ -3,19 +3,31 @@
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<% content_for :title, "Jobs" %>
<% content_for :title, "Current Print Jobs" %>
<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Jobs</h1>
<%= link_to "New job", new_job_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
<div class="flex justify-between items-center py-4">
<h1 class="font-bold text-4xl">Plottaufträge am <%= Date.today.strftime("%d.%m.%Y") %></h1>
<%= link_to "Plottauftrag aufgeben", new_job_path, class: "py-3 px-5 bg-hsrm-red drop-shadow-lg transition-colors duration-100 hover:bg-hsrm-red-light text-white block font-medium" %>
</div>
<div id="jobs" class="min-w-full">
<% @jobs.each do |job| %>
<%= render job %>
<p>
<%= link_to "Show this job", job, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
</p>
<% end %>
<div id="jobs" class="min-w-full drop-shadow-lg">
<table class="w-full">
<thead class="bg-gray-200 border-b-2 border-gray-400">
<tr>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> ID </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> Name </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> PDF </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> A0 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> A1 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> A2 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> A3 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> Status </th>
</tr>
</thead>
<tbody>
<%= render partial: "job_tr", collection: @jobs, as: :job %>
<%#= link_to "Show this job", job, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
</tbody>
</table>
</div>
</div>