diff --git a/app/models/splat.rb b/app/models/splat.rb index 430803ae9..736ec5e5b 100644 --- a/app/models/splat.rb +++ b/app/models/splat.rb @@ -5,5 +5,5 @@ class Splat < ApplicationRecord enum :color, %w[ #AF2E1B #CC6324 #3B4B59 #BFA07A #ED8008 #ED3F1C #BF1B1B #736B1E #D07B53 #736356 #AD1D1D #BF7C2A #C09C6F #698F9C #7C956B #5D618F #3B3633 #67695E - ].index_by(&:itself), suffix: true, default: :dodgerblue + ].index_by(&:itself), suffix: true, default: "#698F9C" end diff --git a/app/views/splats/index.html.erb b/app/views/splats/index.html.erb index 042e83b0e..fa3814a4e 100644 --- a/app/views/splats/index.html.erb +++ b/app/views/splats/index.html.erb @@ -18,18 +18,10 @@ <% end %> -
- <%= tag.button class: "btn flex-item-justify-end", popovertarget: "new-splat-panel" do %> - <%= image_tag "add.svg", aria: { hidden: true }, size: 24 %> - Create a new splat - <% end %> - - -
- <%= turbo_frame_tag :new_splat, src: new_splat_path, target: "_top" %> -
-
-
+ <%= link_to new_splat_path, class: "btn flex-item-justify-end" do %> + <%= image_tag "add.svg", aria: { hidden: true }, size: 24 %> + Create a new splat + <% end %> <% end %> diff --git a/app/views/splats/new.html.erb b/app/views/splats/new.html.erb index f563992dd..9467ce5d4 100644 --- a/app/views/splats/new.html.erb +++ b/app/views/splats/new.html.erb @@ -1,3 +1,15 @@ -<%= turbo_frame_tag :new_splat do %> - <%= render "splats/form", splat: @splat %> -<% end %> +
+
+ <%= form_with model: @splat, class: "flex flex-column gap full-width" do | form | %> +

+ <%= form.text_area :title, class: "input full-width borderless", required: true, placeholder: "Name it…", rows: 4, autofocus: true %> +

+ + <%= form.button class: "btn btn--reversed center" do %> + <%= image_tag "check.svg", aria: { hidden: "true" }, size: 24%> + Save + <% end %> + <% end %> + +
+