diff options
| author | rubenwardy <rw@rubenwardy.com> | 2020-07-18 02:48:22 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2020-07-18 02:48:22 +0100 |
| commit | 68a132f271b04eb7c1812609c6be4f78960fad22 (patch) | |
| tree | 0bfc0ec08ba691ff453215258182051e07587b2d /app/templates | |
| parent | c7b1dcec4f3f924ad300ddb662eb573b1677c979 (diff) | |
| download | cheatdb-68a132f271b04eb7c1812609c6be4f78960fad22.tar.xz | |
Add tags list to homepage
Diffstat (limited to 'app/templates')
| -rw-r--r-- | app/templates/index.html | 14 | ||||
| -rw-r--r-- | app/templates/packages/list.html | 10 |
2 files changed, 18 insertions, 6 deletions
diff --git a/app/templates/index.html b/app/templates/index.html index 1911058..6fb833e 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -58,6 +58,20 @@ {{ render_pkggrid(pop_txp) }} + <h2 class="my-3">{{ _("Search by Tags") }}</h2> + {% for pair in tags %} + {% set count = pair[0] %} + {% set tag = pair[1] %} + + <a class="btn btn-sm btn-secondary m-1" rel="nofollow" + href="{{ url_for('packages.list_all', tag=tag.name) }}"> + {{ tag.title }} + <span class="badge badge-pill badge-light ml-1">{{ count }}</span> + </a> + {% endfor %} + <div class="clearfix mb-4"></div> + + <a href="{{ url_for('packages.list_reviews') }}" class="btn btn-secondary float-right"> {{ _("See more") }} </a> diff --git a/app/templates/packages/list.html b/app/templates/packages/list.html index ec17f80..49fcdd1 100644 --- a/app/templates/packages/list.html +++ b/app/templates/packages/list.html @@ -27,18 +27,16 @@ {% set tag = pair[1] %} {% if tag in selected_tags %} - <a class="badge badge-primary" rel="nofollow" + <a class="btn btn-sm btn-primary m-1" rel="nofollow" href="{{ url_set_query(page=1, _remove={ 'tag': tag.name }) }}"> - {{ tag.title }} - ({{ count }}) + <span class="badge badge-pill badge-light ml-1">{{ count }}</span> </a> {% else %} - <a class="badge badge-secondary" rel="nofollow" + <a class="btn btn-sm btn-secondary m-1" rel="nofollow" href="{{ url_set_query(page=1, _add={ 'tag': tag.name }) }}"> - {{ tag.title }} - ({{ count }}) + <span class="badge badge-pill badge-light ml-1">{{ count }}</span> </a> {% endif %} {% endfor %} |
