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
d4fe6e84
Commit
d4fe6e84
authored
Oct 25, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remobve include with
parent
97ca8f84
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1121 additions
and
9 deletions
+1121
-9
myGraphs.html
templates/pages/corpora/myGraphs.html
+1
-1
sources.html
templates/pages/corpora/sources.html
+1
-1
terms.html
templates/pages/corpora/terms.html
+1
-1
titles.html
templates/pages/corpora/titles.html
+1
-1
menu.html
templates/pages/menu.html
+16
-3
corpora_list.tpl
templates/pages/projects/corpora_list.tpl
+120
-0
modals.tpl
templates/pages/projects/modals.tpl
+103
-0
moissonneurs.js
templates/pages/projects/moissonneurs.js
+290
-0
old_project.html
templates/pages/projects/old_project.html
+318
-0
overview.html
templates/pages/projects/overview.html
+1
-1
project.html
templates/pages/projects/project.html
+1
-1
statuses.tpl
templates/pages/projects/statuses.tpl
+81
-0
validate_form.js
templates/pages/projects/validate_form.js
+100
-0
validators.js
templates/pages/projects/validators.js
+87
-0
No files found.
templates/pages/corpora/myGraphs.html
View file @
d4fe6e84
{% extends "pages/menu.html" with user_parameters%}
{% extends "pages/menu.html" with user_parameters
=user_parameters
%}
{% block css %}
...
...
templates/pages/corpora/sources.html
View file @
d4fe6e84
{% extends "pages/menu.html" with user_parameters%}
{% extends "pages/menu.html" with user_parameters
=user_parameters
%}
{% block css %}
{% load staticfiles %}
...
...
templates/pages/corpora/terms.html
View file @
d4fe6e84
{% extends "pages/menu.html" with user_parameters%}
{% extends "pages/menu.html" with user_parameters
=user_parameters
%}
{% load staticfiles %}
{% block css %}
...
...
templates/pages/corpora/titles.html
View file @
d4fe6e84
{% extends "pages/menu.html" with user_parameters%}
{% extends "pages/menu.html" with user_parameters
=user_parameters
%}
{% load staticfiles %}
{% block css %}
...
...
templates/pages/menu.html
View file @
d4fe6e84
...
...
@@ -68,6 +68,8 @@
{% endif %}
</ul>
<ul
class=
"nav navbar-nav pull-right"
>
<li
class=
"dropdown"
>
<a
href=
"#"
role=
"button"
class=
"dropdown-toggle navbar-text"
data-toggle=
"dropdown"
title=
"That is your username"
>
...
...
@@ -102,10 +104,21 @@
{% endif %}
</ul>
</li>
<li
class=
"lang"
>
<a
href=
"#"
role=
"button"
class=
"dropdown-toggle navbar-text"
>
{% if user_parameters.language == "fr" %}
<img
value=
"{{user_parameters.language}}"
src=
"{% static "
img
/
fr
.
png
"%}"
width=
"45%"
/>
{%else %}
<img
value=
"{{user_parameters.language}}"
src=
"{% static "
img
/
en
.
png
"%}"
width=
"45%"
/>
{%endif%}
{{user_parameters.language}}
</a>
</li>
</ul>
<ul
class=
"nav navbar-nav pull-right"
>
<button
class=
"btn primary_keylang"
>
{{user_parameters["language"]}}
</button>
</ul>
</div>
</div>
{% if corpus %}
...
...
templates/pages/projects/corpora_list.tpl
0 → 100644
View file @
d4fe6e84
{
%
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 %}
<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>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endifequal %}
{% endfor %}
</div>
<div
class=
"col-md-1 content"
></div>
</h4>
</div>
</div>
{% endfor %}
{% endfor %}
{% endif %}
templates/pages/projects/modals.tpl
0 → 100644
View file @
d4fe6e84
<div
class=
"modal fade"
id=
"stack1"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h3>
Query to PubMed
</h3>
</div>
<div
class=
"modal-body"
>
<p>
One fine body…
</p>
<input
id=
"daquery"
type=
"text"
class=
"input-lg"
data-tabindex=
"2"
>
<a
onclick=
"getGlobalResults();"
class=
"btn"
>
Scan
</a>
<div
id=
"results"
></div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
<button
onclick=
"doTheQuery();"
disabled
id=
"id_thebutton"
type=
"button"
class=
"btn btn-primary"
>
Explore a sample!
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- Modal -->
<div
class=
"modal fade"
id=
"addcorpus"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel2"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h3>
Add a Corpus
<a
href=
"https://gogs.iscpif.fr/humanities/faq_gargantext/wiki/FAQ#import--export-a-dataset"
>
<span
class=
"glyphicon glyphicon-question-sign"
aria-hidden=
"true"
></span>
</a>
</h3>
</div>
<div
class=
"modal-body"
>
<!-- FAQ -->
<form
id=
"id_form"
enctype=
"multipart/form-data"
action=
"/projects/{
{
project
.
id
}
}/"
method=
"post"
>
{% csrf_token %}
<table
cellpadding=
"5"
>
{% for field in form %}
<tr>
<th>
{
{
field
.
label_tag
}
}
</th>
<td>
{{ field.errors }}
{{ field }}
{% if field.name == 'name' %}
<span
onclick=
"getGlobalResults(this);"
id=
"scanpubmed"
></span>
<div
id=
"theresults"
></div>
{% endif %}
</td>
</tr>
{% endfor %}
<tr>
<th></th>
<td>
<div
id=
"pubmedcrawl"
style=
"visibility: hidden;"
>
Do you have a file already?
<input
type=
"radio"
id=
"file_yes"
name=
"file1"
onclick=
"FileOrNotFile(this.value);"
class=
"file1"
value=
"true"
checked
>
Yes
</input>
<input
type=
"radio"
id=
"file_no"
name=
"file1"
onclick=
"FileOrNotFile(this.value);"
class=
"file1"
value=
"false"
>
No
</input>
</div>
</td>
</tr>
</table>
</form>
<div
class=
"modal-footer"
>
<!-- <div id="pubmedcrawl" align="right" style="visibility: hidden;"><a data-toggle="modal" href="#stack1">➞ Query directly in PubMed</a></div> -->
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
<span
class=
"glyphicon glyphicon-remove"
aria-hidden=
"true"
></span>
Close
</button>
<button
onclick=
'bringDaNoise();'
id=
"submit_thing"
disabled
class=
"btn btn-primary"
>
<span
class=
"glyphicon glyphicon-ok"
aria-hidden=
"true"
></span>
Process this!
</button><span
id=
"simpleloader"
></span>
</div>
</div>
</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"
>
<h5>
Your file has been uploaded !
Gargantext need some time to eat it.
Duration depends on the size of the dish.
</h5>
</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 -->
templates/pages/projects/moissonneurs.js
0 → 100644
View file @
d4fe6e84
This diff is collapsed.
Click to expand it.
templates/pages/projects/old_project.html
0 → 100644
View file @
d4fe6e84
This diff is collapsed.
Click to expand it.
templates/pages/projects/overview.html
View file @
d4fe6e84
{% extends "pages/menu.html"
with user_parameters
%}
{% extends "pages/menu.html" %}
{% block css %}
{% load staticfiles %}
...
...
templates/pages/projects/project.html
View file @
d4fe6e84
{% extends "pages/menu.html"
with user_parameters
%}
{% extends "pages/menu.html" %}
{% block css %}
{% load staticfiles %}
...
...
templates/pages/projects/statuses.tpl
0 → 100644
View file @
d4fe6e84
{
%
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"
>
{% 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: 25%"
>
<span>
{{ state.action }}
{% if state.complete %}
Ok
{% else %}
Processing
{% endif %}
</span>
</div>
{% endif %}
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endifequal %}
{% endfor %}
function manageStatus(statuses){
status_bar = ""
status_bar += '
<div
class=
"progress"
>
'
statuses.forEach(function (status){
if (status["action"] == "Workflow"){
if (status["complete"]){
status_bar += '
<span
class=
"glyphicon glyphicon-ok pull-right"
aria-hidden=
"true"
></span></div>
'
return status_bar;
};
else if (status["error"]) {
status_bar += '
<span
class=
"glyphicon glyphicon-exclamation-sign pull-right"
aria-hidden=
"true"
></span></div>
'
return status_bar;
};
else{
};
};
else{
status_bar +='
<div
class=
" progress-bar progress-bar-striped'
if (status["
complete
"]){
status_bar
+='
progress-bar-sucess
'
};
else
{
status_bar
+='
active
'
};
status_bar
+=
'"
role=
"progressbar"
aria-valuenow=
"45"
aria-valuemin=
"0"
aria-valuemax=
"100"
style=
"width: 25%"
>
<span>
'
if (status["action"]){
if (status["complete"]){
status_bar+= " OK
</span></div>
"
};
else{
status_bar+= " Processing
</span>
"
};
}
});
}
}
})
status_bar+="
</div>
"
return status_bar
};
templates/pages/projects/validate_form.js
0 → 100644
View file @
d4fe6e84
console
.
log
(
errors
)
errors
.
forEach
(
function
(
err
)
{
div
=
err
[
0
].
split
(
" "
)
logs
=
[]
logs
.
push
(
div
[
0
])
if
(
err
[
1
]
==
false
)
{
alert
(
div
[
0
])
//$(div[0]).parent().addClass("alert danger error");
$
(
div
[
0
]).
next
(
div
[
1
]).
collapse
(
"show"
);
//$(div[0]).find(div[1]).collapse("show")
}
else
{
$
(
"<span class='glyphicon glyphicon-ok' aria-hidden='true'>"
).
appendTo
(
div
[
0
])
}
});
return
errors
};
function
checkInput
(
source
){
if
(
source
.
val
().
length
>
0
){
return
true
}
else
{
return
false
}
}
function
checkSourceFormat
(){
source
=
$
(
"select#source"
).
find
(
':selected'
)
if
(
source
.
val
()
!=
''
)
{
console
.
log
(
source
)
source_data
=
source
.
data
(
"format"
)
alert
(
source_data
)
formats
=
source_data
.
split
(
','
);
alert
(
formats
);
extension
=
$
(
"#file"
).
val
().
substr
(
(
filename
.
lastIndexOf
(
'.'
)
+
1
)
);
if
(
$
.
inArray
(
extension
,
formats
)
==
-
1
){
//$("span.format").collapse("show");
return
false
;
}
else
{
//$("span.format").collapse("hide");
return
true
;
}
}
return
true
}
function
checkFileSize
(
filesize
,
max_size
){
if
(
filesize
>
max_size
){
return
true
}
else
{
return
false
}
};
//ADD CORPUS FORM
// //source
// $('#source').change(function() {
// $("#source").next("span.required").collapse("hide");
// source_type = $('#source').find(":selected");
// var formats = source_type.data("format").split(',');
// if (formats.length == 0){
// $("#source").next("span.required").collapse("show");
//
// }
// else{
// $("#source").next("span.required").collapse("hide");
// }
// });
// //file
// var max_size = parseInt($('#file').data("max-size"));
// $('#file').change(function() {
// var filesize = parseInt(this.files[0].size);
// if( filesize > max_size){
// alert("Upload file can't exceed 1 Mo because Gargantext would have an indigestion. Consult the special diet of Gargantext in our FAQ")
// $("#file").empty();
// };
// });
//
//
// });
$
(
"#create"
).
bind
(
"click"
,
function
(){
var
method
=
$
(
'#radioBtn'
).
find
(
'a.active'
).
data
(
"title"
);
errors
=
checkForm
()
if
(
has_error
==
"true"
){
alert
(
"Invalid Form"
);
}
else
{
alert
(
"OK"
)
//if (checkFileExtension() == true){
//preparePost(method, form)
//}
}
});
templates/pages/projects/validators.js
0 → 100644
View file @
d4fe6e84
/////////////////FORM VALIDATION
function
checkFilename
(
filename
){
if
(
filename
==
""
){
$
(
"#filename"
).
next
(
"span.required"
).
collapse
(
"show"
);
return
false
;
}
else
{
$
(
"#file"
).
next
(
"span.required"
).
collapse
(
"hide"
);
return
true
;
}
};
function
checkFileSize
(
filesize
,
max_size
){
if
(
filesize
>
max_size
){
$
(
"span.size"
).
collapse
(
"show"
);
}
else
{
$
(
"span.size"
).
collapse
(
"hide"
);
}
};
function
checkFileExtension
(){
filename
=
$
(
'#file'
).
val
()
source_type
=
$
(
'#source'
).
find
(
":selected"
);
if
(
filename
!=
""
&&
source_type
.
val
()
!==
"0"
){
fextension
=
filename
.
substr
(
(
filename
.
lastIndexOf
(
'.'
)
+
1
)
);
var
formats
=
source_type
.
data
(
"format"
).
split
(
','
);
if
(
$
.
inArray
(
extension
,
formats
)
==
-
1
){
$
(
"span.format"
).
collapse
(
"show"
);
return
false
;
}
else
{
$
(
"span.format"
).
collapse
(
"hide"
);
return
true
;
}
}
};
//name
$
(
"span.error"
).
collapse
(
"hide"
);
$
(
'#name'
).
on
(
'input'
,
function
()
{
var
input
=
$
(
this
);
var
is_name
=
input
.
val
();
if
(
is_name
.
length
<
0
){
$
(
"#name"
).
next
(
"span.required"
).
collapse
(
"show"
);
$
(
"form-group#name"
).
addClass
(
"error"
);
}
else
{
$
(
"#name"
).
next
(
"span"
).
collapse
(
"hide"
);
}
});
//source
$
(
'#source'
).
change
(
function
()
{
$
(
"#source"
).
next
(
"span.required"
).
collapse
(
"hide"
);
source_type
=
$
(
'#source'
).
find
(
":selected"
);
var
formats
=
source_type
.
data
(
"format"
).
split
(
','
);
if
(
formats
.
length
==
0
){
$
(
"#source"
).
next
(
"span.required"
).
collapse
(
"show"
);
}
else
{
$
(
"#source"
).
next
(
"span.required"
).
collapse
(
"hide"
);
}
});
//file
var
max_size
=
parseInt
(
$
(
'#file'
).
data
(
"max-size"
));
$
(
'#file'
).
change
(
function
()
{
$
(
'#name span'
).
collapse
(
"hide"
);
var
input
=
$
(
this
);
var
filename
=
input
.
val
()
var
filesize
=
parseInt
(
this
.
files
[
0
].
size
);
checkFileSize
(
filesize
,
max_size
);
});
//console.log("ERRORS?,)
$
(
"#create"
).
bind
(
"click"
,
function
(){
var
method
=
$
(
'#radioBtn'
).
find
(
'a.active'
).
data
(
"title"
);
has_error
=
$
(
"span.error"
).
hasClass
(
"collapse in"
);
if
(
has_error
==
"true"
){
alert
(
"Invalid Form"
);
}
else
{
if
(
checkFileExtension
()
==
true
){
//preparePost(method, form)
}
}
});
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