Files
plottservice/app/views/operator/jobs/index.html.erb

182 lines
9.8 KiB
Plaintext

<%= turbo_stream_from 'operator_jobs' %>
<% content_for :title, "Current Print Jobs" %>
<div class="flex space-x-4">
<%= link_to "#openjobs-h" do %>
<div class="flex-1 bg-status-open-light bg-opacity-50 text-status-open w-72 min-h-28 shadow-lg ">
<h3 class="p-5 text-4xl">
<%= icon("inbox-stack", class: "text-status-paid size-10 inline drop-shadow") %>
Open
<span class="text-right block"><%= @openjobs.count %></span>
</h3>
</div>
<% end %>
<%= link_to "#printingjobs-h" do %>
<div class="flex-1 bg-status-printing-light bg-opacity-50 text-status-printing w-72 min-h-28 shadow-lg">
<h3 class="p-5 text-4xl">
<%= icon("printer", class: "text-status-paid size-10 inline drop-shadow") %>
Printing
<span class="text-right block"><%= @printingjobs.count %></span>
</h3>
</div>
<% end %>
<%= link_to "#pickupjobs-h" do %>
<div class="flex-1 bg-status-pickup-light bg-opacity-50 text-status-pickup w-72 min-h-28 shadow-lg">
<h3 class="p-5 text-4xl">
<%= icon("arrow-up-tray", class: "text-status-paid size-10 inline drop-shadow") %>
Pickup
<span class="text-right block"><%= @pickupjobs.count %></span>
</h3>
</div>
<% end %>
<%= link_to "#paidcanceledjobs-h" do %>
<div class="flex-1 bg-status-paid-light bg-opacity-50 text-status-paid w-72 min-h-28 shadow-lg">
<h3 class="p-5 text-4xl">
<%= icon("banknotes", class: "text-status-paid size-10 inline drop-shadow") %>
Paid
<span class="text-right block"><%= @paidjobs.count %></span>
</h3>
</div>
<% end %>
<%= link_to "#paidcanceledjobs-h" do %>
<div class="flex-1 bg-status-canceled-light bg-opacity-50 text-status-canceled w-72 min-h-28 shadow-lg">
<h3 class="p-5 text-4xl">
<%= icon("x-circle", class: "text-status-paid size-10 inline drop-shadow") %>
Canceled
<span class="text-right block"><%= @canceledjobs.count %></span>
</h3>
</div>
<% end %>
</div>
<div class="w-full">
<div class="flex justify-between items-center py-4">
<h1 class="font-bold text-hsrm-gray text-4xl">
Printing
</h1>
<% if @openjobs.any? %>
<%= button_to icon("printer",
class: "text-hsrm-gray size-6 inline drop-shadow hover:text-opacity-75 mr-2",
title: "Drucken") + "Start next job (" + @openjobs.count.to_s + ")", operator_job_path(@openjobs.first),
params: { :job => { status: :printing} },
method: :patch,
form_class: "inline px-3 py-2 font-semibold bg-green-500 hover:opacity-90 shadow-lg transition-colors duration-100 bg-opacity-100 flex items-center group text-hsrm-gray" %>
<% else %>
<span class="px-3 py-2 font-semibold bg-gray-300 shadow-lg transition-colors duration-100 bg-opacity-100 flex items-center group text-white">
<%= icon("printer", class: "text-hsrm-gray text-opacity-25 size-6 inline drop-shadow mr-2", title: "") %>
Start next job
</span>
<% end %>
</div>
<%# render partial: "job_card", collection: @printingjobs, as: :job %>
<div id="printingjobs-h" class="overflow-auto min-w-full shadow-lg">
<table class="w-full py-8 table-auto">
<thead class="bg-gray-200 text-hsrm-gray border-b-2 border-gray-300">
<tr>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> ID </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Vorschau </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> Auftraggeber </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-center w-1"> A0 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> A1 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> A2 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> A3 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1 text-nowrap"> no DIN </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Kosten </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Status </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-40">Action</th>
</tr>
</thead>
<tbody id='printingjobs' class="divide-y divivde-gray-300">
<%= render partial: "job_tr", collection: @printingjobs, 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 class="flex justify-between items-center py-4">
<h1 class="font-bold text-hsrm-gray text-4xl">
Pickup
</h1>
</div>
<div id="pickupjobs-h" class="overflow-auto min-w-full shadow-lg">
<table class="w-full py-8 table-auto">
<thead class="bg-gray-200 text-hsrm-gray border-b-2 border-gray-300">
<tr>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> ID </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Vorschau </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> Auftraggeber </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 w-1"> A0 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A1 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A2 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A3 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1 text-nowrap"> no DIN </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Kosten </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Status </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1">Action</th>
</tr>
</thead>
<tbody id='pickupjobs' class="divide-y divivde-gray-300">
<%= render partial: "job_tr", collection: @pickupjobs, 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 class="flex justify-between items-center py-4">
<h1 class="font-bold text-hsrm-gray text-4xl">
open
</h1>
</div>
<div id="openjobs-h" class="overflow-auto min-w-full shadow-lg">
<table class="w-full py-8 table-auto">
<thead class="bg-gray-200 text-hsrm-gray border-b-2 border-gray-300">
<tr>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> ID </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Vorschau </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> Auftraggeber </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 w-1"> A0 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A1 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A2 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A3 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1 text-nowrap"> no DIN </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Kosten </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Status </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1">Action</th>
</tr>
</thead>
<tbody id='openjobs' class="divide-y divivde-gray-300">
<%= render partial: "job_tr", collection: @openjobs, 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 class="flex justify-between items-center py-4">
<h1 class="font-bold text-hsrm-gray text-4xl">
Paid/Canceled
</h1>
</div>
<div id="paidcanceledjobs-h" class="overflow-auto min-w-full shadow-lg">
<table class="w-full py-8 table-auto">
<thead class="bg-gray-200 text-hsrm-gray border-b-2 border-gray-300">
<tr>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> ID </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Vorschau </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left"> Auftraggeber </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 w-1"> A0 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A1 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A2 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-left w-1"> A3 </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1 text-nowrap"> no DIN </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Kosten </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"> Status </th>
<th class="p-3 text-sm font-semibold tracking-wide text-center w-1"></th>
</tr>
</thead>
<tbody id='paidcanceledjobs' class="divide-y divivde-gray-300">
<%= render partial: "job_tr", collection: @paidcanceledjobs, 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>