diff options
author | hellekin <hellekin@cepheide.org> | 2020-10-09 10:29:34 +0200 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2020-10-09 10:29:34 +0200 |
commit | d242fb5bbc423876f4c192b5f133619a2d4f0113 (patch) | |
tree | 5da6478cd67c49406d8678aa7e99f949419f905c /app/views/resources/_form.html.erb | |
parent | f48ce2f4c934fde3862cdad593eececc7a567d61 (diff) | |
download | incommon-map-d242fb5bbc423876f4c192b5f133619a2d4f0113.tar.gz |
Scope routes to Agent
Since an Agent is required for all records, we scope the routes
and get it present for free ;)
This commit also adds resource views.
Diffstat (limited to 'app/views/resources/_form.html.erb')
-rw-r--r-- | app/views/resources/_form.html.erb | 61 |
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> |