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
ddc7b5fa
Commit
ddc7b5fa
authored
Sep 16, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M [TPL] edit-form
parent
ea978833
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
21 deletions
+20
-21
garganrest_projects.js
static/lib/gargantext/garganrest_projects.js
+16
-17
overview.html
templates/pages/projects/overview.html
+4
-4
No files found.
static/lib/gargantext/garganrest_projects.js
View file @
ddc7b5fa
...
@@ -226,7 +226,7 @@ function deleteOne(url){
...
@@ -226,7 +226,7 @@ function deleteOne(url){
};
};
function
editOne
(
url
,
data
){
function
editOne
(
url
,
id
,
data
){
$
.
ajax
({
$
.
ajax
({
url
:
'/api'
+
url
+
"?"
+
jQuery
.
param
(
data
),
url
:
'/api'
+
url
+
"?"
+
jQuery
.
param
(
data
),
type
:
'PUT'
,
type
:
'PUT'
,
...
@@ -236,7 +236,7 @@ function editOne(url, data){
...
@@ -236,7 +236,7 @@ function editOne(url, data){
success
:
function
(
response
)
{
success
:
function
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
console
.
log
(
"EDIT SUCCESS!"
);
console
.
log
(
"EDIT SUCCESS!"
);
addFormStatus
(
"success"
,
"div#editForm
"
,
response
[
"detail"
]);
addFormStatus
(
"success"
,
"div#editForm
-"
+
id
,
response
[
"detail"
]);
window
.
location
.
reload
()
window
.
location
.
reload
()
},
},
error
:
function
(
xhr
)
{
error
:
function
(
xhr
)
{
...
@@ -244,7 +244,7 @@ function editOne(url, data){
...
@@ -244,7 +244,7 @@ function editOne(url, data){
var
status
=
xhr
.
status
;
var
status
=
xhr
.
status
;
var
info
=
xhr
.
responseJSON
[
"detail"
];
var
info
=
xhr
.
responseJSON
[
"detail"
];
var
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
var
msg
=
"<strong>ERROR ["
+
status
+
"]:</strong>"
+
"<p>"
+
info
+
"</p>"
addFormStatus
(
"error"
,
"div#editForm
"
,
msg
);
addFormStatus
(
"error"
,
"div#editForm
-"
+
id
,
msg
);
},
},
});
});
};
};
...
@@ -328,28 +328,27 @@ $(document).on("click",".edit", function(){
...
@@ -328,28 +328,27 @@ $(document).on("click",".edit", function(){
console
.
log
(
id
)
console
.
log
(
id
)
//newform.collapse("show");
//newform.collapse("show");
$
(
'#editForm-'
+
id
).
collapse
(
'toggle'
)
$
(
'#editForm-'
+
id
).
collapse
(
'toggle'
)
$
(
"#edit-submit
"
).
on
(
'click'
,
function
(){
$
(
"#edit-submit
-"
+
id
).
on
(
'click'
,
function
(){
//alert(url)
//alert(url)
name
=
$
(
"input#name
_p"
).
val
()
name
=
$
(
"input#name
-"
+
id
).
val
()
data
=
{
"name"
:
name
}
data
=
{
"name"
:
name
}
editOne
(
url
,
data
);
editOne
(
url
,
id
,
data
);
})
//window.location.reload();
$
(
"#edit-cancel"
).
on
(
'click'
,
function
(){
});
$
(
"#edit-cancel-"
+
id
).
on
(
'click'
,
function
(){
//alert("cancel")
//alert("cancel")
$
(
'input#name_p'
).
val
(
""
);
$
(
'input#name_p'
).
val
(
""
);
resetStatusForm
(
"#editForm
"
);
resetStatusForm
(
"#editForm
-"
+
id
);
});
})
$
(
"button"
).
on
(
"click"
,
".edit"
,
function
(){
if
(
$
(
"#editForm"
).
hasClass
(
"collapse in"
)){
$
(
"button"
).
on
(
"click"
,
".edit"
,
function
(){
$
(
'input#name_p'
).
val
(
""
);
$
(
'input#name_p'
).
val
(
""
);
resetStatusForm
(
"#editForm"
);
resetStatusForm
(
"#editForm-"
+
id
);
})
})
}
})
})
//UNIQUE RECALC
//UNIQUE RECALC
$
(
document
).
on
(
"click"
,
".refresh"
,
function
(){
$
(
document
).
on
(
"click"
,
".refresh"
,
function
(){
alert
(
refresh
)
alert
(
refresh
)
...
...
templates/pages/projects/overview.html
View file @
ddc7b5fa
...
@@ -145,12 +145,12 @@
...
@@ -145,12 +145,12 @@
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
id
=
"editForm-{id}"
class
=
"collapse "
>
<
div
id
=
"editForm-{id}"
class
=
"collapse "
>
<!--
status
of
the
form
-->
<!--
status
of
the
form
-->
<
div
id
=
"status-form"
class
=
"collapse"
><
/div
>
<
div
id
=
"status-form"
class
=
"collapse"
><
/div
>
<
b
>
Name
:
<
/b><input type="text" id="name
_p
" /
>
<
b
>
Name
:
<
/b><input type="text" id="name
-{id}
" /
>
<
button
id
=
"edit-submit"
class
=
"btn btn-success btn-sm"
><
span
class
=
"glyphicon glyphicon-ok"
aria
-
hidden
=
"true"
><
/span></
button
>
<
button
id
=
"edit-submit
-{id}
"
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
-{id}
"
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