summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorprathamesh2017-11-06 14:50:21 +0530
committerprathamesh2017-11-06 14:50:21 +0530
commitcde2eeb4f15de06def22d3bf07120a0a416e807f (patch)
treef2d1a713796f22339377f066cfad7b9423b9ccb8 /yaksh/templates
parent840c00b9e939d2b33058d236ef4170923e0a018b (diff)
downloadonline_test-cde2eeb4f15de06def22d3bf07120a0a416e807f.tar.gz
online_test-cde2eeb4f15de06def22d3bf07120a0a416e807f.tar.bz2
online_test-cde2eeb4f15de06def22d3bf07120a0a416e807f.zip
Upload user to the course via csv.
The csv takes firstname, lastname and email. User and Profile are created with username and password been same as email. Following cases are handled for csv upload: - wrong csv headders - missing csv values - already existing users - invalid csv
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/course_detail.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html
index d8aeb2e..3f13ea7 100644
--- a/yaksh/templates/yaksh/course_detail.html
+++ b/yaksh/templates/yaksh/course_detail.html
@@ -41,6 +41,18 @@
<a href="{{URL_ROOT}}/exam/manage/send_mail/{{ course.id }}/">
Send Mail</a>
</li>
+ <li>
+ <form id="upload_users" action="{{ URL_ROOT }}/exam/manage/upload_users/{{course.id}}/"
+ method="POST" enctype="multipart/form-data">
+ {% csrf_token %}
+ <input type="file" name="csv_file" />
+ <button class="btn btn-primary" type=submit> Upload Users <span class="glyphicon glyphicon-open"/></button>
+ </form>
+ <div class="alert alert-info" role="alert">
+ The uploaded csv should have headers exactly same as mentioned below:<br>
+ <b>firstname, lastname, email</b>
+ </div>
+ </li>
</ul>
</div>
</div>
@@ -53,6 +65,13 @@
</center>
</div>
{% endif %}
+ {% if upload_details %}
+ <div class="alert alert-info" role="info">
+ {% for detail in upload_details %}
+ <strong> {{ detail }} </strong><br>
+ {% endfor %}
+ </div>
+ {% endif %}
{% if state == 'mail' %}
<div id="enrolled-students">
<center><b><u>Send Mails to Students</u></b></center><br>
@@ -218,6 +237,7 @@
{% endif %}
</div>
</div>
+
<!-- Dialog to display error message -->
<div id="dialog" title="Alert">
<p id="error_msg"></p>