Skip to content

Commit

Permalink
Add popup for information about page access statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
MizukiTemma committed Nov 20, 2024
1 parent d26dd9a commit 96dc83f
Show file tree
Hide file tree
Showing 12 changed files with 188 additions and 9 deletions.
11 changes: 11 additions & 0 deletions integreat_cms/cms/fixtures/test_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1727,6 +1728,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1753,6 +1755,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1779,6 +1782,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1805,6 +1809,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1831,6 +1836,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1857,6 +1863,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1883,6 +1890,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1909,6 +1917,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1935,6 +1944,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand All @@ -1961,6 +1971,7 @@
"chat_last_visited": "0001-01-01T00:00:00Z",
"expert_mode": true,
"page_tree_tutorial_seen": true,
"statistics_tutorial_seen": true,
"distribute_sidebar_boxes": false,
"totp_key": null,
"passwordless_authentication_enabled": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.16 on 2024-11-19 16:50

from django.db import migrations, models


class Migration(migrations.Migration):
"""
Migration to add a new field statistics_tutorial_seen to User model
"""

dependencies = [
("cms", "0110_region_zammad_webhook_token_alter_region_zammad_url"),
]

operations = [
migrations.AddField(
model_name="user",
name="statistics_tutorial_seen",
field=models.BooleanField(
default=False,
help_text="Will be set to true once the user dismissed the tutorial for page access statistics",
verbose_name="Page access statistics tutorial seen",
),
),
]
7 changes: 7 additions & 0 deletions integreat_cms/cms/models/users/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ class User(AbstractUser, AbstractBaseModel):
"Will be set to true once the user dismissed the page tree tutorial"
),
)
statistics_tutorial_seen = models.BooleanField(
default=False,
verbose_name=_("Page access statistics tutorial seen"),
help_text=_(
"Will be set to true once the user dismissed the tutorial for page access statistics"
),
)
distribute_sidebar_boxes = models.BooleanField(
default=False,
verbose_name=_("automatically distribute sidebar boxes"),
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/cms/templates/generic_tutorial_dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<input id="dismiss-tutorial"
type="checkbox"
name="dismiss-tutorial"
{% if request.user.page_tree_tutorial_seen %}checked{% endif %} />
{% if tutorial_seen %}checked{% endif %} />
{% translate "Don't show again" %}
</label>
<button type="submit" class="btn">
Expand Down
2 changes: 1 addition & 1 deletion integreat_cms/cms/templates/pages/page_tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ <h3 class="font-bold text-xl">
</div>
{% endif %}
{% include "../generic_confirmation_dialog.html" %}
{% include "../tutorials/page_tree.html" with tutorial_id="page-tree" hidden=request.user.page_tree_tutorial_seen %}
{% include "../tutorials/page_tree.html" with tutorial_id="page-tree" hidden=tutorial_seen %}
{% include "pages/_page_preview_overlay.html" %}
{% include "pages/_page_xliff_export_overlay.html" %}
{% include "_machine_translation_overlay.html" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<div class="col-sm-12">
<h1 class="heading">
{% translate "Statistics" %}
<button data-show-tutorial="page-access-statistics-info"
class="hover:text-blue-500">
<i icon-name="info" class="align-baseline"></i>
</button>
</h1>
</div>
<div class="xl:flex gap-3 pt-2">
Expand All @@ -17,5 +21,6 @@ <h1 class="heading">
</div>
</div>
</div>
{% include "../tutorials/page_access_statistics.html" with tutorial_id="page-access-statistics-info" hidden=tutorial_seen %}
{% endblock content %}
{% endif %}
38 changes: 38 additions & 0 deletions integreat_cms/cms/templates/tutorials/page_access_statistics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% extends "../generic_tutorial_dialog.html" %}
{% load i18n %}
{% load static %}
{% block content %}
<!-- Pop-Up Header -->
<div class="flex items-center bg-water-500 w-full rounded h-12">
<h2 class="flex items-center font-semibold leading-normal pl-2 text-black text-xl">
{% translate "Important information about page access" %}
</h2>
</div>
<!-- Pop-Up Content -->
<div class="px-4">
<p class="mt-4 text-s max-w-fit text-gray-600">
{% translate "There is a text here that helps employees to interpret the numbers and statistics appropriately." %}
</p>
<ul class="list-disc my-2 pl-5 text-s text-gray-600">
<li>
{% translate "Offline access cannot be counted. This means that even a page with few hits in the list can have higher hits that took place offline." %}
</li>
<li>
{% translate "Pages that contain specific information about seasonal or one-time events (e.g. events or election times) may receive higher traffic during certain periods. Outside these phases, traffic may be lower." %}
</li>
<li>
{% translate "Page views should not be viewed in isolation, but always in the context of the overall communication strategy. A page with few hits can still be an important part of user guidance and information." %}
</li>
<li>
{% translate "Some pages may be rarely visited, but are extremely important for specific target groups (e.g. newcomers, people with special needs). For example, information about special advisory services or integration offers could not be used by the general public, but could be indispensable for the target group." %}
</li>
<li>
{% translate "Content that is no longer current or appears outdated can lead to a decrease in traffic. It is therefore important to regularly check whether content has been updated and how this affects the statistics. Low traffic numbers could indicate that the page is no longer perceived as relevant." %}
</li>
</ul>
<p class="mt-4 text-s max-w-fit text-gray-600">
{% translate "You can find more information about this in " %}<a href="{% url 'public:wiki_redirect' %}"
class="text-blue-500 underline">{% translate "Wiki" %}</a>
</p>
</div>
{% endblock content %}
1 change: 1 addition & 0 deletions integreat_cms/cms/views/pages/page_tree_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,6 @@ def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
currently_in_translation=True,
).count()
> 0,
"tutorial_seen": request.user.page_tree_tutorial_seen,
},
)
2 changes: 2 additions & 0 deletions integreat_cms/cms/views/settings/dismiss_tutorial_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> JsonResponse:

