diff --git a/aleksis/core/preferences.py b/aleksis/core/preferences.py index 4e1bd8a40744e8374a3c3df041b2832da3f7275d..5adc20e5a4ff1e6884d15f0f8390ff3f27129e22 100644 --- a/aleksis/core/preferences.py +++ b/aleksis/core/preferences.py @@ -386,3 +386,13 @@ class PDFFileExpirationDuration(IntegerPreference): default = 3 verbose_name = _("PDF file expiration duration") help_text = _("in minutes") + + +@person_preferences_registry.register +class AutoUpdatingDashboard(BooleanPreference): + """User preference for automatically updating the dashboard.""" + + section = general + name = "automatically_update_dashboard" + default = True + verbose_name = _("Automatically update the dashboard and its widgets") diff --git a/aleksis/core/templates/core/index.html b/aleksis/core/templates/core/index.html index 6bbbab8ecfbe2768d12eb139fae110ac5cf62371..6c6bfdd9e5c3858b3367d375c19906625b18cd45 100644 --- a/aleksis/core/templates/core/index.html +++ b/aleksis/core/templates/core/index.html @@ -110,5 +110,7 @@ </div> {% endif %} - <script type="text/javascript" src="{% static "js/include_ajax_live.js" %}"></script> + {% if user.person.preferences.general__automatically_update_dashboard %} + <script type="text/javascript" src="{% static "js/include_ajax_live.js" %}"></script> + {% endif %} {% endblock %}