diff options
Diffstat (limited to 'gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py')
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py index 2344f1f..77a0737 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py @@ -91,6 +91,7 @@ def themes(request, group_id, app_id=None, app_set_id=None): nodes = "" unfold_tree = request.GET.get('unfold','') selected = request.GET.get('selected','') + tree = request.GET.get('tree','collapsible') unfold = "false" # topics_GST = node_collection.find_one({'_type': 'GSystemType', 'name': 'Topics'}) @@ -129,8 +130,8 @@ def themes(request, group_id, app_id=None, app_set_id=None): # nodes_dict = node_collection.find({'member_of': {'$all': [theme_GST._id]},'group_set':{'$all': [ObjectId(group_id)]}}) return render_to_response("ndf/theme.html", - {'theme_GST_id':theme_GST._id, 'themes_cards': themes_cards, - 'group_id': group_id,'groupid': group_id,'node': node,'shelf_list': shelf_list,'shelves': shelves, + {'theme_GST_id':theme_GST._id, 'theme_GST':theme_GST, 'themes_cards': themes_cards, 'theme_GST':theme_GST, + 'group_id': group_id,'groupid': group_id,'node': node,'shelf_list': shelf_list,'shelves': shelves, 'tree': tree, 'nodes':nodes_dict,'app_id': app_id,'app_name': appName,"selected": selected, 'title': title,'themes_list_items': themes_list_items, 'themes_hierarchy': themes_hierarchy, 'unfold': unfold, @@ -667,7 +668,7 @@ def theme_topic_create_edit(request, group_id, app_set_id=None): ) return render_to_response("ndf/theme.html", - {'group_id': group_id,'groupid': group_id, 'drawer': drawer, 'themes_cards': themes_cards, + {'group_id': group_id,'groupid': group_id, 'drawer': drawer, 'themes_cards': themes_cards, 'theme_GST':theme_GST, 'theme_GST':theme_GST, 'shelf_list': shelf_list,'shelves': shelves, 'create_edit': create_edit, 'themes_hierarchy': themes_hierarchy,'app_id': app_id,'appId':app._id, 'nodes_list': nodes_list,'title': title,'node': node, 'parent_nodes_collection': parent_nodes_collection, @@ -724,7 +725,8 @@ def topic_detail_view(request, group_id, app_Id=None): nav_l=request.GET.get('nav_li','') breadcrumbs_list = [] nav_li = "" - + #a temp. variable which stores the lookup for append method + breadcrumbs_list_append_temp=breadcrumbs_list.append if nav_l: nav_li = nav_l nav_l = str(nav_l).split(",") @@ -739,9 +741,9 @@ def topic_detail_view(request, group_id, app_Id=None): if each_obj.prior_node: theme_obj = node_collection.one({'_id': ObjectId(each_obj.prior_node[0] ) }) theme_id = theme_obj._id - breadcrumbs_list.append( (str(theme_obj._id), theme_obj.name) ) + breadcrumbs_list_append_temp( (str(theme_obj._id), theme_obj.name) ) - breadcrumbs_list.append( (str(each_obj._id), each_obj.name) ) + breadcrumbs_list_append_temp( (str(each_obj._id), each_obj.name) ) @@ -752,6 +754,8 @@ def topic_detail_view(request, group_id, app_Id=None): ###shelf### shelves = [] + #a temp. variable which stores the lookup for append method + shelves_append_temp=shelves.append shelf_list = {} auth = node_collection.one({'_type': 'Author', 'name': unicode(request.user.username) }) @@ -763,12 +767,14 @@ def topic_detail_view(request, group_id, app_Id=None): if shelf: for each in shelf: shelf_name = node_collection.one({'_id': ObjectId(each.right_subject)}) - shelves.append(shelf_name) + shelves_append_temp(shelf_name) shelf_list[shelf_name.name] = [] + #a temp. variable which stores the lookup for append method + shelf_list_shlefname_append_temp=shelf_list[shelf_name.name].append for ID in shelf_name.collection_set: shelf_item = node_collection.one({'_id': ObjectId(ID) }) - shelf_list[shelf_name.name].append(shelf_item.name) + shelf_list_shlefname_append_temp(shelf_item.name) else: shelves = [] |