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
ad864e71
Commit
ad864e71
authored
May 07, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Adding resource type in corpora page.
parent
fef1f1b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
0 deletions
+17
-0
constants.py
gargantext/constants.py
+9
-0
corpora.py
gargantext/views/pages/corpora.py
+3
-0
terms.py
gargantext/views/pages/terms.py
+2
-0
menu.html
templates/pages/menu.html
+3
-0
No files found.
gargantext/constants.py
View file @
ad864e71
...
...
@@ -130,6 +130,15 @@ def resourcetype(name):
'''
return
[
n
[
0
]
for
n
in
enumerate
(
r
[
'name'
]
for
r
in
RESOURCETYPES
)
if
n
[
1
]
==
name
][
0
]
def
resourcename
(
corpus
):
'''
resourcetype :: Corpus -> String
Usage : resourcename(corpus) == "ISTex"
'''
resource
=
corpus
.
resources
()[
0
]
return
RESOURCETYPES
[
resource
[
'type'
]][
'name'
]
RESOURCETYPES
=
[
# type 0
{
'name'
:
'Select database below'
,
...
...
gargantext/views/pages/corpora.py
View file @
ad864e71
...
...
@@ -37,11 +37,13 @@ def docs_by_titles(request, project_id, corpus_id):
'date'
:
datetime
.
now
(),
'project'
:
project
,
'corpus'
:
corpus
,
'resourcename'
:
resourcename
(
corpus
),
'view'
:
'titles'
,
'user'
:
request
.
user
},
)
@
requires_auth
def
chart
(
request
,
project_id
,
corpus_id
):
authorized
,
user
,
project
,
corpus
=
_get_user_project_corpus
(
request
,
project_id
,
corpus_id
)
...
...
@@ -69,6 +71,7 @@ def docs_by_journals(request, project_id, corpus_id):
'date'
:
datetime
.
now
(),
'project'
:
project
,
'corpus'
:
corpus
,
'resourcename'
:
resourcename
(
corpus
),
'view'
:
'journals'
},
)
...
...
gargantext/views/pages/terms.py
View file @
ad864e71
...
...
@@ -2,6 +2,7 @@ from gargantext.util.http import requires_auth, render, settings
from
gargantext.util.db
import
session
from
gargantext.util.db_cache
import
cache
from
gargantext.models
import
Node
from
gargantext.constants
import
resourcename
from
datetime
import
datetime
@
requires_auth
...
...
@@ -31,6 +32,7 @@ def ngramtable(request, project_id, corpus_id):
'date'
:
datetime
.
now
(),
'project'
:
project
,
'corpus'
:
corpus
,
'resourcename'
:
resourcename
(
corpus
),
'view'
:
'terms'
},
)
templates/pages/menu.html
View file @
ad864e71
...
...
@@ -151,6 +151,9 @@
<span class="glyphicon glyphicon-book" aria-hidden="true"></span>
{{ project.name }}
</a>
<br>
<span class="glyphicon glyphicon-cd" aria-hidden="true"></span>
{{ resourcename }}
<br>
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
{{ corpus.name }}
...
...
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