]> git.lizzy.rs Git - cheatdb.git/blobdiff - app/templates/packages/list.html
Add description title tooltips to tags
[cheatdb.git] / app / templates / packages / list.html
index d516f2c2cc9fb1d63cf15000e45283b49abfc911..8becd70a75ad57dea0b41b097163417b6ef1563f 100644 (file)
@@ -5,30 +5,59 @@
 {% endblock %}
 
 {% block content %}
-       <form method="get" action="" class="plsearchform">
-               {% if type %}<input type="hidden" name="type" value="{{ type }}" />{% endif %}
-               <input type="text" name="q" value="{{ query or ''}}" />
-               <input type="submit" value="Search" />
+       {% if authors %}
+               <p class="alert alert-primary">
+                       Did you mean to search for packages by
 
-               <p>
-                       Found {{ packages | count }} packages.
+                       {% for author in authors %}
+                               <a href="{{ url_for('packages.list_all', type=type, author=author[0], q=author[1]) }}">{{ author[0] }}</a>
+                               {% if not loop.last %}
+                               ,
+                               {% endif %}
+                       {% endfor %}
+                       ?
                </p>
-       </form>
+       {% endif %}
+
+       <aside class="mb-5">
+               <p class="text-muted">Filter by tags</p>
 
-       <aside class="box box_grey outsidecontainer">
-               <h3>Tags</h3>
+               {% for pair in tags %}
+                       {% set count = pair[0] %}
+                       {% set tag = pair[1] %}
 
-               <ul class="flatlist">
-                       {% for t in tags %}
-                               <li><a href="{{ url_for('packages_page', q=(query or '')+' tag:'+t.name, type=type) }}">
-                                       {{ t.title }}
-                               </a></li>
+                       {% if tag in selected_tags %}
+                               <a class="btn btn-sm btn-primary m-1" rel="nofollow"
+                                               title="{{ tag.description or '' }}"
+                                               href="{{ url_set_query(page=1, _remove={ 'tag': tag.name }) }}">
+                                       {{ tag.title }}
+                                       <span class="badge badge-pill badge-light ml-1">{{ count }}</span>
+                               </a>
                        {% else %}
-                               <li><i>No tags available</i></ul>
-                       {% endfor %}
-               </ul>
+                               <a class="btn btn-sm btn-secondary m-1" rel="nofollow"
+                                               title="{{ tag.description or '' }}"
+                                               href="{{ url_set_query(page=1, _add={ 'tag': tag.name }) }}">
+                                       {{ tag.title }}
+                                       <span class="badge badge-pill badge-light ml-1">{{ count }}</span>
+                               </a>
+                       {% endif %}
+               {% endfor %}
        </aside>
 
        {% from "macros/packagegridtile.html" import render_pkggrid %}
        {{ render_pkggrid(packages) }}
+
+
+       {% from "macros/pagination.html" import render_pagination %}
+       {{ render_pagination(pagination, url_set_query) }}
+
+
+       {% if topics %}
+               <h2 style="margin-top:2em;">More content from the forums</h2>
+
+               {% from "macros/topics.html" import render_topics %}
+               {{ render_topics(topics, current_user) }}
+       {% endif %}
+
+
 {% endblock %}