Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
1ba4b32a
Commit
1ba4b32a
authored
Oct 26, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX bug on Graph + languages imported
parent
2d363650
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
11 deletions
+26
-11
constants.py
gargantext/constants.py
+1
-1
corpora.py
gargantext/views/pages/corpora.py
+8
-3
main.py
gargantext/views/pages/main.py
+6
-4
projects.py
gargantext/views/pages/projects.py
+3
-0
terms.py
gargantext/views/pages/terms.py
+3
-0
views.py
graph/views.py
+5
-3
No files found.
gargantext/constants.py
View file @
1ba4b32a
...
...
@@ -152,7 +152,7 @@ INDEXED_HYPERDATA = {
}
# user parameters----------------------------------------
USER_LANG
=
(
"fr"
,
"en"
)
USER_LANG
=
[
"fr"
,
"en"
]
# resources ---------------------------------------------
...
...
gargantext/views/pages/corpora.py
View file @
1ba4b32a
...
...
@@ -6,6 +6,7 @@ from gargantext.constants import *
from
gargantext.settings
import
*
from
datetime
import
datetime
from
.main
import
get_node_user
from
gargantext.constants
import
USER_LANG
def
_get_user_project_corpus
(
request
,
project_id
,
corpus_id
):
"""Helper method to get a corpus, knowing the project's and corpus' ID.
...
...
@@ -42,6 +43,7 @@ def docs_by_titles(request, project_id, corpus_id):
'view'
:
'titles'
,
'user'
:
request
.
user
,
'user_parameters'
:
node_user
.
hyperdata
,
'languages'
:
USER_LANG
},
)
...
...
@@ -73,7 +75,8 @@ def docs_by_sources(request, project_id, corpus_id):
'resourcename'
:
get_resource
(
source_type
)[
'name'
],
'user'
:
request
.
user
,
'user_parameters'
:
node_user
,
'view'
:
'sources'
'view'
:
'sources'
,
'USER_LANG'
:
USER_LANG
},
)
...
...
@@ -104,7 +107,8 @@ def docs_by_authors(request, project_id, corpus_id):
'resourcename'
:
get_resource
(
source_type
)[
'name'
],
'view'
:
'authors'
,
'user'
:
request
.
user
,
'user_parameters'
:
node_user
.
hyperdata
'user_parameters'
:
node_user
.
hyperdata
,
'USER_LANG'
:
USER_LANG
},
)
...
...
@@ -129,6 +133,7 @@ def analytics(request, project_id, corpus_id):
'resourcename'
:
get_resource
(
source_type
)[
'name'
],
'view'
:
'analytics'
,
'user'
:
request
.
user
,
'user_parameters'
:
node_user
.
hyperdata
'user_parameters'
:
node_user
.
hyperdata
,
'USER_LANG'
:
USER_LANG
},
)
gargantext/views/pages/main.py
View file @
1ba4b32a
...
...
@@ -3,6 +3,7 @@ from gargantext.util.db import session
from
gargantext.models
import
Node
,
User
import
datetime
from
gargantext.util.generators
import
paragraphs
,
credits
from
gargantext.constants
import
USER_LANG
def
get_node_user
(
user
):
#load user parameters from User(Node).hyperdata from request.user or cache.
...
...
@@ -43,15 +44,15 @@ def home(request):
'paragraph_gargantua'
:
paragraphs
.
gargantua
(),
'paragraph_lorem'
:
paragraphs
.
lorem
(),
'paragraph_tutoreil'
:
paragraphs
.
tutoreil
(),
'user_parameters'
:
user_node
.
hyperdata
'user_parameters'
:
user_node
.
hyperdata
,
'languages'
:
USER_LANG
,
},
)
def
about
(
request
):
'''About Gargantext, its team and sponsors
'''
user_node
=
get_
user_node
(
request
.
user
)
user_node
=
get_
node_user
(
request
.
user
)
return
render
(
template_name
=
'pages/main/about.html'
,
request
=
request
,
...
...
@@ -62,7 +63,8 @@ def about(request):
'institutions'
:
credits
.
institutions
(),
'labos'
:
credits
.
labs
(),
'grants'
:
credits
.
grants
(),
'user_parameters'
:
user_node
.
hyperdata
'user_parameters'
:
user_node
.
hyperdata
,
'languages'
:
USER_LANG
,
},
)
...
...
gargantext/views/pages/projects.py
View file @
1ba4b32a
...
...
@@ -4,6 +4,7 @@ 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
...
...
@@ -68,6 +69,7 @@ def overview(request):
'number'
:
user_projects
.
count
(),
'projects'
:
user_projects
,
"user_parameters"
:
node_user
.
hyperdata
,
'USER_LANG'
:
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
),
[]),
...
...
@@ -190,6 +192,7 @@ def project(request, project_id):
'form'
:
NewCorpusForm
,
'user'
:
request
.
user
,
"user_parameters"
:
node_user
.
hyperdata
,
'languages'
:
USER_LANG
,
'date'
:
datetime
.
now
(),
'project'
:
project
,
'donut'
:
donut
,
...
...
gargantext/views/pages/terms.py
View file @
1ba4b32a
...
...
@@ -3,6 +3,7 @@ from gargantext.util.db import session
from
gargantext.util.db_cache
import
cache
from
gargantext.models
import
Node
from
gargantext.constants
import
get_resource
from
gargantext.constants
import
USER_LANG
from
.main
import
get_node_user
from
datetime
import
datetime
...
...
@@ -51,6 +52,8 @@ def ngramtable(request, project_id, corpus_id):
# for the CSV import modal
'importroute'
:
"/api/ngramlists/import?onto_corpus=
%
i"
%
corpus
.
id
,
'corporainfos'
:
corpora_infos
,
#user params
'user_parameters'
:
user_node
.
hyperdata
,
'USER_LANG'
:
USER_LANG
},
)
graph/views.py
View file @
1ba4b32a
...
...
@@ -4,9 +4,9 @@ from gargantext.util.db_cache import cache
from
gargantext.models
import
*
from
gargantext.constants
import
*
from
gargantext.settings
import
*
from
gargantext.views.pages.main
import
get_node_user
from
gargantext.constants
import
USER_LANG
from
datetime
import
datetime
from
gargantext.views.pages.main
import
get_node_user
@
requires_auth
def
explorer
(
request
,
project_id
,
corpus_id
):
...
...
@@ -49,6 +49,7 @@ def explorer(request, project_id, corpus_id):
'maplist_id'
:
maplist_id
,
'view'
:
'graph'
,
'user_parameters'
:
node_user
.
hyperdata
,
'USER_LANG'
:
USER_LANG
},
)
...
...
@@ -64,7 +65,7 @@ def myGraphs(request, project_id, corpus_id):
'''
user
=
cache
.
User
[
request
.
user
.
id
]
node_user
=
get_node_user
(
user
)
user_node
=
get_node_user
(
user
)
# we pass our corpus
corpus
=
cache
.
Node
[
corpus_id
]
...
...
@@ -105,5 +106,6 @@ def myGraphs(request, project_id, corpus_id):
'coocs'
:
coocs
,
'coocs_count'
:
coocs_count
,
'user_parameters'
:
user_node
.
hyperdata
,
'languages'
:
USER_LANG
,
},
)
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