diff --git a/templates/base.html b/templates/base.html index 7a2074f2..891e243f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -93,14 +93,14 @@ with this program; if not, write to the Free Software Foundation, Inc., {% can_view_app users %}
  • {% trans "Manage the users" %}
  • {% trans "Manage the clubs" %}
  • - {% acl_end %} + {% acl_end %} {% can_view_app machines %}
  • {% trans "Manage the machines" %}
  • {% acl_end %} {% can_view_app cotisations %}
  • {% trans "Manage the subscriptions" %}
  • {% acl_end %} - + {% for template in optionnal_templates_navbar_user_list%} {{ template }} {% endfor %} @@ -301,8 +301,9 @@ with this program; if not, write to the Free Software Foundation, Inc., let s = Sapphire(); Konami(s.activate); + {% if request.user.shortcuts_enabled %} - + {% endif %} {# Read the documentation for more information #} diff --git a/users/forms.py b/users/forms.py index 33100c9d..75d73de1 100644 --- a/users/forms.py +++ b/users/forms.py @@ -441,7 +441,8 @@ class AdherentEditForm(AdherentForm): 'telephone', 'room', 'shell', - 'gpg_fingerprint' + 'gpg_fingerprint', + 'shortcuts_enabled', ] class ClubForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): diff --git a/users/migrations/0083_user_shortcuts_enabled.py b/users/migrations/0083_user_shortcuts_enabled.py new file mode 100644 index 00000000..8ba2252d --- /dev/null +++ b/users/migrations/0083_user_shortcuts_enabled.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.23 on 2019-09-20 12:38 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0082_auto_20190908_1338'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='shortcuts_enabled', + field=models.BooleanField(default=True, verbose_name='Enable shortcuts on Re2o website'), + ), + ] diff --git a/users/models.py b/users/models.py index 66d53a96..0438ae83 100755 --- a/users/models.py +++ b/users/models.py @@ -247,6 +247,10 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, blank=True, null=True ) + shortcuts_enabled = models.BooleanField( + verbose_name=_("Enable shortcuts on Re2o website"), + default=True + ) USERNAME_FIELD = 'pseudo' REQUIRED_FIELDS = ['surname', 'email'] diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index a7079232..29c55f32 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -305,6 +305,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
    {{ users.shell }}
    {% endif %} +
    +
    {% trans "Shortcuts enabled" %}
    +
    {{ users.shortcuts_enabled | tick }}
    +