|
1 | 1 | <%= simple_form_for [document] do |f| %>
|
| 2 | + <span class="lighter"> |
| 3 | + <%= f.association :service, collection: services, hint: "If your service isn't on the list, please contact the team" %> |
2 | 4 |
|
3 |
| - <%= f.association :service, collection: services, hint: "If your service isn't on the list, please contact the team" %> |
| 5 | + <% if document.name.present? %> |
| 6 | + <label class="sr-only" for="inputHelpBlock">Name</label> |
| 7 | + <input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock" placeholder="<%= document.name%>" readonly> |
| 8 | + <span id="helpBlock" class="help-block">To change the document name, please select a new document type</span> |
| 9 | + <% end %> |
4 | 10 |
|
5 |
| - <% if document.name.present? %> |
6 |
| - <label class="sr-only" for="inputHelpBlock">Name</label> |
7 |
| - <input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock" placeholder="<%= document.name%>" readonly> |
8 |
| - <span id="helpBlock" class="help-block">To change the document name, please select a new document type.</span> |
9 |
| - <% end %> |
10 |
| - |
11 |
| - <%= f.association :document_type, collection: document_names, hint: "Inspect the document types and their descriptions #{link_to 'here', document_types_path}".html_safe %> |
12 |
| - |
13 |
| - <%= f.input :url, hint: "Where we should fetch this document", placeholder: "e.g. \"https://www.facebook.com/about/privacy\"" %> |
14 |
| - |
15 |
| - <%= f.input :xpath, input_html: { value: (f.object.xpath.present?) ? f.object.xpath : '//body' }, placeholder: "e.g. \"//*[@id='content']//div[@class='_5tkp _3m9']\"", hint: "The location of the terms on the page using <a href=\"https://en.wikipedia.org/wiki/XPath\" title=\"Wikipedia explanation of XPath\" target=\"_blank\">XPath</a>".html_safe %> |
16 |
| - |
17 |
| - <%= f.input :crawler_server, collection: crawlers, label_method: :second, value_method: :first, hint: "<a href=\"https://to.tosdr.org/U98u1\">Select from which country the crawler should be used, or a specific crawler. Useful if blocked by EU. (Optional)</a>".html_safe, selected: document.crawler_server || "eu.crawler.api.tosdr.org" %> |
| 11 | + <%= f.association :document_type, collection: document_names, hint: "Inspect the document types and their descriptions #{link_to 'here', document_types_path}".html_safe %> |
| 12 | + |
| 13 | + <%= f.input :url, hint: "The web location at which we can fetch the text of this document", placeholder: "e.g. \"https://www.facebook.com/about/privacy\"" %> |
| 14 | + |
| 15 | + <%= f.input :xpath, input_html: { value: (f.object.xpath.present?) ? f.object.xpath : '//body' }, placeholder: "e.g. \"//*[@id='content']//div[@class='_5tkp _3m9']\"", hint: "The location of the terms on the web page using <a href=\"https://en.wikipedia.org/wiki/XPath\" title=\"Wikipedia explanation of XPath\" target=\"_blank\">XPath</a>".html_safe %> |
| 16 | + |
| 17 | + <%= f.input :crawler_server, collection: crawlers, label_method: :second, value_method: :first, hint: "<a href=\"https://to.tosdr.org/U98u1\">Select which crawler should be used (optional, useful if blocked by EU)</a>".html_safe, selected: document.crawler_server || "eu.crawler.api.tosdr.org" %> |
| 18 | + </span> |
18 | 19 |
|
19 |
| - <%= f.submit "Crawl Document", name: "only_create", class: 'btn btn-primary' %> |
| 20 | + <%= f.submit "Crawl Document", name: "only_create", class: 'btn btn-default lighter' %> |
20 | 21 | <% end %>
|
0 commit comments