diff options
author | makfire <mukeshpandey15@hotmail.com> | 2015-07-08 17:33:53 +0530 |
---|---|---|
committer | makfire <mukeshpandey15@hotmail.com> | 2015-07-08 17:33:53 +0530 |
commit | 62b7b318060b0bc32aaab0221f55df9d93a94906 (patch) | |
tree | 181e176750444a6212927812bc231bebb2804b52 /gnowsys-ndf/gnowsys_ndf | |
parent | 10bd2dd3fcf8d350e3efc84a77fb68b32d4b14fb (diff) | |
download | gnowsys-62b7b318060b0bc32aaab0221f55df9d93a94906.tar.gz |
deletion flow setupped
Diffstat (limited to 'gnowsys-ndf/gnowsys_ndf')
5 files changed, 42 insertions, 4 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review.html index 9fd5dee..26e1d23 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review.html @@ -824,6 +824,26 @@ $drContainer.css("opacity", "1"); }) // ---END of search in the data-review + function deleteNode(node_id) + { + a = node_id + alert(a) + $.ajax({ + + url:"{% url 'delete_resource' groupid %}", + type:'Get', + data:{ + 'node_id':node_id + }, + + success:function(data){ + alert(data) + } + + + }); + + } // </script> {% endblock %} diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review_table.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review_table.html index 7313197..8b6c9e5 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review_table.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review_table.html @@ -14,6 +14,7 @@ <th class="text-center right-border" colspan="3">Alignment & Level</th> <th class="text-center right-border" colspan="7">Curate</th> <th class="text-center right-border" colspan="3">Advance</th> + <th class="text-center right-border" colspan="2">Admin</th> {% if title == "moderation" %} <th class="text-center right-border" colspan="3">Moderation</th> {% endif %} @@ -65,7 +66,10 @@ <th class="expand-width-3">Reading Level</th> <th>Time Required</th> <th class="expand-width-3 right-border">Text Complexity</th> - + <!-- Admin --> + + <th class="expand-width-3"> Purge </th> + <th class="expand-width-3"> Restore </th> <!-- moderation --> {% if title == "moderation" %} <th class="expand-width-2">Discuss</th> diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review_tbody.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review_tbody.html index 3c8d8a6..8057b22 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review_tbody.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review_tbody.html @@ -291,6 +291,12 @@ </option> --> </select> </td> + <td class="deletedata"> + + <div class="button tiny exapnd" id = "{{resource.pk}}" onclick = "deleteNode('{{resource.pk}}')"> Delete </div> + <div class="button tiny exapnd" id = "{{resource.pk}}" onclick = "restoreNode('{{resource.pk}}')"> restore </div> + </td> + {% if title == "moderation" %} diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/trash.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/trash.py index 9073651..e4007cb 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/trash.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/trash.py @@ -1,7 +1,9 @@ from django.conf.urls import patterns, url urlpatterns = patterns('gnowsys_ndf.ndf.views.trash', - url(r'^/delete/(?P<node_id>[\w-]+)$', 'trash_resource',name='trash_resource'), - ) + url(r'^/delete/(?P<node_id>[\w-]+)$', 'trash_resource',name='trash_resource'), + url(r'^/delete$', 'delete_resource',name='delete_resource'), + + ) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/trash.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/trash.py index 043b188..718dd90 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/trash.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/trash.py @@ -4,7 +4,7 @@ from django.shortcuts import render_to_response # , render from django.template import RequestContext from gnowsys_ndf.ndf.models import * from gnowsys_ndf.ndf.views.page import * - +from gnowsys_ndf.ndf.views.methods import * @@ -20,3 +20,9 @@ def trash_resource(request,group_id,node_id): print "node",node.group_set node.save() return (eval('page')(request, group_id)) + + +def delete_resource(request,group_id): + node_id = request.GET.getlist('node_id','')[0] + delete_node(ObjectId(node_id),deletion_type=1) + return HttpResponse("Deleted Successfully") |