diff options
Diffstat (limited to 'gnowsys-ndf/gnowsys_ndf')
9 files changed, 170 insertions, 416 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/hierarchy_tree.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/hierarchy_tree.html index 2864bba..bc9ff32 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/hierarchy_tree.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/hierarchy_tree.html @@ -5,25 +5,23 @@ <style> - /*#app-set-item li { padding:0.5em }*/ - .jqtree-closed > .jqtree-element i.icon-folder-open:before { content: "\f07b"; } .jqtree-tree i { - margin-right: 4px; + margin-right: 4px; } ul.jqtree-tree ul.jqtree_common { margin-left: 36px; } + </style> <script type="text/javascript"> - // $(document).ready(function() { function plotHierarchyTree() { // Funtion for loading tree for showing collection list left side panel doc(); @@ -31,7 +29,6 @@ // Function for manipulating tree when user visits to page directly via browser url {% if selected %} TreeTillNode(); {% endif %} } - // }); function TreeTillNode () { @@ -132,9 +129,7 @@ if (node.node_type == "Topic"){ location.href = "/{{group_name_tag}}/topic_details/"+node.id+"?nav_li="+nav_list+""; } - } - } ); @@ -159,16 +154,11 @@ alert("Topic "+node.name+" deleted successfully"); location.reload(true); }, - }); - } {% endif %} - } ); - - }; @@ -552,72 +542,4 @@ }); - - </script> - - - {% if themes_hierarchy %} <!-- bool --> - - <h2> {{node.name}}</h2> - <div class="row"> - <div class="large-4 columns"> - - {% if user_access == "allow" %} - - <a class="button tiny" data-reveal-id="view_add_page" title="Add Theme Item"> - + Add Theme Item - </a> - - <div id="view_add_page" class="reveal-modal" data-reveal style="height:300px;"> - - <h3>Add New Theme Item:</h3> - <!-- To enter name of theme item --> - <div> - <input class="name_id" name="name" type="text" placeholder="Enter name..."> - </div> <br/> - - <input type="submit" id="add_theme_item" value="Save Theme Item" class="medium round button"/> - - <a class="close-reveal-modal">×</a> - - </div> - {% endif %} - </div> - - <div class="large-4 columns"> - - <a data-dropdown="hover1" data-options="is_hover:true; hover_timeout:5000" class="tree_browser" style="border: 2px solid #0eacb5; padding: 5px;"><b> {% trans "Tree Browser" %} </b></a> - <ul id="hover1" class="f-dropdown" data-dropdown-content> - <li><a class="fold"><i class="fi-plus"></i> {% trans "Fold" %} </a></li> - <li><a class="unfold"><i class="fi-minus"></i> {% trans "Unfold" %} </a></li> - </ul> - - <a class="collapsible_tree" style="border: 2px solid #0eacb5; padding: 5px;"><b> {% trans "Collapsible Tree" %} </b></a> - - </div> - - <div class="large-4 columns"> - {% if user.is_authenticated %} - {% if user_access == "allow" %} - - <input class="button tiny deleteObjects right" type="button" value="Delete"> - <span class="right"><input class="checkedAll" type="checkbox"> Select All </span> - - <div id="myModal" class="reveal-modal" data-reveal style="height:500px;overflow:scroll;"> - - <h3>{% trans "Are you sure you want to delete? All of the related items for the following themes 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> - - {% endif %} - {% endif %} - </div> - </div> - <hr/> - - {% endif %} +</script> diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/moderation_data_review.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/moderation_data_review.html index 06505c0..7676a47 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/moderation_data_review.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/moderation_data_review.html @@ -42,7 +42,7 @@ function approveResource (oid) { alert("Resource is successfully approved from this group."); // fetching resource blank seperator row - var $resBlankRow = $("tr#blank-row-" + "5577ed2b90b5502857a8e67d"); + var $resBlankRow = $("tr#blank-row-" + oid); // fetching resource object VIEW row var $resViewRow = $("tr#view-row-" + oid); // fetching resource object EDIT row diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_details.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_details.html index b1dbabe..159a259 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_details.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/person_details.html @@ -23,17 +23,22 @@ <header class="row event"> <section class="medium-12 columns" > <h2> - <span class='node'>{{node.name}}</span> - <small class="label-list"> + <span class='node'>{{node.name}} + {% if "Student" in node.member_of_names_list %} + - {{node.enrollment_code}} + {% endif %} + </span> +<!-- <small class="label-list"> {% for tag in node.tags %} <a href="{% url 'tag_info' groupid tag %}"><span class="label">{{tag}}</span></a> {% endfor %} </small> + --> </h2> <dl class="row tabs" data-tab data-options="deep_linking:true"> {% for tab_details in property_order_list %} - <dd {% if forloop.counter == 1 %}class="active"{% endif %} title="Click here to add {{tab_details.0}} details..."> + <dd {% if forloop.counter == 1 %}class="active"{% endif %} title="Click here to see {{tab_details.0}} details."> <a href="#panel_{{tab_details.0}}">{{tab_details.0}}</a> </dd> {% endfor %} @@ -73,9 +78,33 @@ <label>{{field.altnames}}</label> </div> <div class="small-7 end columns"> - {% if field.type == "RelationType" %} - {% for details in field.value %} - <label>{{details.name}}</label> + {% if field.altnames == "Caste" or field.altnames == "District" or field.altnames == "State" or field.altnames == "College ( Graduation )" %} + <label>{{field.value.0.name|title}}</label> + {% elif field.altnames == "Languages Known" %} + {% for each_lang in field.value %} + <label>{{each_lang|title}}</label> + {% endfor %} + + {% elif field.altnames == "College(s)" %} + {% for each_colg in field.value %} + <label>{{each_colg.name}} </label> + {% endfor %} + + {% elif field.altnames == "Volunteer to teach Course in College" %} + {% for course_colg in field.value %} + <label>{{course_colg.0.name|title}} - {{course_colg.1.name|title}}</label> + {% endfor %} + + {% elif field.altnames == "Voluntary Teacher: Minimum qualifications requirement" %} + {% for min_qual in field.value %} + {% for key,val in min_qual.items %} + <label>{{key|title}} + {% for reqd_qual in val %} + - {{reqd_qual}}</label> + {% empty %} + - Not specified</label> + {% endfor %} + {% endfor %} {% endfor %} {% else %} <label>{{field.value|title}}</label> @@ -126,7 +155,8 @@ {{ node.member_of_names_list.0 }} Edited {{ node.last_update|timesince }} ago by <a class="user" href="{% url 'dashboard' node.modified_by %}">{{node.user_details_dict.modified_by}}</a> <br> - <small> + +<!-- <small> <a href="#view-changes"><i class="fi-clock"></i> Versions </a> {% for seq_no, version_no in node.version_dict.items|slice:"-6:" reversed %} <abbr title="Version #{{version_no}}"> @@ -140,6 +170,7 @@ </abbr> {% endfor %} </small> + --> </p> </div> diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/student_create_edit.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/student_create_edit.html index d67c66d..216f045 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/student_create_edit.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/student_create_edit.html @@ -210,6 +210,23 @@ </div> </div> + + <!-- For Aadhar id --> + <div class="row"> + <div class="small-6 columns"> + <div class="row"> + <div class="small-3 columns"> + <label for="{{property_order_list.0.1.13.name}}" class="right inline"> {{property_order_list.0.1.13.altnames}} </label> + </div> + <div class="small-9 columns"> + {% html_widget groupid node.pk property_order_list.0.1.13 %} + </div> + </div> + </div> + </div> + + + <br> <!-- Navigation buttons for tab --> <div class="row tab-nav"> diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/student_list.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/student_list.html index 68a516b..2c7accb 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/student_list.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/student_list.html @@ -586,7 +586,7 @@ s_id = data["stud_id"]; $(row).attr("id", s_id); - edit_url = "{% url 'mis:mis_app_instance_edit' 'groupid' 'app_id' 'app_set_id' 'stud_id' %}".replace("groupid", groupid_val).replace("app_id", app_id_val).replace("app_set_id", app_set_id_val).replace("stud_id", s_id); + edit_url = "{% url 'mis:mis_app_instance_detail' 'groupid' 'app_id' 'app_set_id' 'stud_id' %}".replace("groupid", groupid_val).replace("app_id", app_id_val).replace("app_set_id", app_set_id_val).replace("stud_id", s_id); name = data['Name'] $(row).find("td:nth-child(3)").html("<a href='" + edit_url + "'>"+name+"</a>"); diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme.html index 7fa7240..33ac64b 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme.html @@ -21,325 +21,17 @@ <link href="/static/ndf/bower_components/jqtree/jqtree.css" rel="stylesheet"> <script src="/static/ndf/bower_components/jqtree/tree.jquery.js"></script> -<!-- <script type="text/javascript"> - - $(document).ready(function() { - - // Funtion for loading tree for showing collection list left side panel - doc(); - - // Function for manipulating tree when user visits to page directly via browser url - {% if selected %} TreeTillNode(); {% endif %} - }); - - - function TreeTillNode () { - - // This gives the last hierarchy node id from browser url. - var url = "{{selected}}"; - - var tree_build = $(".themes").not(".jqtree-loading"); - var node = tree_build.tree('getNodeById', url); - tree_build.tree('openNode', node); - - // Javascript function to be used for checking objects in specific time of interval - setTimeout(function(){ - - // console.log($(".themes")) - if( ($(".themes").length > 0) ) { TreeTillNode() } - }, 100 ); - } - - - function doc() { - - var $tree = $('.themes'); - var user = "{{user.is_authenticated}}"; - var unfold = "{{unfold}}"; - - if(unfold == "true"){ - unfold = true - } - else{ - unfold = false - } - - $tree.tree({ - autoOpen: unfold, - - onCreateLi: function(node, $li) { - - if (node.node_type == "Topic"){ - $li.find('.jqtree-title').before('  <span class="fi-page"></span> '); - } - else{ - $li.find('.jqtree-title').before('  <span class="fi-folder" style="color:orange"></span> '); - } - - if (node.node_type == "Topic"){ - $li.find('.jqtree-element').append( - - ' <a id='+node.id+' name='+node.name+' class="topic" href="/{{groupid}}/topics/'+node.id+'/"> </a>' - ); - } - else{ - if (user == "True"){ - - $li.find('.jqtree-element').append( - {% user_access_policy groupid request.user as user_access %} - {% if user_access == "allow" %} - - ' <a href="/{{groupid}}/topics/'+node.id+'/"> <i class="fi-pencil edit"></i></a> <a id='+node.id+' class="objectsCheckbox"> <input type="checkbox"> </a>' - - {% endif %} - ); - } - } - } - }); - - // bind 'tree.click' event - $tree.bind( - 'tree.click', - function(event) { - // The clicked node is 'event.node' - var node = event.node; - - var parent_arr = []; - var parent_node = node; - parent_arr.push(node.id); - - // Bellow code manipulates the parent hierarchy of clicked node in a tree - while (parent_node) { - if (parent_node.name !== undefined){ - $tree.tree('openNode', parent_node); - parent_node = parent_node.parent; - if (parent_node.name !== undefined){ - parent_arr.push(parent_node.id); - } - } - else{ - break; - } - } - var nav_list = parent_arr.reverse(); - // alert(nav_list); - - // If its topic node i.e no children of this node then show the detail view for topic - if( node.children[0] == null ){ - - if (node.node_type == "Topic"){ - location.href = "/{{group_name_tag}}/topic_details/"+node.id+"?nav_li="+nav_list+""; - } - - } - - } - ); - - $tree.bind( - 'tree.contextmenu', - function(event) { - // The clicked node is 'event.node' - var node = event.node; - {% user_access_policy groupid request.user as user_access %} - {% if user_access == "allow" %} - var msg = confirm("Do you want to delete this topic ?"); - if (msg == true) { - - $.ajax({ - url: "{% url 'delete_themes' groupid %}", - type: 'POST', - data:{ - deleteobj: node.id, - csrfmiddlewaretoken: '{{ csrf_token }}' - }, - success: function(result){ - alert("Topic "+node.name+" deleted successfully"); - location.reload(true); - }, - - }); - - } - {% endif %} - - } - ); - - - }; - - - // method to handle hover on topics - function showTopicStats(){ - // Javascript function to be used for checking objects in specific time of interval - setTimeout(function(){ - // On hover of topic node manipulate resources only once - - $(".jqtree-title.jqtree_common").hover( function(){ - - topic_id = $(this).siblings("a").attr("id"); - // var topic_name = $(this).siblings("a").attr("name"); - var data_info = $(this).attr("data-info"); - var hover_context = this; - if ( ! data_info && topic_id ){ - $(".topic_stats").css("display", "none"); - - $.ajax({ - url: "{% url 'get_topic_contents' groupid %}", - type: 'POST', - data:{ - node_id: topic_id, - csrfmiddlewaretoken: '{{ csrf_token }}' - }, - success: function(data){ - - count = display_top_res(data) - - if (data != "{}"){ - - $(".topic_stats").html(count); - $(hover_context).attr("data-info", data) - - $(".topic_stats").css("display", "block"); - - } - else{ - $(hover_context).attr("data-info", data); - } - - }, - - }); - - - } - else{ - - if (topic_id){ - var data = $(this).attr("data-info"); - count = display_top_res(data) - $(".topic_stats").html(count); - $(".topic_stats").css("display", "block"); - } - - } - }); - - // console.log($(".jqtree-element.jqtree_common")) - if( ($(".jqtree-title.jqtree_common").length <= 0) ) { - showTopicStats() - } - - }, 1000 ); - } - - - function display_top_res(data){ - data_obj = JSON.parse(data); - count = "" - - if (data != "{}"){ - var k = Object.keys(data_obj); // To get the keys from incomming data - - for (var m = 0; m < k.length; m++) { - var key = k[m]; - var len = data_obj[key].length; // length of list as a value of key - // alert(key+": "+len); - count += key+": "+len+"<br/>"; - } - - } - else{ - count += "No Resources !<br/>"; - } - - return count - - } - - showTopicStats(); - - </script> - --> <style> -/* - #app-set-item li { padding:0.5em } - - .jqtree-closed > .jqtree-element i.icon-folder-open:before { - content: "\f07b"; - } - .jqtree-tree i { - margin-right: 4px; - } -*/ /* for reingold tilford tree */ -/* - .node { - cursor: pointer; - } - - .node circle { - fill: #fff; - stroke: green; - stroke-width: 1.5px; - } - - .node text { - font: 12px sans-serif; - } - - .link { - fill: none; - stroke: #ccc; - stroke-width: 1.5px; - } - */ - /* for reingold tilford tree -- end */ - - /*.node { - cursor: pointer; - }*/ -/* - .node circle { - fill: #fff; - stroke: steelblue; - stroke-width: 1.5px; - } -*/ - /*.node text { - font-size:10px; - font-family:sans-serif; - }*/ -/* - .link { - fill: none; - stroke: #ccc; - stroke-width: 1.5px; - } -*/ + #theme-drag-zoom-tree-container{ border: medium dashed #D8BFD8; border-radius: 5px; } -/* .templink { - fill: none; - stroke: red; - stroke-width: 3px; - } -*/ - /*.ghostCircle.show{ - display:block; - }*/ -/* - .ghostCircle, .activeDrag .ghostCircle{ - display: none; - }*/ - .download-graph{ color: gray } + .download-graph:hover { color: black; background-color: #e5e5e5; @@ -349,10 +41,24 @@ transition: all 1s; } + .themes { + margin: 2rem 5rem; + } + + .highlight { + background-color: #efefef; + padding: 0 1em; + border: solid #e5e5e5; + } + + #hover1.f-dropdown { + width: 10em; + } + </style> {% endblock%} - +<!-- {% comment %} {% block shelf_content %} {% if user.is_authenticated %} @@ -362,6 +68,7 @@ {% endif %} {% endblock %} {% endcomment %} + --> {% block meta_content %} <a class="Tp" href="{% url 'topics' group_name_tag %}" title="Click to go to themes card view"> @@ -400,12 +107,61 @@ </div> </li> - </ul> + </ul> </div> {% endif %} + <br/> + <div> + {% if user_access == "allow" %} + + <a class="button tiny expand" data-reveal-id="view_add_page" title="Add Theme Item"> + + Add Theme Item + </a> + + <div id="view_add_page" class="reveal-modal" data-reveal style="height:300px;"> + + <h3>Add New Theme Item:</h3> + <!-- To enter name of theme item --> + <div> + <input class="name_id" name="name" type="text" placeholder="Enter name..."> + </div> + <br/> + + <input type="submit" id="add_theme_item" value="Save Theme Item" class="medium round button"/> + + <a class="close-reveal-modal">×</a> + + </div> + + {% endif %} + + </div> + <!-- <br/> --> + <div> + {% if user.is_authenticated %} + {% if user_access == "allow" %} + + <span><input class="checkedAll" type="checkbox"> Select All</span> + <input class="button tiny deleteObjects right" type="button" value="Delete"> + + <div id="myModal" class="reveal-modal" data-reveal style="height:500px;overflow:scroll;"> + + <h3>{% trans "Are you sure you want to delete? All of the related items for the following themes 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> + + {% endif %} + {% endif %} + </div> <div class="topic_stats panel" style="display:none; position:fixed; background-color:#ddd;border: 1px solid #1a1a1a;"> </div> + {% endblock %} @@ -413,9 +169,29 @@ {% user_access_policy groupid request.user as user_access %} - {% if themes_hierarchy and node %} + <div style="float:left; font-size: 2em; line-height: 0.8;"> {{node.name}}</div> + + <div style="float:right; margin:0 2em;"> + + <a class="collapsible_tree {% if tree == 'collapsible' or not tree %} highlight {% endif %}" style=""> + {% trans "Collapsible Tree" %} + </a> + + <a data-dropdown="hover1" data-options="is_hover:true; hover_timeout:5000" class="tree_browser {% if tree == 'hierarchical' %} highlight {% endif %}" style="margin-left:2em;"> + {% trans "Tree Browser" %} + </a> + + <ul id="hover1" class="f-dropdown" data-dropdown-content style="width: 7em;"> + <li><a class="fold"><i class="fi-plus"></i> {% trans "Fold" %} </a></li> + <li><a class="unfold"><i class="fi-minus"></i> {% trans "Unfold" %} </a></li> + </ul> + + </div> + + <br/> + <br/> {% cache 300 theme_tree node.pk request.LANGUAGE_CODE tree unfold %} diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme_drag_zoom_d3tree.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme_drag_zoom_d3tree.html index 3710cda..a7fdb0c 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme_drag_zoom_d3tree.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme_drag_zoom_d3tree.html @@ -579,7 +579,6 @@ // Define the root root = treeData; - aaa = root; root.x0 = viewerHeight / 2; root.y0 = 0; @@ -589,6 +588,11 @@ update(root); centerNode(root); + setTimeout(function () { + firstChild = root.children[0]; + click(firstChild); + }, 1500); + // recursive function needed to get data for {{selected}} node // result = "" // function getData (d) { diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/person.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/person.py index f3e0e3d..a2adc0e 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/person.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/person.py @@ -638,7 +638,7 @@ def person_create_edit(request, group_id, app_id, app_set_id=None, app_set_insta if old_college_group_id_list: # If college-group list exists - # Then update their group_admin field (append PO's created_by) + # Then update their group_admin field (remove PO's created_by) res = node_collection.collection.update( {'_id': {'$in': old_college_group_id_list}, '$or': [{'group_admin': auth_node.created_by}, {'author_set': auth_node.created_by}]}, @@ -657,8 +657,12 @@ def person_create_edit(request, group_id, app_id, app_set_id=None, app_set_insta # Its purpose is to change the agency type back to Other auth_node.reload() + # if person_gst.name != "Student": + # return HttpResponseRedirect(reverse(app_name.lower()+":"+template_prefix+'_app_detail', kwargs={'group_id': group_id, "app_id":app_id, "app_set_id":app_set_id})) + # else: + return HttpResponseRedirect(reverse('mis:mis_app_instance_detail',kwargs={'group_id': group_id, "app_id":app_id, "app_set_id":app_set_id, "app_set_instance_id":unicode(person_gs._id)})) - return HttpResponseRedirect(reverse(app_name.lower()+":"+template_prefix+'_app_detail', kwargs={'group_id': group_id, "app_id":app_id, "app_set_id":app_set_id})) + # return HttpResponseRedirect(reverse(app_name.lower()+":"+template_prefix+'_app_detail', kwargs={'group_id': group_id, "app_id":app_id, "app_set_id":app_set_id})) default_template = "ndf/person_create_edit.html" diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/userDashboard.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/userDashboard.py index c64cac9..bdd8735 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/userDashboard.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/userDashboard.py @@ -150,37 +150,37 @@ def uDashboard(request, group_id): user_activity = [] page_gst = node_collection.one({'_type': "GSystemType", 'name': 'Page'}) - page_cur = node_collection.find ({'member_of': {'$all': [page_gst._id]}, + page_cur = node_collection.find({'member_of': {'$all': [page_gst._id]}, 'created_by': int(usrid), "status": {"$nin": ["HIDDEN"]}}) - file_cur = node_collection.find ({'_type': u"File", 'created_by': int(usrid), + file_cur = node_collection.find({'_type': u"File", 'created_by': int(usrid), "status": {"$nin": ["HIDDEN"]}}) forum_gst = node_collection.one({"_type": "GSystemType", "name": "Forum"}) - forum_count = node_collection.find ({"_type": "GSystem", + forum_count = node_collection.find({"_type": "GSystem", "member_of": forum_gst._id, 'created_by': int(usrid), "status": {"$nin": ["HIDDEN"]}}) quiz_gst = node_collection.one({"_type": "GSystemType", "name": "Quiz"}) - quiz_count = node_collection.find ({"_type": "GSystem", + quiz_count = node_collection.find({"_type": "GSystem", "member_of": quiz_gst._id, 'created_by': int(usrid), "status": {"$nin": ["HIDDEN"]}}) thread_gst = node_collection.one({"_type": "GSystemType", "name": "Twist"}) - thread_count =node_collection.find ({"_type": "GSystem", + thread_count =node_collection.find({"_type": "GSystem", "member_of": thread_gst._id, 'created_by': int(usrid), "status": {"$nin": ["HIDDEN"]}}) reply_gst = node_collection.one({"_type": "GSystemType", "name": "Reply"}) - reply_count = node_collection.find ({"_type": "GSystem", + reply_count = node_collection.find({"_type": "GSystem", "member_of": reply_gst._id, 'created_by': int(usrid), "status": {"$nin": ["HIDDEN"]}}) task_cur = "" if current_user: if int(current_user) == int(usrid): - task_cur = node_collection.find ( + task_cur = node_collection.find( {'member_of': task_gst._id, 'attribute_set.Status': {'$in': ["New", "In Progress"]}, 'attribute_set.Assignee':usrid} ).sort('last_update', -1).limit(10) dashboard_count.update({'Task': task_cur.count()}) - group_cur = node_collection.find ( + group_cur = node_collection.find( {'_type': "Group", 'name': {'$nin': ["home", auth.name]},"access_policy":{"$in":Access_policy}, '$or': [{'group_admin': int(usrid)}, {'author_set': int(usrid)}]}).sort('last_update', -1).limit(10) @@ -189,7 +189,7 @@ def uDashboard(request, group_id): # user activity gives all the activities of the users activity = "" - activity_user = node_collection.find ( + activity_user = node_collection.find( {'$and': [{'$or': [{'_type': 'GSystem'}, {'_type': 'group'}, {'_type': 'File'}]}, {"access_policy": {"$in": Access_policy}},{'status':{'$in':[u"DRAFT",u"PUBLISHED"]}}, {'member_of': {'$nin': [exclued_from_public]}}, @@ -243,7 +243,7 @@ def uDashboard(request, group_id): task_cur gives the task asigned to users ''' - obj = node_collection.find ( + obj = node_collection.find( {'_type': {'$in': [u"GSystem", u"File"]}, 'contributors': int(usrid), 'group_set': {'$all': [ObjectId(group_id)]}} ) |