Commit 34c0afda authored by c24b's avatar c24b

Add user_parameters into corpora TPL

parent d6b81cba
......@@ -28,7 +28,7 @@ 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()
node_user = session.query(Node).filter(Node.user_id == user.id & Node.typename== "USER")
source_type = corpus.resources()[0]['type']
# response!
return render(
......@@ -41,7 +41,8 @@ def docs_by_titles(request, project_id, corpus_id):
'corpus': corpus,
'resourcename' : get_resource(source_type)['name'],
'view': 'titles',
'user': request.user
'user': request.user,
'user_parameters': node_user.hyperdata
},
)
......@@ -59,7 +60,7 @@ def docs_by_sources(request, project_id, corpus_id):
project = cache.Node[project_id]
source_type = corpus.resources()[0]['type']
node_user = session.query(Node).filter(Node.user_id == user.id & Node.typename== "USER")
# rendered page : sources.html
return render(
template_name = 'pages/corpora/sources.html',
......@@ -70,6 +71,8 @@ def docs_by_sources(request, project_id, corpus_id):
'project': project,
'corpus' : corpus,
'resourcename' : get_resource(source_type)['name'],
'user': request.user,
"user_parameters": node_user.hyperdata,
'view': 'sources'
},
)
......@@ -88,7 +91,7 @@ def docs_by_authors(request, project_id, corpus_id):
project = cache.Node[project_id]
source_type = corpus.resources()[0]['type']
node_user = session.query(Node).filter(Node.user_id == user.id & Node.typename== "USER")
# rendered page : sources.html
return render(
template_name = 'pages/corpora/authors.html',
......@@ -99,7 +102,9 @@ def docs_by_authors(request, project_id, corpus_id):
'project': project,
'corpus' : corpus,
'resourcename' : get_resource(source_type)['name'],
'view': 'authors'
'view': 'authors',
'user': request.user,
"user_parameters": node_user.hyperdata
},
)
......@@ -111,7 +116,7 @@ def analytics(request, project_id, corpus_id):
return HttpResponseForbidden()
source_type = corpus.resources()[0]['type']
node_user = session.query(Node).filter(Node.user_id == user.id & Node.typename== "USER")
# response!
return render(
template_name = 'pages/analytics/histories.html',
......@@ -123,6 +128,7 @@ def analytics(request, project_id, corpus_id):
'corpus': corpus,
'resourcename' : get_resource(source_type)['name'],
'view': 'analytics',
'user': request.user
'user': request.user,
'user_parameters': node_user.hyperdata,
},
)
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