mirror of
https://github.com/Superredstone/patrickcanal.it.git
synced 2026-09-28 05:07:53 +02:00
feat(portfolio): add project search
This commit is contained in:
@@ -2,40 +2,20 @@
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<div class="row row-deck row-cards">
|
||||
{% for project in object_list %}
|
||||
<div class="col-md-4">
|
||||
{% if project.url %}
|
||||
<a class="card card-link card-link-pop"
|
||||
href="{{ project.url }}"
|
||||
target="_blank">
|
||||
<div class="card-body">
|
||||
<h4>{{ project.name }}</h4>
|
||||
<p>{{ project.short_description }}</p>
|
||||
<div>
|
||||
{% for t in project.tags.all %}
|
||||
<div class="badge text-white fs-5"
|
||||
style="background-color: #{{ t.color }}">{{ t }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{% else %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4>{{ project.name }}</h4>
|
||||
<p>{{ project.short_description }}</p>
|
||||
<div>
|
||||
{% for t in project.tags.all %}
|
||||
<div class="badge text-white fs-5"
|
||||
style="background-color: #{{ t.color }}">{{ t }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<form class="mb-4">
|
||||
<div class="form-floating">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="floating-name"
|
||||
placeholder=""
|
||||
name="query"
|
||||
autocomplete="off"
|
||||
hx-target="#projects"
|
||||
hx-get="{% url 'projects-query' %}"
|
||||
hx-trigger="load, input, delay:200ms" />
|
||||
<label for="floating-name">{% trans "Search" %}</label>
|
||||
</div>
|
||||
</form>
|
||||
<div id="projects"></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user