send cohort to post view context
This commit is contained in:
@@ -11,7 +11,7 @@ from django.contrib.auth.models import User
|
||||
|
||||
from mitxmako.shortcuts import render_to_response, render_to_string
|
||||
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 urllib import urlencode
|
||||
@@ -166,6 +166,7 @@ def forum_form_discussion(request, course_id):
|
||||
'category_map': category_map,
|
||||
'roles': saxutils.escape(json.dumps(utils.get_role_ids(course_id)), escapedict),
|
||||
'is_moderator': cached_has_permission(request.user, "see_all_cohorts", course_id),
|
||||
'cohorts': get_course_cohorts
|
||||
}
|
||||
# print "start rendering.."
|
||||
return render_to_response('discussion/index.html', context)
|
||||
|
||||
@@ -45,13 +45,15 @@
|
||||
%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>
|
||||
%endif
|
||||
% if true:
|
||||
% if is_moderator:
|
||||
<div class="form-group-label">
|
||||
Make visible to:
|
||||
<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="g2">Group 2</option>
|
||||
%endfor
|
||||
|
||||
</select>
|
||||
</div>
|
||||
%endif
|
||||
|
||||
Reference in New Issue
Block a user