Commit dc9e819b authored by c24b's avatar c24b

[TPL] INFOBOX Uploading

parent 5ecf25df
...@@ -104,16 +104,9 @@ def project(request, project_id): ...@@ -104,16 +104,9 @@ def project(request, project_id):
# parse_extract: fileparsing -> ngram extraction -> lists # parse_extract: fileparsing -> ngram extraction -> lists
scheduled(parse_extract_indexhyperdata)(corpus.id) scheduled(parse_extract_indexhyperdata)(corpus.id)
wait = True
return render( else:
template_name = 'pages/projects/wait.html', wait = False
request = request,
context = {
'user' : request.user,
'project': project,
},
)
# corpora within this project # corpora within this project
corpora = project.children('CORPUS', order=True).all() corpora = project.children('CORPUS', order=True).all()
...@@ -161,6 +154,25 @@ def project(request, project_id): ...@@ -161,6 +154,25 @@ def project(request, project_id):
} }
for sourcename, count in sourcename2documentscount.items() for sourcename, count in sourcename2documentscount.items()
] ]
if wait:
return render(
template_name = 'pages/projects/wait.html',
request = request,
context = {
'form': NewCorpusForm,
'user': request.user,
'date': datetime.now(),
'project': project,
'donut': donut,
'list_corpora': dict(sourcename2corpora),
'whitelists': [],
'blacklists': [],
'cooclists': [],
'number': len(corpora),
'query_size': QUERY_SIZE_N_DEFAULT,
},
)
# response! # response!
return render( return render(
template_name = 'pages/projects/project.html', template_name = 'pages/projects/project.html',
......
...@@ -61,23 +61,7 @@ ...@@ -61,23 +61,7 @@
</p> </p>
</div> </div>
</div> </div>
<!-- Modal -->
<div id="wait" class="modal" style="top:8%;">
<div class="jumbotron">
<div class="container theme-showcase jumbotron" role="main">
<div>
<div class="col-md-3"></div>
<div class="col-md-6">
<h2>Your file has been uploaded ! </h2>
<h2>Gargantext need some time to eat it.</h2>
<h2>Duration depends on the size of the dish.</h2>
<a class="btn btn-primary btn-lg" href="/projects/{{ project.id }}" title="Click and test by yourself">Continue on Gargantext</a>
</div>
<div class="col-md-3"></div>
</div>
</div>
</div>
</div>
</div> </div>
...@@ -295,6 +279,29 @@ ...@@ -295,6 +279,29 @@
</div><!-- /.modal-content --> </div><!-- /.modal-content -->
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->
</div><!-- /.modal --> </div><!-- /.modal -->
<!-- Modal -->
<div id="wait" class="modal fade">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h2 class="modal-title"><h2><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> Uploading corpus...</h2>
</div>
<div class="modal-body">
<p>
Your file has been uploaded !
Gargantext need some time to eat it.
Duration depends on the size of the dish.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Continue on Gargantext</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script type="text/javascript" src="{% static "lib/jquery/1.11.2/jquery-ui.js" %}"></script> <script type="text/javascript" src="{% static "lib/jquery/1.11.2/jquery-ui.js" %}"></script>
<script type="text/javascript"> <script type="text/javascript">
function getCookie(name) { function getCookie(name) {
...@@ -312,7 +319,7 @@ ...@@ -312,7 +319,7 @@
} }
return cookieValue; return cookieValue;
} }
var thequeries = [] ; var thequeries = [] ;
// load the template's value for N scan size // load the template's value for N scan size
...@@ -657,9 +664,14 @@ ...@@ -657,9 +664,14 @@
alert("OK") alert("OK")
setTimeout( setTimeout(
function() { function() {
alert("TimeOut!")
$('#addcorpus').modal('hide') $('#addcorpus').modal('hide')
$("#wait").modal("show") $("#wait").modal("show");
// setTimeout(
// function(){
// location.reload();
//
// }, 600);
// )
//setTimeout(, 300) //setTimeout(, 300)
//location.reload(); //location.reload();
}, 600); }, 600);
...@@ -730,6 +742,10 @@ ...@@ -730,6 +742,10 @@
formatter: function (y) { return y + "%" } formatter: function (y) { return y + "%" }
}); });
{% endif %} {% endif %}
$('#wait').on('hidden.bs.modal', function (e) {
// reload page when dismiss the info box
window.location.reload()
})
</script> </script>
......
This diff is collapsed.
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