From 241c5019c0649b026cd707a54139efecbd670b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=B6hm?= Date: Wed, 14 Aug 2024 19:56:41 +0200 Subject: [PATCH] Some layout improvements --- app/views/jobs/_job_tr.html.erb | 46 +++---- app/views/jobs/index.html.erb | 28 ++-- app/views/layouts/application.html.erb | 2 +- app/views/operator/jobs/_job_tr.html.erb | 36 +++--- app/views/operator/jobs/index.html.erb | 156 ++++++++++++----------- 5 files changed, 135 insertions(+), 133 deletions(-) diff --git a/app/views/jobs/_job_tr.html.erb b/app/views/jobs/_job_tr.html.erb index 75e30a8..19bf5c4 100644 --- a/app/views/jobs/_job_tr.html.erb +++ b/app/views/jobs/_job_tr.html.erb @@ -1,63 +1,63 @@ - - + + <%= job.id %> - + <% if job.pdf.attached? %> - <%= image_tag(url_for(job.pdf.blob.preview(resize_to_limit: [100, 100]))) %> + <%= 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 %> - + <%= job.costumer_fullname %> - + <% if job.pdf.attached? %> - <%= job.pdf.filename %> + <%= truncate(job.pdf.filename.to_s, length: 45) %> <% end %> - - + + <%= job.number_of_plans_a0 %> - - + + <%= job.number_of_plans_a1 %> - - + + <%= job.number_of_plans_a2 %> - - + + <%= job.number_of_plans_a3 %> - - + + <%= job.costum_qm_plan.round(2) %> m² - - + + <%= job.cost.round(2) %> € - - + + <%= job.status %> - + <% if job.open? %> <%= button_to icon("x-circle", class: "text-hsrm-red size-8 inline", title: "Abbrechen"), 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-8 inline", title: "Kann nicht mehr abgebrochen werden") %> + <%= icon("x-circle", class: "text-hsrm-gray text-opacity-50 size-8 inline drop-shadow", title: "Kann nicht mehr abgebrochen werden") %> <% end %> diff --git a/app/views/jobs/index.html.erb b/app/views/jobs/index.html.erb index 56972f7..b66c12f 100644 --- a/app/views/jobs/index.html.erb +++ b/app/views/jobs/index.html.erb @@ -6,22 +6,22 @@

Aktuelle Plottaufträge <%= Date.today.strftime("%d.%m.%Y") %>

<%= link_to "Plottauftrag aufgeben", new_job_path, class: "px-3 py-2 bg-hsrm-red drop-shadow-lg transition-colors hover:bg-hsrm-red-light text-white block font-medium" %> -
+
- + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ab3c067..e2ecc78 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -13,7 +13,7 @@ <%= render "layouts/flash" %>
- Plottservice Fachbereich AB + Plottservice Fachbereich AB
- - - - <% Job::AVAILABLE_PAGE_FORMATS.each do |din| %> - <% end %> - - - -
ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status Action
- + + <%= job.id %> + <% if job.pdf.attached? %> - <%= link_to_if job.printing?, image_tag(url_for(job.pdf.preview(resize_to_limit: [100, 100]))), job.pdf, target: "_blank", class: "shadow-lg" %> + <%= link_to_if job.printing?, image_tag(url_for(job.pdf.preview(resize_to_limit: [100, 100])), class:"shadow-lg"), job.pdf, target: "_blank" %> <% end %> + <%= job.costumer_fullname %> + <% 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 %> + <%= link_to_if job.printing?, truncate(job.pdf.filename.to_s, length: 45), job.pdf, download:true %> <%=number_to_human_size job.pdf.blob.byte_size%> <% end %> + <% if job.printing? %>
- + <%= button_to icon("chevron-up", class: "size-5 inline", title: "erhöhen"), increment_page_operator_job_path(job, din:), method: :patch, form_class: "inline" %> <% end %> - + <%= job.public_send("number_of_plans_#{din}") if job.respond_to? "number_of_plans_#{din}" %> <% if job.printing? %> - + <%= button_to icon("chevron-down", class: "size-5 inline", title: "verringern"), decrement_page_operator_job_path(job, din:), method: :patch, form_class: "inline" %>
<% end %>
- + + <%= job.costum_qm_plan.round(2) %> m² - + + <%= job.cost.round(2) %> € - + + <%= job.status %> + <% 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" %> diff --git a/app/views/operator/jobs/index.html.erb b/app/views/operator/jobs/index.html.erb index 76163a4..3a4dc87 100644 --- a/app/views/operator/jobs/index.html.erb +++ b/app/views/operator/jobs/index.html.erb @@ -1,46 +1,48 @@ <%= turbo_stream_from 'operator_jobs' %> <% content_for :title, "Current Print Jobs" %> -
- <%= link_to "#openjobs-h" do %> -
-

- <%= icon("inbox-stack", class: "text-status-open size-10 inline drop-shadow") %> +
+
+
+ <%= link_to "#openjobs-h", class: "flex-1" do %> +
+

+ <%= icon("inbox-stack", class: "text-status-open size-8 inline drop-shadow -translate-y-1") %> Open <%= @openjobs.count %>

<% end %> - <%= link_to "#printingjobs-h" do %> -
-

- <%= icon("printer", class: "text-status-printing size-10 inline drop-shadow") %> + <%= link_to "#printingjobs-h", class: "flex-1" do %> +
+

+ <%= icon("printer", class: "text-status-printing size-8 inline drop-shadow -translate-y-1") %> Printing <%= @printingjobs.count %>

<% end %> - <%= link_to "#pickupjobs-h" do %> -
-

- <%= icon("arrow-up-tray", class: "text-status-pickup size-10 inline drop-shadow") %> + <%= link_to "#pickupjobs-h", class: "flex-1" do %> +
+

+ <%= icon("arrow-up-tray", class: "text-status-pickup size-8 inline drop-shadow -translate-y-1") %> Pickup <%= @pickupjobs.count %>

<% end %> - <%= link_to "#paidcanceledjobs-h" do %> -
-

- <%= icon("banknotes", class: "text-status-paid size-10 inline drop-shadow") %> + <%= link_to "#paidcanceledjobs-h", class: "flex-1" do %> +
+

+ <%= icon("banknotes", class: "text-status-paid size-8 inline drop-shadow -translate-y-1") %> Paid <%= @paidjobs.count %>

<% end %> - <%= link_to "#paidcanceledjobs-h" do %> -
-

- <%= icon("x-circle", class: "text-status-canceled size-10 inline drop-shadow") %> + <%= link_to "#paidcanceledjobs-h", class: "flex-1" do %> +
+

+ <%= icon("x-circle", class: "text-status-canceled size-8 inline drop-shadow -translate-y-1") %> Canceled <%= @canceledjobs.count %>

@@ -49,7 +51,7 @@
-

+

Printing

<% if @openjobs.any? %> @@ -69,20 +71,20 @@ <%# render partial: "job_card", collection: @printingjobs, as: :job %>
- + - - - - - - - - - - - - + + + + + + + + + + + + @@ -92,26 +94,26 @@
ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status Action ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status Action
-

+

Pickup

- + - - - - - - - - - - - - + + + + + + + + + + + + @@ -121,26 +123,26 @@
ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status Action ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status Action
-

+

Open

- + - - - - - - - - - - - - + + + + + + + + + + + + @@ -150,26 +152,26 @@
ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status Action ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status Action
-

+

Paid/Canceled

- + - - - - - - - - - - - - + + + + + + + + + + + +
ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status ID Vorschau Auftraggeber PDF A0 A1 A2 A3 no DIN Kosten Status Action