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
35af8634
Commit
35af8634
authored
Sep 19, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] corpus type was none in doc view etc
parent
2666d34a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
constants.py
gargantext/constants.py
+2
-4
corpora.py
gargantext/views/pages/corpora.py
+13
-4
No files found.
gargantext/constants.py
View file @
35af8634
...
...
@@ -119,10 +119,8 @@ INDEXED_HYPERDATA = {
# resources ---------------------------------------------
def
get_resource
(
sourcetype
):
'''resource :: type => resource dict'''
for
n
in
RESOURCETYPES
:
if
int
(
n
[
"type"
])
==
int
(
sourcetype
):
return
n
return
None
return
RESOURCETYPES
[
sourcetype
-
1
]
def
get_resource_by_name
(
sourcename
):
'''resource :: name => resource dict'''
for
n
in
RESOURCETYPES
:
...
...
gargantext/views/pages/corpora.py
View file @
35af8634
...
...
@@ -28,6 +28,8 @@ def docs_by_titles(request, project_id, corpus_id):
authorized
,
user
,
project
,
corpus
=
_get_user_project_corpus
(
request
,
project_id
,
corpus_id
)
if
not
authorized
:
return
HttpResponseForbidden
()
source_type
=
corpus
.
resources
()[
0
][
'type'
]
# response!
return
render
(
template_name
=
'pages/corpora/titles.html'
,
...
...
@@ -37,7 +39,7 @@ def docs_by_titles(request, project_id, corpus_id):
'date'
:
datetime
.
now
(),
'project'
:
project
,
'corpus'
:
corpus
,
'resourcename'
:
get_resource
_by_name
(
corpus
.
resources
()[
0
])
,
'resourcename'
:
get_resource
(
source_type
)[
'name'
]
,
'view'
:
'titles'
,
'user'
:
request
.
user
},
...
...
@@ -56,6 +58,8 @@ def docs_by_journals(request, project_id, corpus_id):
# and the project just for project.id in corpusBannerTop
project
=
cache
.
Node
[
project_id
]
source_type
=
corpus
.
resources
()[
0
][
'type'
]
# rendered page : journals.html
return
render
(
template_name
=
'pages/corpora/journals.html'
,
...
...
@@ -65,7 +69,7 @@ def docs_by_journals(request, project_id, corpus_id):
'date'
:
datetime
.
now
(),
'project'
:
project
,
'corpus'
:
corpus
,
'resourcename'
:
get_resource
_by_name
(
corpus
.
resources
()[
0
])
,
'resourcename'
:
get_resource
(
source_type
)[
'name'
]
,
'view'
:
'journals'
},
)
...
...
@@ -83,6 +87,8 @@ def docs_by_authors(request, project_id, corpus_id):
# and the project just for project.id in corpusBannerTop
project
=
cache
.
Node
[
project_id
]
source_type
=
corpus
.
resources
()[
0
][
'type'
]
# rendered page : journals.html
return
render
(
template_name
=
'pages/corpora/authors.html'
,
...
...
@@ -92,7 +98,7 @@ def docs_by_authors(request, project_id, corpus_id):
'date'
:
datetime
.
now
(),
'project'
:
project
,
'corpus'
:
corpus
,
'resourcename'
:
get_resource
_by_name
(
corpus
.
resources
()[
0
])
,
'resourcename'
:
get_resource
(
source_type
)[
'name'
]
,
'view'
:
'authors'
},
)
...
...
@@ -103,6 +109,9 @@ def analytics(request, project_id, corpus_id):
authorized
,
user
,
project
,
corpus
=
_get_user_project_corpus
(
request
,
project_id
,
corpus_id
)
if
not
authorized
:
return
HttpResponseForbidden
()
source_type
=
corpus
.
resources
()[
0
][
'type'
]
# response!
return
render
(
template_name
=
'pages/analytics/histories.html'
,
...
...
@@ -112,7 +121,7 @@ def analytics(request, project_id, corpus_id):
'date'
:
datetime
.
now
(),
'project'
:
project
,
'corpus'
:
corpus
,
'resourcename'
:
get_resource
_by_name
(
corpus
.
resources
()[
0
])
,
'resourcename'
:
get_resource
(
source_type
)[
'name'
]
,
'view'
:
'analytics'
,
'user'
:
request
.
user
},
...
...
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