Commit 1962d247 by Calen Pennington

Make allow_anonymous and allow_anonymous_to_peers use field access in templates

parent d8b99e1e
...@@ -7,15 +7,15 @@ ...@@ -7,15 +7,15 @@
<div class="options"> <div class="options">
<input type="checkbox" name="follow" class="discussion-follow" class="discussion-follow" id="new-post-follow" checked><label for="new-post-follow">follow this post</label> <input type="checkbox" name="follow" class="discussion-follow" class="discussion-follow" id="new-post-follow" checked><label for="new-post-follow">follow this post</label>
<br> <br>
% if course.metadata.get("allow_anonymous", True): % if course.allow_anonymous:
<input type="checkbox" name="anonymous" class="discussion-anonymous" id="new-post-anonymous"><label for="new-post-anonymous">post anonymously</label> <input type="checkbox" name="anonymous" class="discussion-anonymous" id="new-post-anonymous"><label for="new-post-anonymous">post anonymously</label>
%elif course.metadata.get("allow_anonymous_to_peers", False): %elif course.allow_anonymous_to_peers:
<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:
<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: %if is_moderator:
%for c in cohorts: %for c in cohorts:
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<article class="new-post-article"> <article class="new-post-article">
<div class="inner-wrapper"> <div class="inner-wrapper">
<form class="new-post-form"> <form class="new-post-form">
<div class="left-column"> <div class="left-column">
<label>Create new post about:</label> <label>Create new post about:</label>
...@@ -41,18 +41,18 @@ ...@@ -41,18 +41,18 @@
<div class="options"> <div class="options">
<input type="checkbox" name="follow" class="discussion-follow" class="discussion-follow" id="new-post-follow" checked><label for="new-post-follow">follow this post</label> <input type="checkbox" name="follow" class="discussion-follow" class="discussion-follow" id="new-post-follow" checked><label for="new-post-follow">follow this post</label>
<br> <br>
% if course.metadata.get("allow_anonymous", True): % if course.allow_anonymous:
<input type="checkbox" name="anonymous" class="discussion-anonymous" id="new-post-anonymous"><label for="new-post-anonymous">post anonymously</label> <input type="checkbox" name="anonymous" class="discussion-anonymous" id="new-post-anonymous"><label for="new-post-anonymous">post anonymously</label>
%elif course.metadata.get("allow_anonymous_to_peers", False): %elif course.allow_anonymous_to_peers:
<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 and is_moderator: %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>
%for c in cohorts: %for c in cohorts:
<option value="${c.id}" <option value="${c.id}"
%if user_cohort and str(user_cohort) == str(c.id): %if user_cohort and str(user_cohort) == str(c.id):
selected selected
%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