add clear search button

This commit is contained in:
Alex Turchyn
2023-09-24 11:11:16 +03:00
parent abfa64140f
commit cb879738c0
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -1,4 +1,9 @@
<form action="<%= request.path %>" method="get" class="items-center hidden md:flex">
<% if params[:q].present? %>
<a href="<%= request.path %>" title="Clear" class="text-xl -mr-3.5 z-10">
&times;
</a>
<% end %>
<input id="search" name="q" value="<%= params[:q] %>" class="input input-ghost text-lg pr-10 -mr-12">
<button type="submit" title="Search" class="btn btn-ghost btn-circle" onclick="window.search.value || document.activeElement === window.search ? null : [event.preventDefault(), window.search.focus()]">
<span class="enabled">
+1 -1
View File
@@ -1,5 +1,5 @@
<%= render 'title', template: @template %>
<% if !@pagy.count.zero? || @template.submitters.to_a.size == 1 %>
<% if !@pagy.count.zero? || @template.submitters.to_a.size == 1 || params[:q].present? %>
<div class="flex justify-between mb-6 md:items-end flex-col md:flex-row">
<p class="text-3xl font-bold">Submissions</p>
<div class="flex space-x-2 mt-3 md:mt-0">