From a745e8cc9c8f5657fcfe835e9eb5ae6a7d2dd5b2 Mon Sep 17 00:00:00 2001 From: Laouen Fernet Date: Fri, 15 Nov 2019 19:06:05 +0000 Subject: [PATCH] Mark strings for translation in multi_op --- multi_op/preferences/models.py | 4 +- .../templates/multi_op/aff_room_state.html | 8 +-- .../templates/multi_op/form_preferences.html | 48 --------------- multi_op/templates/multi_op/form_ticket.html | 58 ------------------- multi_op/templates/multi_op/index.html | 34 ----------- .../templates/multi_op/index_room_state.html | 9 +-- multi_op/templates/multi_op/navbar.html | 2 +- .../templates/multi_op/navbar_logout.html | 6 -- multi_op/templates/multi_op/preferences.html | 36 ------------ multi_op/templates/multi_op/sidebar.html | 2 +- multi_op/views.py | 28 +++++++-- 11 files changed, 36 insertions(+), 199 deletions(-) delete mode 100644 multi_op/templates/multi_op/form_preferences.html delete mode 100644 multi_op/templates/multi_op/form_ticket.html delete mode 100644 multi_op/templates/multi_op/index.html delete mode 100644 multi_op/templates/multi_op/navbar_logout.html delete mode 100644 multi_op/templates/multi_op/preferences.html diff --git a/multi_op/preferences/models.py b/multi_op/preferences/models.py index 6f6f8066..c342bf41 100644 --- a/multi_op/preferences/models.py +++ b/multi_op/preferences/models.py @@ -34,8 +34,8 @@ class Preferences(models.Model): "topologie.Dormitory", related_name="vlan_tagged", blank=True, - verbose_name=_("Enabled dorm"), + verbose_name=_("enabled dorm"), ) class Meta: - verbose_name = _("Dormitory of connection settings") + verbose_name = _("dormitories preferences") diff --git a/multi_op/templates/multi_op/aff_room_state.html b/multi_op/templates/multi_op/aff_room_state.html index 75ca027c..bdfdd98b 100644 --- a/multi_op/templates/multi_op/aff_room_state.html +++ b/multi_op/templates/multi_op/aff_room_state.html @@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Building" as tr_building %} {% include 'buttons/sort.html' with prefix='building' col='name' text=tr_building %} {% include 'buttons/sort.html' with prefix='room' col='name' text=tr_room %} - {% trans "Connnected on" %} + {% trans "Connnected to" %} {% trans "User" %} {% trans "Details" %} {% trans "End of subscription on" %} @@ -49,10 +49,10 @@ with this program; if not, write to the Free Software Foundation, Inc., {{ room.building }} {{ room.name }} - {% if room.port_set.all %}AURORE{% else %}{% trans "Other operator" %}{% endif %} - {% if room.adherent %}{{ room.adherent }}{% else %} {% trans "Aucun" %}{% endif %} + {% if room.port_set.all %}{{ asso_name }}{% else %}{% trans "Other operator" %}{% endif %} + {% if room.adherent %}{{ room.adherent }}{% else %} {% trans "None" %}{% endif %} {{ room.details }} - {% if room.adherent.is_adherent %}{% else %}{% endif %}{% if room.adherent.end_adhesion %}{{ room.adherent.end_adhesion}}{% else %}{% trans "No member" %}{% endif %} + {% if room.adherent.is_adherent %}{% else %}{% endif %}{% if room.adherent.end_adhesion %}{{ room.adherent.end_adhesion}}{% else %}{% trans "Non member" %}{% endif %} {% if room.adherent.has_access == True %} {% trans "Active" %} diff --git a/multi_op/templates/multi_op/form_preferences.html b/multi_op/templates/multi_op/form_preferences.html deleted file mode 100644 index 5c7e5d5e..00000000 --- a/multi_op/templates/multi_op/form_preferences.html +++ /dev/null @@ -1,48 +0,0 @@ -{% extends 'machines/sidebar.html' %} -{% comment %} -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 Gabriel Détraz -Copyright © 2017 Goulven Kermarec -Copyright © 2017 Augustin Lemesle -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. -{% endcomment %} - -{% load bootstrap3 %} -{% load i18n %} - -{% block title %}{% trans "Ticket" %}{% endblock %} - -{% block content %} -

