Implemented status changes operator index
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
</td>
|
||||
<td class="p-3 text-sm text-hsrm-gray whitespace-nowrap">
|
||||
<% if job.pdf.attached? %>
|
||||
<%= 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 %>
|
||||
<%#= link_to job.pdf.filename, rails_blob_path(job.pdf, disposition: "attachment") %>
|
||||
<%= link_to_if job.printing?, 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">
|
||||
@@ -58,24 +59,29 @@
|
||||
</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" %>
|
||||
<% if job.printing? || job.canceled? || job.paid? %>
|
||||
<%= button_to icon("inbox-stack", class: "text-hsrm-gray size-6 inline drop-shadow hover:text-opacity-75", title: "Zurück in die Warteschlange"), operator_job_path(job), method: :patch, params: {:job => {status: :open}}, form_class: "inline" %>
|
||||
<% else %>
|
||||
<%= icon("inbox-stack", class: "text-hsrm-gray text-opacity-25 size-6 inline drop-shadow", title: "") %>
|
||||
<% end %>
|
||||
<% if job.open? || job.canceled? || job.paid? %>
|
||||
<%= button_to icon("printer", class: "text-hsrm-gray size-6 inline drop-shadow hover:text-opacity-75", title: "Drucken"), operator_job_path(job), method: :patch, params: {:job => {status: :printing}}, 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" %>
|
||||
<% if job.printing? || job.paid? %>
|
||||
<%= button_to icon("arrow-up-tray", class: "text-hsrm-gray size-6 inline drop-shadow hover:text-opacity-75", title: "Pläne sind fertig gedruckt und bereit abgeholt zu werden."), operator_job_path(job), method: :patch, params: {:job => {status: :pickup}}, 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") %>
|
||||
<%= icon("arrow-up-tray", class: "text-hsrm-gray text-opacity-25 size-6 inline drop-shadow", title: "") %>
|
||||
<% 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" %>
|
||||
<% if job.pickup? || job.printing? %>
|
||||
<% job.printing? && turbo_confirm = 'Sind die Pläne gedruckt und die Seitenanzahl und QM korrekt?' %>
|
||||
<%= button_to icon("banknotes", class: "text-status-paid size-6 inline drop-shadow hover:text-opacity-75", title: "Bezahlt"), operator_job_path(job), method: :patch, params: {:job => {status: :paid}}, form: {data: {turbo_confirm: turbo_confirm}}, 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" %>
|
||||
<%= button_to icon("x-circle", class: "text-hsrm-red size-6 inline drop-shadow hover:text-opacity-75", title: "Abbrechen"), operator_job_path(job), method: :patch, params: {:job => {status: :canceled}}, 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 %>
|
||||
|
||||
Reference in New Issue
Block a user