Files
plottservice/app/views/jobs/_job_tr.html.erb
2024-08-11 12:25:51 +02:00

36 lines
2.9 KiB
Plaintext

<tr id="<%= dom_id job %>" class="odd:bg-gray-50 even:bg-gray-100">
<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"> <%= job.costumer_fullname %> </td>
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap w-6">
<% if job.pdf.attached? %>
<%= image_tag url_for(job.pdf.preview(resize_to_limit: [100, 100])) %>
<% end %>
</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 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"><span class="p-1.5 bg-gray-300 bg-opacity-50 font-medium rounded-lg"><%= job.number_of_plans_a0 %></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_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">
<%= link_to icon("pencil-square", class: "size-5 inline"), edit_job_path(job), classe: "p-1.5 ml-2 rounded-lg bg-gray-300 bg-opacity-50 font-medium" %>
<% if job.able_to_cancel? %>
<%= button_to icon("x-circle", class: "text-hsrm-red size-5 inline"), 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-5 inline") %>
<% end %>
</td>
</tr>