Commit 5bfd2c33 by Your Name

send cohort to post view context

parent 43d4661c
...@@ -11,7 +11,7 @@ from django.contrib.auth.models import User ...@@ -11,7 +11,7 @@ from django.contrib.auth.models import User
from mitxmako.shortcuts import render_to_response, render_to_string from mitxmako.shortcuts import render_to_response, render_to_string
from courseware.courses import get_course_with_access from courseware.courses import get_course_with_access
from course_groups.cohorts import get_cohort_id from course_groups.cohorts import get_cohort_id, get_course_cohorts
from courseware.access import has_access from courseware.access import has_access
from urllib import urlencode from urllib import urlencode
...@@ -166,6 +166,7 @@ def forum_form_discussion(request, course_id): ...@@ -166,6 +166,7 @@ def forum_form_discussion(request, course_id):
'category_map': category_map, 'category_map': category_map,
'roles': saxutils.escape(json.dumps(utils.get_role_ids(course_id)), escapedict), 'roles': saxutils.escape(json.dumps(utils.get_role_ids(course_id)), escapedict),
'is_moderator': cached_has_permission(request.user, "see_all_cohorts", course_id), 'is_moderator': cached_has_permission(request.user, "see_all_cohorts", course_id),
'cohorts': get_course_cohorts
} }
# print "start rendering.." # print "start rendering.."
return render_to_response('discussion/index.html', context) return render_to_response('discussion/index.html', context)
......
...@@ -45,13 +45,15 @@ ...@@ -45,13 +45,15 @@
%elif course.metadata.get("allow_anonymous_to_peers", False): %elif course.metadata.get("allow_anonymous_to_peers", False):
<input type="checkbox" name="anonymous_to_peers" class="discussion-anonymous-to-peers" id="new-post-anonymous-to-peers"><label for="new-post-anonymous-to-peers">post anonymously to classmates</label> <input type="checkbox" name="anonymous_to_peers" class="discussion-anonymous-to-peers" id="new-post-anonymous-to-peers"><label for="new-post-anonymous-to-peers">post anonymously to classmates</label>
%endif %endif
% if true: % if is_moderator:
<div class="form-group-label"> <div class="form-group-label">
Make visible to: Make visible to:
<select class="group-filter-select"> <select class="group-filter-select">
<option value="all">All Groups</option> <option >All Groups</option>
%for c in cohorts:
<option value="g1">Group 1</option> <option value="g1">Group 1</option>
<option value="g2">Group 2</option> %endfor
</select> </select>
</div> </div>
%endif %endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment