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
e27625dd
Commit
e27625dd
authored
Aug 05, 2018
by
Laouen Fernet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translation of search/ (front)
parent
c3b3146f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
210 additions
and
38 deletions
+210
-38
search/forms.py
search/forms.py
+24
-22
search/locale/fr/LC_MESSAGES/django.mo
search/locale/fr/LC_MESSAGES/django.mo
+0
-0
search/locale/fr/LC_MESSAGES/django.po
search/locale/fr/LC_MESSAGES/django.po
+163
-0
search/templates/search/index.html
search/templates/search/index.html
+14
-12
search/templates/search/search.html
search/templates/search/search.html
+5
-2
search/templates/search/sidebar.html
search/templates/search/sidebar.html
+4
-2
No files found.
search/forms.py
View file @
e27625dd
...
...
@@ -26,23 +26,24 @@ from __future__ import unicode_literals
from
django
import
forms
from
django.forms
import
Form
from
django.utils.translation
import
ugettext_lazy
as
_
from
re2o.utils
import
get_input_formats_help_text
CHOICES_USER
=
(
(
'0'
,
'Actifs'
),
(
'1'
,
'Désactivés'
),
(
'2'
,
'Archivés'
),
(
'0'
,
_
(
"Active"
)
),
(
'1'
,
_
(
"Disabled"
)
),
(
'2'
,
_
(
"Archived"
)
),
)
CHOICES_AFF
=
(
(
'0'
,
'Utilisateurs'
),
(
'1'
,
'Machines'
),
(
'2'
,
'Factures'
),
(
'3'
,
'Bannissements'
),
(
'4'
,
'Accès à titre gracieux'
),
(
'5'
,
'Chambres'
),
(
'6'
,
'Ports'
),
(
'7'
,
'Switchs'
),
(
'0'
,
_
(
"Users"
)
),
(
'1'
,
_
(
"Machines"
)
),
(
'2'
,
_
(
"Invoices"
)
),
(
'3'
,
_
(
"Bans"
)
),
(
'4'
,
_
(
"Whitelists"
)
),
(
'5'
,
_
(
"Rooms"
)
),
(
'6'
,
_
(
"Ports"
)
),
(
'7'
,
_
(
"Switches"
)
),
)
...
...
@@ -55,11 +56,11 @@ def initial_choices(choice_set):
class
SearchForm
(
Form
):
"""The form for a simple search"""
q
=
forms
.
CharField
(
label
=
'Recherche'
,
label
=
_
(
"Search"
)
,
help_text
=
(
'Utilisez « » et «,» pour spécifier différents mots, «"query"» '
'pour une recherche exacte et «
\\
» pour échapper un caractère.'
),
_
(
"Use « » and «,» to specify distinct words, «
\"
query
\"
» for"
" an exact search and «
\\
» to escape a character."
)
),
max_length
=
100
)
...
...
@@ -67,23 +68,23 @@ class SearchForm(Form):
class
SearchFormPlus
(
Form
):
"""The form for an advanced search (with filters)"""
q
=
forms
.
CharField
(
label
=
'Recherche'
,
label
=
_
(
"Search"
)
,
help_text
=
(
'Utilisez « » et «,» pour spécifier différents mots, «"query"» '
'pour une recherche exacte et «
\\
» pour échapper un caractère.'
_
(
"Use « » and «,» to specify distinct words, «
\"
query
\"
» for"
" an exact search and «
\\
» to escape a character."
)
),
max_length
=
100
,
required
=
False
)
u
=
forms
.
MultipleChoiceField
(
label
=
"Filtre utilisateurs"
,
label
=
_
(
"Users filter"
)
,
required
=
False
,
widget
=
forms
.
CheckboxSelectMultiple
,
choices
=
CHOICES_USER
,
initial
=
initial_choices
(
CHOICES_USER
)
)
a
=
forms
.
MultipleChoiceField
(
label
=
"Filtre affichage"
,
label
=
_
(
"Display filter"
)
,
required
=
False
,
widget
=
forms
.
CheckboxSelectMultiple
,
choices
=
CHOICES_AFF
,
...
...
@@ -91,11 +92,11 @@ class SearchFormPlus(Form):
)
s
=
forms
.
DateField
(
required
=
False
,
label
=
"Date de début"
,
label
=
_
(
"Start date"
)
,
)
e
=
forms
.
DateField
(
required
=
False
,
label
=
"Date de fin"
label
=
_
(
"End date"
)
)
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -106,3 +107,4 @@ class SearchFormPlus(Form):
self
.
fields
[
'e'
].
help_text
=
get_input_formats_help_text
(
self
.
fields
[
'e'
].
input_formats
)
search/locale/fr/LC_MESSAGES/django.mo
0 → 100644
View file @
e27625dd
File added
search/locale/fr/LC_MESSAGES/django.po
0 → 100644
View file @
e27625dd
# 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 © 2018 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.
msgid ""
msgstr ""
"Project-Id-Version: 2.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-15 18:15+0200\n"
"PO-Revision-Date: 2018-06-24 20:10+0200\n"
"Last-Translator: Laouen Fernet <laouen.fernet@supelec.fr>\n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:33
msgid "Active"
msgstr "Actifs"
#: forms.py:34
msgid "Disabled"
msgstr "Désactivés"
#: forms.py:35
msgid "Archived"
msgstr "Archivés"
#: forms.py:39
msgid "Users"
msgstr "Utilisateurs"
#: forms.py:40
msgid "Machines"
msgstr "Machines"
#: forms.py:41
msgid "Invoices"
msgstr "Factures"
#: forms.py:42
msgid "Bans"
msgstr "Bannissements"
#: forms.py:43
msgid "Whitelists"
msgstr "Accès gracieux"
#: forms.py:44
msgid "Rooms"
msgstr "Chambres"
#: forms.py:45
msgid "Ports"
msgstr "Ports"
#: forms.py:46
msgid "Switches"
msgstr "Commutateurs réseau"
#: forms.py:59 forms.py:71 templates/search/search.html:29
#: templates/search/search.html:48
msgid "Search"
msgstr "Rechercher"
#: forms.py:61 forms.py:73
msgid ""
"Use « » and «,» to specify distinct words, «\"query\"» for an exact search "
"and «\\» to escape a character."
msgstr ""
"Utilisez « » et «,» pour spécifier différents mots, «\"query\"» pour une "
"recherche exacte et «\\» pour échapper un caractère."
#: forms.py:80
msgid "Users filter"
msgstr "Filtre utilisateurs"
#: forms.py:87
msgid "Display filter"
msgstr "Filtre affichage"
#: forms.py:95
msgid "Start date"
msgstr "Date de début"
#: forms.py:99
msgid "End date"
msgstr "Date de fin"
#: templates/search/index.html:29
msgid "Search results"
msgstr "Résultats de la recherche"
#: templates/search/index.html:33
msgid "Results among users:"
msgstr "Résultats parmi les utilisateurs :"
#: templates/search/index.html:37
msgid "Results among clubs:"
msgstr "Résultats parmi les clubs :"
#: templates/search/index.html:41
msgid "Results among machines:"
msgstr "Résultats parmi les machines :"
#: templates/search/index.html:45
msgid "Results among invoices:"
msgstr "Résultats parmi les factures :"
#: templates/search/index.html:49
msgid "Results among whitelists:"
msgstr "Résultats parmi les accès à titre gracieux :"
#: templates/search/index.html:53
msgid "Results among bans:"
msgstr "Résultats parmi les bannissements :"
#: templates/search/index.html:57
msgid "Results among rooms:"
msgstr "Résultats parmi les chambres :"
#: templates/search/index.html:61
msgid "Results among ports"
msgstr "Résultats parmi les ports :"
#: templates/search/index.html:65
msgid "Results among switches"
msgstr "Résultats parmi les commutateurs réseau :"
#: templates/search/index.html:69
msgid "No result"
msgstr "Pas de résultat"
#: templates/search/index.html:71
#, python-format
msgid "(Only the first %(max_result)s results are displayed in each category)"
msgstr ""
"(Seulement les %(max_result)s premiers résultats sont affichés dans chaque "
"catégorie)"
#: templates/search/sidebar.html:31
msgid "Simple search"
msgstr "Recherche simple"
#: templates/search/sidebar.html:35
msgid "Advanced search"
msgstr "Recherche avancée"
search/templates/search/index.html
View file @
e27625dd
...
...
@@ -24,52 +24,54 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load bootstrap3 %}
{% load i18n %}
{% block title %}
Résultats de la recherche
{% endblock %}
{% block title %}
{% trans "Search results" %}
{% endblock %}
{% block content %}
{% if users %}
<h2>
Résultats dans les utilisateurs
</h2>
<h2>
{% trans "Results among users:" %}
</h2>
{% include "users/aff_users.html" with users_list=users %}
{% endif%}
{% if clubs %}
<h2>
Résultats dans les clubs
</h2>
<h2>
{% trans "Results among clubs:" %}
</h2>
{% include "users/aff_clubs.html" with clubs_list=clubs %}
{% endif%}
{% if machines %}
<h2>
Résultats dans les machines :
</h2>
<h2>
{% trans "Results among machines:" %}
</h2>
{% include "machines/aff_machines.html" with machines_list=machines %}
{% endif %}
{% if factures %}
<h2>
Résultats dans les factures :
</h2>
<h2>
{% trans "Results among invoices:" %}
</h2>
{% include "cotisations/aff_cotisations.html" with facture_list=factures %}
{% endif %}
{% if whitelists %}
<h2>
Résultats dans les accès à titre gracieux :
</h2>
<h2>
{% trans "Results among whitelists:" %}
</h2>
{% include "users/aff_whitelists.html" with white_list=whitelists %}
{% endif %}
{% if bans %}
<h2>
Résultats dans les banissements :
</h2>
<h2>
{% trans "Results among bans:" %}
</h2>
{% include "users/aff_bans.html" with ban_list=bans %}
{% endif %}
{% if rooms %}
<h2>
Résultats dans les chambres :
</h2>
<h2>
{% trans "Results among rooms:" %}
</h2>
{% include "topologie/aff_chambres.html" with room_list=rooms %}
{% endif %}
{% if ports %}
<h2>
Résultats dans les ports :
</h2>
<h2>
{% trans "Results among ports" %}
</h2>
{% include "topologie/aff_port.html" with port_list=ports %}
{% endif %}
{% if switches %}
<h2>
Résultats dans les switchs :
</h2>
<h2>
{% trans "Results among switches" %}
</h2>
{% include "topologie/aff_switch.html" with switch_list=switches %}
{% endif %}
{% if not users and not machines and not factures and not whitelists and not bans and not rooms and not ports and not switches %}
<h3>
Aucun résultat
</h3>
<h3>
{% trans "No result" %}
</h3>
{% else %}
<h6>
(Seulement les {{ max_result }} premiers résultats sont affichés dans chaque catégorie)
</h6>
<h6>
{% blocktrans %}(Only the first {{ max_result }} results are displayed in each category){% endblocktrans %}
</h6>
{% endif %}
<br
/>
<br
/>
<br
/>
{% endblock %}
search/templates/search/search.html
View file @
e27625dd
...
...
@@ -24,8 +24,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load bootstrap3 %}
{% load i18n %}
{% block title %}
Recherche
{% endblock %}
{% block title %}
{% trans "Search" %}
{% endblock %}
{% block content %}
{% bootstrap_form_errors search_form %}
...
...
@@ -44,7 +45,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if search_form.e %}
{% bootstrap_field search_form.e %}
{% endif %}
{% bootstrap_button "Search" button_type="submit" icon="search" %}
{% trans "Search" as tr_search %}
{% bootstrap_button tr_search button_type="submit" icon="search" %}
</form>
<br
/>
<br
/>
...
...
@@ -52,3 +54,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<br
/>
<br
/>
{% endblock %}
search/templates/search/sidebar.html
View file @
e27625dd
...
...
@@ -23,14 +23,16 @@ 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 %}
{% block sidebar %}
<a
class=
"list-group-item list-group-item-warning"
href=
"{% url "
search:search
"
%}"
>
<i
class=
"fa fa-search"
></i>
Recherche simple
{% trans "Simple search" %}
</a>
<a
class=
"list-group-item list-group-item-warning"
href=
"{% url "
search:searchp
"
%}"
>
<i
class=
"fa fa-search-plus"
></i>
Recherche avancée
{% trans "Advanced search" %}
</a>
{% endblock %}
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