diff options
author | adityacp | 2017-06-12 18:22:21 +0530 |
---|---|---|
committer | adityacp | 2017-06-12 18:22:21 +0530 |
commit | a7c9591eac66eb2751a2706b5686a997d7c236dd (patch) | |
tree | b532b66fb9f7e58cbdb34adaa360cfd8421b843b /yaksh/templates | |
parent | 928ebb23f8b2926240fc220791655614cc4192d2 (diff) | |
download | online_test-a7c9591eac66eb2751a2706b5686a997d7c236dd.tar.gz online_test-a7c9591eac66eb2751a2706b5686a997d7c236dd.tar.bz2 online_test-a7c9591eac66eb2751a2706b5686a997d7c236dd.zip |
Add separate form to send emails
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/course_detail.html | 67 |
1 files changed, 51 insertions, 16 deletions
diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html index 2cbdf8b..676d7f3 100644 --- a/yaksh/templates/yaksh/course_detail.html +++ b/yaksh/templates/yaksh/course_detail.html @@ -21,9 +21,13 @@ <div class="row"> <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar"> + {% if msg == 'mail'%} + <li><a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">Go to Course Details</a></li> + {% else %} <li><a href="#student-requests" id="request"> Requested Students </a></li> <li><a href="#enrolled-students" id="enroll-students"> Enrolled Students </a></li> <li><a href="#rejected-students" id="reject-students"> Rejected Students </a></li> + {% endif %} <li> <a href="{{URL_ROOT}}/exam/manage/toggle_status/{{ course.id }}/"> {% if course.active %}Deactivate Course {% else %} Activate Course {% endif %}</a> @@ -32,6 +36,10 @@ <a href="{{URL_ROOT}}/exam/manage/duplicate_course/{{ course.id }}/"> Clone Course</a> </li> + <li> + <a href="{{URL_ROOT}}/exam/manage/send_mail/{{ course.id }}/"> + Send Mail</a> + </li> </ul> </div> </div> @@ -44,6 +52,47 @@ </center> </div> {% endif %} + {% if msg == 'mail' %} + <div id="enrolled-students"> + <center><b><u>Send Mails to Students</u></b></center><br> + {% if course.get_enrolled %} + <input type="checkbox" class="reject"/> <font size="2">Select all</font> + <div id="reject"> + <form action="{{URL_ROOT}}/exam/manage/send_mail/{{ course.id }}/" method="post" id="send_mail_form"> + {% csrf_token %} + <table class="table table-striped"> + <th></th> + <th></th> + <th>Full Name</th> + <th>Email</th> + <th>Roll Number</th> + <th>Institute</th> + <th>Department</th> + {% for enrolled in course.get_enrolled %} + <tr> + <td><input type="checkbox" name="check" value="{{ enrolled.id }}"></td> + <td>{{ forloop.counter }}.</td> + <td> {{ enrolled.get_full_name|title }} </td> + <td> {{enrolled.email}}</td> + <td> {{enrolled.profile.roll_number}}</td> + <td> {{enrolled.profile.institute}}</td> + <td> {{enrolled.profile.department}}</td> + </tr> + {% endfor %} + </table> + <br> + <input type="text" name="subject" id="subject" placeholder="Email Subject"> + <br><br> + <textarea name="body" id="email_body"></textarea><br> + Attachments: <input type="file" name="email_attach" multiple=""> + <br> + <button class="btn btn-success" type="submit" name='send_mail' value='send_mail' id="send_mail"> + Send Mail to Selected Students</button> + </div> + {% endif %} + </form> + </div> + {% else %} <div id="student-requests"> <center><b><u>Requests</u></b></center><br> {% if course.get_requests %} @@ -91,7 +140,7 @@ {% if course.get_enrolled %} <input type="checkbox" class="reject"/> <font size="2">Select all</font> <div id="reject"> - <form action="{{URL_ROOT}}/exam/manage/enrolled/reject/{{ course.id }}/" method="post" enctype="multipart/form-data" id="reject-form"> + <form action="{{URL_ROOT}}/exam/manage/enrolled/reject/{{ course.id }}/" method="post" id="reject-form"> {% csrf_token %} <table class="table table-striped"> <th></th> @@ -118,21 +167,6 @@ </tr> {% endfor %} </table> - <a data-toggle="collapse" data-target="#mail"> - <span class="glyphicon glyphicon-chevron-down"></span> - Click Here to send email to students - </a> - <div id="mail" class="collapse"> - <br> - <input type="text" name="subject" id="subject" placeholder="Email Subject"> - <br><br> - <textarea name="body" id="email_body"></textarea><br> - Attachments: <input type="file" name="email_attach" multiple=""> - <br> - <button class="btn btn-success" type="submit" name='send_mail' value='send_mail' id="send_mail"> - Send Mail to Selected Students</button> - </div> - <br><br> <button class="btn btn-danger" type="submit" name='reject' value='reject'> Reject Selected</button> </div> @@ -180,6 +214,7 @@ {% endif %} </form> </div> + {% endif %} </div> </div> <!-- Dialog to display error message --> |