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
e997805a
Commit
e997805a
authored
Nov 06, 2014
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DOC] Comments of first views (and objectives to deal with).
parent
8a830bb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
views.py
gargantext_web/views.py
+20
-0
No files found.
gargantext_web/views.py
View file @
e997805a
...
@@ -69,6 +69,11 @@ def date_range(start_dt, end_dt = None, format=None):
...
@@ -69,6 +69,11 @@ def date_range(start_dt, end_dt = None, format=None):
# SOME VIEWS
# SOME VIEWS
def
home
(
request
):
def
home
(
request
):
'''
Home describes the platform.
A video draws the narratives.
If not logged a project test is shown.
'''
t
=
get_template
(
'home.html'
)
t
=
get_template
(
'home.html'
)
user
=
request
.
user
user
=
request
.
user
date
=
datetime
.
datetime
.
now
()
date
=
datetime
.
datetime
.
now
()
...
@@ -81,6 +86,11 @@ def home(request):
...
@@ -81,6 +86,11 @@ def home(request):
return
HttpResponse
(
html
)
return
HttpResponse
(
html
)
def
projects
(
request
):
def
projects
(
request
):
'''
This view show all projects for each user.
Each project is described with metadata that are updateded on each following view.
To each project, we can link a resource that can be an image.
'''
if
not
request
.
user
.
is_authenticated
():
if
not
request
.
user
.
is_authenticated
():
return
redirect
(
'/admin/logout/?next=
%
s'
%
request
.
path
)
return
redirect
(
'/admin/logout/?next=
%
s'
%
request
.
path
)
...
@@ -112,6 +122,13 @@ def projects(request):
...
@@ -112,6 +122,13 @@ def projects(request):
})
})
def
project
(
request
,
project_id
):
def
project
(
request
,
project_id
):
'''
This view represents all corpora in a panoramic way.
The title sums all corpora
The donut summerizes composition of the project.
The list of lists enalbles to navigate throw it.
'''
if
not
request
.
user
.
is_authenticated
():
if
not
request
.
user
.
is_authenticated
():
return
redirect
(
'/login/?next=
%
s'
%
request
.
path
)
return
redirect
(
'/login/?next=
%
s'
%
request
.
path
)
...
@@ -126,6 +143,9 @@ def project(request, project_id):
...
@@ -126,6 +143,9 @@ def project(request, project_id):
project
=
Node
.
objects
.
get
(
id
=
project_id
)
project
=
Node
.
objects
.
get
(
id
=
project_id
)
corpora
=
project
.
children
.
all
()
corpora
=
project
.
children
.
all
()
number
=
project
.
children
.
count
()
number
=
project
.
children
.
count
()
# DONUT corpora representation
donut_part
=
defaultdict
(
int
)
donut_part
=
defaultdict
(
int
)
docs_total
=
0
docs_total
=
0
...
...
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