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
cccf1a82
Commit
cccf1a82
authored
Sep 15, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M [TPL+JS] reload
parent
a7f6e667
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
16 deletions
+15
-16
projects.py
gargantext/views/api/projects.py
+10
-10
garganrest_projects.js
static/lib/gargantext/garganrest_projects.js
+2
-5
overview.html
templates/pages/projects/overview.html
+3
-1
No files found.
gargantext/views/api/projects.py
View file @
cccf1a82
...
@@ -54,8 +54,7 @@ class ProjectList(APIView):
...
@@ -54,8 +54,7 @@ class ProjectList(APIView):
# project = check_rights(request, project)
# project = check_rights(request, project)
uids
=
[]
uids
=
[]
for
node
in
projects
:
for
node
in
projects
:
node
.
delete
(
synchronize_session
=
False
)
session
.
delete
(
node
)
#session.delete(node)
session
.
commit
()
session
.
commit
()
uids
.
append
(
node
.
id
)
uids
.
append
(
node
.
id
)
return
Response
({
"detail"
:
"Deleted
%
i projects"
%
len
(
uids
)},
status
=
HTTP_204_NO_CONTENT
)
return
Response
({
"detail"
:
"Deleted
%
i projects"
%
len
(
uids
)},
status
=
HTTP_204_NO_CONTENT
)
...
@@ -106,19 +105,20 @@ class ProjectView(APIView):
...
@@ -106,19 +105,20 @@ class ProjectView(APIView):
def
delete
(
self
,
request
,
project_id
):
def
delete
(
self
,
request
,
project_id
):
'''DELETE project'''
'''DELETE project'''
node
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
project_id
)
.
first
()
node
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
project_id
)
.
first
()
print
(
"DELETE project"
)
if
node
is
None
:
if
node
is
None
:
print
(
"Not Found"
)
return
Response
({
'detail'
:
"PROJECT Node #
%
s not found"
%
(
project_id
)
},
return
Response
({
'detail'
:
"PROJECT Node #
%
s not found"
%
(
project_id
)
},
status
=
HTTP_404_NOT_FOUND
)
status
=
HTTP_404_NOT_FOUND
)
else
:
else
:
print
(
">"
,
node
)
try
:
check_rights
(
request
,
project_id
)
check_rights
(
request
,
project_id
)
except
Exception
as
e
:
return
Response
({
'detail'
:
"Unauthorized"
%
(
project_id
)
},
status
=
403
)
session
.
delete
(
node
)
session
.
delete
(
node
)
print
(
"delete"
)
session
.
commit
()
session
.
commit
()
print
(
"commit"
)
return
Response
({
"detail"
:
"Successfully deleted Node #
%
s"
%
project_id
},
status
=
204
)
return
Response
({
"detail"
:
"Successfully deleted Node #
%
s"
%
project_id
},
200
)
def
put
(
self
,
request
,
project_id
):
def
put
(
self
,
request
,
project_id
):
'''UPDATE project '''
'''UPDATE project '''
...
@@ -129,7 +129,7 @@ class ProjectView(APIView):
...
@@ -129,7 +129,7 @@ class ProjectView(APIView):
status
=
HTTP_404_NOT_FOUND
)
status
=
HTTP_404_NOT_FOUND
)
check_rights
(
request
,
project_id
)
check_rights
(
request
,
project_id
)
params
=
get_parameters
(
request
)
params
=
get_parameters
(
request
)
print
(
params
)
#
print(params)
#u_project = deepcopy(project)
#u_project = deepcopy(project)
for
key
,
val
in
params
.
items
():
for
key
,
val
in
params
.
items
():
if
len
(
val
)
==
0
:
if
len
(
val
)
==
0
:
...
...
static/lib/gargantext/garganrest_projects.js
View file @
cccf1a82
...
@@ -283,7 +283,6 @@ $(document).on("hover", "button", function(){
...
@@ -283,7 +283,6 @@ $(document).on("hover", "button", function(){
// checkbox with BUTTON #delete, #edit #refresh
// checkbox with BUTTON #delete, #edit #refresh
//DELETE MULTI
//DELETE MULTI
$
(
document
).
on
(
"click"
,
"#delete"
,
function
(){
$
(
document
).
on
(
"click"
,
"#delete"
,
function
(){
//alert("Delete");
var
selected
=
selectedUrls
();
var
selected
=
selectedUrls
();
selected
.
forEach
(
function
(
url
)
{
selected
.
forEach
(
function
(
url
)
{
deleteOne
(
url
);
deleteOne
(
url
);
...
@@ -298,12 +297,12 @@ $(document).on("click","#edit", function(){
...
@@ -298,12 +297,12 @@ $(document).on("click","#edit", function(){
// selected.forEach(function(url) {
// selected.forEach(function(url) {
// editOne(url, data);
// editOne(url, data);
// });
// });
alert
(
"Not Implemented Yet"
)
//
alert("Not Implemented Yet")
});
});
//RECALC MULTI
//RECALC MULTI
$
(
document
).
on
(
"click"
,
"#recalculate"
,
function
(){
$
(
document
).
on
(
"click"
,
"#recalculate"
,
function
(){
alert
(
"Recalculate"
);
//
alert("Recalculate");
var
selected
=
selectedIds
();
var
selected
=
selectedIds
();
selected
.
forEach
(
function
(
id
)
{
selected
.
forEach
(
function
(
id
)
{
recalculateOne
(
id
);
recalculateOne
(
id
);
...
@@ -316,9 +315,7 @@ $(document).on("click","#recalculate", function(){
...
@@ -316,9 +315,7 @@ $(document).on("click","#recalculate", function(){
// UNIQUE DELETION
// UNIQUE DELETION
$
(
document
).
on
(
"click"
,
".delete"
,
function
()
{
$
(
document
).
on
(
"click"
,
".delete"
,
function
()
{
var
url
=
$
(
this
).
data
(
"url"
);
var
url
=
$
(
this
).
data
(
"url"
);
alert
(
url
);
deleteOne
(
url
);
deleteOne
(
url
);
alert
(
"delete"
);
});
});
//UNIQUE EDITION
//UNIQUE EDITION
...
...
templates/pages/projects/overview.html
View file @
cccf1a82
...
@@ -130,9 +130,11 @@
...
@@ -130,9 +130,11 @@
<
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
-->
<!--
<
button
type
=
"button"
class
=
"btn btn-default refresh pull-right"
data
-
id
=
"{id}"
>
<
button
type
=
"button"
class
=
"btn btn-default refresh pull-right"
data
-
id
=
"{id}"
>
<
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
?
-->
...
...
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