| 1 |
<div class="results-container results-list" id="results-container-inner"> |
| 2 |
|
| 3 |
<div class="results-table" id="results-table"> |
| 4 |
{% if mode == "projects" %} |
| 5 |
{% for project in projects %} |
| 6 |
<a href="/p/{{ project.slug }}" class="table-row project-row"> |
| 7 |
<span class="row-info"><span class="row-name">{{ project.title }}</span><span class="row-creator">{{ project.creator }}</span></span> |
| 8 |
<span class="row-category">{{ project.category_name.as_deref().unwrap_or(&project.project_type) }}</span> |
| 9 |
<span class="row-items">{{ project.item_count }}</span> |
| 10 |
<span class="row-date">{{ project.date }}</span> |
| 11 |
</a> |
| 12 |
{% endfor %} |
| 13 |
{% if projects.is_empty() %} |
| 14 |
<div class="empty-state"> |
| 15 |
<p>No projects found matching your filters.</p> |
| 16 |
<p class="empty-state-hint">Try broadening your search or <a href="/discover">clearing all filters</a>.</p> |
| 17 |
</div> |
| 18 |
{% endif %} |
| 19 |
{% else %} |
| 20 |
{% for item in items %} |
| 21 |
<div class="table-row table-row-item"> |
| 22 |
<a href="{% if item.is_free %}/i/{{ item.id }}{% else %}/purchase/{{ item.id }}{% endif %}" class="table-row-link"> |
| 23 |
<span class="row-type">{{ item.item_type }}</span> |
| 24 |
<span class="row-info"><span class="row-name">{{ item.name }}</span><span class="row-creator">{{ item.project }} · {{ item.creator }}</span></span> |
| 25 |
<span class="row-category">{{ item.primary_tag }}</span> |
| 26 |
<span class="row-price">{{ item.price }}</span> |
| 27 |
<span class="row-date">{{ item.date }}</span> |
| 28 |
<span class="discover-row-ai-tier">{{ item.ai_tier }}</span> |
| 29 |
</a> |
| 30 |
{% if is_authenticated %} |
| 31 |
<button class="row-save collection-picker-anchor" data-collection-trigger data-item-id="{{ item.id }}" |
| 32 |
onclick="event.stopPropagation(); openCollectionPicker('{{ item.id }}', this)" title="Save to collection" aria-label="Save to collection">+</button> |
| 33 |
{% endif %} |
| 34 |
</div> |
| 35 |
{% endfor %} |
| 36 |
{% if items.is_empty() %} |
| 37 |
<div class="empty-state"> |
| 38 |
<p>No items found matching your filters.</p> |
| 39 |
<p class="empty-state-hint">Try broadening your search or <a href="/discover">clearing all filters</a>.</p> |
| 40 |
</div> |
| 41 |
{% endif %} |
| 42 |
{% endif %} |
| 43 |
</div> |
| 44 |
|
| 45 |
|
| 46 |
<div class="results-grid" id="results-grid"> |
| 47 |
{% if mode == "projects" %} |
| 48 |
{% for project in projects %} |
| 49 |
<a href="/p/{{ project.slug }}" class="grid-card"> |
| 50 |
<div class="grid-card-content"> |
| 51 |
<div class="grid-card-title">{{ project.title }}</div> |
| 52 |
<div class="grid-card-meta">{{ project.creator }}</div> |
| 53 |
<div class="grid-card-footer"> |
| 54 |
<span class="grid-card-category">{{ project.category_name.as_deref().unwrap_or(&project.project_type) }}</span> |
| 55 |
<span class="grid-card-stat">{{ project.item_count }} items</span> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
</a> |
| 59 |
{% endfor %} |
| 60 |
{% if projects.is_empty() %} |
| 61 |
<div class="empty-state"> |
| 62 |
<p>No projects found matching your filters.</p> |
| 63 |
<p class="empty-state-hint">Try broadening your search or <a href="/discover">clearing all filters</a>.</p> |
| 64 |
</div> |
| 65 |
{% endif %} |
| 66 |
{% else %} |
| 67 |
{% for item in items %} |
| 68 |
<div class="grid-card discover-grid-card"> |
| 69 |
{% if is_authenticated %} |
| 70 |
<button class="grid-card-save collection-picker-anchor" data-collection-trigger data-item-id="{{ item.id }}" |
| 71 |
onclick="event.stopPropagation(); openCollectionPicker('{{ item.id }}', this)" title="Save to collection" aria-label="Save to collection">+</button> |
| 72 |
{% endif %} |
| 73 |
<a href="{% if item.is_free %}/i/{{ item.id }}{% else %}/purchase/{{ item.id }}{% endif %}" class="discover-card-link"> |
| 74 |
<div class="grid-card-thumbnail">{{ item.item_type }}</div> |
| 75 |
<div class="grid-card-content"> |
| 76 |
<div class="grid-card-title">{{ item.name }}</div> |
| 77 |
<div class="grid-card-meta">{{ item.project }} · {{ item.creator }}</div> |
| 78 |
<div class="grid-card-footer"> |
| 79 |
<span class="grid-card-category">{{ item.primary_tag }}</span> |
| 80 |
<span class="grid-card-price">{{ item.price }}</span> |
| 81 |
<span class="discover-row-ai-tier">{{ item.ai_tier }}</span> |
| 82 |
</div> |
| 83 |
</div> |
| 84 |
</a> |
| 85 |
</div> |
| 86 |
{% endfor %} |
| 87 |
{% if items.is_empty() %} |
| 88 |
<div class="empty-state"> |
| 89 |
<p>No items found matching your filters.</p> |
| 90 |
<p class="empty-state-hint">Try broadening your search or <a href="/discover">clearing all filters</a>.</p> |
| 91 |
</div> |
| 92 |
{% endif %} |
| 93 |
{% endif %} |
| 94 |
</div> |
| 95 |
</div> |
| 96 |
|
| 97 |
<div class="table-footer"> |
| 98 |
<span class="page-info">Showing {{ showing_start }}-{{ showing_end }} of {{ total_items }}</span> |
| 99 |
<div class="pagination"> |
| 100 |
{% if total_pages > 0 %} |
| 101 |
<button {% if current_page == 1 %}disabled{% endif %} |
| 102 |
hx-get="/discover/results" |
| 103 |
hx-target="#results-container" |
| 104 |
hx-include=".discover-filter" |
| 105 |
hx-vals='{"page": {{ current_page - 1 }}}' |
| 106 |
{% if current_page == 1 %}hx-disabled-elt="this"{% endif %}>Prev</button> |
| 107 |
{% for p in pagination_range %} |
| 108 |
<button {% if *p == current_page %}class="is-selected"{% endif %} |
| 109 |
hx-get="/discover/results" |
| 110 |
hx-target="#results-container" |
| 111 |
hx-include=".discover-filter" |
| 112 |
hx-vals='{"page": {{ p }}}'>{{ p }}</button> |
| 113 |
{% endfor %} |
| 114 |
{% if total_pages > 5 %} |
| 115 |
<button disabled>...</button> |
| 116 |
<button hx-get="/discover/results" |
| 117 |
hx-target="#results-container" |
| 118 |
hx-include=".discover-filter" |
| 119 |
hx-vals='{"page": {{ total_pages }}}'>{{ total_pages }}</button> |
| 120 |
{% endif %} |
| 121 |
<button {% if current_page == total_pages || total_pages == 0 %}disabled{% endif %} |
| 122 |
hx-get="/discover/results" |
| 123 |
hx-target="#results-container" |
| 124 |
hx-include=".discover-filter" |
| 125 |
hx-vals='{"page": {{ current_page + 1 }}}' |
| 126 |
{% if current_page == total_pages || total_pages == 0 %}hx-disabled-elt="this"{% endif %}>Next</button> |
| 127 |
{% endif %} |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
|