From 389904834957af7956b5fa3615dcbc6752449ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=B6hm?= Date: Wed, 11 Sep 2024 11:25:51 +0200 Subject: [PATCH] Updated job view and edit --- .../stylesheets/application.tailwind.css | 3 ++ app/views/operator/jobs/_form.html.erb | 18 ++++++------ app/views/operator/jobs/_job.html.erb | 29 +++++++++---------- app/views/operator/jobs/edit.html.erb | 7 ++--- app/views/operator/jobs/show.html.erb | 5 ---- 5 files changed, 29 insertions(+), 33 deletions(-) diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index 58481b7..04fdfa2 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -9,6 +9,9 @@ .btn-primary { @apply bg-hsrm-red hover:bg-hsrm-red-light; } + .btn-alert { + @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; } diff --git a/app/views/operator/jobs/_form.html.erb b/app/views/operator/jobs/_form.html.erb index 94af127..541f9dd 100644 --- a/app/views/operator/jobs/_form.html.erb +++ b/app/views/operator/jobs/_form.html.erb @@ -18,33 +18,33 @@ <%= form.label :costumer_lastname, 'Nachname' %> <%= form.text_field :costumer_lastname, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %> -
- <%= form.label :intern %> - <%= form.check_box :intern, class: "block mt-2 h-5 w-5" %> +
+ <%= form.check_box :intern, class: "pr-2 h-5 w-5" %> + <%= form.label :intern, "Interne Umbuchung" %>
- <%= form.label :cost_center %> + <%= form.label :cost_center, "Kostenstelle/Auftragsnummer" %> <%= form.text_field :cost_center, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
<% if edit_form? %>
- <%= form.label :number_of_plans_a0 %> + <%= form.label :number_of_plans_a0, "Anzahl A0 Pläne" %> <%= form.number_field :number_of_plans_a0, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
- <%= form.label :number_of_plans_a1 %> + <%= form.label :number_of_plans_a1, "Anzahl A1 Pläne" %> <%= form.number_field :number_of_plans_a1, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
- <%= form.label :number_of_plans_a2 %> + <%= form.label :number_of_plans_a2, "Anzahl A2 Pläne" %> <%= form.number_field :number_of_plans_a2, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
- <%= form.label :number_of_plans_a3 %> + <%= form.label :number_of_plans_a3, "Anzahl A3 Pläne" %> <%= form.number_field :number_of_plans_a3, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
- <%= form.label :costum_qm_plan %> + <%= form.label :costum_qm_plan, "Quatratmeter noDin" %> <%= form.number_field :costum_qm_plan, in: 0..20.0, step: 0.01 ,class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
<% else %> diff --git a/app/views/operator/jobs/_job.html.erb b/app/views/operator/jobs/_job.html.erb index 8ae1d50..56cf23d 100644 --- a/app/views/operator/jobs/_job.html.erb +++ b/app/views/operator/jobs/_job.html.erb @@ -1,56 +1,50 @@
- +

Operator ID: - <%= job.operator_id %> <% if job.operator %> - - <%= job.operator.name %> (<%= job.operator.email %>) + <%= job.operator_id %> - <%= job.operator.name %> (<%= job.operator.email %>) <% else %> - <% end %>

Costumer ID: - <%= job.costumer_id %> <% if job.costumer %> - - <%= job.costumer.name %> (<%= job.costumer.email %>) + <%= job.costumer_id %> - <%= job.costumer.name %> (<%= job.costumer.email %>) <% else %> - <% end %>

- Operator: + Betreiber: <%= "#{job.operator_firstname} #{job.operator_lastname}" %>

- Costumer: + Auftraggeber: <%= "#{job.costumer_firstname} #{job.costumer_lastname}" %>

- Paid: - <%= icon bool_icon(job.paid), class: "icon" %> + Aktueller Status: + <%= %>

Paid at: <%= job.paid_at %>

-

- Printed: - <%= icon bool_icon(job.printed), class: "icon" %> -

Printed at: <%= job.printed_at %>

- Intern: + Interne Umbuchung: <%= icon bool_icon(job.intern), class: "icon" %>

- Cost center: + Kostenstelle: <%= job.cost_center %>

@@ -72,5 +66,10 @@

+ <%= link_to "Edit this job", edit_operator_job_path(@job), class: "btn" %> + <%= link_to "Back to jobs", operator_jobs_path, class: "btn" %> +
+ <%= button_to "Destroy this job", operator_job_path(@job), method: :delete, class: "btn btn-alert inline-block" %> +
diff --git a/app/views/operator/jobs/edit.html.erb b/app/views/operator/jobs/edit.html.erb index 1d76d12..1a918bc 100644 --- a/app/views/operator/jobs/edit.html.erb +++ b/app/views/operator/jobs/edit.html.erb @@ -1,11 +1,10 @@ -

Editing job

- +
<%= render "form", job: @job %> - <%= link_to "Show this job", operator_job_path(@job), class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> - <%= link_to "Back to jobs", operator_jobs_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> + <%= link_to "Show this job", operator_job_path(@job), class: "btn" %> + <%= link_to "Back to jobs", operator_jobs_path, class: "btn" %>
diff --git a/app/views/operator/jobs/show.html.erb b/app/views/operator/jobs/show.html.erb index 80a6bd2..e03351e 100644 --- a/app/views/operator/jobs/show.html.erb +++ b/app/views/operator/jobs/show.html.erb @@ -4,10 +4,5 @@

<%= notice %>

<% end %> <%= render @job %> - <%= link_to "Edit this job", edit_operator_job_path(@job), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> - <%= link_to "Back to jobs", operator_jobs_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %> -
- <%= button_to "Destroy this job", operator_job_path(@job), method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %> -