diff --git a/app/views/_tailwind/contact_messages/_form.html.erb b/app/views/_tailwind/contact_messages/_form.html.erb
index 5a61ecb28..c5b2c9519 100644
--- a/app/views/_tailwind/contact_messages/_form.html.erb
+++ b/app/views/_tailwind/contact_messages/_form.html.erb
@@ -1,19 +1,19 @@
<%= form_with model: contact_message, builder: FormBuilders::Tailwind do |f| %>
- <%# TODO: Ask people to sign in to make it easier for them if they aren't %>
- <%# TODO: Only show name and email fields if not signed in %>
-
- <%= f.label :name, "Your name", class: "block mb-3" %>
- <%= f.text_field :name, class: "block w-full" %>
- <%= f.error :name, class: "mt-2" %>
- <%= f.hint do %>
- Or <%= pa_link_to "sign in", new_user_session_path %>
- <% end %>
-
-
- <%= f.label :email, "Your email", class: "block mb-3" %>
- <%= f.email_field :email, class: "block w-full" %>
- <%= f.error :email, class: "mt-2" %>
-
+ <% if current_user.nil? %>
+
+ <%= f.label :name, "Your name", class: "block mb-3" %>
+ <%= f.text_field :name, class: "block w-full" %>
+ <%= f.error :name, class: "mt-2" %>
+ <%= f.hint do %>
+ Or <%= pa_link_to "sign in", new_user_session_path %>
+ <% end %>
+
+
+ <%= f.label :email, "Your email", class: "block mb-3" %>
+ <%= f.email_field :email, class: "block w-full" %>
+ <%= f.error :email, class: "mt-2" %>
+
+ <% end %>
<%= f.label :reason, "I'm getting in touch because", class: "block mb-3" %>
<%# TODO: Extract style of select into form builder %>
@@ -29,6 +29,7 @@
<%= f.text_area :details, class: "block w-full", rows: 8 %>
<%= f.error :details, class: "mt-2" %>
+ <%# TODO: Add big box with helpful questions to ask yourself %>
<%= f.label :attachments, "Attach files or screenshots", class: "block mb-3" %>
<%# TODO: Style this %>
@@ -37,49 +38,18 @@
multiple: true, data: { direct_upload_url: rails_direct_uploads_url },
class: "block" %>
- <%# TODO: Only show recaptcha when user is logged out and recaptcha is configured %>
-
- <%= recaptcha_tags %>
- <%# TODO: Make sure recaptcha errors are shown here %>
- <%= f.error :base, class: "mt-2" %>
- <%= f.hint class: "mt-2" do %>
- Or <%= pa_link_to "sign in", new_user_session_path %> to remove this annoying reCaptcha
- <% end %>
-
+ <% if current_user.nil? && Rails.application.credentials[:recaptcha] %>
+
+ <%= recaptcha_tags %>
+ <%# TODO: Make sure recaptcha errors are shown here %>
+ <%= f.error :base, class: "mt-2" %>
+ <%= f.hint class: "mt-2" do %>
+ Or <%= pa_link_to "sign in", new_user_session_path %> to remove this annoying reCaptcha
+ <% end %>
+
+ <% end %>
<%= f.button "Send message to the Planning Alerts team" %>
+ We run this site, not the Government!
<% end %>
-
-<%
-=begin
-%>
-
-<%= semantic_form_for contact_message do |f| %>
- <%= f.inputs do %>
- <% if current_user.nil? %>
- <%= f.input :name, hint: t("formtastic.hints.contact_message.name", link: new_user_session_path) %>
- <%= f.input :email %>
- <% end %>
- <%= f.input :reason, collection: ContactMessage::REASONS_LONG, prompt: "-- Select closest relevant --" %>
- <%= f.input :details, input_html: { rows: 8 } %>
- <%= f.input :attachments, as: :file, input_html: { multiple: true, data: { direct_upload_url: rails_direct_uploads_url } } %>
- <% if current_user.nil? && Rails.application.credentials[:recaptcha] %>
- <%= recaptcha_tags %>
-
- Or
- <%= link_to "sign in", new_user_session_path %>
- to remove this annoying reCaptcha
-
- <% end %>
- <%= f.semantic_errors :base %>
- <% end %>
- <%= f.actions do %>
- <%= f.action :submit, button_html: { class: "button button-action" } %>
- <% end %>
- We run this site, not the Government!
-<% end %>
-
-<%
-=end
-%>