aboutsummaryrefslogtreecommitdiff
path: root/app/views/resources/_form.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/resources/_form.html.erb')
-rw-r--r--app/views/resources/_form.html.erb61
1 files changed, 61 insertions, 0 deletions
diff --git a/app/views/resources/_form.html.erb b/app/views/resources/_form.html.erb
new file mode 100644
index 0000000..fe5f532
--- /dev/null
+++ b/app/views/resources/_form.html.erb
@@ -0,0 +1,61 @@
+<fieldset>
+ <%= tag.legend "Propriétés de la ressource" %>
+
+ <dl>
+ <dt><%= f.label :name %></dt>
+ <dd><%= f.text_field :name, maxlength: 64, placeholder: 'La ferme des animaux', value: resource.name %></dd>
+
+ <dt><%= f.label :summary %></dt>
+ <dd><%= f.text_field :summary, maxlength: 136, placeholder: 'Une ferme locale', value: resource.name %></dd>
+
+ <dt><%= f.label :description %></dt>
+ <dd><%= f.text_area :description, cols: 72, rows: 10, placeholder: '## Un choix pertinent
+
+La description _peut_ comporter du [Markdown].
+
+[Markdown]: https://www.markdownguide.org/getting-started/' %></dd>
+
+ <dt><%= f.label :email %></dt>
+ <dd><%= f.email_field :email, placeholder: 'bonjour@la-ferme-des-animaux.example' %></dd>
+
+ <dt><%= f.label :website %></dt>
+ <dd><%= f.url_field :website, placeholder: 'https://la-ferme-des-animaux.example' %></dd>
+
+ <dt><%= f.label :phone_number %></dt>
+ <dd><%= f.telephone_field :phone_number, placeholder: '+32 489 000 0000' %></dd>
+ </dl>
+</fieldset>
+
+<fieldset>
+ <%= tag.legend "Classification" %>
+ <%# TODO Add a taxonomy selector %>
+ <%= section_select(current_agent.taxonomies.first) %>
+</fieldset>
+
+<fieldset>
+ <%= tag.legend "Coordonées géographiques" %>
+ <%# TODO Add a graphical geo selector %>
+
+ <dl>
+ <dt><%= f.label :address %></dt>
+ <dd><%= f.text_field :address, value: resource.address, placeholder: 'Rue aux herbes, 123' %></dd>
+
+ <dt><%= f.label :postal_code %></dt>
+ <dd><%= f.text_field :postal_code, value: resource.postal_code, placeholder: '1000' %></dd>
+
+ <dt><%= f.label :city %></dt>
+ <dd><%= f.text_field :city, value: resource.city, placeholder: 'Bruxelles' %></dd>
+ </dl>
+
+ <dl>
+ <dt><%= f.label :longitude %></dt>
+ <dd><%= f.text_field :longitude, value: resource.longitude, placeholder: '0.56789012' %></dd>
+
+ <dt><%= f.label :latitude %></dt>
+ <dd><%= f.text_field :latitude, value: resource.latitude, placeholder: '50.12345678' %></dd>
+ </dl>
+</fieldset>
+
+<%= f.hidden_field :agent_id, value: current_agent.id %>
+
+<p><%= f.submit 'Save' %></p>