diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-12-23 23:49:49 +0000 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-12-23 23:54:20 +0000 |
| commit | 50889ccca57cea9166ab7c64a83d540d6c0a20ce (patch) | |
| tree | 57d757bc7250517b8f4b5e38251b9dfc8422bf8c /app/templates/macros | |
| parent | b8ca5d24c50f108ea574c89405e2ce2e70ea18af (diff) | |
| download | cheatdb-50889ccca57cea9166ab7c64a83d540d6c0a20ce.tar.xz | |
Add topic searching and topic discarding
Diffstat (limited to 'app/templates/macros')
| -rw-r--r-- | app/templates/macros/topics.html | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/app/templates/macros/topics.html b/app/templates/macros/topics.html index a3d40c6..66d11b4 100644 --- a/app/templates/macros/topics.html +++ b/app/templates/macros/topics.html @@ -1,7 +1,6 @@ -{% macro render_topics_table(topics, show_author=True) -%} +{% macro render_topics_table(topics, show_author=True, show_discard=False) -%} <table class="table"> <tr> - <th>Id</th> <th></th> <th>Title</th> {% if show_author %}<th>Author</th>{% endif %} @@ -10,8 +9,7 @@ <th>Actions</th> </tr> {% for topic in topics %} - <tr{% if topic.wip %} class="wiptopic"{% endif %}> - <td>{{ topic.topic_id }}</td> + <tr class="{% if topic.wip %}wiptopic{% endif %}{% if topic.discarded %}discardtopic{% endif %}"> <td> [{{ topic.type.value }}] </td> @@ -24,8 +22,20 @@ {% endif %} <td>{{ topic.name or ""}}</td> <td>{% if topic.link %}<a href="{{ topic.link }}">{{ topic.link | domain }}</a>{% endif %}</td> - <td> - <a href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">Create</a> + <td class="btn-group"> + <a class="btn btn-primary" + href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}"> + Create + </a> + {% if show_discard %} + <a class="btn btn-{% if topic.discarded %}success{% else %}danger{% endif %} topic-discard" data-tid={{ topic.topic_id }}> + {% if topic.discarded %} + Show + {% else %} + Discard + {% endif %} + </a> + {% endif %} </td> </tr> {% endfor %} |