{% trans "Tickets settings modification" %}

- -{% for message in messages %} -
- - {{ message | safe }} -
-{% endfor %} - -
- {% csrf_token %} - {% bootstrap_field preferencesform.publish_address %} - {% bootstrap_field preferencesform.mail_language %} - {% bootstrap_button "Editer" button_type="submit" icon='ok' button_class='btn-success' %} -
-{% endblock %} diff --git a/multi_op/templates/multi_op/form_ticket.html b/multi_op/templates/multi_op/form_ticket.html deleted file mode 100644 index d35e9f5d..00000000 --- a/multi_op/templates/multi_op/form_ticket.html +++ /dev/null @@ -1,58 +0,0 @@ -{% extends 'machines/sidebar.html' %} -{% comment %} -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 Gabriel Détraz -Copyright © 2017 Goulven Kermarec -Copyright © 2017 Augustin Lemesle -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. -{% endcomment %} - -{% load bootstrap3 %} -{% load massive_bootstrap_form %} -{% load i18n %} - -{% block title %}{% trans "Ticket" %}{% endblock %} - -{% block content %} -

Ouverture d'un Ticket

- -
- {% csrf_token %} - {% if not user.is_authenticated %} -

{% trans "Vous n'êtes pas authentifié. Veuillez fournir une adresse mail afin que nous puissions vous recontacter." %}

- {% bootstrap_field ticketform.email %} - {% endif %} - {% bootstrap_field ticketform.title %} -
-

{% trans "Description de votre problème. Veuillez fournir le plus d'informations possible afin de faciliter la recherche de solution. Voici quelques informations dont nous pourions avoir besoin:" %}

-
    -
  • -

    {% trans "Le type de votre problème (adhesion, connexion, paiement ou autre)." %}

    -
  • -
  • -

    {% trans "Les conditions dans lesquelles vous rencontrez le problème (Wifi/filaire, sur tout les apareils ou sur un seul. Est-ce une nouvelle machine ?" %}

    -
  • -
  • -

    {% trans "Les endroits dans lequels le problème survient (chez vous, dans une partie commune, dans un batiment en particulier)." %}

    -
- {% bootstrap_field ticketform.description %} - {% bootstrap_button "Ouvrir le Ticket" button_type="submit" icon='ok' button_class='btn-success' %} -
-{% endblock %} diff --git a/multi_op/templates/multi_op/index.html b/multi_op/templates/multi_op/index.html deleted file mode 100644 index 4429c4fd..00000000 --- a/multi_op/templates/multi_op/index.html +++ /dev/null @@ -1,34 +0,0 @@ -{% extends 'users/sidebar.html' %} -{% comment %} -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 Gabriel Détraz -Copyright © 2017 Goulven Kermarec -Copyright © 2017 Augustin Lemesle - -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. -{% endcomment %} - -{% load bootstrap3 %} -{% load i18n %} - -{% block title%}{% trans "Tickets" %}{% endblock %} - -{% block content %} -

{% trans "Tickets" %}

- {% include 'tickets/aff_tickets.html' with tickets_list=tickets_list %} -{% endblock %} diff --git a/multi_op/templates/multi_op/index_room_state.html b/multi_op/templates/multi_op/index_room_state.html index 50881a19..6e7bb45e 100644 --- a/multi_op/templates/multi_op/index_room_state.html +++ b/multi_op/templates/multi_op/index_room_state.html @@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load i18n %} -{% block title %}{% trans "Multi Operators" %}{% endblock %} +{% block title %}{% trans "Multiple operators" %}{% endblock %} {% block content %} @@ -35,17 +35,18 @@ with this program; if not, write to the Free Software Foundation, Inc., {% bootstrap_form_errors dormitory_form %} {% endif %} -

{% trans "Rooms connections" %}

+

{% trans "Room connections" %}

{% if dormitory_form %}
{% csrf_token %} {% bootstrap_form dormitory_form %} - {% bootstrap_button "Select Dormitory" icon='ok' button_class='btn-success' %} + {% trans "Select dormitory" as tr_select_dorm %} + {% bootstrap_button tr_select_dorm icon='ok' button_class='btn-success' %}
{% endif %} -{% include 'multi_op/aff_room_state.html' with room_list=room_list %} +{% include 'multi_op/aff_room_state.html' with room_list=room_list asso_name=asso_name %}


