From 32be24bca9b216c24da621d63bb0e601771d3a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=B6hm?= Date: Thu, 15 Aug 2024 02:07:11 +0200 Subject: [PATCH] Refactored stylesheet --- .../stylesheets/application.tailwind.css | 33 ++++- 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 | 56 ++++---- app/views/operator/jobs/index.html.erb | 136 +++++++++--------- 6 files changed, 162 insertions(+), 139 deletions(-) diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index 8666d2f..001a22c 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -2,12 +2,35 @@ @tailwind components; @tailwind utilities; -/* - @layer components { + .btn { + @apply px-4 py-2 font-semibold text-white transition-colors duration-100 bg-opacity-100 shadow bg-hsrm-gray-light hover:bg-opacity-75 ; + } .btn-primary { - @apply py-2 px-4 bg-blue-200; + @apply bg-hsrm-red hover:bg-hsrm-red-light; + } + .badge { + @apply text-sm font-medium text-center font-bold rounded-lg uppercase bg-gray-300 bg-opacity-50 px-2 py-1.5 shadow; + } + .badge-hover { + @apply p-1 hover:bg-opacity-75; + } + .badge-xl { + @apply text-2xl; + } + .badge-status { + @apply block w-24; + } + .icon { + @apply inline text-hsrm-gray size-7 drop-shadow hover:text-opacity-75; + } + .icon-disabled { + @apply text-opacity-25 hover:text-opacity-25; + } + .icon-nohover { + @apply hover:text-opacity-100; + } + .card-status { + @apply uppercase bg-opacity-50 shadow-lg min-h-20 hover:bg-opacity-70; } } - -*/ diff --git a/app/views/jobs/_job_tr.html.erb b/app/views/jobs/_job_tr.html.erb index 19bf5c4..4ccc9f4 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])), class: "shadow") %> <%#= image_tag job.pdf.preview(resize_to_limit: [50, 50]), class: "mx-auto" %> <% end %> - + <%= job.costumer_fullname %> - + <% if job.pdf.attached? %> <%= 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" %> + <%= 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: "text-hsrm-gray text-opacity-50 size-8 inline drop-shadow", title: "Kann nicht mehr abgebrochen werden") %> + <%= icon("x-circle", class: "icon icon-disabled size-10", title: "Kann nicht mehr abgebrochen werden") %> <% end %> diff --git a/app/views/jobs/index.html.erb b/app/views/jobs/index.html.erb index b66c12f..403ca3a 100644 --- a/app/views/jobs/index.html.erb +++ b/app/views/jobs/index.html.erb @@ -2,26 +2,26 @@
<%#= render partial: 'layouts/flash' %> <% content_for :title, "Current Print Jobs" %> -
-

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

+
+

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 e2ecc78..4f10460 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -31,7 +31,7 @@ - + - - - <% Job::AVAILABLE_PAGE_FORMATS.each do |din| %> - <% end %> - - - - diff --git a/app/views/operator/jobs/index.html.erb b/app/views/operator/jobs/index.html.erb index 3a4dc87..e99ffd7 100644 --- a/app/views/operator/jobs/index.html.erb +++ b/app/views/operator/jobs/index.html.erb @@ -4,45 +4,45 @@
<%= link_to "#openjobs-h", class: "flex-1" do %> -
-

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

+ <%= icon("inbox-stack", class: "text-status-open icon icon-nohover") %> Open - <%= @openjobs.count %> + <%= @openjobs.count %>

<% end %> <%= link_to "#printingjobs-h", class: "flex-1" do %> -
-

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

+ <%= icon("printer", class: "text-status-printing icon icon-nohover") %> Printing <%= @printingjobs.count %>

<% end %> <%= link_to "#pickupjobs-h", class: "flex-1" do %> -
-

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

+ <%= icon("arrow-up-tray", class: "text-status-pickup icon icon-nohover") %> Pickup <%= @pickupjobs.count %>

<% end %> <%= link_to "#paidcanceledjobs-h", class: "flex-1" do %> -
-

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

+ <%= icon("banknotes", class: "text-status-paid icon icon-nohover") %> Paid <%= @paidjobs.count %>

<% end %> <%= link_to "#paidcanceledjobs-h", class: "flex-1" do %> -
-

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

+ <%= icon("x-circle", class: "text-status-canceled icon icon-nohover") %> Canceled <%= @canceledjobs.count %>

@@ -56,14 +56,14 @@

<% if @openjobs.any? %> <%= button_to icon("printer", - class: "text-hsrm-gray size-6 inline drop-shadow hover:text-opacity-75 mr-2", + class: "icon icon-nohover size-6 mr-2", title: "Drucken") + "Start next job (" + @openjobs.count.to_s + ")", operator_job_path(@openjobs.first), params: { :job => { status: :printing} }, method: :patch, - form_class: "inline px-3 py-2 font-semibold bg-green-500 hover:opacity-90 shadow-lg transition-colors duration-100 bg-opacity-100 flex items-center group text-hsrm-gray" %> + form_class: "btn bg-green-400 text-black" %> <% else %> - - <%= icon("printer", class: "text-hsrm-gray text-opacity-25 size-6 inline drop-shadow mr-2", title: "") %> + + <%= icon("printer", class: "icon icon-nohover size-6 mr-2", title: "") %> Start next job <% end %> @@ -73,18 +73,18 @@

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
- +
+ <%= job.id %> + <% if job.pdf.attached? %> <%= 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?, 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" %> + <%= button_to icon("inbox-stack", class: "icon", 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: "") %> + <%= icon("inbox-stack", class: "icon icon-disabled", 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" %> + <%= button_to icon("printer", class: "icon", 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: "") %> + <%= icon("printer", class: "icon icon-disabled", title: "") %> <% end %> <% if job.printing? || job.paid? %> <% job.printing? && turbo_confirm = 'Sind die Pläne gedruckt und die Seitenanzahl und QM korrekt?' %> - <%= 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: turbo_confirm}}, form_class: "inline" %> + <%= button_to icon("arrow-up-tray", class: "icon", 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: turbo_confirm}}, form_class: "inline" %> <% else %> - <%= icon("arrow-up-tray", class: "text-hsrm-gray text-opacity-25 size-6 inline drop-shadow", title: "") %> + <%= icon("arrow-up-tray", class: "icon icon-disabled", title: "") %> <% end %> <% 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-hsrm-gray 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" %> + <%= button_to icon("banknotes", class: "icon", 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: "") %> + <%= icon("banknotes", class: "icon icon-disabled ", 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"), operator_job_path(job), method: :patch, params: {:job => {status: :canceled}}, form: {data: {turbo_confirm: 'Den Plottauftrag wirklich abbrechen?'}}, form_class: "inline" %> + <%= button_to icon("x-circle", class: "icon text-hsrm-red", 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") %> + <%= icon("x-circle", class: "icon icon-disabled", title: "Kann nicht mehr abgebrochen werden") %> <% end %>
- - - - - - - - - - - - + + + + + + + + + + + + @@ -102,18 +102,18 @@
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
- - - - - - - - - - - - + + + + + + + + + + + + @@ -131,18 +131,18 @@
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
- - - - - - - - - - - - + + + + + + + + + + + + @@ -160,18 +160,18 @@
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
- - - - - - - - - - - - + + + + + + + + + + + +
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