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
09a6a976
Commit
09a6a976
authored
Sep 16, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M - KEYpress
parent
1ac999ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
12 deletions
+102
-12
garganrest_projects.js
static/lib/gargantext/garganrest_projects.js
+7
-6
add_corpus_form.html
templates/pages/projects/add_corpus_form.html
+90
-0
overview.html
templates/pages/projects/overview.html
+5
-6
No files found.
static/lib/gargantext/garganrest_projects.js
View file @
09a6a976
...
@@ -331,11 +331,11 @@ $(document).on("click",".edit", function(){
...
@@ -331,11 +331,11 @@ $(document).on("click",".edit", function(){
//newform.collapse("show");
//newform.collapse("show");
$
(
'#editForm-'
+
id
).
collapse
(
'toggle'
)
$
(
'#editForm-'
+
id
).
collapse
(
'toggle'
)
$
(
document
).
bind
(
'keypress'
,
function
(
e
)
{
//
$(document).bind('keypress', function(e) {
if
(
e
.
keyCode
==
13
){
//
if(e.keyCode==13){
$
(
'#edit-submit-'
+
id
).
trigger
(
'click'
);
//
$('#edit-submit-'+id).trigger('click');
}
//
}
});
//
});
$
(
"#edit-submit-"
+
id
).
on
(
'click'
,
function
(){
$
(
"#edit-submit-"
+
id
).
on
(
'click'
,
function
(){
//alert(url)
//alert(url)
...
@@ -376,7 +376,7 @@ function createProject() {
...
@@ -376,7 +376,7 @@ function createProject() {
//onclick inside element because probleme of scope with modal
//onclick inside element because probleme of scope with modal
//we recover the element by hand for the moment
//we recover the element by hand for the moment
var
project_name
=
$
(
".popover #inputName"
).
val
();
var
project_name
=
$
(
".popover #inputName"
).
val
();
//
alert(project_name);
alert
(
project_name
);
console
.
log
(
"Create project #"
+
project_name
);
console
.
log
(
"Create project #"
+
project_name
);
console
.
log
(
"POST /api/projects"
);
console
.
log
(
"POST /api/projects"
);
$
.
ajax
({
$
.
ajax
({
...
@@ -393,6 +393,7 @@ function createProject() {
...
@@ -393,6 +393,7 @@ function createProject() {
location
.
reload
();
location
.
reload
();
},
},
error
:
function
(
data
)
{
error
:
function
(
data
)
{
alert
(
data
)
console
.
log
(
data
)
console
.
log
(
data
)
status
=
data
.
status
;
status
=
data
.
status
;
info
=
data
.
responseJSON
[
"detail"
];
info
=
data
.
responseJSON
[
"detail"
];
...
...
templates/pages/projects/add_corpus_form.html
0 → 100644
View file @
09a6a976
<div
class =
"container"
>
<div
id=
"addform"
class=
"row collapse"
>
<div
class=
"col-md-3"
></div>
<div
class=
"col-md-6"
>
<center>
<div
class=
"panel panel-info"
>
<div
class=
"panel-heading"
>
Add a corpus
</div>
<div
class=
"panel-body"
>
<form
id=
"form"
class=
"add"
role=
"form"
action=
"/project/{{ project_id }}/"
method=
"post"
enctype=
"multipart/form-data"
>
{% csrf_token %}
<div
id=
"radioBtn"
class=
"btn-group"
>
<a
id=
"parse"
class=
"btn btn-info active"
data-toggle=
"method"
data-title=
"parse"
>
<span
class=
"glyphicon glyphicon-download-alt"
aria-hidden=
"true"
>
UPLOAD
</span>
</a>
<div
class=
"btn"
>
OR
</div>
<a
id=
"scan"
class=
"btn btn-info notActive"
data-toggle=
"method"
data-title=
"scan"
>
<span
class=
"glyphicon glyphicon-search"
aria-hidden=
"true"
>
SEARCH
</span>
</a>
</div>
<br
/>
<br
/>
<div
class=
"form-group"
for=
"corpus_name"
>
<label
for=
"name"
>
Name:
</label>
<input
type=
"text"
id=
"name"
/>
<span
class=
"help-block collapse"
for=
"name"
>
This field is required.
</span>
</div>
<div
id=
"source-group"
>
<label
for=
"source"
>
Select a database
</label>
<select
id=
"source"
name=
"source"
required
>
<option
value=
""
>
Select a database
⇓
</option>
{% for element in ressources %}
{% if element.parser != None and element.crawler != None %}
<option
value=
"{{element.type}}"
data-parser =
"true"
data-crawler=
"true"
data-format=
{{element.file_formats|join:","}}
>
{{element.name}}
</option>
{% elif element.parser != None and element.crawler == None %}
<option
value=
"{{element.type}}"
data-parser =
"true"
data-crawler=
"false"
data-format =
{{element.file_formats|
join:
","}}
>
{{element.name}}
</option>
{% elif element.parser == None and element.crawler != None %}
<option
value=
"{{element.type}}"
data-parser =
"false"
data-crawler=
"true"
data-format =
{{element.file_formats|join:","}}
>
{{element.name}}
</option>
{%else%}
<option
value=
"{{element.type}}"
data-parser =
"false"
data-crawler=
"false"
data-format =
{{element.file_formats|join:","}}
>
{{element.name}}
</option>
{% endif %}
{% endfor %}
</select>
<span
class=
"help-block collapse"
for=
"source"
>
This field is required
</span>
</div>
<br
/>
<div
id=
"parser"
class=
"form-group"
>
<input
type=
"file"
id=
"file"
data-validation=
"mime size"
data-validation-allowing=
"csv, txt, xml, zip"
data-validation-max-size=
"1M"
name=
"file"
class=
"form-control-file"
accept=
"text/*,application/xml, application/zip"
>
<span
class=
"help-block collapse"
for=
"file"
class=
"danger"
>
This field is required
</span>
</div>
<br
/>
<div
id=
"crawler"
class=
"form-group"
>
<label
for=
"query"
>
Query:
</label>
<textarea
id=
"query"
type=
"input"
name=
"query"
class=
"form-control col-xs-12"
></textarea>
<span
class=
"help-block collapse"
for=
"id_query"
class=
"danger"
>
This field is required
</span>
<br>
</div>
<br
/>
<div
class=
"form-group"
id=
"btnsubmit"
>
<button
type=
"button"
id=
"create"
class=
"btn btn-info"
>
Add corpus
</button>
</div>
</form>
<span
id=
"simpleloader"
></span>
</div>
</div>
</center>
</div>
<div
class=
"col-md-3"
></div>
</div>
</div>
templates/pages/projects/overview.html
View file @
09a6a976
...
@@ -169,12 +169,11 @@
...
@@ -169,12 +169,11 @@
<script
type=
"text/javascript"
src=
"{% static "
lib
/
gargantext
/
garganrest_projects
.
js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
lib
/
gargantext
/
garganrest_projects
.
js
"
%}"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
getProjects
();
getProjects
();
$
(
document
).
bind
(
'keypress'
,
function
(
e
)
{
// $(document).on("input#inoutName").bind('keypress', function(e) {
if
(
e
.
keyCode
==
13
){
// if(e.keyCode==13){
$
(
'#createProject'
).
trigger
(
'click'
);
// $('#createProject').trigger('click');
}
// }
});
// });
$
(
document
).
on
(
"click"
,
"#createProject"
,
function
(
e
){
$
(
document
).
on
(
"click"
,
"#createProject"
,
function
(
e
){
//alert("clicked");
//alert("clicked");
//
//
...
...
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