summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authoradityacp2020-09-30 19:14:38 +0530
committeradityacp2020-09-30 19:35:28 +0530
commitc6c57869fe653d2ea0502017a9fb15f2f745491b (patch)
treee225826a16daf9a9485607457d5d67b568753553 /yaksh/templates
parent86be5fd441b92a7679eb2b8673bfba2c188ba0ba (diff)
downloadonline_test-c6c57869fe653d2ea0502017a9fb15f2f745491b.tar.gz
online_test-c6c57869fe653d2ea0502017a9fb15f2f745491b.tar.bz2
online_test-c6c57869fe653d2ea0502017a9fb15f2f745491b.zip
Change multiple files
- Add download sample yaml for toc in the lesson - Add validation for upload toc yaml - Add tests for download sample yaml toc
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/show_toc.html28
1 files changed, 18 insertions, 10 deletions
diff --git a/yaksh/templates/yaksh/show_toc.html b/yaksh/templates/yaksh/show_toc.html
index ddaad74..92ea0cd 100644
--- a/yaksh/templates/yaksh/show_toc.html
+++ b/yaksh/templates/yaksh/show_toc.html
@@ -1,13 +1,21 @@
-<div>
- <form action="" method="POST" enctype="multipart/form-data">
- {% csrf_token %}
- <input type="file" name="toc" required="">
- <button class="btn btn-outline-success" id="upload_toc" name="upload_toc">
- <i class="fa fa-upload"></i>&nbsp;Upload TOC
- </button>
- </form>
-</div>
-<hr>
+{% load custom_filters %}
+{% has_lesson_video lesson_id as has_video %}
+{% if has_video %}
+ <div>
+ <a href="{% url 'yaksh:download_sample_toc' %}">
+ <i class="fa fa-download"></i>&nbsp;Download Sample
+ </a>
+ <br><br>
+ <form action="" method="POST" enctype="multipart/form-data">
+ {% csrf_token %}
+ <input type="file" name="toc" required="">
+ <button class="btn btn-outline-success" id="upload_toc" name="upload_toc">
+ <i class="fa fa-upload"></i>&nbsp;Upload TOC
+ </button>
+ </form>
+ </div>
+ <hr>
+{% endif %}
<table class="table table-responsive-sm">
{% for toc in contents %}
{% with toc.get_toc_text as toc_name %}