diff options
author | katkamrachana <katkam.rachana@gmail.com> | 2015-04-01 13:16:07 +0530 |
---|---|---|
committer | katkamrachana <katkam.rachana@gmail.com> | 2015-04-01 13:16:07 +0530 |
commit | 2b2dcbbe0d0b01b30da2606d0bb9d4b7d9d333b8 (patch) | |
tree | 8ca381adc7bb8c8990b8cf72fa4b497fde8e26d7 /gnowsys-ndf/gnowsys_ndf/ndf | |
parent | 63e103dcadc2c8df41ee95c62510aa989b788a59 (diff) | |
parent | 020a1122c65195e7b800c543e36275a2590fa659 (diff) | |
download | gnowsys-2b2dcbbe0d0b01b30da2606d0bb9d4b7d9d333b8.tar.gz |
Merge branch 'mongokit' of https://github.com/gnowledge/gstudio into mongokit
Diffstat (limited to 'gnowsys-ndf/gnowsys_ndf/ndf')
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/base.html | 2 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/node_ajax_view.html | 33 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/repository.html | 52 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme.html | 8 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py | 32 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py | 2 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/views/file.py | 10 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py | 17 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py | 4 |
9 files changed, 124 insertions, 36 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/base.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/base.html index 4753baf..7025ff7 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/base.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/base.html @@ -92,7 +92,7 @@ <li> <!-- <a href="{#% url 'GAPPS' 'home' 'topics' %#}" {#% if nroer_menu.top_menu_selected == "Repository" %#}class="active"{#% endif %#}> --> - <a href="{% url 'topics' 'home' %}" {% if nroer_menu.top_menu_selected == "Repository" %}class="active"{% endif %}> + <a href="{% url 'repository' 'home' %}" {% if nroer_menu.top_menu_selected == "Repository" %}class="active"{% endif %}> Repository </a> </li> diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/node_ajax_view.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/node_ajax_view.html index a30b0d8..576d3b0 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/node_ajax_view.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/node_ajax_view.html @@ -338,15 +338,26 @@ ul#navigation li a.last { {% endfor %} </ul> </li> - {% elif k == "textcomplexity" %} + {% elif k == "educationaluse" %} <li> - <a> {% trans "Text Complexity" %} »</a> + <a> {% trans "Educational Use" %} »</a> <ul> {% for opts in v %} <li class="view_list edu-sub-li view-filters" id="{{k}}" title="{{opts}}"><a>{% trans opts %}</a></li> {% endfor %} </ul> </li> + <!-- Commented bellow filters for time being will be using this filter at different place "So dont remove this code" --> + {% comment %} + <!-- {% elif k == "textcomplexity" %} + <li> + <a> {% trans "Text Complexity" %} »</a> + <ul> + {% for opts in v %} + <li class="view_list edu-sub-li view-filters" id="{{k}}" title="{{opts}}"><a>{% trans opts %}</a></li> + {% endfor %} + </ul> + </li> {% elif k == "educationalalignment" %} <li> <a> {% trans "Educational Alignment" %} »</a> @@ -355,7 +366,8 @@ ul#navigation li a.last { <li class="view_list edu-sub-li view-filters" id="{{k}}" title="{{opts}}"><a>{% trans opts %}</a></li> {% endfor %} </ul> - </li> + </li> --> + {% endcomment %} {% elif k == "language" %} <li> <a> {% trans "Language" %} »</a> @@ -383,15 +395,6 @@ ul#navigation li a.last { {% endfor %} </ul> </li> - {% elif k == "curricular" %} - <li> - <a> {% trans "Curricular" %} »</a> - <ul> - {% for opts in v %} - <li class="view_list edu-sub-li view-filters" id="{{k}}" title="{{opts}}"><a>{% trans opts %}</a></li> - {% endfor %} - </ul> - </li> {% endif %} {% endfor %} @@ -518,7 +521,7 @@ ul#navigation li a.last { {% if each_node.mime_type %} <a href="{% url 'read_file' group_name_tag each_node.pk grid_fs_obj.filename %}">{{ each_node.name }}</a>, {% else %} - <a href="{% url 'topic_details' group_name_tag each_node.pk %}">{{ each_node.name }}</a> + <a href="{% url 'topic_details' group_name_tag each_node.pk %}{% if nav_list %}?nav_li={{nav_list}}{% endif %}">{{ each_node.name }}</a> {% if not forloop.last %}, {% endif %} {% endif %} {% endfor %} @@ -822,14 +825,14 @@ ul#navigation li a.last { {% for k,v in val.items %} {% if k == "fallback_lang" %} {% for each in v %} - <a href ="{% url 'file_detail' group_name_tag each.pk %}"> {{each.name}} </a> + <a href ="{% url 'file_detail' group_name_tag each.pk %}?nav_li={{nav_list}}"> {{each.name}} </a> {% endfor %} {% elif k == "other_languages" %} {% if v %} <fieldset id="{{k}}"> <legend>{% trans "In other languages" %}</legend> {% for each in v %} - <a href ="{% url 'file_detail' group_name_tag each.pk %}"> {{each.name}} </a> + <a href ="{% url 'file_detail' group_name_tag each.pk %}?nav_li={{nav_list}}"> {{each.name}} </a> {% endfor %} {% endif %} {% endif %} diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/repository.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/repository.html new file mode 100644 index 0000000..84d07ec --- /dev/null +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/repository.html @@ -0,0 +1,52 @@ +{% extends "ndf/base.html" %} + +{% load ndf_tags %} + +{% block title %} Repository {% endblock %} + +{% block style %} + + .app-card{ + min-width: 10rem; + min-height: 20rem; + margin-left: 5vh; + background-color: #efefef; + border: thin solid lightgray; + float: left; + padding: 1em; + } + + .app-card:hover{ + box-shadow: 0px 0px 20px gray; + border: thin solid lightgray; + transition: ease 0.5s; + } + + .icons{ + position: absolute; + font-size: 7em; + z-index: 0; + opacity: 0.2; + top: 30%; + } +<!-- + .elibrary{ + background: url("watermark.png") no-repeat 0 70%; + } + --> +{% endblock %} + +{% block body_content %} + <ul class="inline-list"> + {% for each_gapp in gapps_dict %} + <li> + <a class="app-card text-center" + {% if each_gapp.values.0 %} href="{% url each_gapp.values.0 group_id %}" {% endif %} > + <i class="icons fi-asterisk"></i> + <h4><small>{{ each_gapp.keys.0 }}</small></h4> + <hr/> + </a> + </li> + {% endfor %} + </ul> +{% endblock %}
\ No newline at end of file diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme.html index 11fab39..6ebf9f2 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme.html @@ -43,7 +43,7 @@ var tree_build = $(".themes").not(".jqtree-loading"); var node = tree_build.tree('getNodeById', url); - tree_build.tree('selectNode', node); + tree_build.tree('openNode', node); // Javascript function to be used for checking objects in specific time of interval setTimeout(function(){ @@ -272,10 +272,10 @@ {% endblock %} {% block related_content %} -<div class="panel" style="background-color:#ddd;"> {% if user.is_authenticated %} {% user_access_policy groupid request.user as user_access %} + <div class="panel" style="background-color:#ddd;"> <ul class="no-bullet" id="app-set-item"> {% get_memberof_objects_count theme_GST_id groupid as count %} @@ -296,9 +296,9 @@ </li> </ul> - + </div> + {% endif %} -</div> {% endblock %} diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py b/gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py index d701f1a..d0dc9d1 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py @@ -521,6 +521,7 @@ def get_gapps_iconbar(request, group_id): """Get GApps menu-bar """ try: + group_name, group_id = get_group_name_id(group_id) selected_gapp = request.META["PATH_INFO"] if len(selected_gapp.split("/")) > 2: selected_gapp = selected_gapp.split("/")[2] @@ -595,6 +596,7 @@ def get_nroer_menu(request, group_name): nroer_menu_dict = {} top_menu_selected = "" + selected_gapp = "" if (len(url_split) > 1) and (url_split[1] != "dashboard"): selected_gapp = url_split[1] # expecting e-library etc. type of extract @@ -614,8 +616,9 @@ def get_nroer_menu(request, group_name): mapping = GSTUDIO_NROER_MENU_MAPPINGS # deciding "top level menu selection" - if (group_name == "home") and nroer_menu_dict.has_key("selected_gapp"): + if ((group_name == "home") and nroer_menu_dict.has_key("selected_gapp")) or (selected_gapp == "repository"): top_menu_selected = "Repository" + # print top_menu_selected elif group_name in mapping.values(): sub_menu_selected = mapping.keys()[mapping.values().index(group_name)] # get key of/from mapping @@ -2106,19 +2109,22 @@ def get_version_of_module(module_id): @get_execution_time @register.assignment_tag def get_group_name(groupid): - group_name = "" - ins_objectid = ObjectId() - if ins_objectid.is_valid(groupid) is True : - group_ins = node_collection.find_one({'_type': "Group","_id": ObjectId(groupid)}) - if group_ins: - group_name = group_ins.name - else : - auth = node_collection.one({'_type': 'Author', "_id": ObjectId(groupid) }) - if auth : - group_name = auth.name + # group_name = "" + # ins_objectid = ObjectId() + # if ins_objectid.is_valid(groupid) is True : + # group_ins = node_collection.find_one({'_type': "Group","_id": ObjectId(groupid)}) + # if group_ins: + # group_name = group_ins.name + # else : + # auth = node_collection.one({'_type': 'Author', "_id": ObjectId(groupid) }) + # if auth : + # group_name = auth.name + + # else : + # pass + + group_name, group_id = get_group_name_id(groupid) - else : - pass return group_name @get_execution_time diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py index 47eee38..7d2726d 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py @@ -125,6 +125,8 @@ urlpatterns = patterns('', (r'^benchmarker/', include('gnowsys_ndf.benchmarker.urls')), + url(r'^(?P<group_id>[^/]+)/repository/?$', 'gnowsys_ndf.ndf.views.methods.repository', name='repository'), + # django-registration url(r'^accounts/password/change/done/', auth_views.password_change_done, name='password_change_done'), url(r'^accounts/password/change/', auth_views.password_change, {'password_change_form': UserChangeform}), diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/file.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/file.py index cfa4ef8..7a499ed 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/file.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/file.py @@ -1167,6 +1167,14 @@ def file_detail(request, group_id, _id): shelves = [] shelf_list = {} + # First get the navigation list till topic from theme map + nav_l=request.GET.get('nav_li','') + breadcrumbs_list = [] + nav_li = "" + + if nav_l: + nav_li = nav_l + if auth: has_shelf_RT = node_collection.one({'_type': 'RelationType', 'name': u'has_shelf' }) shelf = triple_collection.find({'_type': 'GRelation', 'subject': ObjectId(auth._id), 'relation_type.$id': has_shelf_RT._id }) @@ -1192,7 +1200,7 @@ def file_detail(request, group_id, _id): 'groupid':group_id, 'annotations' : annotations, 'shelf_list': shelf_list, - 'shelves': shelves, + 'shelves': shelves, 'nav_list':nav_li, 'imageCollection':imageCollection }, context_instance = RequestContext(request) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py index 7daad8c..422e0c1 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py @@ -12,7 +12,7 @@ from mongokit import paginator import mongokit ''' -- imports from application folders/files -- ''' -from gnowsys_ndf.settings import META_TYPE +from gnowsys_ndf.settings import META_TYPE, GSTUDIO_NROER_GAPPS from gnowsys_ndf.settings import DEFAULT_GAPPS_LIST, WORKING_GAPPS, BENCHMARK from gnowsys_ndf.ndf.models import db, node_collection, triple_collection from gnowsys_ndf.ndf.models import * @@ -3859,3 +3859,18 @@ def delete_node( except Exception as e: delete_status_message = "Error (from delete_node) :-\n" + str(e) return (False, delete_status_message) + + +def repository(request, group_id): + ''' + It's an NROER repository. Which will hold the list of apps. + ''' + + # [i.values()[0] for i in GSTUDIO_NROER_GAPPS] + + return render_to_response("ndf/repository.html", + { "gapps_dict" : GSTUDIO_NROER_GAPPS, + 'group_id': group_id, 'groupid': group_id + }, + context_instance=RequestContext(request) + ) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py index b34756b..99360f2 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/topics.py @@ -715,8 +715,10 @@ def topic_detail_view(request, group_id, app_Id=None): # First get the navigation list till topic from theme map nav_l=request.GET.get('nav_li','') breadcrumbs_list = [] + nav_li = "" if nav_l: + nav_li = nav_l nav_l = str(nav_l).split(",") # create beadcrumbs list from navigation list sent from template. @@ -765,7 +767,7 @@ def topic_detail_view(request, group_id, app_Id=None): return render_to_response('ndf/topic_details.html', { 'node': obj,'app_id': app_id,"theme_id": theme_id, "prior_obj": prior_obj, - 'group_id': group_id,'shelves': shelves,'topic': topic, + 'group_id': group_id,'shelves': shelves,'topic': topic, 'nav_list':nav_li, 'groupid':group_id,'shelf_list': shelf_list,'breadcrumbs_list': breadcrumbs_list }, context_instance = RequestContext(request) |