if (tutorial_slug := kwargs.get("slug")) == "page-tree":
request.user.page_tree_tutorial_seen = True
elif (tutorial_slug := kwargs.get("slug")) == "page-access-statistics-info":
request.user.statistics_tutorial_seen = True
else:
return JsonResponse(
{"error": f"Tutorial '{tutorial_slug}' not found."}, status=404
Expand Down
1 change: 1 addition & 0 deletions integreat_cms/cms/views/statistics/statistics_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ def get(
{
**self.get_context_data(**kwargs),
"form": form,
"tutorial_seen": request.user.statistics_tutorial_seen,
},
)
101 changes: 94 additions & 7 deletions integreat_cms/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2337,8 +2337,8 @@ msgid ""
"A Zammad URL, Zammad Webhook Token and Access Token are required in order to "
"enable the Integreat Chat."
msgstr ""
"Eine Zammad URL, ein Zammad Webhook Token und ein Zugangstoken sind erforderlich um, den Integreat "
"Chat aktivieren."
"Eine Zammad URL, ein Zammad Webhook Token und ein Zugangstoken sind "
"erforderlich um, den Integreat Chat aktivieren."

#: cms/forms/regions/region_form.py
msgid ""
Expand Down Expand Up @@ -4236,8 +4236,8 @@ msgid ""
"webhook path."
msgstr ""
"Token der von Zammad Webhooks verwendet wird, um das Integreat CMS über "
"geänderte Tickets zu informieren. Der Token muss als token= GET parameter dem "
"Webhook-Pfad angefügt werden."
"geänderte Tickets zu informieren. Der Token muss als token= GET parameter "
"dem Webhook-Pfad angefügt werden."

#: cms/models/regions/region.py
msgid "Zammad chat handlers"
Expand Down Expand Up @@ -4353,6 +4353,18 @@ msgstr ""
"Wird auf wahr gesetzt, wenn der:die Benutzer:in das Tutorial zum Seitenbaum "
"angesehen hat"

#: cms/models/users/user.py
msgid "Page access statistics tutorial seen"
msgstr "Seitenzugriff-Tutorial angesehen"

#: cms/models/users/user.py
msgid ""
"Will be set to true once the user dismissed the tutorial for page access "
"statistics"
msgstr ""
"Wird auf wahr gesetzt, wenn der:die Benutzer:in das Tutorial zum "
"Seitezugriff angesehen hat"

#: cms/models/users/user.py
msgid "automatically distribute sidebar boxes"
msgstr "Sidebar-Boxen automatisch verteilen"
Expand Down Expand Up @@ -8538,6 +8550,84 @@ msgstr "Summe pro Art des Inhalts"
msgid "Total per Status"
msgstr "Summe pro Status"

#: cms/templates/tutorials/page_access_statistics.html
msgid "Important information about page access"
msgstr "Wichtige Hinweise zu Seitenzugriffen"

#: cms/templates/tutorials/page_access_statistics.html
msgid ""
"There is a text here that helps employees to interpret the numbers and "
"statistics appropriately."
msgstr ""
"Hier steht ein Text, der Mitarbeiter:innen dabei hilft, die Zahlen und "
"Statistiken angemessen interpretieren zu können."

#: cms/templates/tutorials/page_access_statistics.html
msgid ""
"Offline access cannot be counted. This means that even a page with few hits "
"in the list can have higher hits that took place offline."
msgstr ""
"Offline-Zugriffe können nicht mitgerechnet werden. D.h. auch eine Seite mit "
"wenigen Zugriffen in der Liste kann höhere Zugriffe haben, die offline "
"stattgefunden haben."

#: cms/templates/tutorials/page_access_statistics.html
msgid ""
"Pages that contain specific information about seasonal or one-time events (e."
"g. events or election times) may receive higher traffic during certain "
"periods. Outside these phases, traffic may be lower."
msgstr ""
"Seiten, die spezifische Informationen zu saisonalen oder einmaligen "
"Ereignissen enthalten (z.B. Veranstaltungen oder Wahlzeiten), können in "
"bestimmten Phasen höhere Zugriffszahlen aufweisen. Außerhalb dieser Phasen "
"sind die Zugriffe eventuell niedriger."

#: cms/templates/tutorials/page_access_statistics.html
msgid ""
"Page views should not be viewed in isolation, but always in the context of "
"the overall communication strategy. A page with few hits can still be an "
"important part of user guidance and information."
msgstr ""
"Seitenzugriffe sollten nicht isoliert betrachtet werden, sondern immer im "
"Kontext der gesamten Kommunikationsstrategie. Eine Seite mit wenigen "
"Zugriffen kann trotzdem ein wichtiger Bestandteil der Nutzerführung und "
"Information sein."

#: cms/templates/tutorials/page_access_statistics.html
msgid ""
"Some pages may be rarely visited, but are extremely important for specific "
"target groups (e.g. newcomers, people with special needs). For example, "
"information about special advisory services or integration offers could not "
"be used by the general public, but could be indispensable for the target "
"group."
msgstr ""
"Manche Seiten werden möglicherweise selten besucht, sind aber für "
"spezifische Zielgruppen (z.B. Neuankömmlinge, Menschen mit besonderen "
"Bedürfnissen) extrem wichtig. Zum Beispiel könnten Informationen über "
"spezielle Beratungsdienste oder Integrationsangebote nicht von der breiten "
"Masse genutzt werden, aber für die Zielgruppe unverzichtbar sein."

#: cms/templates/tutorials/page_access_statistics.html
msgid ""
"Content that is no longer current or appears outdated can lead to a decrease "
"in traffic. It is therefore important to regularly check whether content has "
"been updated and how this affects the statistics. Low traffic numbers could "
"indicate that the page is no longer perceived as relevant."
msgstr ""
"Inhalte, die nicht mehr aktuell sind oder veraltet erscheinen, können zu "
"einem Rückgang der Zugriffe führen. Es ist daher wichtig, regelmäßig zu "
"überprüfen, ob Inhalte aktualisiert wurden und wie dies die Statistiken "
"beeinflusst. Niedrige Zugriffszahlen könnten darauf hinweisen, dass die "
"Seite nicht mehr als relevant wahrgenommen wird."

#: cms/templates/tutorials/page_access_statistics.html
msgid "You can find more information about this in "
msgstr "Mehr Informationen dazu finden Sie im"

#: cms/templates/tutorials/page_access_statistics.html
msgid "Wiki"
msgstr "Wiki"

#: cms/templates/tutorials/page_tree.html
msgid "Introduction - Page Tree"
msgstr "Einführung in den neuen Seiten-Baum"
Expand Down Expand Up @@ -11248,9 +11338,6 @@ msgstr ""
#~ msgid "Import calendar"
#~ msgstr "Kalender importieren"

#~ msgid "Find more information about this"
#~ msgstr "Mehr Informationen finden Sie"

#~ msgid ""
#~ "Easy words and short sentences can increase the text understandability."
#~ msgstr ""
Expand Down
2 changes: 2 additions & 0 deletions integreat_cms/release_notes/current/unreleased/3132.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
en: Add popup with information about page access statistics
de: Füge Popup mit Informationen über die Zugriffsstatistiken hinzu

0 comments on commit 96dc83f

Please sign in to comment.