From e5fbdeca9774df50760775c1ff14fd5dcd4f2009 Mon Sep 17 00:00:00 2001 From: Dean Lofts Date: Thu, 5 Sep 2024 18:10:57 +1000 Subject: [PATCH] make forms uniform and prevent signup --- app/views/achievements/_form.html.erb | 6 +- app/views/achievements/edit.html.erb | 2 +- app/views/achievements/new.html.erb | 1 - app/views/devise/confirmations/new.html.erb | 28 ++-- app/views/devise/passwords/edit.html.erb | 44 ++++--- app/views/devise/passwords/new.html.erb | 28 ++-- app/views/devise/registrations/edit.html.erb | 25 ++-- app/views/devise/registrations/new.html.erb | 120 +++++++++--------- app/views/devise/sessions/new.html.erb | 44 ++++--- .../devise/shared/_error_messages.html.erb | 10 +- app/views/devise/shared/_links.html.erb | 16 +-- app/views/devise/unlocks/new.html.erb | 28 ++-- app/views/links/_form.html.erb | 6 +- app/views/links/edit.html.erb | 1 - app/views/links/new.html.erb | 1 - app/views/waiting_lists/new.html.erb | 15 +++ config/application.rb | 2 + 17 files changed, 216 insertions(+), 161 deletions(-) create mode 100644 app/views/waiting_lists/new.html.erb diff --git a/app/views/achievements/_form.html.erb b/app/views/achievements/_form.html.erb index 8d39dc5..046bbbf 100644 --- a/app/views/achievements/_form.html.erb +++ b/app/views/achievements/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_with(model: achievement, local: true, class: "max-w-md mx-auto p-4 bg-gray-800 rounded-lg shadow-md") do |form| %> +<%= form_with(model: achievement, local: true, class: "max-w-2xl mx-auto p-6 bg-gray-800 rounded-lg shadow-md") do |form| %> <% if achievement.errors.any? %>

<%= pluralize(achievement.errors.count, 'error') %> prohibited this achievement from being saved:

@@ -39,3 +39,7 @@ <%= form.submit 'Save', class: 'bg-lime-500 hover:bg-lime-700 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out' %>
<% end %> + +
+ <%= link_to 'Back', achievements_path, class: 'text-lime-300 hover:text-lime-100 transition duration-300 ease-in-out' %> +
\ No newline at end of file diff --git a/app/views/achievements/edit.html.erb b/app/views/achievements/edit.html.erb index d538e7f..1f69808 100644 --- a/app/views/achievements/edit.html.erb +++ b/app/views/achievements/edit.html.erb @@ -1,3 +1,3 @@

Edit achievement

<%= render 'form', achievement: @achievement %> -<%= link_to 'Back', achievements_path, class: 'text-white hover:text-lime-300' %> + diff --git a/app/views/achievements/new.html.erb b/app/views/achievements/new.html.erb index ef86c07..02438f7 100644 --- a/app/views/achievements/new.html.erb +++ b/app/views/achievements/new.html.erb @@ -1,3 +1,2 @@

New Achievement

<%= render 'form', achievement: @achievement %> -<%= link_to 'Back', achievements_path, class: 'text-white hover:text-lime-300' %> diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index b12dd0c..2a0c0da 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -1,16 +1,20 @@ -

Resend confirmation instructions

+
+

Resend confirmation instructions

-<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> - <%= render "devise/shared/error_messages", resource: resource %> + <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post, class: "space-y-6" }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> -
+
+ <%= f.label :email, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
-
- <%= f.submit "Resend confirmation instructions" %> -
-<% end %> +
+ <%= f.submit "Resend confirmation instructions", class: 'bg-lime-500 hover:bg-lime-600 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out focus:outline-none' %> +
+ <% end %> -<%= render "devise/shared/links" %> +
+ <%= render "devise/shared/links" %> +
+
\ No newline at end of file diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 5fbb9ff..3826627 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -1,25 +1,29 @@ -

Change your password

+
+

Change your password

