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:
23
app/views/jobs/_job_tr.html.erb
Normal file
23
app/views/jobs/_job_tr.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
<tr id="<%= dom_id job %>" class="<%= cycle('bg-gray-50','bg-gray-200') %> ">
|
||||
<td class="p-3 text-sm text-gray-900"> <%= job.id %> </td>
|
||||
<td class="p-3 text-sm text-gray-900"> <%= job.fullname %> </td>
|
||||
<td class="p-3 text-sm text-gray-900"> <%= job.pdf %> </td>
|
||||
<td class="p-3 text-sm text-gray-900"> <%= job.number_of_plans_a0 %> </td>
|
||||
<td class="p-3 text-sm text-gray-900"> <%= job.number_of_plans_a1 %> </td>
|
||||
<td class="p-3 text-sm text-gray-900"> <%= job.number_of_plans_a2 %> </td>
|
||||
<td class="p-3 text-sm text-gray-900"> <%= job.number_of_plans_a3 %> </td>
|
||||
<td class="p-3 text-sm text-gray-900">
|
||||
<% case job.status.to_sym %>
|
||||
<% when :open %>
|
||||
<span class="p-1.5 text-xs font-medium upercase tracking-wieder text-gray-900 bg-gray-300 rounded-lg"> <%= job.status %> </span>
|
||||
<% when :printing %>
|
||||
<span class="p-1.5 text-xs font-medium upercase tracking-wieder text-yellow-900 bg-yellow-300 rounded-lg"> <%= job.status %> </span>
|
||||
<% when :ready_for_pickup %>
|
||||
<span class="p-1.5 text-xs font-medium upercase tracking-wieder text-orange-900 bg-orange-300 rounded-lg"> <%= job.status %> </span>
|
||||
<% when :paid %>
|
||||
<span class="p-1.5 text-xs font-medium upercase tracking-wieder text-green-900 bg-green-300 rounded-lg"> <%= job.status %> </span>
|
||||
<% when :cancelled %>
|
||||
<span class="p-1.5 text-xs font-medium upercase tracking-wieder text-red-900 bg-red-300 rounded-lg"> <%= job.status %> </span>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user