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
c34cf61d
Commit
c34cf61d
authored
Sep 15, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M [TPL] overview reload
parent
31de1848
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
garganrest_projects.js
static/lib/gargantext/garganrest_projects.js
+15
-14
No files found.
static/lib/gargantext/garganrest_projects.js
View file @
c34cf61d
...
@@ -66,10 +66,11 @@ function addFormStatus(status, form, msg){
...
@@ -66,10 +66,11 @@ function addFormStatus(status, form, msg){
}
}
}
}
function
resetStatusForm
(
form
){
function
resetStatusForm
(
form
){
$
(
form
).
removeClass
(
"alert-danger alert-info alert-success"
)
$
(
form
).
removeClass
(
"alert-danger alert-info alert-success"
);
$
(
"div#status-form"
).
val
(
""
)
$
(
"div#status-form"
).
val
(
""
);
$
(
"div#status-form"
).
collapse
(
"hide"
)
$
(
"div#status-form"
).
collapse
(
"hide"
);
alert
(
"reset"
)
//$(form).collapse("hide");
//window.location.reload()
}
}
//PAGES STATUSES
//PAGES STATUSES
function
addPageStatus
(
status
,
msg
){
function
addPageStatus
(
status
,
msg
){
...
@@ -203,7 +204,6 @@ function deleteOne(url){
...
@@ -203,7 +204,6 @@ function deleteOne(url){
$
.
ajax
({
$
.
ajax
({
url
:
'/api'
+
url
,
url
:
'/api'
+
url
,
type
:
'delete'
,
type
:
'delete'
,
beforeSend
:
function
(
xhr
)
{
beforeSend
:
function
(
xhr
)
{
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
},
},
...
@@ -214,9 +214,9 @@ function deleteOne(url){
...
@@ -214,9 +214,9 @@ function deleteOne(url){
},
},
error
:
function
(
xhr
)
{
error
:
function
(
xhr
)
{
console
.
log
(
"FAIL!"
);
console
.
log
(
"FAIL!"
);
console
.
log
(
xhr
);
console
.
log
(
xhr
.
status
);
var
status
=
xhr
.
status
;
var
status
=
xhr
.
status
;
var
info
=
xhr
.
responseJSON
[
"detail"
];
var
info
=
xhr
[
"detail"
];
var
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
var
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
addPageStatus
(
"error"
,
msg
);
addPageStatus
(
"error"
,
msg
);
},
},
...
@@ -350,9 +350,9 @@ $(document).on("click",".edit", function(){
...
@@ -350,9 +350,9 @@ $(document).on("click",".edit", function(){
})
})
//UNIQUE RECALC
//UNIQUE RECALC
$
(
document
).
on
(
"click"
,
".refresh"
,
function
(){
$
(
document
).
on
(
"click"
,
".refresh"
,
function
(){
//alert("refresh"
)
alert
(
refresh
)
//console.log( $(this))
//console.log( $(this))
var
id
=
$
(
this
).
data
(
"id"
)
var
id
=
$
(
this
).
data
(
"id"
)
//var url = $( this ).data("url")
//var url = $( this ).data("url")
recalculateOne
(
id
)
recalculateOne
(
id
)
...
@@ -376,15 +376,15 @@ function createProject() {
...
@@ -376,15 +376,15 @@ function createProject() {
beforeSend
:
function
(
xhr
)
{
beforeSend
:
function
(
xhr
)
{
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
},
},
success
:
function
(
response
)
{
success
:
function
(
xhr
,
response
)
{
console
.
log
(
response
.
status
);
console
.
log
(
xhr
.
status
);
console
.
log
(
response
[
"detail"
]);
console
.
log
(
response
[
"detail"
]);
location
.
reload
();
location
.
reload
();
},
},
error
:
function
(
data
)
{
error
:
function
(
data
)
{
console
.
log
(
data
)
console
.
log
(
data
)
status
=
data
.
status
;
status
=
data
.
status
;
info
=
data
[
"detail"
];
info
=
data
.
responseJSON
[
"detail"
];
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
addFormStatus
(
"error"
,
"div#createForm"
,
msg
)
addFormStatus
(
"error"
,
"div#createForm"
,
msg
)
},
},
...
@@ -392,7 +392,8 @@ function createProject() {
...
@@ -392,7 +392,8 @@ function createProject() {
};
};
function
createCorpus
(
url
,
method
,
form
){
function
createCorpus
(
url
,
method
,
form
){
alert
(
method
)
alert
(
url
)
console
.
log
(
form
)
console
.
log
(
form
)
console
.
log
(
"POST corpus"
)
console
.
log
(
"POST corpus"
)
$
.
ajax
({
$
.
ajax
({
...
@@ -425,7 +426,7 @@ function createCorpus(url, method, form){
...
@@ -425,7 +426,7 @@ function createCorpus(url, method, form){
status
=
data
.
status
;
status
=
data
.
status
;
info
=
data
.
responseJSON
[
"detail"
];
info
=
data
.
responseJSON
[
"detail"
];
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
alert
(
msg
)
addFormStatus
(
"error"
,
"form#formCorpus"
,
msg
);
addFormStatus
(
"error"
,
"form#formCorpus"
,
msg
);
//$(".collapse").collapse("hide");
//$(".collapse").collapse("hide");
//_content = '<h2><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span>Error while creating the corpus.</h2>'
//_content = '<h2><span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span>Error while creating the corpus.</h2>'
...
...
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