|
1 | 1 | {% extends "core/base.html" %} |
2 | 2 | {% block content %} |
3 | | - <div class="mb-3"> |
4 | | - {% for object in object_list %} |
5 | | - <div class="mb-1 rounded"> |
6 | | - <div class="shadow-xl card bg-base-100"> |
7 | | - <div class="pb-2 card-body"> |
8 | | - <a target="_blank" href="{{ object.github_url }}"> |
9 | | - <h2 class="flex justify-between card-title"> |
10 | | - <span>{{ object.full_name }}</span> |
11 | | - <span class="text-sm">⭐ {{ object.stars }}</span> |
12 | | - </h2> |
13 | | - </a> |
14 | | - <p> |
15 | | - {% for topic in object.topics|slice:"0:5" %} |
16 | | - <a class="p-3 mr-1 text-xs badge badge-outline hover:brightness-125" |
17 | | - href="{% url 'core:search' %}?q={{ topic }}">{{ topic|truncatechars:30 }}</a> |
18 | | - {% endfor %} |
19 | | - </p> |
20 | | - <p class="mt-2">{{ object.description }}</p> |
21 | | - </div> |
| 3 | + <div class="mb-5 w-full flex-col content-center self-center lg:mt-5 lg:flex lg:w-7/12"> |
| 4 | + <form class="form flex justify-between"> |
| 5 | + <label class="form-control"> |
| 6 | + <div class="label"> |
| 7 | + <span class="label-text">Search</span> |
22 | 8 | </div> |
| 9 | + <input type="text" |
| 10 | + name="q" |
| 11 | + value="{{ request.GET.q }}" |
| 12 | + class="input input-bordered input-sm min-w-64" |
| 13 | + hx-get="{% url 'core:search' %}" |
| 14 | + hx-target="#search_table" |
| 15 | + hx-trigger="keyup changed delay:1s" |
| 16 | + hx-push-url="true" /> |
| 17 | + </label> |
| 18 | + <div class="flex gap-4"> |
| 19 | + <label class="form-control"> |
| 20 | + <div class="label"> |
| 21 | + <span class="label-text">Category</span> |
| 22 | + </div> |
| 23 | + <select name="category" |
| 24 | + class="select select-bordered" |
| 25 | + hx-get="{% url 'core:search' %}" |
| 26 | + hx-target="#search_table" |
| 27 | + hx-trigger="change" |
| 28 | + hx-push-url="true"> |
| 29 | + <option selected>All</option> |
| 30 | + {% for category in categories %}<option value="{{ category.name }}">{{ category.name }}</option>{% endfor %} |
| 31 | + </select> |
| 32 | + </label> |
23 | 33 | </div> |
24 | | - {% endfor %} |
| 34 | + </form> |
| 35 | + <table id="search_table" class="table table-sm mt-7"> |
| 36 | + {% include "core/search_table.html" %} |
| 37 | + </table> |
25 | 38 | </div> |
26 | 39 | {% endblock content %} |
0 commit comments