95 lines
5.3 KiB
Plaintext
95 lines
5.3 KiB
Plaintext
<tr id="<%= dom_id job %>" class="bg-status-<%= job.status %>-light odd:bg-opacity-20 even:bg-opacity-10">
|
|
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap">
|
|
<span class="p-1.5 text-xs font-medium uppercase tracking-wider bg-opacity-50 text-status-<%= job.status %> bg-status-<%= job.status %>-light rounded-lg">
|
|
<%= job.id %>
|
|
</span>
|
|
</td>
|
|
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap w-6">
|
|
<% if job.pdf.attached? %>
|
|
<%= link_to_if job.printing?, image_tag(url_for(job.pdf.preview(resize_to_limit: [100, 100]))), job.pdf, download:true, class: "shadow-lg" %>
|
|
<!--<iframe src=<%= url_for(job.pdf) %> width="500" height="700" style="border: none;"></iframe>-->
|
|
<% end %>
|
|
</td>
|
|
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap">
|
|
<%= job.costumer_fullname %>
|
|
</td>
|
|
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap">
|
|
<% if job.pdf.attached? %>
|
|
<%#= link_to job.pdf.filename, rails_blob_path(job.pdf, disposition: "attachment") %>
|
|
<%= link_to job.pdf.filename, job.pdf, download:true %>
|
|
<span class="p-1.5 bg-gray-300 bg-opacity-50 text-hsrm-gray font-medium rounded-lg ml-2">
|
|
<%=number_to_human_size job.pdf.blob.byte_size%>
|
|
</span>
|
|
<% end %>
|
|
</td>
|
|
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap">
|
|
<% if job.printing? %>
|
|
<span class="p-1 bg-gray-300 bg-opacity-50 font-medium rounded-lg inline-block">
|
|
<%= button_to icon("chevron-up", class: "size-5 inline", title: "erhöhen"), operator_job_path(job), method: :patch, form_class: "inline" %>
|
|
</span>
|
|
<% end %>
|
|
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg text-center">
|
|
<%= job.number_of_plans_a0 %>
|
|
</span>
|
|
<% if job.printing? %>
|
|
<span class="p-1 bg-gray-300 bg-opacity-50 font-medium rounded-lg inline-block">
|
|
<%= button_to icon("chevron-down", class: "size-5 inline", title: "verringern"), operator_job_path(job), method: :patch, form_class: "inline" %>
|
|
</span>
|
|
<% end %>
|
|
</td>
|
|
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap">
|
|
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg">
|
|
<%= job.number_of_plans_a1 %>
|
|
</span>
|
|
</td>
|
|
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap">
|
|
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg">
|
|
<%= job.number_of_plans_a2 %>
|
|
</span>
|
|
</td>
|
|
<td class="p-3 text-sm text-left text-hsrm-gray whitespace-nowrap">
|
|
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg">
|
|
<%= job.number_of_plans_a3 %>
|
|
</span>
|
|
</td>
|
|
<td class="p-3 text-sm text-right text-hsrm-gray whitespace-nowrap">
|
|
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg">
|
|
<%= job.costum_qm_plan.round(2) %> m²
|
|
</span>
|
|
</td>
|
|
<td class="p-3 text-sm text-right text-hsrm-gray whitespace-nowrap">
|
|
<span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg">
|
|
<%= job.cost.round(2) %> €
|
|
</span>
|
|
</td>
|
|
<td class="p-3 text-sm 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">
|
|
<%= job.status %>
|
|
</span>
|
|
</td>
|
|
<td class="p-3 text-sm text-right text-hsrm-gray whitespace-nowrap">
|
|
<!-- TODO: move logic to model -->
|
|
<% if job.open? %>
|
|
<%= button_to icon("printer", class: "text-hsrm-gray size-6 inline drop-shadow hover:text-opacity-75", title: "Drucken"), printing_operator_job_path(job), method: :patch, form_class: "inline" %>
|
|
<% else %>
|
|
<%= icon("printer", class: "text-hsrm-gray text-opacity-25 size-6 inline drop-shadow", title: "") %>
|
|
<% end %>
|
|
<%= link_to_if job.printing?, icon("document-arrow-down", class: "text-hsrm-gray #{ unless job.printing?; 'text-opacity-25' else; 'hover:text-opacity-75'; end} size-6 inline", title: "Download"), job.pdf, download:true %>
|
|
<% if job.printing? %>
|
|
<%= button_to icon("check-circle", class: "text-green-700 size-6 inline drop-shadow hover:text-opacity-75", title: "Pläne sind fertig gedruckt"), pickup_operator_job_path(job), method: :patch, form: {data: {turbo_confirm: 'Sind die Pläne gedruckt und die Seitenanzahl und QM korrekt?'}}, form_class: "inline" %>
|
|
<% else %>
|
|
<%= icon("check-circle", class: "text-hsrm-gray text-opacity-25 size-6 inline drop-shadow", title: "Kann nicht mehr abgebrochen werden") %>
|
|
<% end %>
|
|
<% if job.pickup? %>
|
|
<%= button_to icon("banknotes", class: "text-status-paid size-6 inline drop-shadow hover:text-opacity-75", title: "Bezahlt"), paid_operator_job_path(job), method: :patch, form_class: "inline" %>
|
|
<% else %>
|
|
<%= icon("banknotes", class: "text-hsrm-gray text-opacity-25 size-6 inline drop-shadow ", title: "") %>
|
|
<% end %>
|
|
<% if job.open? || job.printing? || job.pickup? %>
|
|
<%= button_to icon("x-circle", class: "text-hsrm-red size-6 inline drop-shadow hover:text-opacity-75", title: "Abbrechen"), cancel_operator_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-25 size-6 inline drop-shadow", title: "Kann nicht mehr abgebrochen werden") %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|