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
9569e22d
Commit
9569e22d
authored
Apr 16, 2018
by
Maël Kervella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set language button
parent
ad12dff8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
40 deletions
+85
-40
re2o/locale/fr/LC_MESSAGES/django.mo
re2o/locale/fr/LC_MESSAGES/django.mo
+0
-0
re2o/locale/fr/LC_MESSAGES/django.po
re2o/locale/fr/LC_MESSAGES/django.po
+8
-0
re2o/settings.py
re2o/settings.py
+5
-0
re2o/urls.py
re2o/urls.py
+1
-0
static/css/base.css
static/css/base.css
+20
-0
templates/base.html
templates/base.html
+3
-40
templates/buttons/setlang.html
templates/buttons/setlang.html
+48
-0
No files found.
re2o/locale/fr/LC_MESSAGES/django.mo
View file @
9569e22d
No preview for this file type
re2o/locale/fr/LC_MESSAGES/django.po
View file @
9569e22d
...
...
@@ -30,6 +30,14 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: settings.py:140
msgid "English"
msgstr "Anglais"
#: settings.py:141
msgid "French"
msgstr "Français"
#: templates/re2o/about.html:29 templates/re2o/about.html:35
msgid "About Re2o"
msgstr "A propos de Re2o"
...
...
re2o/settings.py
View file @
9569e22d
...
...
@@ -37,6 +37,7 @@ from __future__ import unicode_literals
import
os
from
.settings_local
import
*
from
django.utils.translation
import
ugettext_lazy
as
_
# The root directory for the project
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
...
...
@@ -135,6 +136,10 @@ LOCALE_PATHS = [
# For translations outside of apps
os
.
path
.
join
(
BASE_DIR
,
'templates'
,
'locale'
).
replace
(
'
\\
'
,
'/'
)
]
LANGUAGES
=
[
(
'en'
,
_
(
'English'
)),
(
'fr'
,
_
(
'French'
))
]
# Should use time zone ?
USE_TZ
=
True
...
...
re2o/urls.py
View file @
9569e22d
...
...
@@ -55,6 +55,7 @@ urlpatterns = [
url
(
r
'^about/$'
,
about_page
,
name
=
'about'
),
url
(
'^logout/'
,
auth_views
.
logout
,
{
'next_page'
:
'/'
}),
url
(
'^'
,
include
(
'django.contrib.auth.urls'
)),
url
(
r
'^i18n/'
,
include
(
'django.conf.urls.i18n'
)),
url
(
r
'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r
'^users/'
,
include
(
'users.urls'
,
namespace
=
'users'
)),
url
(
r
'^search/'
,
include
(
'search.urls'
,
namespace
=
'search'
)),
...
...
static/css/base.css
View file @
9569e22d
...
...
@@ -35,6 +35,26 @@ footer a {
border-radius
:
0
;
}
/* Add right colors for buttons in dropdown in navbar-inverse (else it is light
* gray on white bg and white when hovered */
.navbar-inverse
.dropdown-menu
.btn-link
{
text-decoration
:
none
;
color
:
#262626
;
padding
:
0
;
}
.navbar-inverse
.dropdown-menu
.btn-link
:hover
{
background-color
:
#f5f5f5
;
}
@media
screen
and
(
max-width
:
767px
)
{
.navbar-inverse
.dropdown-menu
.btn-link
{
color
:
#9d9d9d
;
}
.navbar-inverse
.dropdown-menu
.btn-link
:hover
{
color
:
#fff
;
background-color
:
transparent
;
}
}
/* Set height of the grid so .sidenav can be 100% (adjust as needed) */
.row.content
{
height
:
100%
;
...
...
templates/base.html
View file @
9569e22d
...
...
@@ -118,7 +118,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</li>
{% acl_end %}
<li>
<a
href=
"{% url 'about' %}"
><i
class=
"fa fa-info-circle"
></i>
{% trans "About" %}
</a>
<a
href=
"{% url 'about' %}"
><i
class=
"fa fa-info-circle"
></i>
{% trans "About" %}
</a>
</li>
{% if not request.user.is_authenticated %}
{% if var_sa %}
...
...
@@ -145,48 +145,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div>
</form>
</li>
{% endif %}
</ul>
</ul>
{% comment %}
<div
class=
"navbar-right"
>
<form
action=
"{% url "
search:search
"%}"
class=
"navbar-form"
role=
"search"
>
<div
class=
"input-group"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"Search"
name=
"q"
id=
"search-term"
{%
if
search_term
%}
value=
"{{ search_term }}"
{%
endif
%}
>
<div
class=
"input-group-btn"
>
<button
class=
"btn btn-default"
type=
"submit"
><i
class=
"fa fa-search"
></i></button>
<a
href=
"{% url "
search:searchp
"
%}"
class=
"btn btn-default"
role=
"button"
><i
class=
"fa fa-plus"
></i></a>
</div>
</div>
</form>
</div>
<ul
class=
"nav navbar-nav navbar-right"
>
{% if not request.user.is_authenticated %}
{% if var_sa %}
<li>
<a
href=
"{% url 'users:new-user' %}"
>
<i
class=
"fa fa-user-plus"
></i>
Créer un compte
</a>
</li>
{% endif %}
<li>
<a
href=
"{% url 'login' %}"
>
<i
class=
"fa fa-sign-in-alt"
></i>
Login
</a>
</li>
{% endif %}
{% can_view_app preferences %}
<li>
<a
href=
"{% url 'preferences:display-options' %}"
>
<i
class=
"fa fa-cogs"
></i>
Preferences
</a>
</li>
{% acl_end %}
{% endif %}
<li>
<a
href=
"{% url 'about' %}"
><i
class=
"fa fa-info-circle"
></i>
A propos
</a>
{% include 'buttons/setlang.html' %}
</li>
</ul>
{% endcomment %}
</div>
</div>
</nav>
...
...
templates/buttons/setlang.html
0 → 100644
View file @
9569e22d
{% 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 © 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.
{% endcomment %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
<a
class=
"dropdown"
type=
"button"
role=
"button"
id=
"setlang"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
>
<i
class=
"fa fa-globe"
></i>
<span
class=
"caret"
></span>
</a>
<div
class=
"dropdown-menu"
aria-labelledby=
"setlang"
>
<form
method=
"post"
action=
"{% url 'set_language' %}"
>
{% csrf_token %}
<input
type=
"hidden"
name=
"next"
value=
"{{ request.path }}"
>
{% for language in languages %}
<button
type=
"submit"
name=
"language"
value=
"{{ language.code }}"
class=
"btn btn-link btn-block
{% if language.code == LANGUAGE_CODE %}disabled{% endif %}"
>
{% if language.code == LANGUAGE_CODE %}
<i
class=
"fa fa-check"
></i>
{% endif %}
{{ language.name_local | title }} ({{ language.code }})
</button>
{% endfor %}
</form>
</div>
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