-<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> - <%= render "devise/shared/error_messages", resource: resource %> - <%= f.hidden_field :reset_password_token %> + <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "space-y-6" }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + <%= f.hidden_field :reset_password_token %> -
- <%= f.label :password, "New password" %>
- <% if @minimum_password_length %> - (<%= @minimum_password_length %> characters minimum)
- <% end %> - <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %> -
+
+ <%= f.label :password, "New password", class: 'block text-lime-200 font-semibold mb-2' %> + <% if @minimum_password_length %> + (<%= @minimum_password_length %> characters minimum) + <% end %> + <%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
-
- <%= f.label :password_confirmation, "Confirm new password" %>
- <%= f.password_field :password_confirmation, autocomplete: "new-password" %> -
+
+ <%= f.label :password_confirmation, "Confirm new password", class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
-
- <%= f.submit "Change my password" %> -
-<% end %> +
+ <%= f.submit "Change my password", class: 'bg-lime-500 hover:bg-lime-600 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out focus:outline-none' %> +
+ <% end %> -<%= render "devise/shared/links" %> +
+ <%= render "devise/shared/links" %> +
+
\ No newline at end of file diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 9b486b8..71ad027 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,16 +1,20 @@ -

Forgot your password?

+
+

Forgot your password?

-<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> - <%= render "devise/shared/error_messages", resource: resource %> + <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: "space-y-6" }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true, autocomplete: "email" %> -
+
+ <%= f.label :email, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
-
- <%= f.submit "Send me reset password instructions" %> -
-<% end %> +
+ <%= f.submit "Send me reset password instructions", class: 'bg-lime-500 hover:bg-lime-600 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out focus:outline-none' %> +
+ <% end %> -<%= render "devise/shared/links" %> +
+ <%= render "devise/shared/links" %> +
+
\ No newline at end of file diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 8a26459..c1ebb98 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -2,7 +2,7 @@

Edit <%= resource_name.to_s.humanize %>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: "space-y-6" }) do |f| %> - <%= devise_error_messages! %> + <%= render "devise/shared/error_messages", resource: resource %>
<%= f.label :email, class: 'block text-lime-200 font-semibold mb-2' %> @@ -29,13 +29,16 @@ <%= f.text_field :avatar, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %>
- <%= f.select :avatar_border, options_for_select([ - ['White', 'white'], - ['Black', 'black'], - ['None', 'none'], - ['Rainbow', 'rainbow'], - ['Rainbow Overlay', 'rainbow-overlay'] -], @user.avatar_border), {}, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ <%= f.label :avatar_border, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.select :avatar_border, options_for_select([ + ['White', 'white'], + ['Black', 'black'], + ['None', 'none'], + ['Rainbow', 'rainbow'], + ['Rainbow Overlay', 'rainbow-overlay'] + ], @user.avatar_border), {}, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
<%= f.label :banner, class: 'block text-lime-200 font-semibold mb-2' %> @@ -77,7 +80,7 @@
- <%= f.submit "Update", class: 'bg-lime-500 hover:bg-lime-600 text-white font-bold py-2 px-4 rounded-sm text-sm uppercase tracking-wide transition duration-300 ease-in-out focus:outline-none' %> + <%= f.submit "Update", class: 'bg-lime-500 hover:bg-lime-600 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out focus:outline-none' %>
<% end %> @@ -88,4 +91,6 @@ -<%= link_to 'Back', user_links_path(username: current_user.username), class: 'text-white hover:text-lime-300' %> +
+ <%= link_to 'Back', :back, class: 'text-lime-300 hover:text-lime-100 transition duration-300 ease-in-out' %> +
\ No newline at end of file diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 76c4caa..27d0b5c 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,57 +1,63 @@ -<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email, class: 'block text-gray-300 mb-1' %> - <%= f.email_field :email, autofocus: true, class: 'w-full p-1 rounded text-black' %> -
- -
- <%= f.label :password, class: 'block text-gray-300 mb-1' %> - <% if @minimum_password_length %> - (<%= @minimum_password_length %> characters minimum) - <% end %> - <%= f.password_field :password, autocomplete: "off", class: 'w-full p-1 rounded text-black' %> -
- -
- <%= f.label :password_confirmation, class: 'block text-gray-300 mb-1' %> - <%= f.password_field :password_confirmation, autocomplete: "off", class: 'w-full p-1 rounded text-black' %> -
- -
- <%= f.label :username, class: 'block text-gray-300 mb-1' %> - <%= f.text_field :username, class: 'w-full p-1 rounded text-black' %> -
- -
- <%= f.label :full_name, class: 'block text-gray-300 mb-1' %> - <%= f.text_field :full_name, class: 'w-full p-1 rounded text-black' %> -
- -
- <%= f.label :tags, class: 'block text-gray-300 mb-1' %> - <%= f.text_field :tags, value: @user.parsed_tags.join(', '), class: 'w-full p-1 rounded text-black' %> -
- -
- <%= f.label :avatar, class: 'block text-gray-300 mb-1' %> - <%= f.text_field :avatar, class: 'w-full p-1 rounded text-black' %> -
- -
- <%= f.label :banner, class: 'block text-gray-300 mb-1' %> - <%= f.text_field :banner, class: 'w-full p-1 rounded text-black' %> -
- -
- <%= f.label :description, class: 'block text-gray-300 mb-1' %> - <%= f.text_area :description, class: 'w-full p-1 rounded text-black' %> -
- -
- <%= f.submit "Sign up", class: 'bg-lime-500 hover:bg-lime-700 text-white font-bold py-1 px-2 rounded' %> -
-<% end %> - -<%= render "devise/shared/links" %> +
+

