From 36000b159273d06aba3fb56eab2cd78099b7e54a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 25 Aug 2018 18:20:45 +0100 Subject: Add list of relevant forum topics to last page of results --- app/templates/macros/topics.html | 52 ++++++++++++++++++++++++++++++ app/templates/macros/topictable.html | 33 ------------------- app/templates/packages/list.html | 8 +++++ app/templates/todo/topics.html | 4 +-- app/templates/users/user_profile_page.html | 4 +-- 5 files changed, 64 insertions(+), 37 deletions(-) create mode 100644 app/templates/macros/topics.html delete mode 100644 app/templates/macros/topictable.html (limited to 'app/templates') diff --git a/app/templates/macros/topics.html b/app/templates/macros/topics.html new file mode 100644 index 0000000..0e01185 --- /dev/null +++ b/app/templates/macros/topics.html @@ -0,0 +1,52 @@ +{% macro render_topics_table(topics, show_author=True) -%} + + + + + + {% if show_author %}{% endif %} + + + + + {% for topic in topics %} + + + + + {% if show_author %} + + {% endif %} + + + + + {% endfor %} +
IdTitleAuthorNameLinkActions
{{ topic.topic_id }} + [{{ topic.type.value }}] + + {{ topic.title }} + {% if topic.wip %}[WIP]{% endif %} + {{ topic.author.display_name}}{{ topic.name or ""}}{% if topic.link %}{{ topic.link | domain }}{% endif %} + Create +
+{% endmacro %} + + +{% macro render_topics(topics, current_user, show_author=True) -%} + +{% endmacro %} diff --git a/app/templates/macros/topictable.html b/app/templates/macros/topictable.html deleted file mode 100644 index 8a6b31c..0000000 --- a/app/templates/macros/topictable.html +++ /dev/null @@ -1,33 +0,0 @@ -{% macro render_topictable(topics, show_author=True) -%} - - - - - - {% if show_author %}{% endif %} - - - - - {% for topic in topics %} - - - - - {% if show_author %} - - {% endif %} - - - - - {% endfor %} -
IdTitleAuthorNameLinkActions
{{ topic.topic_id }} - [{{ topic.type.value }}] - - {{ topic.title }} - {% if topic.wip %}[WIP]{% endif %} - {{ topic.author.display_name}}{{ topic.name or ""}}{% if topic.link %}{{ topic.link | domain }}{% endif %} - Create -
-{% endmacro %} diff --git a/app/templates/packages/list.html b/app/templates/packages/list.html index 0ce5c90..53ffac0 100644 --- a/app/templates/packages/list.html +++ b/app/templates/packages/list.html @@ -37,4 +37,12 @@
  • {{ page }} / {{ page_max }}
  • {% if next_url %}
  • Next
  • {% endif %} + + {% if topics %} +

    More content from the forums

    + + {% from "macros/topics.html" import render_topics %} + {{ render_topics(topics, current_user) }} + {% endif %} + {% endblock %} diff --git a/app/templates/todo/topics.html b/app/templates/todo/topics.html index f53c4eb..74a9381 100644 --- a/app/templates/todo/topics.html +++ b/app/templates/todo/topics.html @@ -12,6 +12,6 @@ Topics to be Added {{ topics | count }} remaining.

    - {% from "macros/topictable.html" import render_topictable %} - {{ render_topictable(topics) }} + {% from "macros/topics.html" import render_topics_table %} + {{ render_topics_table(topics) }} {% endblock %} diff --git a/app/templates/users/user_profile_page.html b/app/templates/users/user_profile_page.html index 81b5934..1120849 100644 --- a/app/templates/users/user_profile_page.html +++ b/app/templates/users/user_profile_page.html @@ -107,8 +107,8 @@ List of your forum topics which do not have a matching package.

    - {% from "macros/topictable.html" import render_topictable %} - {{ render_topictable(topics_to_add, show_author=False) }} + {% from "macros/topics.html" import render_topics_table %} + {{ render_topics_table(topics_to_add, show_author=False) }} {% endif %} -- cgit v1.2.3