diff --git a/app/assets/images/logo.svg b/app/assets/images/logo.svg new file mode 100644 index 0000000..702eb89 --- /dev/null +++ b/app/assets/images/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/mountains.jpg b/app/assets/images/mountains.jpg new file mode 100644 index 0000000..c9f4428 Binary files /dev/null and b/app/assets/images/mountains.jpg differ diff --git a/app/assets/images/ruby.svg b/app/assets/images/ruby.svg new file mode 100644 index 0000000..ffa2aa9 --- /dev/null +++ b/app/assets/images/ruby.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/typesense.svg b/app/assets/images/typesense.svg new file mode 100644 index 0000000..849a665 --- /dev/null +++ b/app/assets/images/typesense.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000..7e41d51 --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,33 @@ +@import 'tailwindcss'; + +@theme { + --font-*: initial; + --font-sans: colfax-web, sans-serif; + --font-mono: + ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, + Courier New, monospace; +} + +@layer base { + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + border-color: var(--color-gray-200, currentcolor); + } +} + +.bg-mountains-fixed { + background-color: #0C2866; + background-size: 1800px auto; + background-repeat: no-repeat; + background-position: 50% 0%; + background-attachment: fixed; +} + +@media screen and (min-width: 1800px) { + .bg-mountains-fixed { + background-size: 100% auto; + } +} diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css deleted file mode 100644 index f1d8c73..0000000 --- a/app/assets/stylesheets/application.tailwind.css +++ /dev/null @@ -1 +0,0 @@ -@import "tailwindcss"; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4db8e2b..9be5702 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,4 @@ class ApplicationController < ActionController::Base - allow_browser versions: :modern before_action :set_current_user private diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index e6dc2c6..45c793d 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb @@ -1,34 +1,38 @@ -

Admin — All Submissions

+
+
+

Admin — All Submissions

-
- <% @submissions.each do |submission| %> -
-
-
-

- <%= submission.user.github_username %> - (<%= submission.user.github_email %>) - · <%= time_ago_in_words(submission.created_at) %> ago - <% if submission.discarded? %> - — discarded - <% end %> -

-

- <%= submission.line1 %>
- <%= submission.line2 %>
- <%= submission.line3 %> -

+
+ <% @submissions.each do |submission| %> +
+
+
+

+ <%= submission.user.github_username %> + (<%= submission.user.github_email %>) + · <%= time_ago_in_words(submission.created_at) %> ago + <% if submission.discarded? %> + — discarded + <% end %> +

+

+ <%= submission.line1 %>
+ <%= submission.line2 %>
+ <%= submission.line3 %> +

+
+
+ <%= button_to submission.discarded? ? "Restore" : "Discard", + admin_toggle_discard_path(submission), + class: "text-sm px-3 py-1 rounded cursor-pointer #{submission.discarded? ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700'}" %> +
+
-
- <%= button_to submission.discarded? ? "Restore" : "Discard", - admin_toggle_discard_path(submission), - class: "text-sm px-3 py-1 rounded #{submission.discarded? ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700'} cursor-pointer" %> -
-
-
- <% end %> -
+ <% end %> -<% if @submissions.empty? %> -

No submissions yet.

-<% end %> + <% if @submissions.empty? %> +

No submissions yet.

+ <% end %> +
+
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2e24aba..44402aa 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,6 +12,7 @@ <%= yield :head %> + @@ -20,32 +21,40 @@ <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %> - -
-
+ + -
- <% if flash[:notice] %> -
<%= flash[:notice] %>
- <% end %> - <% if flash[:alert] %> -
<%= flash[:alert] %>
- <% end %> + <% if flash[:notice] %> +
+
<%= flash[:notice] %>
+
+ <% end %> + <% if flash[:alert] %> +
+
<%= flash[:alert] %>
+
+ <% end %> +
<%= yield %>
diff --git a/app/views/pages/home.html.erb b/app/views/pages/home.html.erb index 2c11b74..f5dd016 100644 --- a/app/views/pages/home.html.erb +++ b/app/views/pages/home.html.erb @@ -1,32 +1,64 @@ -
-

Blue Ridge Ruby Haiku Giveaway

-

Submit a haiku for a chance to win a ticket to Blue Ridge Ruby 2026!

-

April 30 – May 1 · Asheville, NC

+
+
+
+
+ <%= image_tag "typesense.svg", alt: "Typesense", class: "h-10" %> +
- <% if submissions_open? %> - <% if Current.user&.submission %> - <%= link_to "Edit Your Haiku", new_submission_path, class: "inline-block bg-[#C41C1C] text-white px-6 py-3 rounded-lg font-medium hover:bg-red-800" %> - <% else %> - <%= link_to "Submit Your Haiku", new_submission_path, class: "inline-block bg-[#C41C1C] text-white px-6 py-3 rounded-lg font-medium hover:bg-red-800" %> - <% end %> -

Submissions close in

- <% else %> -

Submissions are closed

- <% end %> +
+ Haiku Ticket Giveaway +
+
-

<%= @submissions.count %> haiku<%= @submissions.count == 1 ? "" : "s" %> submitted

-
+
+
+ Submit a haiku for a chance to win a ticket to Blue Ridge Ruby. +
-<% if @submissions.any? %> -
- <% @submissions.each do |submission| %> -
-

- <%= submission.line1 %>
- <%= submission.line2 %>
- <%= submission.line3 %> +

+

+ Typesense (sponsor of Blue Ridge Ruby 2026) is giving away four tickets to the conference. Submit a haiku on the theme of “search” by March 30th and the four top-voted haikus will be awarded a free ticket.
+ (Limit one submission per person. No purchase necessary.)

+ +
+
+ <% if submissions_open? %> + <% if Current.user&.submission %> + <%= link_to "Edit Your Haiku", new_submission_path, class: "bg-[#C41C1C] bg-linear-to-t from-[#C41C1C] to-[#DD423E] text-white font-medium py-3 px-8 shadow-sm rounded-sm cursor-pointer text-lg" %> + <% else %> + <%= link_to "Submit Your Haiku", new_submission_path, class: "bg-[#C41C1C] bg-linear-to-t from-[#C41C1C] to-[#DD423E] text-white font-medium py-3 px-8 shadow-sm rounded-sm cursor-pointer text-lg" %> + <% end %> +

Submissions close in

+ <% else %> +

Submissions are closed

+ <% end %> +
+
+
+
+ +
+
+

Haiku Submissions

+ +

+ <%= @submissions.count %> haiku<%= @submissions.count == 1 ? "" : "s" %> submitted +

+ + <% if @submissions.any? %> +
+ <% @submissions.each do |submission| %> +
+

+ <%= submission.line1 %>
+ <%= submission.line2 %>
+ <%= submission.line3 %> +

+
+ <% end %> +
<% end %>
-<% end %> +
diff --git a/app/views/submissions/new.html.erb b/app/views/submissions/new.html.erb index 3adb223..ba04c1f 100644 --- a/app/views/submissions/new.html.erb +++ b/app/views/submissions/new.html.erb @@ -1,38 +1,43 @@ -
-

- <%= @submission.persisted? ? "Edit Your Haiku" : "Submit Your Haiku" %> -

+
+
+
+

+ <%= @submission.persisted? ? "Edit Your Haiku" : "Submit Your Haiku" %> +

- <%= form_with(model: @submission, url: @submission.persisted? ? submission_path(@submission) : submissions_path) do |f| %> - <% if @submission.errors.any? %> -
- <% @submission.errors.full_messages.each do |msg| %> -

<%= msg %>

+

+ A haiku is a three-line, unrhymed poetic form typically consisting of 17 syllables in a 5-7-5 pattern. Our theme is “search,” however you would like to interpret that. +

+ + + <%= form_with(model: @submission, url: @submission.persisted? ? submission_path(@submission) : submissions_path) do |f| %> + <% if @submission.errors.any? %> +
+ <% @submission.errors.full_messages.each do |msg| %> +

<%= msg %>

+ <% end %> +
<% end %> -
- <% end %> -
-
- <%= f.label :line1, "Line 1 (5 syllables)", class: "block text-sm font-medium text-gray-700 mb-1" %> - <%= f.text_field :line1, class: "w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[#C41C1C]", autofocus: true %> -
+
+
+ <%= f.label :line1, "Line 1", class: "block font-medium text-[#0C2866] mb-1" %> + <%= f.text_field :line1, class: "w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[#2672B5]", autofocus: true %> +
-
- <%= f.label :line2, "Line 2 (7 syllables)", class: "block text-sm font-medium text-gray-700 mb-1" %> - <%= f.text_field :line2, class: "w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[#C41C1C]" %> -
+
+ <%= f.label :line2, "Line 2", class: "block font-medium text-[#0C2866] mb-1" %> + <%= f.text_field :line2, class: "w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[#2672B5]" %> +
-
- <%= f.label :line3, "Line 3 (5 syllables)", class: "block text-sm font-medium text-gray-700 mb-1" %> - <%= f.text_field :line3, class: "w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[#C41C1C]" %> -
+
+ <%= f.label :line3, "Line 3", class: "block font-medium text-[#0C2866] mb-1" %> + <%= f.text_field :line3, class: "w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[#2672B5]" %> +
- <%= f.submit @submission.persisted? ? "Update Haiku" : "Submit Haiku", class: "w-full bg-[#C41C1C] text-white px-6 py-3 rounded-lg font-medium hover:bg-red-800 cursor-pointer" %> + <%= f.submit @submission.persisted? ? "Update Haiku" : "Submit Haiku", class: "bg-[#C41C1C] bg-linear-to-t from-[#C41C1C] to-[#DD423E] text-white font-medium py-3 px-6 shadow-sm rounded-sm cursor-pointer text-lg" %> +
+ <% end %>
- <% end %> - -

- <%= link_to "← Back", root_path, class: "text-gray-500 hover:text-gray-700" %> -

-
+
+
diff --git a/package.json b/package.json index dce0a46..b9e5b47 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ }, "scripts": { "build": "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets", - "build:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify" + "build:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/application.css -o ./app/assets/builds/application.css --minify" }, "dependencies": { "@hotwired/stimulus": "^3.2.2", diff --git a/test/system/home_test.rb b/test/system/home_test.rb index 53b25da..a574338 100644 --- a/test/system/home_test.rb +++ b/test/system/home_test.rb @@ -4,7 +4,7 @@ class HomeTest < ApplicationSystemTestCase test "home page displays" do visit root_url - assert_text "Blue Ridge Ruby Haiku Giveaway" + assert_text "Haiku Ticket Giveaway" assert_text "Submit Your Haiku" assert_text "0 haikus submitted" end