From d9b8ea5b09e52f171d47098eee2273f9df7136bc Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Sun, 26 Apr 2020 19:14:47 +0200 Subject: [PATCH] Form blank state --- app/views/forms/_form_example.html.erb | 4 +- app/views/forms/_form_example_js.html.erb | 2 +- app/views/forms/show.html.erb | 70 +++++++++++++++++------ 3 files changed, 54 insertions(+), 22 deletions(-) diff --git a/app/views/forms/_form_example.html.erb b/app/views/forms/_form_example.html.erb index 58844d6..fed070c 100644 --- a/app/views/forms/_form_example.html.erb +++ b/app/views/forms/_form_example.html.erb @@ -6,6 +6,6 @@ <%= text_field_tag header %>

<% end %> - ... - <%= submit_tag 'Submit' %> + ... + diff --git a/app/views/forms/_form_example_js.html.erb b/app/views/forms/_form_example_js.html.erb index 6ef5a7d..15311f0 100644 --- a/app/views/forms/_form_example_js.html.erb +++ b/app/views/forms/_form_example_js.html.erb @@ -7,5 +7,5 @@

<% end %> ... - <%= submit_tag 'Submit' %> + diff --git a/app/views/forms/show.html.erb b/app/views/forms/show.html.erb index c5abbcb..1f2270d 100644 --- a/app/views/forms/show.html.erb +++ b/app/views/forms/show.html.erb @@ -18,24 +18,56 @@ <%= @form.title %> -
- - - - <% @form.spreadsheet_headers.each do |value| %> - + + <% if @form.submissions.empty? %> + +
+
+ +

Setup your online form:

+

+ Your form submission URL: <%= submission_url(@form) %> +

+

+ Set the action of your online form to this URL and make sure your fields have proper name attributes. +

+

Example:

+

+<%= html_escape_once render('form_example', form: @form) %>
+        
+ + + +

+ Let us know if you need <%= link_to 'help', help_url %> - we also build the form for you! +

+ +
+
+ + <% else %> + +
+
<%= value %>
+ + + <% @form.spreadsheet_headers.each do |value| %> + + <% end %> + + + + <% @submissions.each do |submission| %> + + <% @form.spreadsheet_headers.each do |column| %> + + <% end %> + <% end %> - - - - <% @submissions.each do |submission| %> - - <% @form.spreadsheet_headers.each do |column| %> - - <% end %> - - <% end %> - -
<%= value %>
<%= submission.data[column] %>
<%= submission.data[column] %>
-
+ + + + + <% end %> +