Files
plottservice/app/views/jobs/_job_tr.html.erb
2024-08-15 02:07:11 +02:00

64 lines
2.0 KiB
Plaintext

<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-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-2 py-3">
<%= job.costumer_fullname %>
</td>
<td class="p-2 py-3">
<% if job.pdf.attached? %>
<%= truncate(job.pdf.filename.to_s, length: 45) %>
<% end %>
</td>
<td class="p-1 py-3">
<span class="badge">
<%= job.number_of_plans_a0 %>
</span>
</td>
<td class="p-1 py-3">
<span class="badge">
<%= job.number_of_plans_a1 %>
</span>
</td>
<td class="p-1 py-3">
<span class="badge">
<%= job.number_of_plans_a2 %>
</span>
</td>
<td class="p-1 py-3">
<span class="badge">
<%= job.number_of_plans_a3 %>
</span>
</td>
<td class="p-2 py-3 text-right">
<span class="badge">
<%= job.costum_qm_plan.round(2) %> m²
</span>
</td>
<td class="p-2 py-3 text-right">
<span class="badge">
<%= job.cost.round(2) %> €
</span>
</td>
<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-2 py-3 text-right">
<% if job.open? %>
<%= 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: "icon icon-disabled size-10", title: "Kann nicht mehr abgebrochen werden") %>
<% end %>
</td>
</tr>