Form to create airtable and google sheets forms
This commit is contained in:
@@ -2,10 +2,87 @@
|
||||
<div class=" columns ">
|
||||
<div class="column is-half is-offset-one-quarter">
|
||||
<div class="box">
|
||||
<div class="content has-text-centered">
|
||||
<h1 class="has-text-weight-light">Create a new form</h1>
|
||||
<div class="content">
|
||||
<h1 class="title has-text-centered">Create a new form</h1>
|
||||
|
||||
<%= render 'form', form: @form %>
|
||||
<div class="tabs is-centered">
|
||||
<ul>
|
||||
<li class="<%= 'is-active' if @form.backend_name == 'google_sheets' %>">
|
||||
<a href="#" data-target="google-sheets-form">
|
||||
<span class="icon is-small"><%= image_tag 'google-sheets-icon.svg' %></span>
|
||||
<span>Google Sheets</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<%= 'is-active' if @form.backend_name == 'airtable' %>">
|
||||
<a href="#" data-target="airtable-form">
|
||||
<span class="icon is-small"><%= image_tag 'airtable-icon.svg' %></span>
|
||||
<span>Airtable</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="google-sheets-form <%= 'is-hidden' unless @form.backend_name == 'google_sheets' %>" id="google-sheets-form">
|
||||
<%= form_for @form, local: true do |f| %>
|
||||
<%= f.hidden_field :backend_name, value: 'google_sheets' %>
|
||||
<div class="field">
|
||||
<label class="label">Name</label>
|
||||
<div class="control">
|
||||
<%= f.text_field :title, class: 'input', placeholder: '', autocomplete: 'off' %>
|
||||
</div>
|
||||
<p class="help">Give your document a name.</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<%= f.submit class: 'button is-primary' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="airtable-form <%= 'is-hidden' unless @form.backend_name == 'airtable' %>" id="airtable-form">
|
||||
<p>
|
||||
To connect a new online form with an Airtable document please <strong>first</strong> <a href="https://airtable.com/" target="_blank">create the document on Airtable</a>.
|
||||
</p>
|
||||
<%= form_for @form, local: true do |f| %>
|
||||
<%= f.hidden_field :backend_name, value: 'airtable' %>
|
||||
<div class="field">
|
||||
<label class="label">Table Name</label>
|
||||
<div class="control">
|
||||
<%= f.text_field :airtable_table, class: 'input', placeholder: 'Table 1', autocomplete: 'off' %>
|
||||
</div>
|
||||
<p class="help">The name of the table in your Airtable base. Your Airtable can have multiple tables/sheets. Which one do you want to use?</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">API Key</label>
|
||||
<div class="control">
|
||||
<%= f.text_field :airtable_api_key, class: 'input', placeholder: '', autocomplete: 'off' %>
|
||||
</div>
|
||||
<p class="help">Your Airtable account API Key. You find this one on your <a href="https://airtable.com/account" target="_blank">Airtable account page</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">APP Key</label>
|
||||
<div class="control">
|
||||
<%= f.text_field :airtable_app_key, class: 'input', placeholder: '', autocomplete: 'off' %>
|
||||
</div>
|
||||
<p class="help">The application key of your Airtable document. You find this one on the <a href="https://airtable.com/api" target="_blank">API page of your Airtable base</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<%= f.submit class: 'button is-primary' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
Do you need help? <%= link_to 'Let us know!', help_url %>.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user