diff options
author | Matthew Lemon <y@yulqen.org> | 2024-11-14 16:14:33 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-11-14 16:14:33 +0000 |
commit | 851521dc475e3d434ff8e13bd9f9e558aa9af772 (patch) | |
tree | d0ca4cbdbcc6ab506c146349199bb3437d0e4802 /app/views/pdfresources/_form.html.erb | |
parent | 6427b28c60c6ed0dfd637307d1ab4ffe65c1144d (diff) |
Improved the feature slot handling - can now remove feature_slot value
Diffstat (limited to '')
-rw-r--r-- | app/views/pdfresources/_form.html.erb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/views/pdfresources/_form.html.erb b/app/views/pdfresources/_form.html.erb index a15bd67..a3922c9 100644 --- a/app/views/pdfresources/_form.html.erb +++ b/app/views/pdfresources/_form.html.erb @@ -92,7 +92,7 @@ <div class="my-5"> <%= required_label_tag(form, :resource_type) %> - <%= form.collection_select :resource_type_id, ResourceType.all, :id, :name, {}, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> + <%= form.collection_select :resource_type_id, ResourceType.all, :id, :name, { prompt: "Select resource type" }, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> </div> <div class="my-5"> @@ -111,8 +111,17 @@ </div> <div class="my-5"> - <%= form.label :feature_slot, class: "font-bold" %> - <%= form.number_field :feature_slot, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> + <%= form.label :feature_slot, "Feature Position", class: "font-bold" %> + <%= form.select :feature_slot, + options_for_select([ + ["Not Featured", nil], + ["Position 1", 1], + ["Position 2", 2], + ["Position 3", 3] + ], pdfresource.feature_slot), + { include_blank: false }, + class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %> + <p class="text-sm text-gray-700">Select a position to feature this resource, or "Not Featured" to remove from featured items. Only three resources can be featured at a time.</p> </div> <div class="flex gap-4 mt-8"> |