membership.html 12 KB
Newer Older
Miles Steele committed
1
<%! from django.utils.translation import ugettext as _ %>
2
<%page args="section_data"/>
asadiqbal08 committed
3
<%! from microsite_configuration import microsite %>
4

5 6 7 8 9
<script type="text/template" id="member-list-widget-template">
  <div class="member-list-widget">
    <div class="header">
      <div class="title"> {{title}} </div>
    </div>
10
    <div class="info"> {{info}} </div>
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
    <div class="member-list">
      <table>
        <thead>
          <tr>
            {{#labels}}
              <td class="label">{{.}}</td>
            {{/labels}}
          </tr>
        </thead>
        <tbody></tbody>
      </table>
    </div>
    <div class="bottom-bar">
      <input type="text" name="add-field" class="add-field" placeholder="{{add_placeholder}}">
      <input type="button" name="add" class="add" value="{{add_btn_label}}">
    </div>
  </div>
</script>

30
<div class="batch-enrollment membership-section">
Miles Steele committed
31
  <h2> ${_("Batch Enrollment")} </h2>
32
  <p>
33 34
    <label for="student-ids">
      ${_("Enter email addresses and/or usernames separated by new lines or commas.")}
35
      ${_("You will not get notification for emails that bounce, so please double-check spelling.")} </label>
36
    <textarea rows="6" name="student-ids" placeholder="${_("Email Addresses/Usernames")}" spellcheck="false"></textarea>
37
  </p>
38

39
  <div class="enroll-option">
40
    <input type="checkbox" name="auto-enroll" value="Auto-Enroll" checked="yes">
41 42 43
    <label for="auto-enroll">${_("Auto Enroll")}</label>
    <div class="hint auto-enroll-hint">
      <span class="hint-caret"></span>
44
      <p>
45 46
	${_("If this option is <em>checked</em>, users who have not yet registered for {platform_name} will be automatically enrolled.").format(platform_name=settings.PLATFORM_NAME)}
	${_("If this option is left <em>unchecked</em>, users who have not yet registered for {platform_name} will not be enrolled, but will be allowed to enroll once they make an account.").format(platform_name=settings.PLATFORM_NAME)}
47 48
	<br /><br />
	${_("Checking this box has no effect if 'Unenroll' is selected.")}
49
      </p>
50
    </div>
51
  </div>
52 53

  <div class="enroll-option">
54
    <input type="checkbox" name="email-students" value="Notify-students-by-email" checked="yes">
55
    <label for="email-students">${_("Notify users by email")}</label>
56 57
    <div class="hint email-students-hint">
      <span class="hint-caret"></span>
58
      <p>
59 60
	${_("If this option is <em>checked</em>, users will receive an email notification.")}
      </p>
61 62
    </div>
  </div>
63

64 65 66 67 68 69
  <div>
    <input type="button" name="enrollment-button" class="enrollment-button" value="${_("Enroll")}" data-endpoint="${ section_data['enroll_button_url'] }" data-action="enroll" >
    <input type="button" name="enrollment-button" class="enrollment-button" value="${_("Unenroll")}" data-endpoint="${ section_data['unenroll_button_url'] }" data-action="unenroll" >
  </div>
  <div class="request-response"></div>
  <div class="request-response-error"></div>
70 71
</div>

asadiqbal08 committed
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
%if microsite.get_value('ALLOW_AUTOMATED_SIGNUPS', settings.FEATURES.get('ALLOW_AUTOMATED_SIGNUPS', False)):
  <hr class="divider" />

  <div class="auto_enroll auto_enroll_csv">
    <h2> ${_("Register/Enroll Students")} </h2>
    <p>
    ${_("To register and enroll a list of users in this course, choose a CSV file that contains the following columns in this exact order: email, username, name, and country. Please include one student per row and do not include any headers, footers, or blank lines.")}
    </p>
    <form id="student-auto-enroll-form" method="post" action="${ section_data['upload_student_csv_button_url'] }" enctype="multipart/form-data">
      <div class="customBrowseBtn">
        <input disabled="disabled" id="browseFile" placeholder="choose file" />
        <div class="file-browse btn btn-primary">
            <span class="browse"> Browse </span>
            <input class="file_field" id="browseBtn" name="students_list" type="file" accept=".csv"/>
        </div>
      </div>
      <button type="submit" name="enrollment_signup_button">${_("Upload CSV")}</button>

      <input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }">
    </form>
    <div class="results"></div>
  </div>
%endif

96
<hr class="divider" />
97

98
%if section_data['access']['instructor']:
99
<div class="batch-beta-testers membership-section">
100
  <h2> ${_("Batch Beta Tester Addition")} </h2>
101
  <p>
102
    <label for="student-ids-for-beta">
103
      ${_("Enter email addresses and/or usernames separated by new lines or commas.")}<br/>
104 105 106
      ${_("Note: Users must have an activated {platform_name} account before they can be enrolled as a beta tester.").format(platform_name=settings.PLATFORM_NAME)}
    </label>

107
  <textarea rows="6" cols="50" name="student-ids-for-beta" placeholder="${_("Email Addresses/Usernames")}" spellcheck="false"></textarea>
108 109 110
  </p>

  <div class="enroll-option">
111 112 113 114 115
    <input type="checkbox" name="auto-enroll" value="Auto-Enroll" checked="yes">
    <label for="auto-enroll-beta">${_("Auto Enroll")}</label>
    <div class="hint auto-enroll-beta-hint">
      <span class="hint-caret"></span>
      <p>
116
	${_("If this option is <em>checked</em>, users who have not enrolled in your course will be automatically enrolled.")}
117 118 119 120 121 122 123
	<br /><br />
	${_("Checking this box has no effect if 'Remove beta testers' is selected.")}
      </p>
    </div>
  </div>

  <div class="enroll-option">
124
    <input type="checkbox" name="email-students-beta" value="Notify-students-by-email" checked="yes">
125 126 127 128
    <label for="email-students-beta">${_("Notify users by email")}</label>
    <div class="hint email-students-beta-hint">
      <span class="hint-caret"></span>
      <p> ${_("If this option is <em>checked</em>, users will receive an email notification.")}</p>
129 130
    </div>
  </div>
131

132
  <div>
133 134
    <input type="button" name="beta-testers" class="enrollment-button" value="${_("Add beta testers")}" data-endpoint="${ section_data['modify_beta_testers_button_url'] }" data-action="add" >
    <input type="button" name="beta-testers" class="enrollment-button" value="${_("Remove beta testers")}" data-endpoint="${ section_data['modify_beta_testers_button_url'] }" data-action="remove" >
135 136
  </div>

137 138
  <div class="request-response"></div>
  <div class="request-response-error"></div>
139 140 141
</div>

<hr class="divider" />
142
%endif
Miles Steele committed
143

144
<div class="member-lists-management membership-section">
145
  ## Translators: an "Administration List" is a list, such as Course Staff, that users can be added to.
Miles Steele committed
146
  <h2> ${_("Administration List Management")} </h2>
Miles Steele committed
147

148 149
  <div class="request-response-error"></div>

150
  <div class="wrapper-member-select">
151 152
    ## Translators: an "Administrator Group" is a group, such as Course Staff, that users can be added to.
    <label for="member-lists-selector">${_("Select an Administrator Group:")}</label>
153 154 155 156 157 158 159
    <select id="member-lists-selector" class="member-lists-selector">
      <option> ${_("Getting available lists...")} </option>
    </select>

  </div>


160 161
  %if not section_data['access']['instructor']:
    <p>
Miles Steele committed
162 163
      ${_("Staff cannot modify staff or beta tester lists. To modify these lists, "
      "contact your instructor and ask them to add you as an instructor for staff "
164
      "and beta lists, or a discussion admin for discussion management.")}
165 166 167
    </p>
  %endif

Miles Steele committed
168
  %if section_data['access']['instructor']:
169 170
    <div class="auth-list-container"
      data-rolename="staff"
Miles Steele committed
171
      data-display-name="${_("Course Staff")}"
172
      data-info-text="
Miles Steele committed
173 174 175 176
        ${_("Course staff can help you manage limited aspects of your course. Staff "
        "can enroll and unenroll students, as well as modify their grades and "
        "see all course data. Course staff are not automatically given access "
        "to Studio and will not be able to edit your course.")}"
177 178
      data-list-endpoint="${ section_data['list_course_role_members_url'] }"
      data-modify-endpoint="${ section_data['modify_access_url'] }"
Miles Steele committed
179
      data-add-button-label="${_("Add Staff")}"
180
    ></div>
181

182 183
    <div class="auth-list-container"
      data-rolename="instructor"
Miles Steele committed
184
      data-display-name="${_("Instructors")}"
185
      data-info-text="
Miles Steele committed
186
        ${_("Instructors are the core administration of your course. Instructors can "
187
        "add and remove course staff, as well as administer discussion access.")}"
188 189
      data-list-endpoint="${ section_data['list_course_role_members_url'] }"
      data-modify-endpoint="${ section_data['modify_access_url'] }"
Miles Steele committed
190
      data-add-button-label="${_("Add Instructor")}"
191
    ></div>
192

193 194
    <div class="auth-list-container"
      data-rolename="beta"
Miles Steele committed
195
      data-display-name="${_("Beta Testers")}"
196
      data-info-text="
Miles Steele committed
197 198 199
        ${_("Beta testers can see course content before the rest of the students. "
        "They can make sure that the content works, but have no additional "
        "privileges.")}"
200 201
      data-list-endpoint="${ section_data['list_course_role_members_url'] }"
      data-modify-endpoint="${ section_data['modify_access_url'] }"
202
      data-add-button-label="${_("Add Beta Tester")}"
203
    ></div>
204

205 206
    <div class="auth-list-container"
      data-rolename="Administrator"
207
      data-display-name="${_("Discussion Admins")}"
208
      data-info-text="
209
        ${_("Discussion admins can edit or delete any post, clear misuse flags, close "
210 211
         "and re-open threads, endorse responses, and see posts from all cohorts. "
         "They CAN add/delete other moderators and their posts are marked as 'staff'.")}"
212 213
      data-list-endpoint="${ section_data['list_forum_members_url'] }"
      data-modify-endpoint="${ section_data['update_forum_role_membership_url'] }"
214
      data-add-button-label="${_("Add Discussion Admin")}"
215
    ></div>
216
  %endif
Miles Steele committed
217

218
  %if section_data['access']['instructor'] or section_data['access']['forum_admin']:
219 220
    <div class="auth-list-container"
      data-rolename="Moderator"
221
      data-display-name="${_("Discussion Moderators")}"
Miles Steele committed
222
      data-info-text="
223
        ${_("Discussion moderators can edit or delete any post, clear misuse flags, close "
224 225
         "and re-open threads, endorse responses, and see posts from all cohorts. "
         "They CANNOT add/delete other moderators and their posts are marked as 'staff'.")}"
226 227
      data-list-endpoint="${ section_data['list_forum_members_url'] }"
      data-modify-endpoint="${ section_data['update_forum_role_membership_url'] }"
Miles Steele committed
228
      data-add-button-label="${_("Add Moderator")}"
229
    ></div>
Miles Steele committed
230

231 232
    <div class="auth-list-container"
      data-rolename="Community TA"
233
      data-display-name="${_("Discussion Community TAs")}"
Miles Steele committed
234
      data-info-text="
Miles Steele committed
235
        ${_("Community TA's are members of the community whom you deem particularly "
236
        "helpful on the discussion boards. They can edit or delete any post, clear misuse flags, "
237 238
        "close and re-open threads, endorse responses, and see posts from all cohorts. "
        "Their posts are marked 'Community TA'.")}"
239 240
      data-list-endpoint="${ section_data['list_forum_members_url'] }"
      data-modify-endpoint="${ section_data['update_forum_role_membership_url'] }"
241
      data-add-button-label="${_("Add Community TA")}"
242
    ></div>
Miles Steele committed
243 244
  %endif

245
</div>
246 247

%if course.is_cohorted:
248 249 250 251
    <hr class="divider" />
    <div class="cohort-management membership-section"
         data-ajax_url="${section_data['cohorts_ajax_url']}"
         data-advanced-settings-url="${section_data['advanced_settings_url']}"
252
         data-upload_cohorts_csv_url="${section_data['upload_cohorts_csv_url']}"
253 254
    >
    </div>
255

256 257 258 259 260 261 262 263 264 265
    <%block name="headextra">
        <script>
        $(document).ready(function() {
            var cohortManagementElement = $('.cohort-management');
            if (cohortManagementElement.length > 0) {
                var cohorts = new CohortCollection();
                cohorts.url = cohortManagementElement.data('ajax_url');
                var cohortsView = new CohortsView({
                    el: cohortManagementElement,
                    model: cohorts,
266 267
                    advanced_settings_url: cohortManagementElement.data('advanced-settings-url'),
                    upload_cohorts_csv_url: cohortManagementElement.data('upload_cohorts_csv_url')
268 269 270 271 272 273 274
                });
                cohorts.fetch().done(function() {
                    cohortsView.render();
                });
            }
        });
        </script>
asadiqbal08 committed
275

276 277
    </%block>
% endif