-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
129 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
backend/templates/v2/public/components/home-hero-search.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<div class="relative pt-8 pb-4" x-data="ngoSearch" x-on:click.outside="close"> | ||
<ul | ||
id="ngo-results" | ||
role="listbox" | ||
class="absolute w-full pt-10 overflow-auto text-sm bg-white border border-gray-300 shadow-lg rounded-2xl max-h-60 ring-1 ring-black/5 focus:outline-none sm:text-sm" | ||
x-show="isOpen" | ||
x-cloak | ||
> | ||
<template x-for="(ngo, index) in results" :key="index"> | ||
<li | ||
class="relative cursor-default select-none" | ||
role="option" | ||
tabindex="-1"> | ||
|
||
<a | ||
class="block px-3 py-2 text-gray-900 truncate hover:bg-amber-300 hover:outline-none" | ||
:href="ngo.url" | ||
> | ||
<span x-text="ngo.name"></span> | ||
</a> | ||
</li> | ||
</template> | ||
</ul> | ||
|
||
<label class="relative grid grid-cols-1"> | ||
<span class="sr-only">Caută un ONG după nume sau CUI/CIF</span> | ||
|
||
<input | ||
type="text" | ||
class="border-none col-start-1 row-start-1 block w-full rounded-full bg-white py-1.5 pl-10 pr-3 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-amber-300 sm:pl-9 sm:text-sm/6 focus:outline-none" | ||
role="combobox" | ||
aria-controls="ngo-results" | ||
placeholder="Caută un ONG după nume sau CUI/CIF" | ||
x-model.debounce="query" | ||
autocomplete="off" | ||
x-on:click="open" | ||
> | ||
|
||
<svg class="self-center col-start-1 row-start-1 ml-3 text-gray-400 pointer-events-none size-5 sm:size-4" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> | ||
<path fill-rule="evenodd" d="M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z" clip-rule="evenodd" /> | ||
</svg> | ||
</label> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,67 @@ | ||
{% load elided_pagination %} | ||
|
||
<div class="flex items-center justify-between"> | ||
<div class="flex justify-between flex-1 sm:hidden"> | ||
{% if page_obj.has_previous %} | ||
<a href="?page={{ page_obj.previous_page_number }}" class="inline-flex items-center text-sm font-medium text-gray-500 hover:text-yellow-400"> | ||
<svg class="mr-3 size-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> | ||
<path fill-rule="evenodd" d="M18 10a.75.75 0 0 1-.75.75H4.66l2.1 1.95a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 1 1 1.02 1.1l-2.1 1.95h12.59A.75.75 0 0 1 18 10Z" clip-rule="evenodd" /> | ||
</svg> | ||
Previous | ||
</a> | ||
{% endif %} | ||
|
||
<div class="flex justify-end flex-1 w-0 -mt-px"> | ||
{% if page_obj.has_next %} | ||
<a href="?page={{ page_obj.next_page_number }}" class="inline-flex items-center text-sm font-medium text-gray-500 hover:text-yellow-400"> | ||
Next | ||
<svg class="ml-3 size-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> | ||
<path fill-rule="evenodd" d="M2 10a.75.75 0 0 1 .75-.75h12.59l-2.1-1.95a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.1-1.95H2.75A.75.75 0 0 1 2 10Z" clip-rule="evenodd" /> | ||
{% if page_obj.paginator.num_pages > 1 %} | ||
<div class="flex items-center justify-between col-span-full"> | ||
<div class="flex justify-between flex-1 sm:hidden"> | ||
{% if page_obj.has_previous %} | ||
<a href="?page={{ page_obj.previous_page_number }}" class="inline-flex items-center text-sm font-medium text-gray-500 hover:text-yellow-400"> | ||
<svg class="mr-3 size-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> | ||
<path fill-rule="evenodd" d="M18 10a.75.75 0 0 1-.75.75H4.66l2.1 1.95a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 1 1 1.02 1.1l-2.1 1.95h12.59A.75.75 0 0 1 18 10Z" clip-rule="evenodd" /> | ||
</svg> | ||
Previous | ||
</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
<div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between"> | ||
<div class="text-sm text-gray-700"> | ||
<span class="font-medium">{{ page_obj.paginator.count }}</span> | ||
organizații | ||
<div class="flex justify-end flex-1 w-0 -mt-px"> | ||
{% if page_obj.has_next %} | ||
<a href="?page={{ page_obj.next_page_number }}" class="inline-flex items-center text-sm font-medium text-gray-500 hover:text-yellow-400"> | ||
Next | ||
<svg class="ml-3 size-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> | ||
<path fill-rule="evenodd" d="M2 10a.75.75 0 0 1 .75-.75h12.59l-2.1-1.95a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.1-1.95H2.75A.75.75 0 0 1 2 10Z" clip-rule="evenodd" /> | ||
</svg> | ||
</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
<nav class="inline-flex gap-1 isolate" aria-label="Pagination"> | ||
{% if page_obj.has_previous %} | ||
<a href="?page={{ page_obj.previous_page_number }}" class="relative inline-flex items-center justify-center text-gray-500 rounded-full w-9 h-9 hover:bg-yellow-100 focus:z-20 focus:outline-offset-0"> | ||
<span class="sr-only">Previous</span> | ||
<svg class="size-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> | ||
<path fill-rule="evenodd" d="M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd" /> | ||
</svg> | ||
</a> | ||
{% endif %} | ||
<div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between"> | ||
<div class="text-sm text-gray-700"> | ||
<span class="font-medium">{{ page_obj.paginator.count }}</span> | ||
organizații | ||
</div> | ||
|
||
{% adjusted_elided_page_range paginator page_obj.number 2 1 as page_range %} | ||
|
||
{% for num in page_range %} | ||
{% if num == '…' %} | ||
<span class="relative inline-flex items-center justify-center text-sm font-semibold text-gray-500 rounded-full w-9 h-9 focus:outline-offset-0">…</span> | ||
{% elif page_obj.number == num %} | ||
<a href="?page={{ num }}" aria-current="page" class="relative z-10 inline-flex items-center justify-center text-sm font-semibold text-gray-900 bg-yellow-400 rounded-full w-9 h-9 focus:z-20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-yellow-400">{{ num }}</a> | ||
{% else %} | ||
<a href="?page={{ num }}" class="relative inline-flex items-center justify-center text-sm font-semibold text-gray-500 rounded-full w-9 h-9 hover:bg-yellow-100 focus:z-20 focus:outline-offset-0">{{ num }}</a> | ||
<nav class="inline-flex gap-1 isolate" aria-label="Pagination"> | ||
{% if page_obj.has_previous %} | ||
<a href="?page={{ page_obj.previous_page_number }}" class="relative inline-flex items-center justify-center text-gray-500 rounded-full w-9 h-9 hover:bg-yellow-100 focus:z-20 focus:outline-offset-0"> | ||
<span class="sr-only">Previous</span> | ||
<svg class="size-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> | ||
<path fill-rule="evenodd" d="M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z" clip-rule="evenodd" /> | ||
</svg> | ||
</a> | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% if page_obj.has_next %} | ||
<a href="?page={{ page_obj.next_page_number }}" class="relative inline-flex items-center justify-center text-gray-500 rounded-full w-9 h-9 hover:bg-yellow-100 focus:z-20 focus:outline-offset-0"> | ||
<span class="sr-only">Next</span> | ||
<svg class="size-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> | ||
<path fill-rule="evenodd" d="M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /> | ||
</svg> | ||
</a> | ||
{% endif %} | ||
</nav> | ||
{% adjusted_elided_page_range paginator page_obj.number 2 1 as page_range %} | ||
|
||
{% for num in page_range %} | ||
{% if num == '…' %} | ||
<span class="relative inline-flex items-center justify-center text-sm font-semibold text-gray-500 rounded-full w-9 h-9 focus:outline-offset-0">…</span> | ||
{% elif page_obj.number == num %} | ||
<a href="?page={{ num }}" aria-current="page" class="relative z-10 inline-flex items-center justify-center text-sm font-semibold text-gray-900 bg-yellow-400 rounded-full w-9 h-9 focus:z-20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-yellow-400">{{ num }}</a> | ||
{% else %} | ||
<a href="?page={{ num }}" class="relative inline-flex items-center justify-center text-sm font-semibold text-gray-500 rounded-full w-9 h-9 hover:bg-yellow-100 focus:z-20 focus:outline-offset-0">{{ num }}</a> | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% if page_obj.has_next %} | ||
<a href="?page={{ page_obj.next_page_number }}" class="relative inline-flex items-center justify-center text-gray-500 rounded-full w-9 h-9 hover:bg-yellow-100 focus:z-20 focus:outline-offset-0"> | ||
<span class="sr-only">Next</span> | ||
<svg class="size-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon"> | ||
<path fill-rule="evenodd" d="M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /> | ||
</svg> | ||
</a> | ||
{% endif %} | ||
</nav> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
{% endif %} |
Oops, something went wrong.