Skip to content

Commit

Permalink
Merge pull request #1746 from saavrabh/section
Browse files Browse the repository at this point in the history
Query update in sync_existing_documents.
  • Loading branch information
kedar2a authored May 25, 2017
2 parents f0b3b9e + 40d88ba commit a91bfd7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/course_about.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,14 @@ <h3>Taking Screenshots of the work and doing something</h3>
<li class="tab-title active" ><a href="#course-notification" role="tab" tabindex="0" aria-selected="true" aria-controls="panel2-1">Notifications</a></li>

{% 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 %} #}
<li class="tab-title" title="Click here to refresh">
<a role="tab" href="#analytics-content" class="fetch-analytics" tabindex="1" aria-selected="false" aria-controls="panel2-2" data-id={{request.user.id}}>
Progress Report
</a>
</li>
<input type="hidden" class="is_admin" value="False" />
{% elif gstaff_access %}
{% elif gstaff_access or request.user.id in group_object.group_admin %}
<input type="hidden" class="is_admin" value="True" />
<li class="tab-title" ><a role="tab" href="#analytics-content" tabindex="1" aria-selected="false" class="fetch-group-analytics" aria-controls="panel2-2" data-id={{request.user.id}}>Group Analytics</a></li>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<div >
{% user_access_policy groupid request.user as user_access_priv %}
{% get_group_object groupid as group_object %}
{% if allow_to_comment %}
<div data-alert class="alert-box new_comments hide info radius">
<div class="new_cmnts_lbl">New comment(s) added. Please refresh to see.</div>
Expand Down Expand Up @@ -110,7 +110,7 @@
<i class="fa fa-reply"></i>
{% trans "Reply" %}
</a>
{% 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 %}
<a class="reply-btn delete_res" data-id='{{ each_reply.oid }}' data-userid="{{each_reply.userid}}" onclick="deleteReply($(this))" style="float:right">
<i class="fa fa-trash-o"></i>
{% trans "Delete" %}
Expand Down Expand Up @@ -294,7 +294,7 @@
+ "<a class='reply-btn reply_res' data-id='" + data[1] + "' onclick='openCKEditor($(this))' data-org-content='"+data[3]+"'>"
+ "<i class='fa fa-reply'></i> Reply"
+ "</a>"
if (request_user_id == reply_user_id){
if (request_user_id == reply_user_id || is_grp_admin ){
htmlReply +="<a class='reply-btn delete_res' data-id='" + data[1]+ "'data-userid='"+ data[5] +"' onclick='deleteReply($(this))' style='float:right'><i class='fa fa-trash-o'></i> Delete"
htmlReply +="<a class='reply-btn edit_res' data-id='"+ data[1] +"' data-userid='{{each_reply.userid}}' data-userid='"+ data[5] +"' onclick='editreply($(this))' style='float:right;margin-right:10px!important'><i class='fa fa-pencil-square-o'></i> Edit |"
}
Expand Down
5 changes: 4 additions & 1 deletion gnowsys-ndf/gnowsys_ndf/ndf/views/discussion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a91bfd7

Please sign in to comment.