aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-11-12 19:41:00 +0000
committerMatthew Lemon <y@yulqen.org>2024-11-12 19:41:00 +0000
commit0c236603161908c72ab86ab9c682a08edd77774f (patch)
treef18c63250a558a7583de958acee9733a617e2ce7
parent634cf4ee06a4820eaa2431a272b9a223118cf884 (diff)
Tidying up the resource form
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock18
-rw-r--r--app/views/pdfresources/_form.html.erb45
-rw-r--r--app/views/pdfresources/new.html.erb4
4 files changed, 46 insertions, 23 deletions
diff --git a/Gemfile b/Gemfile
index c722ced..8108483 100644
--- a/Gemfile
+++ b/Gemfile
@@ -40,7 +40,7 @@ gem "kamal", require: false
gem "thruster", require: false
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
-# gem "image_processing", "~> 1.2"
+gem "image_processing", "~> 1.2"
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
diff --git a/Gemfile.lock b/Gemfile.lock
index 5624788..c3948f6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -110,6 +110,16 @@ GEM
erubi (1.13.0)
et-orbi (1.2.11)
tzinfo
+ ffi (1.17.0-aarch64-linux-gnu)
+ ffi (1.17.0-aarch64-linux-musl)
+ ffi (1.17.0-arm-linux-gnu)
+ ffi (1.17.0-arm-linux-musl)
+ ffi (1.17.0-arm64-darwin)
+ ffi (1.17.0-x86-linux-gnu)
+ ffi (1.17.0-x86-linux-musl)
+ ffi (1.17.0-x86_64-darwin)
+ ffi (1.17.0-x86_64-linux-gnu)
+ ffi (1.17.0-x86_64-linux-musl)
fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
@@ -117,6 +127,9 @@ GEM
activesupport (>= 6.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
+ image_processing (1.13.0)
+ mini_magick (>= 4.9.5, < 5)
+ ruby-vips (>= 2.0.17, < 3)
importmap-rails (2.0.3)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
@@ -152,6 +165,7 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
+ mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.25.1)
msgpack (1.7.3)
@@ -272,6 +286,9 @@ GEM
rubocop-performance
rubocop-rails
ruby-progressbar (1.13.0)
+ ruby-vips (2.2.2)
+ ffi (~> 1.12)
+ logger
rubyzip (2.3.2)
securerandom (0.3.2)
selenium-webdriver (4.26.0)
@@ -374,6 +391,7 @@ DEPENDENCIES
brakeman
capybara
debug
+ image_processing (~> 1.2)
importmap-rails
jbuilder
kamal
diff --git a/app/views/pdfresources/_form.html.erb b/app/views/pdfresources/_form.html.erb
index a75121a..39c8314 100644
--- a/app/views/pdfresources/_form.html.erb
+++ b/app/views/pdfresources/_form.html.erb
@@ -12,55 +12,60 @@
<% end %>
<div class="my-5">
- <%= form.label :name %>
+ <%= form.label :name, class: "font-bold" %>
<%= form.text_field :name, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>
+
+ <div class="my-5">
+ <%= form.label :description, class: "font-bold" %>
+ <%= form.textarea :description, rows: 4, 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">Go to two with the description here. THIS WILL BE RICH TEXT.</p>
+ </div>
<div class="my-5">
- <%= form.label :stripe_product_id %>
- <%= form.text_field :stripe_product_id, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
+ <%= form.label :card_description, class: "font-bold" %>
+ <%= form.textarea :card_description, rows: 4, 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">This is a much shorter description that is used inside the "card" boxes on the listings page.</p>
</div>
<div class="my-5">
- <%= form.label :pdfs %>
+ <%= form.label :pdfs, "Resource PDFs", class: "font-bold" %>
<%= form.file_field :pdfs, multiple: true, 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">You can upload up to 10 PDFs per resource.</p>
</div>
<div class="my-5">
- <%= form.label :thumbnails %>
+ <%= form.label :thumbnails, class: "font-bold" %>
<%= form.file_field :thumbnails, multiple: true, 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">You can upload up to 10 thumbnails per resource.</p>
</div>
<div class="my-5">
- <%= form.label :price %>
- <%= form.text_field :price, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
+ <%= form.label :price, class: "font-bold" %>
+ <%= form.number_field :price, 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">This is what we will sell it for!</p>
+ </div>
+
+ <div class="my-5">
+ <%= form.label :stripe_product_id, "Stripe Product ID", class: "font-bold" %>
+ <%= form.text_field :stripe_product_id, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
- <%= form.label :age_range %>
+ <%= form.label :age_range, class: "font-bold" %>
<%= form.text_field :age_range, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
- <%= form.label :curriculum %>
+ <%= form.label :curriculum, class: "font-bold" %>
<%= form.text_field :curriculum, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
- <%= form.label :feature_slot %>
+ <%= 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" %>
</div>
- <div class="my-5">
- <%= form.label :description %>
- <%= form.textarea :description, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
- </div>
-
- <div class="my-5">
- <%= form.label :card_description %>
- <%= form.textarea :card_description, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
- </div>
-
<div class="inline">
<%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
</div>
diff --git a/app/views/pdfresources/new.html.erb b/app/views/pdfresources/new.html.erb
index 5bd072b..73f1a01 100644
--- a/app/views/pdfresources/new.html.erb
+++ b/app/views/pdfresources/new.html.erb
@@ -1,5 +1,5 @@
-<div class="mx-auto md:w-2/3 w-full">
- <h1 class="font-bold text-4xl">New pdfresource</h1>
+<div class="mx-auto md:w-1/2 w-full">
+ <h1 class="font-bold text-4xl">Add a new Resource</h1>
<%= render "form", pdfresource: @pdfresource %>