add clear search button

pull/133/head
Alex Turchyn 2 years ago
parent abfa64140f
commit cb879738c0

@ -1,4 +1,9 @@
<form action="<%= request.path %>" method="get" class="items-center hidden md:flex"> <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"> <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()]"> <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"> <span class="enabled">

@ -1,5 +1,5 @@
<%= render 'title', template: @template %> <%= 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"> <div class="flex justify-between mb-6 md:items-end flex-col md:flex-row">
<p class="text-3xl font-bold">Submissions</p> <p class="text-3xl font-bold">Submissions</p>
<div class="flex space-x-2 mt-3 md:mt-0"> <div class="flex space-x-2 mt-3 md:mt-0">

Loading…
Cancel
Save