diff --git a/multi_op/templates/multi_op/navbar.html b/multi_op/templates/multi_op/navbar.html index c5e84c43..ac3cfe5f 100644 --- a/multi_op/templates/multi_op/navbar.html +++ b/multi_op/templates/multi_op/navbar.html @@ -1,2 +1,2 @@ {% load i18n %} -
  • {% trans "Multi Operators" %}
  • +
  • {% trans "Manage the operators" %}
  • diff --git a/multi_op/templates/multi_op/navbar_logout.html b/multi_op/templates/multi_op/navbar_logout.html deleted file mode 100644 index 8a7114f3..00000000 --- a/multi_op/templates/multi_op/navbar_logout.html +++ /dev/null @@ -1,6 +0,0 @@ -{% load i18n %} -
  • - - {% trans "Ouvrir un ticket" %} - -
  • diff --git a/multi_op/templates/multi_op/preferences.html b/multi_op/templates/multi_op/preferences.html deleted file mode 100644 index 60cbfac6..00000000 --- a/multi_op/templates/multi_op/preferences.html +++ /dev/null @@ -1,36 +0,0 @@ -{% load i18n %} - -
    - - -
    - - - - {% trans "Edit" %} - -

    - -
    - - - - {% if preferences.publish_address %} - - {% else %} - - {% endif %} - - - - -

    {% trans "Publication email address"%}

    {{ preferences.publish_address }}

    {% trans "Pas d'adresse, les tickets ne sont pas annoncés" %}

    {% trans "Email language" %}

    {{ language }}

    -
    -
    -
    -
    -
    diff --git a/multi_op/templates/multi_op/sidebar.html b/multi_op/templates/multi_op/sidebar.html index 0433fc61..86771de1 100644 --- a/multi_op/templates/multi_op/sidebar.html +++ b/multi_op/templates/multi_op/sidebar.html @@ -28,7 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block sidebar %} - {% trans "Rooms connection state" %} + {% trans "Room connections state" %} diff --git a/multi_op/views.py b/multi_op/views.py index 64b9eeee..266c8a15 100644 --- a/multi_op/views.py +++ b/multi_op/views.py @@ -41,7 +41,7 @@ from re2o.base import re2o_paginator, SortTable from re2o.acl import can_view, can_view_all, can_edit, can_create -from preferences.models import GeneralOption +from preferences.models import GeneralOption, AssoOption from .forms import DormitoryForm @@ -67,7 +67,15 @@ def display_rooms_connection(request, dormitory=None): ) pagination_number = GeneralOption.get_cached_value("pagination_number") room_list = re2o_paginator(request, room_list, pagination_number) - return render(request, "multi_op/index_room_state.html", {"room_list": room_list}) + asso_name = AssoOption.get_cached_value("pseudo") + return render( + request, + "multi_op/index_room_state.html", + { + "room_list": room_list, + "asso_name": asso_name, + }, + ) @login_required @@ -105,10 +113,15 @@ def aff_pending_connection(request): ) pagination_number = GeneralOption.get_cached_value("pagination_number") room_list = re2o_paginator(request, room_list, pagination_number) + asso_name = AssoOption.get_cached_value("pseudo") return render( request, "multi_op/index_room_state.html", - {"room_list": room_list, "dormitory_form": dormitory_form}, + { + "room_list": room_list, + "dormitory_form": dormitory_form, + "asso_name": asso_name, + }, ) @@ -135,10 +148,15 @@ def aff_pending_disconnection(request): ) pagination_number = GeneralOption.get_cached_value("pagination_number") room_list = re2o_paginator(request, room_list, pagination_number) + asso_name = AssoOption.get_cached_value("pseudo") return render( request, "multi_op/index_room_state.html", - {"room_list": room_list, "dormitory_form": dormitory_form}, + { + "room_list": room_list, + "dormitory_form": dormitory_form, + "asso_name": asso_name, + }, ) @@ -148,7 +166,7 @@ def disconnect_room(request, room, roomid): """Action of disconnecting a room""" room.port_set.clear() room.save() - messages.success(request, "Room %s disconnected" % room) + messages.success(request, _("The room %s was disconnected.") % room) return redirect(reverse("multi_op:aff-pending-disconnection"))