diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2024-03-13 18:03:43 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <msabate@suse.com> | 2024-03-13 18:03:43 +0100 |
| commit | a7791635aa98f012d35f97c3c5288494bbb28e38 (patch) | |
| tree | bad987e6b4d10ad2f7cd02e40658d464907595ee /app/views/searches | |
| download | operum-a7791635aa98f012d35f97c3c5288494bbb28e38.tar.gz operum-a7791635aa98f012d35f97c3c5288494bbb28e38.zip | |
Initial commit
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'app/views/searches')
| -rw-r--r-- | app/views/searches/_form.html.erb | 29 | ||||
| -rw-r--r-- | app/views/searches/_search.html.erb | 5 | ||||
| -rw-r--r-- | app/views/searches/edit.html.erb | 1 | ||||
| -rw-r--r-- | app/views/searches/index.html.erb | 1 | ||||
| -rw-r--r-- | app/views/searches/new.html.erb | 1 | ||||
| -rw-r--r-- | app/views/searches/show.html.erb | 1 |
6 files changed, 38 insertions, 0 deletions
diff --git a/app/views/searches/_form.html.erb b/app/views/searches/_form.html.erb new file mode 100644 index 0000000..c940fe2 --- /dev/null +++ b/app/views/searches/_form.html.erb @@ -0,0 +1,29 @@ +<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' %> + </div> + + <div> + <%= form.text_field :body, "data-action": "keydown.enter->search#load", "data-search-target": "body", placeholder: 'Search body' %> + <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> diff --git a/app/views/searches/_search.html.erb b/app/views/searches/_search.html.erb new file mode 100644 index 0000000..a717a22 --- /dev/null +++ b/app/views/searches/_search.html.erb @@ -0,0 +1,5 @@ +<div id="items"> + <% items.values.flatten.each do |item| %> + <%= render item %> + <% end %> +</div> diff --git a/app/views/searches/edit.html.erb b/app/views/searches/edit.html.erb new file mode 100644 index 0000000..2702224 --- /dev/null +++ b/app/views/searches/edit.html.erb @@ -0,0 +1 @@ +<%= render "form", search: @search %> diff --git a/app/views/searches/index.html.erb b/app/views/searches/index.html.erb new file mode 100644 index 0000000..b7d3854 --- /dev/null +++ b/app/views/searches/index.html.erb @@ -0,0 +1 @@ +<%= render "search", items: @search.results %> diff --git a/app/views/searches/new.html.erb b/app/views/searches/new.html.erb new file mode 100644 index 0000000..2702224 --- /dev/null +++ b/app/views/searches/new.html.erb @@ -0,0 +1 @@ +<%= render "form", search: @search %> diff --git a/app/views/searches/show.html.erb b/app/views/searches/show.html.erb new file mode 100644 index 0000000..b7d3854 --- /dev/null +++ b/app/views/searches/show.html.erb @@ -0,0 +1 @@ +<%= render "search", items: @search.results %> |
