aboutsummaryrefslogtreecommitdiff
path: root/app/views/searches/_form.html.erb
blob: e846b8c7c376bbf7da886508a55724dd3cf654a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<div data-controller="search">
  <%= form_with(model: search) do |form| %>
    <%= render "layouts/errors", model: search %>

    <div id="search_form">
      <div id="search-form-name" class="hidden">
        <%= form.label :name %>
        <%= form.text_field :name, required: true, autocomplete: 'off', autocapitalize: 'on' %>
      </div>

      <div id="search-form-description" class="hidden">
        <%= form.label :description %>
        <%= form.rich_textarea :description %>
      </div>

      <div>
        <%= form.label :body, id: 'search-body-label', class: 'hidden' %>
        <%= form.text_field :body, "data-action": "keydown.enter->search#load", "data-search-target": "body", placeholder: I18n.t('searches.title') %>
        <a id="save-search" href="#" data-action="search#save" class="hidden"><%= I18n.t('searches.save') %></a>
      </div>

      <div id="search-form-shared" class="hidden">
        <%= form.check_box :shared %>
        <%= form.label :shared, I18n.t('searches.public') %>
      </div>

      <div id="search-form-submit" class="hidden">
        <%= form.submit %>
      </div>
    </div>
  <% end %>

  <div id="results">
  </div>
</div>