diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/management/commands/sync_existing_documents.py b/gnowsys-ndf/gnowsys_ndf/ndf/management/commands/sync_existing_documents.py index 76c43be711..514ef07d29 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/management/commands/sync_existing_documents.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/management/commands/sync_existing_documents.py @@ -26,7 +26,7 @@ def handle(self, *args, **options): # Keep latest changes in field(s) to be added at top # updating project_config for Groups - proj_config = node_collection.collection.update({'_type': 'Group','project_config': {'$exists': False} },{'$set': {'project_config': {} }}, upsert=False, multi=True) + proj_config = node_collection.collection.update({'_type':{'$in': [u'Author', u'Group']},'project_config': {'$exists': False} },{'$set': {'project_config': {} }}, upsert=False, multi=True) # updating visited_nodes for Counter instances counter_objs = counter_collection.collection.update({'_type': 'Counter', diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/course_about.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/course_about.html index f91301b750..7d3ad7e90f 100755 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/course_about.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/course_about.html @@ -282,13 +282,14 @@

Taking Screenshots of the work and doing something

  • Notifications
  • {% if request.user.is_authenticated and not gstaff_access %} + {# {% if request.user.is_authenticated and not gstaff_access and request.user.id in group_obj.author_set %} #}
  • Progress Report
  • - {% elif gstaff_access %} + {% elif gstaff_access or request.user.id in group_object.group_admin %}
  • Group Analytics
  • {% endif %} 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 a7eebd1036..ced9fa62b6 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 @@ -32,7 +32,7 @@
    {% user_access_policy groupid request.user as user_access_priv %} - +{% get_group_object groupid as group_object %} {% if allow_to_comment %}
    New comment(s) added. Please refresh to see.
    @@ -110,7 +110,7 @@ {% trans "Reply" %} - {% if request.user.id == each_reply.userid or is_gstaff %} + {% if request.user.id == each_reply.userid or is_gstaff or request.user.id in group_object.group_admin %} {% trans "Delete" %} @@ -294,7 +294,7 @@ + "" + " Reply" + "" - if (request_user_id == reply_user_id){ + if (request_user_id == reply_user_id || is_grp_admin ){ htmlReply +=" Delete" htmlReply +=" Edit |" } diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/discussion.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/discussion.py index 0fb6bc5e83..3777d181a8 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/discussion.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/discussion.py @@ -330,8 +330,11 @@ def discussion_reply(request, group_id, node_id): # print files user_names = reply_obj.user_details_dict["contributors"] + is_grp_admin = False + if request.user.id in group_object.group_admin: + is_grp_admin = True # ["status_info", "reply_id", "prior_node", "html_content", "org_content", "user_id", "user_name", "created_at" ] - reply = json.dumps( [ "reply_saved", str(reply_obj._id), str(reply_obj.prior_node[0]), reply_obj.content, reply_obj.content_org, user_id, user_names, formated_time, files], cls=DjangoJSONEncoder ) + reply = json.dumps( [ "reply_saved", str(reply_obj._id), str(reply_obj.prior_node[0]), reply_obj.content, reply_obj.content_org, user_id, user_names, formated_time, files,is_grp_admin], cls=DjangoJSONEncoder ) # print "===========", reply