Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor page tree and add page based statistics #3325

Draft
wants to merge 54 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
39de968
Merge page_tree_archived into page_tree
jarlhengstmengel Nov 27, 2024
63219f4
Fix translation format
JoeyStk Nov 27, 2024
8eb7279
Add template for statistics about viewed pages
JoeyStk Nov 27, 2024
94fcc30
Add _generic_page_tree.html
JoeyStk Nov 27, 2024
3c12cc7
Add additional column to page tree on statistics
JoeyStk Nov 27, 2024
b1545cc
Fix missing backend titles for root pages in page tree and deleting t…
jarlhengstmengel Nov 29, 2024
9edae89
Merging page_tree_node and page_tree_archived_node
jarlhengstmengel Dec 2, 2024
e3c0d63
Disable dragable tree node for archived tree nodes
jarlhengstmengel Dec 3, 2024
8466b66
[WIP] Page based access
JoeyStk Dec 6, 2024
813b751
[WIP] Restored commit
JoeyStk Dec 7, 2024
04ce650
Fix loading of childnodes
jarlhengstmengel Dec 9, 2024
aed75ed
Fix codestyle
jarlhengstmengel Dec 9, 2024
05c2ad1
Add _generic_page_tree_node.hmtl
jarlhengstmengel Dec 9, 2024
7128904
update translations
jarlhengstmengel Dec 9, 2024
718358e
Cleaning up and deleting page_tree_archived files
jarlhengstmengel Dec 9, 2024
4fd9720
Rename page_tree to pages_page_tree
jarlhengstmengel Dec 9, 2024
feb7a64
Add page accesses calls
JoeyStk Dec 9, 2024
a41035d
Merge branch 'feature/refactor_page_tree_and_add_statistics_to_collap…
JoeyStk Dec 9, 2024
bbfb58c
Fix pylint
JoeyStk Dec 9, 2024
c375fde
[WIP] Include page tree to statistics
JoeyStk Dec 10, 2024
68ccfe1
Javascript code
JoeyStk Dec 10, 2024
a9fa6ae
[WIP] First idea for graph
JoeyStk Dec 12, 2024
edc3114
Show bars
JoeyStk Dec 12, 2024
0308511
Merge page_tree_archived into page_tree
jarlhengstmengel Nov 27, 2024
562f952
Fix translation format
JoeyStk Nov 27, 2024
836506b
Add template for statistics about viewed pages
JoeyStk Nov 27, 2024
bc93bc6
Add _generic_page_tree.html
JoeyStk Nov 27, 2024
ce301cc
Add additional column to page tree on statistics
JoeyStk Nov 27, 2024
4f4c99d
Fix missing backend titles for root pages in page tree and deleting t…
jarlhengstmengel Nov 29, 2024
4f91410
Merging page_tree_node and page_tree_archived_node
jarlhengstmengel Dec 2, 2024
046c9d0
Disable dragable tree node for archived tree nodes
jarlhengstmengel Dec 3, 2024
a022d8f
[WIP] Page based access
JoeyStk Dec 6, 2024
ef21cf8
[WIP] Restored commit
JoeyStk Dec 7, 2024
4801e17
Add page accesses calls
JoeyStk Dec 9, 2024
b882d07
Fix loading of childnodes
jarlhengstmengel Dec 9, 2024
5b66426
Fix codestyle
jarlhengstmengel Dec 9, 2024
160d621
Add _generic_page_tree_node.hmtl
jarlhengstmengel Dec 9, 2024
89fd0fd
update translations
jarlhengstmengel Dec 9, 2024
962f0c5
Cleaning up and deleting page_tree_archived files
jarlhengstmengel Dec 9, 2024
5df5e37
Rename page_tree to pages_page_tree
jarlhengstmengel Dec 9, 2024
495e71b
Fix pylint
JoeyStk Dec 9, 2024
7a82550
[WIP] Include page tree to statistics
JoeyStk Dec 10, 2024
71c19ab
Javascript code
JoeyStk Dec 10, 2024
b0ffcc6
[WIP] First idea for graph
JoeyStk Dec 12, 2024
c502c28
Show bars
JoeyStk Dec 12, 2024
b1da1bc
Add option to change time range and language selection
JoeyStk Dec 28, 2024
424448f
Disable editable page tree in statistics
jarlhengstmengel Jan 7, 2025
9305396
Upgrade lucide dependicy
jarlhengstmengel Jan 7, 2025
b183cc5
Update translations
jarlhengstmengel Jan 8, 2025
4d0ff3e
Merge branch 'feature/refactor_page_tree_and_add_statistics_to_collap…
jarlhengstmengel Jan 8, 2025
29809d1
Fix page tree
jarlhengstmengel Jan 8, 2025
4990aea
Fix archived page tree
jarlhengstmengel Jan 11, 2025
7af0938
Fix code styles
JoeyStk Jan 11, 2025
120f93c
Update lucide version
JoeyStk Jan 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions integreat_cms/cms/templates/pages/_generic_page_tree.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% load i18n %}
{% load static %}
{% load content_filters %}
{% load page_filters %}
{% load rules %}
{% block content %}
<th class="text-sm text-left uppercase py-3 pl-4 pr-2 min">
<input type="checkbox" id="bulk-select-all" class="cursor-wait" />
</th>
{% if not filter_form.is_enabled %}
<th class="text-sm text-left uppercase py-3 pl-2 pr-2 min">
{% translate "Hierarchy" %}
</th>
{% endif %}
<th class="text-sm text-left uppercase py-3 pl-2 pr-2">
{% translate "Title in" %} {{ language.translated_name }}
</th>
{% get_current_language as LANGUAGE_CODE %}
{% get_language LANGUAGE_CODE as backend_language %}
{% if backend_language and backend_language != language %}
<th class="text-sm text-left uppercase py-3 px-2">
{% translate "Title in" %} {{ backend_language.translated_name }}
</th>
{% endif %}
{% endblock content %}
70 changes: 70 additions & 0 deletions integreat_cms/cms/templates/pages/_generic_page_tree_node.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{% load i18n %}
{% load content_filters %}
{% load page_filters %}
{% load tree_filters %}
{% load rules %}
{% get_translation page language.slug as page_translation %}
{% block content %}
<td class="pl-4">
<input type="checkbox"
name="selected_ids[]"
value="{{ page.id }}"
class="bulk-select-item cursor-wait" />
</td>
{% if not filter_form.is_enabled %}
{% has_perm 'cms.change_page_object' request.user as can_edit_pages %}
<td class="hierarchy single_icon whitespace-nowrap">
<span data-drag-id="{{ page.id }}"
data-node-descendants="{{ page|get_descendant_ids }}"
class="drag cursor-move text-gray-800 inline-block pl-4 align-middle"
draggable="{% if can_edit_pages and not is_archive and not is_statistics %}true{% else %}false{% endif %}"
title="{% if not is_archive and not is_statistics %}{% translate "Change the order and position of the pages with drag & drop." %}{% else %}{% translate "Drag & drop is disabled for archived pages and statistics." %}{% endif %}">
{% if can_edit_pages %}
<i icon-name="move"></i>
{% endif %}
</span>
{% if not is_archive %}
{% if not page.parent_id and not page.is_leaf or page.parent_id and page.cached_children|length > 0 %}
<span class="toggle-subpages inline-block align-middle cursor-wait transform"
data-expand-title="{% translate "Expand all subpages" %}"
data-collapse-title="{% translate "Collapse all subpages" %}"
data-page-id="{{ page.id }}"
data-page-children="{{ page|get_children_ids }}"
data-page-tree-id="{{ page.tree_id }}">
<i icon-name="chevron-right"></i>
</span>
{% endif %}
{% endif %}
</td>
{% endif %}
<td>
<a href="{% url 'edit_page' page_id=page.id region_slug=request.region.slug language_slug=language.slug %}"
class="block py-1.5 px-2 overflow-hidden max-w-xs whitespace-nowrap text-ellipsis text-gray-800"
title="{% if page_translation %} {{ page_translation.title }}{% endif %}">
{% if page_translation %}
{{ page_translation.title }}
{% else %}
<i>{% translate "Translation not available" %}</i>
{% endif %}
</a>
</td>
{% if not backend_language %}
{% get_current_language as LANGUAGE_CODE %}
{% get_language LANGUAGE_CODE as backend_language %}
{% endif %}
{% if backend_language != language %}
<td>
<a href="{% url 'edit_page' page_id=page.id region_slug=request.region.slug language_slug=backend_language.slug %}"
class="block py-1.5 px-2 overflow-hidden max-w-xs whitespace-nowrap text-ellipsis text-gray-800"
title="{% if page.backend_translation %} {{ page.backend_translation.title }}{% endif %}">
<div class="translation-title">
{% if page.backend_translation %}
{{ page.backend_translation.title }}
{% else %}
<i>{% translate "Translation not available" %}</i>
{% endif %}
</div>
</a>
</td>
{% endif %}
{% endblock content %}
6 changes: 5 additions & 1 deletion integreat_cms/cms/templates/pages/_page_tree_children.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<table>
<tbody>
{% for page in pages %}
{% include "pages/page_tree_node.html" %}
{% if is_statistics %}
{% include "statistics/statistics_viewed_pages_node.html" %}
{% else %}
{% include "pages/pages_page_tree_node.html" %}
{% endif %}
{% endfor %}
</tbody>
</table>
Loading