Some layout and model changes
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
<%= form_with(model: job, class: "contents") do |form| %>
|
||||
<% if job.errors.any? %>
|
||||
<div
|
||||
id="error_explanation"
|
||||
class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3"
|
||||
>
|
||||
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3" >
|
||||
<h2><%= pluralize(job.errors.count, "error") %>
|
||||
prohibited this job from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% job.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
@@ -14,63 +10,42 @@
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :costumer_firstname %>
|
||||
<%= form.text_field :costumer_firstname,
|
||||
class:
|
||||
"block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
<%= form.text_field :costumer_firstname, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :costumer_lastname %>
|
||||
<%= form.text_field :costumer_lastname,
|
||||
class:
|
||||
"block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
<%= 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" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :intern %>
|
||||
<%= form.check_box :intern, class: "block mt-2 h-5 w-5" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :cost_center %>
|
||||
<%= form.text_field :cost_center,
|
||||
class:
|
||||
"block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
<%= 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" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :number_of_plans_a0 %>
|
||||
<%= form.number_field :number_of_plans_a0,
|
||||
class:
|
||||
"block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
<%= 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" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :number_of_plans_a1 %>
|
||||
<%= form.number_field :number_of_plans_a1,
|
||||
class:
|
||||
"block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
<%= 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" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :number_of_plans_a2 %>
|
||||
<%= form.number_field :number_of_plans_a2,
|
||||
class:
|
||||
"block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
<%= 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" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :number_of_plans_a3 %>
|
||||
<%= form.number_field :number_of_plans_a3,
|
||||
class:
|
||||
"block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
<%= 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" %>
|
||||
</div>
|
||||
<div>
|
||||
<%= form.label :accept_privacy %> <%= form.check_box :accept_privacy, class: "block mt-2 h-5 w-5" %>
|
||||
</div>
|
||||
|
||||
<div class="inline">
|
||||
<%= form.submit class:
|
||||
"rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
|
||||
<%= form.submit "Plottauftrag abschicken", class: "py-2 px-3 bg-hsrm-red hover:bg-hsrm-red-light shadow-lg text-white inline-block font-medium cursor-pointer" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<td class="p-3 text-sm text-hsrm-gray"> <%= job.id %> </td>
|
||||
<td class="p-3 text-sm text-hsrm-gray"> <%= job.fullname %> </td>
|
||||
<td class="p-3 text-sm text-hsrm-gray"> <%= job.pdf %> </td>
|
||||
<td class="p-3 text-sm text-center text-hsrm-gray"><span class="p-1.5 font-bg-gray-gray-900 bg-gray-300 font-medium rounded-lg"> <%= job.number_of_plans_a0 %></span> </td>
|
||||
<td class="p-3 text-sm text-center text-hsrm-gray"><span class="p-1.5 font-bg-gray-gray-900 bg-gray-300 font-medium rounded-lg"><%= job.number_of_plans_a1 %></span> </td>
|
||||
<td class="p-3 text-sm text-center text-hsrm-gray"><span class="p-1.5 font-bg-gray-gray-900 bg-gray-300 font-medium rounded-lg"><%= job.number_of_plans_a2 %> </span></td>
|
||||
<td class="p-3 text-sm text-center text-hsrm-gray"><span class="p-1.5 font-bg-gray-gray-900 bg-gray-300 font-medium rounded-lg"><%= job.number_of_plans_a3 %></span> </td>
|
||||
<td class="p-3 text-sm text-center text-hsrm-gray"><span class="p-1.5 bg-gray-300 font-medium rounded-lg"> <%= job.number_of_plans_a0 %></span> </td>
|
||||
<td class="p-3 text-sm text-center text-hsrm-gray"><span class="p-1.5 bg-gray-300 font-medium rounded-lg"><%= job.number_of_plans_a1 %></span> </td>
|
||||
<td class="p-3 text-sm text-center text-hsrm-gray"><span class="p-1.5 bg-gray-300 font-medium rounded-lg"><%= job.number_of_plans_a2 %> </span></td>
|
||||
<td class="p-3 text-sm text-center text-hsrm-gray"><span class="p-1.5 bg-gray-300 font-medium rounded-lg"><%= job.number_of_plans_a3 %></span> </td>
|
||||
<td class="p-3 text-sm text-center text-hsrm-gray">
|
||||
<% case job.status.to_sym %>
|
||||
<% when :open %>
|
||||
@@ -16,7 +16,7 @@
|
||||
<span class="p-1.5 text-xs font-medium upercase tracking-wider text-lime-900 bg-lime-300 rounded-lg"> <%= job.status %> </span>
|
||||
<% when :paid %>
|
||||
<span class="p-1.5 text-xs font-medium upercase tracking-wider text-green-900 bg-green-300 rounded-lg"> <%= job.status %> </span>
|
||||
<% when :cancelled %>
|
||||
<% when :canceled %>
|
||||
<span class="p-1.5 text-xs font-medium upercase tracking-wider text-red-900 bg-red-300 rounded-lg"> <%= job.status %> </span>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<% end %>
|
||||
<% content_for :title, "Current Print Jobs" %>
|
||||
<div class="flex justify-between items-center py-4">
|
||||
<h1 class="font-bold text-hsrm-gray text-4xl">Plottaufträge am <%= Date.today.strftime("%d.%m.%Y") %></h1>
|
||||
<%= link_to "Plottauftrag aufgeben", new_job_path, class: "px-3 py-2 bg-hsrm-red drop-shadow-lg transition-colors duration-100 hover:bg-hsrm-red-light text-white block font-medium" %>
|
||||
<h1 class="font-bold text-hsrm-gray text-4xl">Aktuelle Plottaufträge <span class="font-semibold text-sm"><%= Date.today.strftime("%d.%m.%Y") %></span></h1>
|
||||
<%= 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" %>
|
||||
</div>
|
||||
<div id="jobs" class="min-w-full drop-shadow-lg">
|
||||
<table class="w-full py-8 table-auto">
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<div class="mx-auto md:w-2/3 w-full">
|
||||
<h1 class="font-bold text-4xl">New job</h1>
|
||||
|
||||
<h1 class="font-bold text-4xl">Plottauftrag erteillen</h1>
|
||||
<%= render "form", job: @job %>
|
||||
|
||||
<%= link_to "Back to jobs", jobs_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
||||
<%= link_to "Zurück zur Übersicht", jobs_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user