Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active search - display all artists when search box is empty #2

Open
tataraba opened this issue Mar 27, 2023 · 0 comments
Open

Active search - display all artists when search box is empty #2

tataraba opened this issue Mar 27, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@tataraba
Copy link
Owner

tataraba commented Mar 27, 2023

For 04_htmx branch:

When selecting the "search" element (<input>), the html response that gets rendered in the "#search-results" div is empty (nothing found).

image

Instead, the element should populate with all artists by default. Once the search is started (on keypress), it filters down appropriately.

Right now, the search.html template has this block:

{% block content %}
<section id="body" class="flex flex-col bg-slate-50 justify-center items-center max-w-screen-lg m-auto">
    <div class="flex flex-col justify-center items-center py-10 min-w-full">
        <h2 class="text-2xl leading-relaxed text-slate-800 uppercase">Search Results</h2>
        <div id="search-results" class="flex flex-row flex-wrap justify-center content-center text-center w-full">
            {% if search|list %}
                {% for result in results %}
                    <p>{{result["name"]}}</p>
                {% endfor %}
            {% else %}
                <p>No results found.</p>
            {% endif %}
        </div>
    </div>
</section>
{% endblock %}

Maybe adding a default for all results in the {% else %} statement?

@tataraba tataraba added the enhancement New feature or request label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant