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
f060d6ca
Commit
f060d6ca
authored
Sep 15, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M EditForm TPL
parent
96f89b36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
22 deletions
+28
-22
garganrest_projects.js
static/lib/gargantext/garganrest_projects.js
+15
-10
overview.html
templates/pages/projects/overview.html
+13
-12
No files found.
static/lib/gargantext/garganrest_projects.js
View file @
f060d6ca
...
@@ -217,8 +217,10 @@ function deleteOne(url){
...
@@ -217,8 +217,10 @@ function deleteOne(url){
console
.
log
(
xhr
.
status
);
console
.
log
(
xhr
.
status
);
var
status
=
xhr
.
status
;
var
status
=
xhr
.
status
;
var
info
=
xhr
[
"detail"
];
var
info
=
xhr
[
"detail"
];
var
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
var
msg
=
"ERROR deleting project"
+
url
addPageStatus
(
"error"
,
msg
);
console
.
log
(
msg
)
//addPageStatus("info", msg);
//window.location.reload();
},
},
});
});
...
@@ -255,17 +257,17 @@ function recalculateOne(id){
...
@@ -255,17 +257,17 @@ function recalculateOne(id){
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
},
},
success
:
function
(
response
)
{
success
:
function
(
response
)
{
console
.
log
(
"SUCCESS!"
);
console
.
log
(
"
RECALC
SUCCESS!"
);
window
.
location
.
reload
();
window
.
location
.
reload
();
},
},
error
:
function
(
xhr
)
{
error
:
function
(
xhr
)
{
console
.
log
(
"FAIL!"
)
console
.
log
(
"
RECALC
FAIL!"
)
console
.
log
(
result
)
console
.
log
(
result
)
var
status
=
xhr
.
status
;
var
status
=
xhr
.
status
;
var
info
=
xhr
[
"detail"
];
var
info
=
xhr
[
"detail"
];
var
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
var
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
//no form error is sent to page status alert
//no form error is sent to page status alert
addPageStatus
(
"error"
,
msg
);
addPageStatus
(
"error"
,
msg
);
},
},
});
});
};
};
...
@@ -316,19 +318,22 @@ $(document).on("click","#recalculate", function(){
...
@@ -316,19 +318,22 @@ $(document).on("click","#recalculate", function(){
$
(
document
).
on
(
"click"
,
".delete"
,
function
()
{
$
(
document
).
on
(
"click"
,
".delete"
,
function
()
{
var
url
=
$
(
this
).
data
(
"url"
);
var
url
=
$
(
this
).
data
(
"url"
);
deleteOne
(
url
);
deleteOne
(
url
);
window
.
location
.
reload
();
});
});
//UNIQUE EDITION
//UNIQUE EDITION
$
(
document
).
on
(
"click"
,
".edit"
,
function
(){
$
(
document
).
on
(
"click"
,
".edit"
,
function
(){
$
(
'#editForm'
).
collapse
(
'show'
);
var
id
=
$
(
this
).
data
(
"id"
)
var
url
=
$
(
this
).
data
(
"url"
);
var
url
=
$
(
this
).
data
(
"url"
)
console
.
log
(
id
)
//newform.collapse("show");
$
(
'#editForm-'
+
id
).
collapse
(
'toggle'
)
$
(
"#edit-submit"
).
on
(
'click'
,
function
(){
$
(
"#edit-submit"
).
on
(
'click'
,
function
(){
//alert(url)
//alert(url)
name
=
$
(
"input#name_p"
).
val
()
name
=
$
(
"input#name_p"
).
val
()
data
=
{
"name"
:
name
}
data
=
{
"name"
:
name
}
editOne
(
url
,
data
);
editOne
(
url
,
data
);
})
})
$
(
"#edit-cancel"
).
on
(
'click'
,
function
(){
$
(
"#edit-cancel"
).
on
(
'click'
,
function
(){
//alert("cancel")
//alert("cancel")
...
...
templates/pages/projects/overview.html
View file @
f060d6ca
...
@@ -112,7 +112,7 @@
...
@@ -112,7 +112,7 @@
<
/div
>
<
/div
>
<
/h3
>
<
/h3
>
<
div
id
=
"project_detail"
class
=
"col-md-4 content"
>
<
div
id
=
"project_detail"
class
=
"col-md-4 content"
>
<
div
id
=
"item-editor"
>
<
div
id
=
"item-editor"
>
<!--
GET
Project
-->
<!--
GET
Project
-->
<
a
href
=
"{url}"
>
<
a
href
=
"{url}"
>
<
button
type
=
"button"
title
=
"see project"
class
=
"btn btn-default show pull-right"
aria
-
label
=
"Left Align"
>
<
button
type
=
"button"
title
=
"see project"
class
=
"btn btn-default show pull-right"
aria
-
label
=
"Left Align"
>
...
@@ -121,13 +121,13 @@
...
@@ -121,13 +121,13 @@
<
/a
>
<
/a
>
<!--
EDIT
PROJECT
-->
<!--
EDIT
PROJECT
-->
<
button
class
=
"btn btn-default edit pull-right"
data
-
url
=
"{url}"
data
-
toggle
=
"collapse"
data
-
target
=
"#editForm"
aria
-
expanded
=
"false"
aria
-
controls
=
"editForm
"
>
<
button
class
=
"btn btn-default edit pull-right"
data
-
id
=
"{id}"
data
-
url
=
"{url}"
data
-
toggle
=
"collapse
"
>
<
span
class
=
"glyphicon glyphicon-pencil"
aria
-
hidden
=
"true"
><
/span
>
<
span
class
=
"glyphicon glyphicon-pencil"
aria
-
hidden
=
"true"
><
/span
>
<
/button
>
<
/button
>
<!--
DELETE
PROJECT
-->
<!--
DELETE
PROJECT
-->
<
button
type
=
"button"
class
=
"btn btn-default delete pull-right"
data
-
url
=
"{url}"
>
<
button
type
=
"button"
class
=
"btn btn-default delete pull-right"
data
-
url
=
"{url}"
>
<
span
class
=
"glyphicon glyphicon-trash pull-right"
aria
-
hidden
=
"true"
><
/span
>
<
span
class
=
"glyphicon glyphicon-trash pull-right"
aria
-
hidden
=
"true"
><
/span
>
<
/button
>
<
/button
>
<!--
REFRESH
PROJECT
-->
<!--
REFRESH
PROJECT
-->
<!--
<!--
...
@@ -135,21 +135,22 @@
...
@@ -135,21 +135,22 @@
<
span
class
=
"glyphicon glyphicon-refresh pull-right"
aria
-
hidden
=
"true"
><
/span
>
<
span
class
=
"glyphicon glyphicon-refresh pull-right"
aria
-
hidden
=
"true"
><
/span
>
<
/button
>
<
/button
>
-->
-->
<
/div
>
<
/div
>
<
div
id
=
"project_status"
>
<
div
id
=
"project_status"
>
<!--
Here
add
nb
of
the
corpus
?
-->
<!--
Here
add
nb
of
the
corpus
?
-->
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
id
=
"editForm"
class
=
"collapse col-lg-10 alert"
>
<
div
id
=
"editForm-{id}"
class
=
"collapse "
>
<!--
status
of
the
form
-->
<!--
status
of
the
form
-->
<
div
id
=
"status-form"
class
=
"collapse"
>
<
div
id
=
"status-form"
class
=
"collapse"
><
/div
>
<
/div
>
<
b
>
Name
:
<
/b><input type="text" id="name_p" /
>
<
b
>
Name
:
<
/b><input type="text" id="name_p" /
>
<
button
id
=
"edit-submit"
class
=
"btn btn-success btn-sm"
><
span
class
=
"glyphicon glyphicon-ok"
aria
-
hidden
=
"true"
><
/span></
button
>
<
button
id
=
"edit-submit"
class
=
"btn btn-success btn-sm"
><
span
class
=
"glyphicon glyphicon-ok"
aria
-
hidden
=
"true"
><
/span></
button
>
<
button
id
=
"edit-cancel"
class
=
"btn btn-danger btn-sm"
><
span
class
=
"glyphicon glyphicon-remove"
aria
-
hidden
=
"true"
><
/span></
button
>
<
button
id
=
"edit-cancel"
class
=
"btn btn-danger btn-sm"
><
span
class
=
"glyphicon glyphicon-remove"
aria
-
hidden
=
"true"
><
/span></
button
>
<
/div
>
<
/div
>
</script>
</script>
...
...
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