From 094e14b0294c367583783cf40955d4d26e4bb8d9 Mon Sep 17 00:00:00 2001 From: siddhu dhangar Date: Tue, 24 Apr 2018 08:41:08 +0530 Subject: [PATCH 1/6] in-line-texteditor.html file changed,added js funtion to show alert message for non-login users when user click on comment button --- .../gnowsys_ndf/ndf/templates/ndf/in-line-texteditor.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/in-line-texteditor.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/in-line-texteditor.html index 39835d2b98..0d383bf034 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/in-line-texteditor.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/in-line-texteditor.html @@ -43,7 +43,7 @@
-
+
{% if thr_int_type %} {% if thr_int_type == "None" %} Feedback {% else %} {{thr_int_type}} {% endif %} {% if all_replies|length > 0 %}({{all_replies|length }}) {% endif %} @@ -594,6 +594,11 @@ } }; }, 10000); + +function check_user_access_policy(obj){ + alert("Please login to rate this resource"); + return false; +} From 06ed35c352b107fb6782cb48ef53033085805159 Mon Sep 17 00:00:00 2001 From: siddhu dhangar Date: Tue, 24 Apr 2018 08:55:15 +0530 Subject: [PATCH 2/6] In rating.html file changed,added input type hidden field for csrf_token,group_id,is_authenticated.rating issue resolved --- gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/rating.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/rating.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/rating.html index 88c3a50f93..6b954838ac 100755 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/rating.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/rating.html @@ -4,6 +4,7 @@ {% block body_content %} + {% if if_comments %} {% get_node nodeid as node %} @@ -15,7 +16,10 @@
+ + +
From d6ebc501f41787aab09935151a530a4c5a66ecc6 Mon Sep 17 00:00:00 2001 From: siddhu dhangar Date: Tue, 24 Apr 2018 09:19:00 +0530 Subject: [PATCH 3/6] In lms.html file changed,showing 'gallery' text on all workspaces tab except home workspace --- gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/lms.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/lms.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/lms.html index 47cdb133bd..2371dbd6fa 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/lms.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/lms.html @@ -52,7 +52,7 @@ {% if not group_object.project_config.resource_name %}{% trans "Resources" %}{% else %}{{group_object.project_config.resource_name}} {% endif %} {% if group_object.name != "help"%}
  • - {% if 'Group' in group_object_member_of_names_list %} {% trans "E-Library" %} {% else %} {% trans "Gallery" %}{% endif %} + {% if 'Group' in group_object_member_of_names_list and group_object.name != "home" %} {% trans "Gallery" %} {% else %} {% trans "E-Library" %}{% endif %}
  • From 05e716ef9c4c5973ec7cefecd4d4378c962a1ae2 Mon Sep 17 00:00:00 2001 From: siddhu dhangar Date: Tue, 24 Apr 2018 09:20:34 +0530 Subject: [PATCH 4/6] In widget_user_search.html,replaced text Find Students to Find Members --- .../gnowsys_ndf/ndf/templates/ndf/widget_user_search.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/widget_user_search.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/widget_user_search.html index f31c630122..1d5a4561c4 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/widget_user_search.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/widget_user_search.html @@ -18,7 +18,7 @@
    {% trans 'Search User by name : ' %}
    - +
    From 081509a9d3e37443703bdf8da25f3573198257cd Mon Sep 17 00:00:00 2001 From: siddhu dhangar Date: Tue, 24 Apr 2018 14:05:23 +0530 Subject: [PATCH 5/6] In method.py file,group_obj argument of user_access_policy() funtion replaced to group_obj._id argument --- gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py index ccb2c85618..92159b3faa 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/methods.py @@ -5826,7 +5826,7 @@ def forbid_private_group(request, group_obj): try: if group_obj.access_policy == u'PRIVATE' or group_obj.group_type == u'PRIVATE': from gnowsys_ndf.ndf.templatetags.ndf_tags import user_access_policy - access_flag = user_access_policy(group_obj, request.user) + access_flag = user_access_policy(group_obj._id, request.user) if access_flag == "disallow": # print "\naccess_flag: ", access_flag, len(access_flag) raise PermissionDenied() From a169c8f01155b0ec796667d224e56757ceefe54d Mon Sep 17 00:00:00 2001 From: siddhu dhangar Date: Thu, 26 Apr 2018 15:03:05 +0530 Subject: [PATCH 6/6] In in-line-texteditor.html file, whole file replaced with master code from gnowledge --- .../ndf/templates/ndf/in-line-texteditor.html | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/in-line-texteditor.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/in-line-texteditor.html index 0d383bf034..a640667287 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/in-line-texteditor.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/in-line-texteditor.html @@ -11,7 +11,7 @@ {% block head %} - + {% if user.is_authenticated %} @@ -43,9 +43,9 @@
    -
    +
    {% if thr_int_type %} - {% if thr_int_type == "None" %} Feedback {% else %} {{thr_int_type}} {% endif %} + {% if thr_int_type == "None" %} Feedback {% else %} {{thr_int_type}} {% endif %} {% if all_replies|length > 0 %}({{all_replies|length }}) {% endif %} {% else %} {{default_discussion_lbl}} {% if all_replies|length > 0 %} ({{all_replies|length }}) {% endif %} @@ -77,7 +77,7 @@
    @@ -109,14 +109,14 @@ " + +"
    " +"
    " +"
    "; return htmlReply; @@ -354,7 +354,7 @@ $("#orgitdownreps").val(""); // make textarea empty if(priorNodeId == "{{ node.pk }}") // main reply { - + //sample format of data = [0:"status_info", 1:"reply_id", 2:"prior_node", 3:"html_content", 4:"org_content", 5:"user_id", 6:"user_name", 7:"created_at" ] // add reply text content after #replies-area var parent_margin_level = $(sourceObj).closest("div").attr("class"); @@ -364,8 +364,8 @@ else // sub-reply { parent_margin_level = $(sourceObj).attr("data-reply-level"); - child_margin_level = parseInt(parent_margin_level) + 1; - + child_margin_level = parseInt(parent_margin_level) + 1; + $(sourceObj).after(createReplyHTML('margin-left:'+((child_margin_level-1)*48)+'px', data,parseInt(parent_margin_level)+1)); @@ -373,7 +373,7 @@ // updating tab-text old_count = old_count + 1 updateDiscussionTabText(); - + } else if( data[0] == "no_content" ){ @@ -388,12 +388,12 @@ alert(" {% trans 'Please provide the reply content.' %}") } // --- END of IF-ELSE // $.ajax({ - // url: "{% url 'get_gin_line_template' group_id node.pk %}", + // url: "{% url 'get_gin_line_template' group_id node.pk %}", // type: "GET", // datatype: "html", - + // success: function(data) { - + // alert(data); // $(".comment-sections:visible").html(data); // } @@ -506,7 +506,7 @@ if(checkCurrEdit()){ return false; } - + var parent_div = sourceObj.parent(); parent_div.append(" Save"); @@ -535,8 +535,8 @@ setCurrNodeEdit(1); // $(sourceObj).append(data); }, - }); - + }); + } @@ -567,7 +567,7 @@ edit_res = curr_thread.closest('.edit_res'); reply_res = curr_thread.closest('.reply_res'); delete_res = curr_thread.closest('.delete_res'); - + content_thread.show(); reply_res.show(); edit_res.show(); @@ -599,7 +599,5 @@ alert("Please login to rate this resource"); return false; } - - - + \ No newline at end of file