Commit 8a953241 by Your Name

first pass

parent 32e5f72c
...@@ -147,17 +147,18 @@ def inline_discussion(request, course_id, discussion_id): ...@@ -147,17 +147,18 @@ def inline_discussion(request, course_id, discussion_id):
else: else:
#otherwise, just make a dictionary of two #otherwise, just make a dictionary of two
user_cohort = get_cohort(cc_user, course_id) #user_cohort = get_cohort(cc_user, course_id)
if user_cohort: #if user_cohort:
user_cohort_name = user_cohort.name # user_cohort_name = user_cohort.name
user_cohort_id = user_cohort.id # user_cohort_id = user_cohort.id
else: #else:
user_cohort_name = user_cohort_id = None # user_cohort_name = user_cohort_id = None
cohorts_list = None
if user_cohort: #if user_cohort:
cohorts_list.append({'name':user_cohort_name, 'id':user_cohort_id}) # cohorts_list.append({'name':user_cohort_name, 'id':user_cohort_id})
else: #else:
cohorts_list = None # cohorts_list = None
return utils.JsonResponse({ return utils.JsonResponse({
......
...@@ -46,21 +46,18 @@ ...@@ -46,21 +46,18 @@
%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 is_course_cohorted: %if is_course_cohorted and is_moderator:
<div class="form-group-label choose-cohort"> <div class="form-group-label choose-cohort">
Make visible to: Make visible to:
<select class="group-filter-select new-post-group" name = "group_id"> <select class="group-filter-select new-post-group" name = "group_id">
<option value="">All Groups</option> <option value="">All Groups</option>
%if is_moderator: %for c in cohorts:
%for c in cohorts: <option value="${c.id}"
<option value="${c.id}">${c.name}</option> %if user_cohort and user_cohort == c.id
%endfor selected
%else:
%if user_cohort:
<option value="${user_cohort}">My Cohort</option>
%endif %endif
%endif >${c.name}</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