Commit cf203527 authored by c24b's avatar c24b

LANGUAGES from USER_LANG >> menu option

parent 1ba4b32a
......@@ -4,7 +4,6 @@ from gargantext.util.db_cache import cache
from gargantext.util.files import upload
from gargantext.models import *
from gargantext.constants import *
from gargantext.constants import USER_LANG
from .main import get_node_user
from gargantext.util.scheduling import scheduled
from gargantext.util.toolchain import parse_extract_indexhyperdata
......@@ -69,7 +68,7 @@ def overview(request):
'number': user_projects.count(),
'projects': user_projects,
"user_parameters":node_user.hyperdata,
'USER_LANG': USER_LANG,
'languages': USER_LANG,
# projects owned by the user's contacts
'common_users': (contact for contact, projects in contacts_projects),
'common_projects': sum((projects for contact, projects in contacts_projects), []),
......@@ -213,6 +212,7 @@ def project(request, project_id):
request = request,
context = {
"user_parameters":node_user.hyperdata,
"languages": USER_LANG,
'form': NewCorpusForm,
'user': request.user,
'date': datetime.now(),
......
......@@ -49,7 +49,7 @@ def explorer(request, project_id, corpus_id):
'maplist_id': maplist_id ,
'view' : 'graph' ,
'user_parameters': node_user.hyperdata,
'USER_LANG': USER_LANG
'languages': USER_LANG
},
)
......
......@@ -104,53 +104,25 @@
{% endif %}
</ul>
</li>
{% if user.is_authenticated %}
<li class="dropdown">
<a tabindex="-1" id="lang" href="#" role="button" data-lang="{{user_parameters.language}}" role="button" class="dropdown-toggle navbar-text" data-toggle="dropdown" title="This is your chosen language">
{% if user_parameters.language == "fr" %}
<img value="{{user_parameters.language}}" src= "{% static "img/fr.png"%}" width="25%"/>
{%else %}
<img value="{{user_parameters.language}}" src= "{% static "img/en.png"%}" width="25%"/>
{%endif%}
{{user_parameters.language}}
<i class="caret"></i>
</a>
<ul class="dropdown-menu">
<li class="dropdown">
{% if user_parameters.language == "fr" %}
<a role="button" id="new_lang" data-lang="en">
<img value="en" src= "{% static "img/en.png"%}" width="25%"/>
en</a>
{%else%}
<a role="button" id="new_lang" data-lang="fr">
<img value="fr" src= "{% static "img/fr.png"%}" width="25%"/>
fr
</a>
{% endif %}
<ul class="dropdown-menu">
<li class="dropdown">
<!-- <a href="/{{user.username}}/parameters/" > -->
{% if user_parameters.language == "fr" %}
<button id="new_lang" data-lang="en">
<img value="en" src= "{% static "img/en.png"%}" width="25%"/>
en
{%else%}
<img value="fr" src= "{% static "img/fr.png"%}" width="25%"/>
fr
<!-- </a> -->
{%endif%}
</button>
</li>
<li></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="lang" data-lang="{{user_parameters.languages}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img value="{{user_parameters.language}}" src="/static/img/{{user_parameters.language}}.png" width="25%"/>
{{user_parameters.language}}
<i class="caret"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="lang">
{% for lang in languages %}
{% if lang != user_parameters.language %}
<li class="dropdown-item"><a class="new_lang" data-lang="{{lang}}"><img value="{{user_parameters.language}}" src="/static/img/{{lang}}.png" width="25%"/> {{lang}} </a></li>
{% endif %}
{% endfor %}
</ul>
</li>
{% endif %}
</ul>
......
......@@ -84,7 +84,7 @@
<div class="container">
{% if list_corpora %}
{% for key, corpora in list_corpora.items %}
<h2>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment