Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
b8c50385
Commit
b8c50385
authored
Jul 19, 2018
by
Grizzly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajout d'un templatetag tick pour afficher les booléens
parent
a84e8b55
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
6 deletions
+88
-6
preferences/templates/preferences/display_preferences.html
preferences/templates/preferences/display_preferences.html
+28
-6
preferences/templatetags/__init__.py
preferences/templatetags/__init__.py
+19
-0
preferences/templatetags/design.py
preferences/templatetags/design.py
+41
-0
No files found.
preferences/templates/preferences/display_preferences.html
100644 → 100755
View file @
b8c50385
...
...
@@ -25,11 +25,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load acl %}
{% load design %}
{% block title %}Création et modification des préférences{% endblock %}
{% block content %}
<h4>
Préférences utilisateur
</h4>
<h4>
Préférences utilisateur
</h4>
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'preferences:edit-options' 'OptionalUser' %}"
>
<i
class=
"fa fa-edit"
></i>
Editer
...
...
@@ -39,15 +40,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table
class=
"table table-striped"
>
<tr>
<th>
Téléphone obligatoirement requis
</th>
<td>
{{ useroptions.is_tel_mandatory }}
</td>
<td>
{{ useroptions.is_tel_mandatory|tick }}
</td>
<th>
Auto inscription
</th>
<td>
{{ useroptions.self_adhesion|tick }}
</td>
</tr>
<tr>
<th>
Champ gpg fingerprint
</th>
<td>
{{ useroptions.gpg_fingerprint }}
</td>
<td>
{{ useroptions.gpg_fingerprint|tick }}
</td>
<th>
Shell par défaut des utilisateurs
</th>
<td>
{{ useroptions.shell_default }}
</td>
</tr>
<tr>
<th>
Creations d'adhérents par tous
</th>
<td>
{{ useroptions.all_can_create_adherent }}
</td>
<th>
Creations de clubs par tous
</th>
<td>
{{ useroptions.all_can_create_club
}}
</td>
<td>
{{ useroptions.all_can_create_adherent
|tick
}}
</td>
<th>
Creations de clubs par tous
</th>
<td>
{{ useroptions.all_can_create_club|tick
}}
</td>
</tr>
<tr>
<th>
Auto inscription
</th>
...
...
@@ -56,6 +63,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>
{{ useroptions.shell_default }}
</td>
</tr>
</table>
<h5>
{% if useroptions.mail_accounts %}
<span
class=
"label label-success"
>
Comptes mails{% else %}
<span
class=
"label label-danger"
>
Comptes mails{% endif%}
</span></h5>
<table
class=
"table table-striped"
>
<tr>
<th>
Gestion des comptes mails
</th>
<td>
{{ useroptions.mail_accounts|tick }}
</td>
<th>
Extension mail interne
</th>
<td>
{{ useroptions.mail_extension }}
</td>
</tr>
<tr>
<th>
Nombre d'alias maximum
</th>
<td>
{{ useroption.max_mail_alias }}
<td>
</tr>
</table>
<h4>
Préférences machines
</h4>
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'preferences:edit-options' 'OptionalMachine' %}"
>
<i
class=
"fa fa-edit"
></i>
...
...
preferences/templatetags/__init__.py
0 → 100644
View file @
b8c50385
#re2o est un logiciel d'administration développé initiallement au rezometz. Il
# se veut agnostique au réseau considéré, de manière à être installable en
# quelques clics.
#
# Copyright © 2017 Maël Kervella
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
preferences/templatetags/design.py
0 → 100644
View file @
b8c50385
#re2o est un logiciel d'administration développé initiallement au rezometz. Il
# se veut agnostique au réseau considéré, de manière à être installable en
# quelques clics.
#
# Copyright © 2017 Maël Kervella
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from
django
import
template
from
django.utils.html
import
conditional_escape
from
django.utils.safestring
import
mark_safe
register
=
template
.
Library
()
@
register
.
filter
(
needs_autoescape
=
False
)
def
tick
(
valeur
,
autoescape
=
False
):
if
autoescape
:
esc
=
conditional_escape
else
:
esc
=
lambda
x
:
x
if
valeur
==
True
:
result
=
'<i style="color: #1ECA18;" class="fas fa-check"></i>'
else
:
result
=
'<i style="color: #D10115;" class="fas fa-times"></i>'
return
mark_safe
(
result
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment