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
e920cbb4
Commit
e920cbb4
authored
Jan 08, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPDATE] trying to use ajax form|post : put a loader
parent
ad2a480e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
109 deletions
+37
-109
add_corpus.html
templates/add_corpus.html
+0
-7
add_corpus_as_p.html
templates/add_corpus_as_p.html
+0
-1
project.html
templates/project.html
+37
-101
No files found.
templates/add_corpus.html
View file @
e920cbb4
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
{% block content %}
{% block content %}
<div
id=
"loading"
style=
"position:absolute; top:50%; left:40%; width:80px; display: none;"
>
<div
id=
"loading"
style=
"position:absolute; top:50%; left:40%; width:80px; display: none;"
>
<img
src=
"{% static "
img
/
ajax-loader
.
gif
"
%}"
alt=
""
/>
<img
src=
"{% static "
img
/
ajax-loader
.
gif
"
%}"
alt=
""
/>
</div>
</div>
...
@@ -29,11 +28,5 @@
...
@@ -29,11 +28,5 @@
</div>
</div>
</div>
</div>
<script>
function
showLoader
(){
$
(
'#loading'
).
setStyle
(
'display'
,
'block'
);
$
(
'submit_btn'
).
disabled
=
true
;
};
</script>
{% endblock %}
{% endblock %}
templates/add_corpus_as_p.html
View file @
e920cbb4
...
@@ -24,5 +24,4 @@
...
@@ -24,5 +24,4 @@
</form>
</form>
</div>
</div>
</div>
</div>
{% endblock %}
{% endblock %}
templates/project.html
View file @
e920cbb4
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
{% endblock %}
{% endblock %}
<div
id=
"loading"
style=
"position:absolute; top:50%; left:40%; width:80px; display: none;"
>
<img
src=
"{% static "
img
/
ajax-loader
.
gif
"
%}"
alt=
""
/>
</div>
{% block content %}
{% block content %}
...
@@ -44,15 +47,15 @@
...
@@ -44,15 +47,15 @@
>
Add a corpus
</button>
>
Add a corpus
</button>
<div
id=
"popover-content"
class=
"hide"
>
<div
id=
"popover-content"
class=
"hide"
>
<form
enctype=
"multipart/form-data"
action=
"/project/{{project.id}}/"
method=
"post"
>
<form
id=
"uploadcorpusform"
enctype=
"multipart/form-data"
action=
"/project/{{project.id}}/"
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
{{ form.non_field_errors }}
{{ form.non_field_errors }}
{{ form.as_p}}
{{ form.as_p}}
{{ formResource.non_field_errors }}
{{ formResource.non_field_errors }}
{{ formResource.as_p}}
{{ formResource.as_p}}
<input
type=
"submit"
class=
"btn"
value=
"Add this corpus"
/>
<input
type=
"submit"
class=
"btn"
value=
"Add this corpus"
/>
</form>
</form>
</center>
</center>
</p>
</p>
...
@@ -65,102 +68,35 @@
...
@@ -65,102 +68,35 @@
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Add jumbotron container for each type of corpus (presse, science etc.) --!>
<div class="container">
{% if list_corpora %}
<h1>Resources</h1>
<h2>Corpora</h2>
<ul>
{% for key, corpora in list_corpora.items %}
<li>{{ key }}</li>
<ul>
{% for corpus in corpora %}
<li> {% ifnotequal corpus.count 0 %}
<a href="/project/{{project.id}}/corpus/{{corpus.id}}">{{corpus.name}}</a>
, {{ corpus.count }} Documents
{% else %}
{{corpus.name}} : Processing, drink a cup of tea, and refresh the page :)
{% endifnotequal %}
<button type="button" class="btn btn-xs btn-default" data-container="body" data-toggle="popover" data-placement="bottom"
data-content='
<ul>
<li> Add documents </li>
<li> Rename </li>
<li><a href="/project/{{ project.id }}/corpus/{{ corpus.id}}/delete">Delete</a></li>
</ul>
'>Manage</button>
</li>
{% endfor %}
</ul>
{% endfor %}
</ul>
{% endif %}
{% if list_corporax %}
<div class="col-md-4">
<h3><a href="/project/{{project.id}}/corpus/{{corpus.id}}">{{corpus.name}}</a>
</h3>
<h4>{{ corpus.count }} Documents </h4>
<h5>Activity:</h5>
<div class="chart" data-percent="73">73%</div>
</div>
{% endif %}
{% if whitelists %}
<h2>Lists of Ngrams</h2>
<h3>White Lists</h2>
{% for list in whitelists %}
<ul>
<li> {{list.name }}
</ul>
{% endfor %}
{% endif %}
{% if whitelists %}
<h3>Black Lists</h2>
{% for list in blacklists %}
<ul>
<li> {{list.name }}
</ul>
{% endfor %}
{% endif %}
{% if cooclists %}
<h2>Results (graphs)</h2>
<h3>Cooccurrences Lists</h2>
{% for list in cooclists %}
<ul>
<li> {{list.name }}
</ul>
{% endfor %}
{% endif %}
</div>
<script>
<script>
// Morris Donut Chart
function
showLoader
(
flag
){
Morris.Donut({
flag
=
!
flag
;
element: 'hero-donut',
$
(
'#loading'
).
setStyle
(
'display'
,
'block'
);
data: [
$
(
'submit_btn'
).
disabled
=
flag
;
{% if donut %}
};
{% for part in donut %}
{label: '{{ part.source }}', value: {{ part.part }} },
console
.
log
(
"i am hereasdasd"
)
{% endfor %}
{% endif %}
// $('#uploadcorpusform').on("submit", function (event) {
// event.preventDefault();
],
// console.log("i am submitting the mofo")
colors: ["@white", "@white"],
// showLoader(true);
//colors: ["#30a1ec", "#76bdee"],
// $.ajax({
formatter: function (y) { return y + "%" }
// type: frm.attr('method'),
});
// url: frm.attr('action'),
// data: frm.serialize(),
// success: function (data) {
// showLoader(false);
// },
// error: function(data) {
// $("#MESSAGE-DIV").html("Something went wrong!");
// }
// });
// return false;
// });
</script>
</script>
{% endblock %}
{% 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