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
ce362964
Commit
ce362964
authored
Sep 14, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/c24b-testing' into testing
parents
3648d3b2
dc9e819b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
263 additions
and
31 deletions
+263
-31
projects.py
gargantext/views/pages/projects.py
+22
-10
project.html
templates/pages/projects/project.html
+36
-20
wait.html
templates/pages/projects/wait.html
+205
-1
No files found.
gargantext/views/pages/projects.py
View file @
ce362964
...
...
@@ -104,16 +104,9 @@ def project(request, project_id):
# parse_extract: fileparsing -> ngram extraction -> lists
scheduled
(
parse_extract_indexhyperdata
)(
corpus
.
id
)
return
render
(
template_name
=
'pages/projects/wait.html'
,
request
=
request
,
context
=
{
'user'
:
request
.
user
,
'project'
:
project
,
},
)
wait
=
True
else
:
wait
=
False
# corpora within this project
corpora
=
project
.
children
(
'CORPUS'
,
order
=
True
)
.
all
()
...
...
@@ -161,6 +154,25 @@ def project(request, project_id):
}
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!
return
render
(
template_name
=
'pages/projects/project.html'
,
...
...
templates/pages/projects/project.html
View file @
ce362964
...
...
@@ -61,23 +61,7 @@
</p>
</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>
...
...
@@ -295,6 +279,29 @@
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</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"
>
×
</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"
>
function
getCookie
(
name
)
{
...
...
@@ -312,7 +319,7 @@
}
return
cookieValue
;
}
var
thequeries
=
[]
;
// load the template's value for N scan size
...
...
@@ -657,9 +664,14 @@
alert
(
"OK"
)
setTimeout
(
function
()
{
alert
(
"TimeOut!"
)
$
(
'#addcorpus'
).
modal
(
'hide'
)
$
(
"#wait"
).
modal
(
"show"
)
$
(
"#wait"
).
modal
(
"show"
);
// setTimeout(
// function(){
// location.reload();
//
// }, 600);
// )
//setTimeout(, 300)
//location.reload();
},
600
);
...
...
@@ -730,6 +742,10 @@
formatter
:
function
(
y
)
{
return
y
+
"%"
}
});
{
%
endif
%
}
$
(
'#wait'
).
on
(
'hidden.bs.modal'
,
function
(
e
)
{
// reload page when dismiss the info box
window
.
location
.
reload
()
})
</script>
...
...
templates/pages/projects/wait.html
View file @
ce362964
...
...
@@ -12,7 +12,7 @@
{% block content %}
<!--
<div class="container theme-showcase" role="main">
<div class="jumbotron">
<h2>Your file has been uploaded ! </h2>
...
...
@@ -20,6 +20,210 @@
<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=
"container theme-showcase"
role=
"main"
>
<div
class=
"jumbotron"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
{% if project %}
<h1>
<span
class=
"glyphicon glyphicon-book"
aria-hidden=
"true"
></span>
{{ project.name | truncatechars:25 }}
</h1>
<!--<h3> {{number}} corpora </h3>-->
{% endif %}
</div>
<div
class=
"col-md-4"
>
<p>
{% if donut %}
<div
id=
"hero-donut"
style=
"height: 200px;"
></div>
{% endif %}
<center>
<a
data-toggle=
"modal"
href=
"#addcorpus"
>
<button
type=
"button"
class=
"btn btn-primary btn-lg"
data-container=
"body"
data-toggle=
"popover"
data-placement=
"bottom"
>
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
Add a corpus
</button>
</a>
</center>
</p>
</div>
</div>
</div>
<!-- Add jumbotron container for each type of corpus (presse, science etc.) -->
<div
id=
"semLoader"
style=
"position:absolute; top:50%; left:40%; width:80px; visibility: hidden;"
>
<img
src=
"{% static "
img
/
loading-bar
.
gif
"
%}"
></img>
</div>
<div
class=
"container"
>
{% if list_corpora %}
{% for key, corpora in list_corpora.items %}
<h2>
<div
class=
"row"
>
<div
class=
"col-md-1 content"
></div>
<span
class=
"glyphicon glyphicon-cd"
aria-hidden=
"true"
></span>
{{ key }}
</h2>
{% for corpus in corpora %}
<div
id=
"corpus_{{corpus.id}}"
>
<div
class=
"row"
>
<h4>
<div
class=
"col-md-1 content"
></div>
<div
class=
"col-md-5 content"
>
<a
href=
"/projects/{{project.id}}/corpora/{{corpus.id}}"
>
<span
class=
"glyphicon glyphicon-file"
aria-hidden=
"true"
></span>
{{corpus.name}}, {{ corpus.count }} documents {{ corpus.status_message }}
</a>
</div>
<div
class=
"col-md-3 content"
>
<!-- -->
{% for state in corpus.hyperdata.statuses %}
{% ifequal state.action "Workflow" %}
{% if state.complete %}
<a
href=
"/projects/{{project.id}}/corpora/{{corpus.id}}"
title=
"View the corpus"
>
<button
type=
"button"
class=
"btn btn-default"
aria-label=
"Left Align"
>
<span
class=
"glyphicon glyphicon-eye-open"
aria-hidden=
"true"
></span>
</button>
</a>
<button
type=
"button"
class=
"btn btn-default yopla"
data-container=
"body"
data-toggle=
"popover"
data-placement=
"bottom"
data-trigger=
"focus"
data-content=
"
<ul>
<li
onclick="
garganrest.metrics.update({{corpus.id}}, function(){alert('The corpus ({{corpus.name|escapejs}}) was updated')});
">
<a href='#'>Recalculate ngram metrics</a> <br/> (can take a little while)
</li>
</ul>
"
>
<span
class=
"glyphicon glyphicon-repeat"
aria-hidden=
"true"
title=
'Recalculate ngram scores and similarities'
></span>
</button>
{% endif %}
<!-- TODO: delete non seulement si state.complete mais aussi si state.error -->
<button
type=
"button"
class=
"btn btn-default"
data-container=
"body"
data-toggle=
"popover"
data-placement=
"bottom"
data-content=
"
<ul>
<li
onclick="
garganrest.nodes.delete({{corpus.id}}, function(){$('#corpus_'+{{corpus.id}}).remove()});
$(this).parent().parent().remove();
">
<a href='#'>Delete this</a>
</li>
</ul>
"
>
<span
class=
"glyphicon glyphicon-trash"
aria-hidden=
"true"
title=
'Delete this corpus'
></span>
</button>
{% endifequal %}
{% endfor %}
</div>
<div
class=
"col-md-3 content"
>
{% for state in corpus.hyperdata.statuses %}
{% ifequal state.action "Workflow" %}
{% if state.complete %}
<span
class=
"glyphicon glyphicon-ok"
aria-hidden=
"true"
></span>
{% else %}
{% if state.error %}
<span
class=
"glyphicon glyphicon-exclamation-sign"
aria-hidden=
"true"
></span>
{{ state.error }}
{% else %}
<div
class=
"progress"
>
<div
class=
" progress-bar progress-bar-striped
progress-bar-success
"
role=
"progressbar"
aria-valuenow=
"45"
aria-valuemin=
"0"
aria-valuemax=
"100"
style=
"width: 20%"
>
<span>
Upload
</span>
</div>
{% for state in corpus.hyperdata.statuses %}
<!-- {% if state.action != "Workflow" %} --!>
<div class=" progress-bar progress-bar-striped
{% if state.complete %}
progress-bar-success
{% else %}
active
{% endif %}
"
role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
<span>
{{ state.action }}
{% if not state.complete %}
Processing
{% endif %}
</span>
</div>
<!-- {% endif %} --!>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endifequal %}
{% endfor %}
</div>
<div class="col-md-1 content"></div>
</h4>
</div>
</div>
{% endfor %}
{% endfor %}
{% endif %}
<!-- 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"
>
×
</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"
>
$
(
window
).
load
(
function
()
{
var
projectid
=
window
.
location
.
href
.
split
(
"projects"
)[
1
].
replace
(
/
\/
/g
,
''
)
//replace all the slashes
$
(
'#wait'
).
modal
({
show
:
false
})
$
(
"#wait"
).
modal
(
"show"
);
$
(
'#wait'
).
on
(
'hidden.bs.modal'
,
function
(
e
)
{
// reload page when dismiss the info box
$
(
location
).
attr
(
'href'
,
window
.
location
.
origin
+
'/projects/'
+
projectid
)
})
});
</script>
{% endblock %}
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