Form blank state

This commit is contained in:
bumi 2020-04-26 19:14:47 +02:00
parent 8fb3fb7175
commit d9b8ea5b09
3 changed files with 54 additions and 22 deletions

View File

@ -7,5 +7,5 @@
</p> </p>
<% end %> <% end %>
... ...
<%= submit_tag 'Submit' %> <input type="submit" value="Submit">
</form> </form>

View File

@ -7,5 +7,5 @@
</p> </p>
<% end %> <% end %>
... ...
<%= submit_tag 'Submit' %> <input type="submit" value="Submit">
</form> </form>

View File

@ -18,6 +18,35 @@
<%= @form.title %> <%= @form.title %>
</h1> </h1>
<% if @form.submissions.empty? %>
<div class="columns is-centered">
<div class="column is-two-thirds">
<h3 class="title">Setup your online form:</h3>
<p>
Your form submission URL: <code><%= submission_url(@form) %></code>
</p>
<p>
Set the <code>action</code> of your online form to this URL and make sure your fields have proper <code>name</code> attributes.
</p>
<h4 class="subtitle" style="margin-top:1em">Example:</h4>
<pre><code class="html">
<%= html_escape_once render('form_example', form: @form) %>
</code></pre>
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.0.0/build/styles/default.min.css">
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.0.0/build/highlight.min.js"></script>
<p>
Let us know if you need <%= link_to 'help', help_url %> - we also build the form for you!
</p>
</div>
</div>
<% else %>
<div class="box table-wrapper is-clearfix" style="clear:both"> <div class="box table-wrapper is-clearfix" style="clear:both">
<table class="submission-table table is-fullwidth is-striped is-hoverable"> <table class="submission-table table is-fullwidth is-striped is-hoverable">
<thead> <thead>
@ -38,4 +67,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<% end %>
</div> </div>