Skip to content

Commit

Permalink
Add row template variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlhengstmengel committed Feb 25, 2025
1 parent d6513b5 commit 13eec4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 1 addition & 5 deletions integreat_cms/cms/templates/pages/_page_tree_children.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
<table>
<tbody>
{% for page in pages %}
{% if is_statistics %}
{% include "statistics/statistics_viewed_pages_node.html" %}
{% else %}
{% include "pages/pages_page_tree_node.html" %}
{% endif %}
{% include row_template %}
{% endfor %}
</tbody>
</table>
6 changes: 6 additions & 0 deletions integreat_cms/cms/views/pages/partial_page_tree_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def render_partial_page_tree_views(
# Convert is_statistics from String to Boolean
is_statistics = literal_eval(is_statistics)

if is_statistics:
row_template = "statistics/statistics_viewed_pages_node.html"
if not is_statistics and not is_archive:
row_template = "pages/pages_page_tree_node.html"

backend_language = Language.objects.filter(slug=get_language()).first()

all_pages = (
Expand Down Expand Up @@ -81,6 +86,7 @@ def render_partial_page_tree_views(
"parent_id": parent.id,
"is_archive": is_archive,
"is_statistics": is_statistics,
"row_template": row_template,
},
request,
)
Expand Down

0 comments on commit 13eec4d

Please sign in to comment.