From 2ee17b370b5595d48c685fd47d02a5a1c83b08ac Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Fri, 20 Jul 2018 19:54:03 +0200 Subject: [PATCH] =?UTF-8?q?Passage=20par=20flags=20plut=C3=B4t=20que=20par?= =?UTF-8?q?=20valeurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/cotisations/aff_cotisations.html | 2 +- logs/templatetags/logs_extra.py | 12 ++++++++++-- templates/buttons/history.html | 4 ++-- users/templates/users/profil.html | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cotisations/templates/cotisations/aff_cotisations.html b/cotisations/templates/cotisations/aff_cotisations.html index 27ced69e..6b5fa8fa 100644 --- a/cotisations/templates/cotisations/aff_cotisations.html +++ b/cotisations/templates/cotisations/aff_cotisations.html @@ -87,7 +87,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% acl_end %}
  • - {% history_button facture text='History' html_class=''%} + {% history_button facture text=True html_class=False%}
  • diff --git a/logs/templatetags/logs_extra.py b/logs/templatetags/logs_extra.py index 48573003..0620f8f4 100644 --- a/logs/templatetags/logs_extra.py +++ b/logs/templatetags/logs_extra.py @@ -36,8 +36,16 @@ def classname(obj): @register.inclusion_tag('buttons/history.html') -def history_button(instance, text=None, html_class=None): - """Creates the correct history button for an instance.""" +def history_button(instance, text=False, html_class=True): + """Creates the correct history button for an instance. + + Args: + instance: The instance of which you want to get history buttons. + text: Flag stating if a 'History' text should be displayed. + html_class: Flag stating if the link should have the html classes + allowing it to be displayed as a button. + + """ return { 'application': instance._meta.app_label, 'name': instance._meta.model_name, diff --git a/templates/buttons/history.html b/templates/buttons/history.html index e22c719b..8d0cc8bc 100644 --- a/templates/buttons/history.html +++ b/templates/buttons/history.html @@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. {% endcomment %} {% load i18n %} - - {% if text %}{% trans text %}{% endif %} + + {% if text %}{% trans 'History' %}{% endif %} diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index 2d671b86..2442f167 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -71,7 +71,7 @@ with this program; if not, write to the Free Software Foundation, Inc., GĂ©rer les groupes {% acl_end %} - {% history_button users text="History" %} + {% history_button users text=True %}