Commit e997805a authored by Administrator's avatar Administrator

[DOC] Comments of first views (and objectives to deal with).

parent 8a830bb4
...@@ -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
......
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