Sign up

+ + <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "space-y-6" }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.label :password, class: 'block text-lime-200 font-semibold mb-2' %> + <% if @minimum_password_length %> + (<%= @minimum_password_length %> characters minimum) + <% end %> + <%= f.password_field :password, autocomplete: "new-password", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.label :password_confirmation, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.label :username, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.text_field :username, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.label :full_name, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.text_field :full_name, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.label :tags, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.text_field :tags, value: @user.parsed_tags.join(', '), class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.label :avatar, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.text_field :avatar, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.label :banner, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.text_field :banner, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.label :description, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.text_area :description, rows: 3, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.submit "Sign up", class: 'bg-lime-500 hover:bg-lime-600 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out focus:outline-none' %> +
+ <% end %> + +
+ <%= render "devise/shared/links" %> +
+
\ No newline at end of file diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 4a6966a..5244abd 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,26 +1,32 @@ -

Log in

+
+

Log in

-<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> -
- <%= f.label :email, class: 'block text-gray-300 mb-1' %> - <%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'w-full p-1 rounded text-black' %> -
+ <%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: "space-y-6" }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> -
- <%= f.label :password, class: 'block text-gray-300 mb-1' %> - <%= f.password_field :password, autocomplete: "current-password", class: 'w-full p-1 rounded text-black' %> -
+
+ <%= f.label :email, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
- <% if devise_mapping.rememberable? %> -
- <%= f.check_box :remember_me, class: 'mr-2' %> - <%= f.label :remember_me, class: 'text-gray-300' %> +
+ <%= f.label :password, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.password_field :password, autocomplete: "current-password", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ + <% if devise_mapping.rememberable? %> +
+ <%= f.check_box :remember_me, class: 'mr-2' %> + <%= f.label :remember_me, class: 'text-lime-200 font-semibold' %> +
+ <% end %> + +
+ <%= f.submit "Log in", class: 'bg-lime-500 hover:bg-lime-600 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out focus:outline-none' %>
<% end %> -
- <%= f.submit "Log in", class: 'bg-lime-500 hover:bg-lime-700 text-white font-bold py-1 px-2 rounded' %> +
+ <%= render "devise/shared/links" %>
-<% end %> - -<%= render "devise/shared/links" %> +
\ No newline at end of file diff --git a/app/views/devise/shared/_error_messages.html.erb b/app/views/devise/shared/_error_messages.html.erb index cabfe30..6ebef4f 100644 --- a/app/views/devise/shared/_error_messages.html.erb +++ b/app/views/devise/shared/_error_messages.html.erb @@ -1,15 +1,15 @@ <% if resource.errors.any? %> -
-

+

-
    + +
      <% resource.errors.full_messages.each do |message| %>
    • <%= message %>
    • <% end %>
