diff --git a/app/assets/stylesheets/input.css b/app/assets/stylesheets/input.css index a461c50..9234003 100644 --- a/app/assets/stylesheets/input.css +++ b/app/assets/stylesheets/input.css @@ -1 +1,7 @@ -@import "tailwindcss"; \ No newline at end of file +@import "tailwindcss"; + +@layer base { + .font-Inter { + font-family: 'Inter', sans-serif; + } +} \ No newline at end of file diff --git a/app/controllers/concerns/turbo_controller.js b/app/controllers/concerns/turbo_controller.js new file mode 100644 index 0000000..0c9200a --- /dev/null +++ b/app/controllers/concerns/turbo_controller.js @@ -0,0 +1,9 @@ +import { Controller } from "@hotwired/stimulus" + +export default class extends Controller { + visit(event) { + event.preventDefault() + Turbo.visit(event.target.dataset.url) + this.element.innerHTML = "" + } +} diff --git a/app/controllers/livres_controller.rb b/app/controllers/livres_controller.rb index 7972d92..c7fa673 100644 --- a/app/controllers/livres_controller.rb +++ b/app/controllers/livres_controller.rb @@ -7,9 +7,14 @@ class LivresController < ApplicationController end end - def new - @livre = Livre.new +def new + @livre = Livre.new + respond_to do |format| + format.html + format.turbo_stream end +end + def create @livre = Livre.new(livre_params) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 3ce3d48..d35e0c6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,8 +2,7 @@
- <%= link_to "Ajouter un nouveau livre", new_livre_path, - class: "text-black underline text-sm hover:text-blue-800 transition" %> -
+
- <%= form.label :titre %>
+
+ <%= form.label :titre,class:" font-bold text-gray-800 mb-6 " %>
<%= form.text_field :titre %>
- <%= form.label :auteur %>
+ <%= form.label :auteur,class:" font-bold text-gray-800 mb-6 " %>
<%= form.text_field :auteur %>
- <%= form.label :date_de_sortie, "Date de sortie" %>
+ <%= form.label :date_de_sortie,class:" font-bold text-gray-800 mb-6 " %>
<%= form.date_field :date_de_sortie %>
<%= link_to "← Retour au catalogue", livres_path %>
+<%= link_to "← Fermer l'éditeur", livres_path %>
+