diff options
author | Avadoot Nachankar <avadoot298@gmail.com> | 2014-07-02 17:07:20 +0530 |
---|---|---|
committer | Avadoot Nachankar <avadoot298@gmail.com> | 2014-07-02 17:07:20 +0530 |
commit | 2e4463d03c0403c741a5b73da3379ebcef0efc27 (patch) | |
tree | 546b0d568f907340b74b3b009837b4d0b9b2288d /gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_list.html | |
parent | 744e816185f1dfde92005b7d81d22c05491f26f0 (diff) | |
download | gnowsys-2e4463d03c0403c741a5b73da3379ebcef0efc27.tar.gz |
Common template created for MIS list-view, and Link button is also added to list-view
Diffstat (limited to 'gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_list.html')
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_list.html | 200 |
1 files changed, 1 insertions, 199 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_list.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_list.html index cc57b761..b1197017 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_list.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_list.html @@ -1,199 +1 @@ -{% extends "ndf/mis_base.html" %} -{% load pagination_tags %} - -{% block body_content %} - - {% if nodes %} - {% autopaginate nodes 25 %} - - <div id="myModal" class="reveal-modal" data-reveal style="height:500px;overflow:scroll;"> - - <h3>Are you sure you want to delete? All of the following related items also will be deleted:</h3> - - <input class="button confirmDeleteObjects" type="button" value="Confirm"> - <input class="button cancelDeleteObjects" type="button" value="Cancel"> - <div id="deletion_results"></div> - <a class="close-reveal-modal">×</a> - - </div> - - {% if user.is_authenticated %} - <input class="button deleteObjects" type="button" value="Delete"> - {% endif %} - - <form method="POST" style="float:right; margin-top:15px;padding-top:10px;"> - - {% csrf_token %} - <input name="search" type="textbox" value="" style="width:300px;"> - <input type="hidden" name="class" value="{{class_name}}"> - <input type="submit" value="search" style="width:100px;"> - - </form> - {% endif %} - - <table > - <thead> - <tr> - - {% if nodes %} - - <th width="20"> <input class="checkedAll" type="checkbox"></th> - <th width="150">Title</th> - <th width="150">Created by</th> - <th width="150">Creation date</th> - <th width="150">Edit</th> - - {% endif %} - - </tr> - </thead> - - <tbody> - {% for each in nodes %} - <tr> - - <td id="{{each.pk}}" class="objectsCheckbox"> <input type="checkbox"> </td> - {% if app_name == "MIS" %} - <td class="name" style="font-size:11px;"><a href="{% url 'mis:mis_app_instance_detail' groupid app_id app_set_id each.pk %}">{{each.name}}</a></td> - {% else %} - <td class="name" style="font-size:11px;"><a href="{% url 'mis-po:mis_app_instance_detail' groupid app_id app_set_id each.pk %}">{{each.name}}</a></td> - {% endif %} - <td class="created_by" style="font-size:11px;">{{each.user_details_dict.created_by}}</td> - <td class="created_at" style="font-size:11px;">{{each.created_at}}</td> - {% if app_name == "MIS" %} - <td class="name" style="font-size:11px;"><a href="{% url 'mis:mis_app_instance_edit' groupid app_id app_set_id each.pk %}" class="button medium">Edit</a></td> - {% else %} - <td class="name" style="font-size:11px;"><a href="{% url 'mis-po:mis_app_instance_edit' groupid app_id app_set_id each.pk %}" class="button medium">Edit</a></td> - {% endif %} - - </tr> - - {% empty %} - <h5>This group doesn't have any events. <b>Be the first to create an event!</b></h5> - - {% endfor %} - - </tbody> - </table> - - {% paginate %} - -{% endblock %} - -{% block script %} -// <script type="text/javascript"> - -$(document).on('click',".checkedAll",function(){ - if($(this).is(":checked")==true){ - $('.objectsCheckbox input').prop( "checked", true ); - } - else{ - $('.objectsCheckbox input').prop( "checked", false ); - } -}); - -$(document).on('click',".button.confirmDeleteObjects",function(){ - var selectedobject = $(".objectsCheckbox input:checked") - $('#myModal').foundation('reveal', 'open'); - // $('#myModal').foundation('reveal', 'close'); - if(selectedobject.length > 0){ - var i = 0; - var str = ""; - $.map(selectedobject,function(each){ - if(i == 0){str = str.concat(each.parentElement.id)} - else {str = str.concat(","+each.parentElement.id)} - i= i+1 - }) - - $.ajax({ - url: "{% url 'deletion_instances' groupid %}", - type: 'POST', - data: {deleteobjects:str,csrfmiddlewaretoken: '{{ csrf_token }}',confirm:"yes"}, - beforeSend: function() { }, - success: function(result){ - }, - complete: function(){ - $('#myModal').foundation('reveal', 'close'); - } - }); - - $.map(selectedobject,function(each){ - each.parentElement.parentElement.remove() - }) - $('#myModal').foundation('reveal', 'close'); - - - } - else{ - alert("select object to delete") - } - - }); - -$(document).on('click',".button.deleteObjects",function(){ - var selectedobject = $(".objectsCheckbox input:checked") - // $('#myModal').foundation('reveal', 'close'); - if(selectedobject.length > 0){ - $('#myModal').foundation('reveal', 'open'); - -// var confirmed = confirm("Deleting "+selectedobject.length+" objects"); -// if(confirmed == true){ - var i = 0; - var str = ""; - $.map(selectedobject,function(each){ - if(i == 0){str = str.concat(each.parentElement.id)} - else {str = str.concat(","+each.parentElement.id)} - i= i+1 - }) - - $.ajax({ - url: "{% url 'deletion_instances' groupid %}", - type: 'POST', - data: {deleteobjects:str,csrfmiddlewaretoken: '{{ csrf_token }}'}, - beforeSend: function() { }, - success: function(result){ - $("#deletion_results").html(""); - for(var obj in result){ - var ulist = $("<ul>"+"</ul>") - .attr("id","conceptlist") - .appendTo($("#deletion_results")); - var li = $("<li><b>"+result[obj].title+"</b></li>") - .appendTo(ulist); - var ulist1 = $("<ul>"+"</ul>") - .attr("id","conceptlist") - .appendTo(li); - for(var obj2 in result[obj].content){ - object = result[obj].content[obj2] - for(var obj3 in object){ - for(var each in object[obj3]){ - var li1 = $("<li>"+object[obj3][each]+"</li>") - .appendTo(ulist1); - }} - } - } - - }, - complete: function(){ } - }); - // } -} -else{ - alert("select object to delete") -} - -}); - -$(document).on('click',".button.cancelDeleteObjects",function(){ - $('#myModal').foundation('reveal', 'close'); -}); - -$(document).foundation({ - tab: { - callback : function (tab) { - console.log(tab); - } - } -}); - -// </script> -{% endblock %} +{% extends "ndf/mis_base_list.html" %}
\ No newline at end of file |