Refactored stylesheet

This commit is contained in:
2024-08-15 02:07:11 +02:00
parent 241c5019c0
commit 32be24bca9
6 changed files with 162 additions and 139 deletions

View File

@@ -1,63 +1,63 @@
<tr id="<%= dom_id job %>" class="bg-status-<%= job.status %>-light odd:bg-opacity-20 even:bg-opacity-15">
<td class="p-3 text-hsrm-gray whitespace-nowrap">
<span class="p-1.5 text-lg font-bold uppercase tracking-wider bg-opacity-50 text-status-<%= job.status %> bg-status-<%= job.status %>-light rounded-lg shadow">
<tr id="<%= dom_id job %>" class="bg-status-<%= job.status %>-light odd:bg-opacity-20 even:bg-opacity-15 text-hsrm-gray whitespace-nowrap">
<td class="p-2 py-3 text-center">
<span class="badge badge-xl text-status-<%= job.status %> bg-status-<%= job.status %>-light rounded-lg shadow">
<%= job.id %>
</span>
</td>
<td class="p-3 text-center text-hsrm-gray">
<td class="p-2 py-3 text-center">
<% if job.pdf.attached? %>
<%= image_tag(url_for(job.pdf.blob.preview(resize_to_limit: [100, 100])), class: "shadow") %>
<%#= image_tag job.pdf.preview(resize_to_limit: [50, 50]), class: "mx-auto" %>
<% end %>
</td>
<td class="p-3 text-hsrm-gray whitespace-nowrap">
<td class="p-2 py-3">
<%= job.costumer_fullname %>
</td>
<td class="p-3 text-hsrm-gray whitespace-nowrap">
<td class="p-2 py-3">
<% if job.pdf.attached? %>
<%= truncate(job.pdf.filename.to_s, length: 45) %>
<% end %>
</td>
<td class="p-3 text-left text-hsrm-gray whitespace-nowrap">
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg shadow">
<td class="p-1 py-3">
<span class="badge">
<%= job.number_of_plans_a0 %>
</span>
</td>
<td class="p-3 text-left text-hsrm-gray whitespace-nowrap">
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg shadow">
<td class="p-1 py-3">
<span class="badge">
<%= job.number_of_plans_a1 %>
</span>
</td>
<td class="p-3 text-left text-hsrm-gray whitespace-nowrap">
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg shadow">
<td class="p-1 py-3">
<span class="badge">
<%= job.number_of_plans_a2 %>
</span>
</td>
<td class="p-3 text-left text-hsrm-gray whitespace-nowrap">
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg shadow">
<td class="p-1 py-3">
<span class="badge">
<%= job.number_of_plans_a3 %>
</span>
</td>
<td class="p-3 text-right text-hsrm-gray whitespace-nowrap">
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg shadow">
<td class="p-2 py-3 text-right">
<span class="badge">
<%= job.costum_qm_plan.round(2) %> m²
</span>
</td>
<td class="p-3 text-right text-hsrm-gray whitespace-nowrap">
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg shadow">
<td class="p-2 py-3 text-right">
<span class="badge">
<%= job.cost.round(2) %> €
</span>
</td>
<td class="p-3 text-left text-hsrm-gray whitespace-nowrap">
<span class="p-1.5 block text-xs font-medium uppercase tracking-wider bg-opacity-50 w-20 text-center text-status-<%= job.status.to_sym %> bg-status-<%= job.status %>-light rounded-lg shadow">
<td class="p-2 py-3">
<span class="badge badge-status text-status-<%= job.status.to_sym %> bg-status-<%= job.status %>-light ">
<%= job.status %>
</span>
</td>
<td class="p-3 text-right text-hsrm-gray whitespace-nowrap">
<td class="p-2 py-3 text-right">
<% if job.open? %>
<%= button_to icon("x-circle", class: "text-hsrm-red size-8 inline", title: "Abbrechen"), cancel_job_path(job), method: :patch, form: {data: {turbo_confirm: 'Den Plottauftrag wirklich abbrechen?'}}, form_class: "inline" %>
<%= button_to icon("x-circle", class: "icon size-10 text-hsrm-red", title: "Abbrechen"), cancel_job_path(job), method: :patch, form: {data: {turbo_confirm: 'Den Plottauftrag wirklich abbrechen?'}}, form_class: "inline" %>
<% else %>
<%= icon("x-circle", class: "text-hsrm-gray text-opacity-50 size-8 inline drop-shadow", title: "Kann nicht mehr abgebrochen werden") %>
<%= icon("x-circle", class: "icon icon-disabled size-10", title: "Kann nicht mehr abgebrochen werden") %>
<% end %>
</td>
</tr>

View File

@@ -2,26 +2,26 @@
<div class="w-full">
<%#= render partial: 'layouts/flash' %>
<% content_for :title, "Current Print Jobs" %>
<div class="flex justify-between items-center py-4">
<h1 class="font-bold text-hsrm-gray text-4xl">Aktuelle Plottaufträge <span class="font-semibold text-sm"><%= Date.today.strftime("%d.%m.%Y") %></span></h1>
<div class="flex items-center justify-between py-4">
<h1 class="text-4xl font-bold text-hsrm-gray">Aktuelle Plottaufträge <span class="text-sm font-semibold"><%= Date.today.strftime("%d.%m.%Y") %></span></h1>
<%= link_to "Plottauftrag aufgeben", new_job_path, class: "px-3 py-2 bg-hsrm-red drop-shadow-lg transition-colors hover:bg-hsrm-red-light text-white block font-medium" %>
</div>
<div class="min-w-full overflow-auto shadow-lg">
<table class="w-full py-8 table-auto">
<thead class="font-semibold tracking-wide bg-gray-200 border-b-2 border-gray-300 text text-hsrm-gray">
<tr>
<th class="w-1 p-3 text-center"> ID </th>
<th class="w-1 p-3 text-center"> Vorschau </th>
<th class="p-3 text-left"> Auftraggeber </th>
<th class="p-3 text-left"> PDF </th>
<th class="w-1 p-3 text-left"> A0 </th>
<th class="w-1 p-3 text-left"> A1 </th>
<th class="w-1 p-3 text-left"> A2 </th>
<th class="w-1 p-3 text-left"> A3 </th>
<th class="w-1 p-3 text-center text-nowrap"> no DIN </th>
<th class="w-1 p-3 text-center"> Kosten </th>
<th class="w-1 p-3 text-center"> Status </th>
<th class="w-1 p-3 text-center">Action</th>
<th class="w-1 p-2 py-3 text-center"> ID </th>
<th class="w-1 p-2 py-3 text-center"> Vorschau </th>
<th class="w-1 p-2 py-3 text-left"> Auftraggeber </th>
<th class="p-2 py-3 text-left"> PDF </th>
<th class="w-1 p-1 py-3 text-left"> A0 </th>
<th class="w-1 p-1 py-3 text-left"> A1 </th>
<th class="w-1 p-1 py-3 text-left"> A2 </th>
<th class="w-1 p-1 py-3 text-left"> A3 </th>
<th class="w-1 p-2 py-3 text-center text-nowrap"> no DIN </th>
<th class="w-1 p-2 py-3 text-center"> Kosten </th>
<th class="w-1 p-2 py-3 text-center"> Status </th>
<th class="w-1 p-2 py-3 text-center">Action</th>
</tr>
</thead>
<tbody id='jobs' class="divide-y divivde-gray-300">