-<% end %> +<% end %> \ No newline at end of file diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb index 4cb72f2..8cef40a 100644 --- a/app/views/devise/shared/_links.html.erb +++ b/app/views/devise/shared/_links.html.erb @@ -1,27 +1,27 @@ <%- if controller_name != 'sessions' %> - <%= link_to "Log in", new_session_path(resource_name) %>
+ <%= link_to "Log in", new_session_path(resource_name), class: "text-lime-300 hover:text-lime-100 transition duration-300 ease-in-out" %>
<% end %> -<% unless Rails.env.production? %> +<% if Rails.application.config.sign_ups_open %> <%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to "Sign up", new_registration_path(resource_name) %>
+ <%= link_to "Sign up", new_registration_path(resource_name), class: "text-lime-300 hover:text-lime-100 transition duration-300 ease-in-out" %>
<% end %> <% end %> <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+ <%= link_to "Forgot your password?", new_password_path(resource_name), class: "text-lime-300 hover:text-lime-100 transition duration-300 ease-in-out" %>
<% end %> <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: "text-lime-300 hover:text-lime-100 transition duration-300 ease-in-out" %>
<% end %> <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: "text-lime-300 hover:text-lime-100 transition duration-300 ease-in-out" %>
<% end %> <%- if devise_mapping.omniauthable? %> <%- resource_class.omniauth_providers.each do |provider| %> - <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %>
+ <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false }, class: "mt-2 bg-gray-600 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-opacity-50" %>
<% end %> -<% end %> +<% end %> \ No newline at end of file diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index ffc34de..330cb0a 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -1,16 +1,20 @@ -

Resend unlock instructions

+
+

Resend unlock instructions

-<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> - <%= render "devise/shared/error_messages", resource: resource %> + <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post, class: "space-y-6" }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true, autocomplete: "email" %> -
+
+ <%= f.label :email, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
-
- <%= f.submit "Resend unlock instructions" %> -
-<% end %> +
+ <%= f.submit "Resend unlock instructions", class: 'bg-lime-500 hover:bg-lime-600 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out focus:outline-none' %> +
+ <% end %> -<%= render "devise/shared/links" %> +
+ <%= render "devise/shared/links" %> +
+
\ No newline at end of file diff --git a/app/views/links/_form.html.erb b/app/views/links/_form.html.erb index 6944b83..7e33516 100644 --- a/app/views/links/_form.html.erb +++ b/app/views/links/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_with(model: link, local: true, class: "max-w-md mx-auto p-4 bg-gray-800 rounded-lg shadow-md") do |form| %> +<%= form_with(model: link, local: true, class: "max-w-2xl mx-auto p-6 bg-gray-800 rounded-lg shadow-md") do |form| %> <% if link.errors.any? %>

<%= pluralize(link.errors.count, 'error') %> prohibited this link from being saved:

@@ -58,3 +58,7 @@ <%= form.submit 'Save', class: 'bg-lime-500 hover:bg-lime-700 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out' %>
<% end %> + +
+ <%= link_to 'Back', links_path, class: 'text-lime-300 hover:text-lime-100 transition duration-300 ease-in-out' %> +
\ No newline at end of file diff --git a/app/views/links/edit.html.erb b/app/views/links/edit.html.erb index 8f3df9e..87c8d18 100644 --- a/app/views/links/edit.html.erb +++ b/app/views/links/edit.html.erb @@ -1,3 +1,2 @@

Edit Link

<%= render 'form', link: @link %> -<%= link_to 'Back', links_path, class: 'text-white hover:text-lime-300' %> diff --git a/app/views/links/new.html.erb b/app/views/links/new.html.erb index 966ad66..51cfac6 100644 --- a/app/views/links/new.html.erb +++ b/app/views/links/new.html.erb @@ -1,3 +1,2 @@

New Link

<%= render 'form', link: @link %> -<%= link_to 'Back', links_path, class: 'text-white hover:text-lime-300' %> diff --git a/app/views/waiting_lists/new.html.erb b/app/views/waiting_lists/new.html.erb new file mode 100644 index 0000000..d41163c --- /dev/null +++ b/app/views/waiting_lists/new.html.erb @@ -0,0 +1,15 @@ + +
+

Join the Waiting List

+ + <%= form_for @waiting_list, url: waiting_lists_path, html: { class: "space-y-6" } do |f| %> +
+ <%= f.label :email, class: 'block text-lime-200 font-semibold mb-2' %> + <%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> +
+ +
+ <%= f.submit "Join Waiting List", class: 'bg-lime-500 hover:bg-lime-600 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out focus:outline-none' %> +
+ <% end %> +
diff --git a/config/application.rb b/config/application.rb index f28b3f7..6abde00 100644 --- a/config/application.rb +++ b/config/application.rb @@ -18,6 +18,8 @@ class Application < Rails::Application config.middleware.use PageViewTracker + config.sign_ups_open = false + # Configuration for the application, engines, and railties goes here. # # These settings can be overridden in specific environments using the files