mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 03:13:12 +00:00
Fix #151
This commit is contained in:
parent
347cd8bf5d
commit
b8d8c11cb0
5 changed files with 34 additions and 4 deletions
|
@ -93,14 +93,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% can_view_app users %}
|
{% can_view_app users %}
|
||||||
<li><a href="{% url 'users:index' %}"><i class="fa fa-user"></i> {% trans "Manage the users" %}</a></li>
|
<li><a href="{% url 'users:index' %}"><i class="fa fa-user"></i> {% trans "Manage the users" %}</a></li>
|
||||||
<li><a href="{% url 'users:index-clubs' %}"><i class="fa fa-users"></i> {% trans "Manage the clubs" %}</a></li>
|
<li><a href="{% url 'users:index-clubs' %}"><i class="fa fa-users"></i> {% trans "Manage the clubs" %}</a></li>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% can_view_app machines %}
|
{% can_view_app machines %}
|
||||||
<li><a href="{% url 'machines:index' %}"><i class="fa fa-desktop"></i> {% trans "Manage the machines" %}</a></li>
|
<li><a href="{% url 'machines:index' %}"><i class="fa fa-desktop"></i> {% trans "Manage the machines" %}</a></li>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% can_view_app cotisations %}
|
{% can_view_app cotisations %}
|
||||||
<li><a href="{% url 'cotisations:index' %}"><i class="fa fa-eur"></i> {% trans "Manage the subscriptions" %}</a></li>
|
<li><a href="{% url 'cotisations:index' %}"><i class="fa fa-eur"></i> {% trans "Manage the subscriptions" %}</a></li>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
|
||||||
{% for template in optionnal_templates_navbar_user_list%}
|
{% for template in optionnal_templates_navbar_user_list%}
|
||||||
{{ template }}
|
{{ template }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -301,8 +301,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
let s = Sapphire();
|
let s = Sapphire();
|
||||||
Konami(s.activate);
|
Konami(s.activate);
|
||||||
</script>
|
</script>
|
||||||
|
{% if request.user.shortcuts_enabled %}
|
||||||
<script src="/static/js/shortcuts.js"></script>
|
<script src="/static/js/shortcuts.js"></script>
|
||||||
|
{% endif %}
|
||||||
{# Read the documentation for more information #}
|
{# Read the documentation for more information #}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -441,7 +441,8 @@ class AdherentEditForm(AdherentForm):
|
||||||
'telephone',
|
'telephone',
|
||||||
'room',
|
'room',
|
||||||
'shell',
|
'shell',
|
||||||
'gpg_fingerprint'
|
'gpg_fingerprint',
|
||||||
|
'shortcuts_enabled',
|
||||||
]
|
]
|
||||||
|
|
||||||
class ClubForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
|
class ClubForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
|
||||||
|
|
20
users/migrations/0083_user_shortcuts_enabled.py
Normal file
20
users/migrations/0083_user_shortcuts_enabled.py
Normal file
|
@ -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'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -247,6 +247,10 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True
|
null=True
|
||||||
)
|
)
|
||||||
|
shortcuts_enabled = models.BooleanField(
|
||||||
|
verbose_name=_("Enable shortcuts on Re2o website"),
|
||||||
|
default=True
|
||||||
|
)
|
||||||
|
|
||||||
USERNAME_FIELD = 'pseudo'
|
USERNAME_FIELD = 'pseudo'
|
||||||
REQUIRED_FIELDS = ['surname', 'email']
|
REQUIRED_FIELDS = ['surname', 'email']
|
||||||
|
|
|
@ -305,6 +305,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<dd>{{ users.shell }}</dd>
|
<dd>{{ users.shell }}</dd>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<div class="col-md-6 col-xs-12">
|
||||||
|
<dt>{% trans "Shortcuts enabled" %}</dt>
|
||||||
|
<dd>{{ users.shortcuts_enabled | tick }}</dd>
|
||||||
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue