Added icons, helperfunction and new fancy notice message
Added icons from webcrunch resp. heroicons Added helperfunction to display inline svg with the plugin inline-svg Implemented fancy notice message webcrunch. Realy nice but does only work with javascript on.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<%= 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 shadow-lg border-l border-red mt-3" >
|
||||
<h2><%= pluralize(job.errors.count, "error") %>
|
||||
prohibited this job from being saved:</h2>
|
||||
<ul>
|
||||
@@ -47,7 +47,7 @@
|
||||
<%= form.file_field :pdf, accept: "application/pdf", class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
|
||||
</div>
|
||||
<div>
|
||||
<%= form.check_box :privacy_policy_accepted, class: "mt-2 h-5 w-5" %> <%= form.label :privacy_policy_accepted, "Datenschutzerklärung akzeptiert", class: "p-2" %>
|
||||
<%= form.check_box :privacy_policy_accepted, class: "mt-2 h-5 w-5" %> <%= form.label :privacy_policy_accepted, "Datenschutzerklärung akzeptiert", class: "p-2" %>
|
||||
</div>
|
||||
<div class="inline">
|
||||
<%= 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" %>
|
||||
|
||||
1
app/views/jobs/cancel.turbo_stream.erb
Normal file
1
app/views/jobs/cancel.turbo_stream.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= turbo_stream.update "flash", partial: "layouts/flash" %>
|
||||
@@ -1,10 +1,6 @@
|
||||
<%= turbo_stream_from 'jobs' %>
|
||||
<div class="w-full">
|
||||
<div id="notice">
|
||||
<% if notice.present? %>
|
||||
<p class="p-4 bg-green-100 text-green-700 font-medium rounded-lg border-l-4 border-green-700"><%= notice %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<%#= render partial: 'layouts/flash' %>
|
||||
<% content_for :title, "Current Print Jobs" %>
|
||||
<div class="flex justify-between items-center py-4">
|
||||
<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>
|
||||
|
||||
13
app/views/layouts/_flash.html.erb
Normal file
13
app/views/layouts/_flash.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= turbo_frame_tag "flash" do %>
|
||||
<% flash.each do |type, message| %>
|
||||
<div data-controller="flash" data-flash-target="toast" class="fixed z-50 top-2 right-2 border p-3 shadow-lg opacity-100 translate-x-full transition-transform ease-in-out duration-300 transform <%= type == :alert ? "bg-red-50 border-red-500/50 text-red-800" : "bg-green-50 border-green-300/90 text-green-800" %>">
|
||||
<div class="flex items-center justify-between gap-4">
|
||||
<%= icon "check", class: "size-4 stroke-primary-500" %>
|
||||
<span class="text-l"><%= message %></span>
|
||||
<button type="button" data-action="click->flash#dismiss" class="p-1 hover:bg-gray-100/70 flex items-center justify-center rounded-md">
|
||||
<%= icon "x-mark", class: "size-4 stroke-current text-gray-600 pointer-events-none" %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
10
app/views/layouts/_flashold.html.erb
Normal file
10
app/views/layouts/_flashold.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<div id="notice">
|
||||
<% if notice.present? %>
|
||||
<div class="flex p-1.5 text-l bg-green-100 text-green-700 font-medium shadow-lg border-l-4 border-green-700>
|
||||
<span class="flex p-1.5"><%= icon "check", class: "size-8 stroke-primary-500" %></span>
|
||||
<p class="p-1.5">
|
||||
<%= notice %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -10,6 +10,7 @@
|
||||
<%= javascript_importmap_tags %>
|
||||
</head>
|
||||
<body>
|
||||
<%= render "layouts/flash" %>
|
||||
<header class="container mx-auto px-4 py-6 flex items-center justify-between border-b-2 border-gray-300">
|
||||
<a href="/" class="font-bold text-black text-4xl">Plottservice Fachbereich AB</a>
|
||||
<nav>
|
||||
|
||||
Reference in New Issue
Block a user