diff options
author | adityacp | 2020-11-03 17:52:24 +0530 |
---|---|---|
committer | adityacp | 2020-11-03 17:54:33 +0530 |
commit | aef2589eadaf7f3252e281286ab1bb83e690ba6a (patch) | |
tree | 1764959aca48f835be56c0819cddd286aeb8b4df /yaksh/templates | |
parent | 167b53a673630c4243c5d82a5966797213a5fa28 (diff) | |
parent | 81f96a24954d375ab32ab8dfb1ee8aba299655c6 (diff) | |
download | online_test-aef2589eadaf7f3252e281286ab1bb83e690ba6a.tar.gz online_test-aef2589eadaf7f3252e281286ab1bb83e690ba6a.tar.bz2 online_test-aef2589eadaf7f3252e281286ab1bb83e690ba6a.zip |
Resolve conflicts
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/base.html | 16 | ||||
-rw-r--r-- | yaksh/templates/yaksh/add_lesson.html | 10 | ||||
-rw-r--r-- | yaksh/templates/yaksh/add_video_quiz.html | 6 | ||||
-rw-r--r-- | yaksh/templates/yaksh/course_forum.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/lessons_forum.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/post_comments.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_lesson_quiz.html | 17 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_toc.html | 28 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_video.html | 98 |
9 files changed, 104 insertions, 79 deletions
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html index a108f8c..cba56cb 100644 --- a/yaksh/templates/base.html +++ b/yaksh/templates/base.html @@ -52,11 +52,23 @@ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script> <!-- To automatically render math in text elements, include the auto-render extension: --> - <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous" - onload="renderMathInElement(document.body);"></script> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> + <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"> + </script> + <script> new WOW().init(); + $(document).ready(function() { + renderMathInElement( + document.body, + { + delimiters: [ + {left: "$$", right: "$$", display: false}, + {left: "$", right: "$", display: true}, + ] + } + ); + }); </script> {% block script %} {% endblock %} diff --git a/yaksh/templates/yaksh/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html index d8ce09c..4400032 100644 --- a/yaksh/templates/yaksh/add_lesson.html +++ b/yaksh/templates/yaksh/add_lesson.html @@ -25,8 +25,8 @@ {{error}} </div> {% endif %} - <div class="row justify-content-center form-group"> - <div class="col-md-5 col-md-offset-4"> + <div class="row"> + <div class="col-md-6"> <a class="btn btn-primary" href="{% url 'yaksh:get_course_modules' course_id %}"> <i class="fa fa-arrow-left"></i> Back </a> @@ -145,7 +145,7 @@ </form> </div> <br><br> - <div class="col-md-5"> + <div class="col-md-6"> <br> <div class="card"> <div class="card-header"> @@ -154,13 +154,13 @@ </a> </div> <div class="collapse show" id="toc-collapse"> - <div class="card-body" id="toc">{{toc}}</div> + <div class="card-body" id="toc" style="max-height: 400px; overflow-y: auto;">{{toc}}</div> </div> </div> <br> <div class="card" id="preview_text_div"> <div class="card-header"> - Setup Lesson + Create lesson table of contents </div> <div class="card-body"> {% if lesson_form.instance and lesson_form.instance.video_path %} diff --git a/yaksh/templates/yaksh/add_video_quiz.html b/yaksh/templates/yaksh/add_video_quiz.html index ad087bc..b8a788e 100644 --- a/yaksh/templates/yaksh/add_video_quiz.html +++ b/yaksh/templates/yaksh/add_video_quiz.html @@ -76,9 +76,9 @@ $('#id_type').children("option[value='code']").show(); } }); - function init_editor() { + $(function() { tinymce.init({ - selector : "textarea", + selector: 'textarea#que_description', setup : function(ed) { ed.on('change', function(e) { tinymce.triggerSave(); @@ -89,6 +89,6 @@ plugins: "image code link", convert_urls: false }); - } + }); }); </script>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html index acd6861..b98688b 100644 --- a/yaksh/templates/yaksh/course_forum.html +++ b/yaksh/templates/yaksh/course_forum.html @@ -129,7 +129,7 @@ {% endwith %} </td> <td> - {% if user == course.creator %} + {% if user == course.creator or user in course.get_teachers %} <small><a href="{% url 'yaksh:hide_post' course.id post.uid %}" class="pull-right fa fa-trash"></i></a></small> {% endif %} </td> diff --git a/yaksh/templates/yaksh/lessons_forum.html b/yaksh/templates/yaksh/lessons_forum.html index 250536d..58fb360 100644 --- a/yaksh/templates/yaksh/lessons_forum.html +++ b/yaksh/templates/yaksh/lessons_forum.html @@ -61,7 +61,7 @@ {% endwith %} </td> <td> - {% if user == course.creator %} + {% if user == course.creator or user in course.get_teachers %} <small><a href="{% url 'yaksh:hide_post' course.id post.uid %}" class="pull-right fa fa-trash"></i></a></small> {% endif %} </td> diff --git a/yaksh/templates/yaksh/post_comments.html b/yaksh/templates/yaksh/post_comments.html index bc452e0..70aac47 100644 --- a/yaksh/templates/yaksh/post_comments.html +++ b/yaksh/templates/yaksh/post_comments.html @@ -38,7 +38,7 @@ {% endif %} </strong> {{post.created_at}} - {% if user == course.creator %}<a href="{% url 'yaksh:hide_post' post.target.id post.uid %}" class="pull-right fa fa-trash"></a>{% endif %} + {% if user == course.creator or user in course.get_teachers %}<a href="{% url 'yaksh:hide_post' post.target.id post.uid %}" class="pull-right fa fa-trash"></a>{% endif %} </small> </div> @@ -77,7 +77,7 @@ </strong> </div> <div class="col-6 text-right"> - <small class="text-muted">{{comment.created_at}} {% if user == course.creator %} <a href="{% url 'yaksh:hide_comment' post.target.id comment.uid %}" class="fa fa-trash"></a>{% endif %}</small> + <small class="text-muted">{{comment.created_at}} {% if user == course.creator or user in course.get_teachers %} <a href="{% url 'yaksh:hide_comment' post.target.id comment.uid %}" class="fa fa-trash"></a>{% endif %}</small> </div> </div> <p class="card-text description">{{comment.description|safe}}</p> diff --git a/yaksh/templates/yaksh/show_lesson_quiz.html b/yaksh/templates/yaksh/show_lesson_quiz.html index fb5ae6c..82e01bc 100644 --- a/yaksh/templates/yaksh/show_lesson_quiz.html +++ b/yaksh/templates/yaksh/show_lesson_quiz.html @@ -1,5 +1,16 @@ {% load custom_filters %} <script type="text/javascript"> + $(document).ready(function() { + renderMathInElement( + document.body, + { + delimiters: [ + {left: "$$", right: "$$", display: false}, + {left: "$", right: "$", display: true}, + ] + } + ); + }); function user_arranged_options() { var temp_array = [] var add_array = document.getElementById("arrange_order"); @@ -120,11 +131,11 @@ var order_array = $(arrange).sortable(['serialize']); </script> {% endif %} - {% if question.type == "mcq" or question.type == "mcc" or question.type == "integer" or question.type == "float" or question.type == "string" %} + {% if question.type == "arrange" %} + <br><button class="btn btn-success" type="submit" name="check" id="check" onClick="return user_arranged_options();">Submit</button> + {% else %} <br><button class="btn btn-success" type="submit" name="check" id="check">Submit </button> - {% elif question.type == "arrange" %} - <br><button class="btn btn-success" type="submit" name="check" id="check" onClick="return user_arranged_options();">Submit</button> {% endif %} </div> </div> diff --git a/yaksh/templates/yaksh/show_toc.html b/yaksh/templates/yaksh/show_toc.html index 104815f..4c8ffe2 100644 --- a/yaksh/templates/yaksh/show_toc.html +++ b/yaksh/templates/yaksh/show_toc.html @@ -1,20 +1,22 @@ {% 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> 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> Upload TOC - </button> - </form> + <div class="card"> + <div class="card-body"> + <a href="{% url 'yaksh:download_sample_toc' %}"> + <i class="fa fa-download"></i> Download Sample + </a> + <hr> + <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> Upload TOC + </button> + </form> + </div> </div> - <hr> + <br> {% endif %} <table class="table table-responsive"> {% for toc in contents %} diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html index 9061e70..d27293e 100644 --- a/yaksh/templates/yaksh/show_video.html +++ b/yaksh/templates/yaksh/show_video.html @@ -141,59 +141,59 @@ <!-- Lesson Table of contents --> <div class="row"> {% if lesson.video_path %} - <div class="col-md-8"> - <div class="card-body"> - {% with lesson.video_path|video_name as video %} - {% if video.1 == "others" %} - <video id="player" playsinline controls> - <source src="{{video.0}}" /> - </video> - {% else %} - <div id="player" data-plyr-provider="{{video.1}}" data-plyr-embed-id="{{video.0}}"></div> - {% endif %} - {% endwith %} - </div> - </div> - {% if toc %} - <div class="col-md-4"> - <div class="card"> - <div class="card-header"> - <a class="card-link" data-toggle="collapse" href="#toc-collapse"> - Table Of Contents <i class="fa fa-angle-down"></i> - </a> + <div class="col-md-8"> + <div class="card-body"> + {% with lesson.video_path|video_name as video %} + {% if video.1 == "others" %} + <video id="player" playsinline controls> + <source src="{{video.0}}" /> + </video> + {% else %} + <div id="player" data-plyr-provider="{{video.1}}" data-plyr-embed-id="{{video.0}}"></div> + {% endif %} + {% endwith %} </div> - <div class="collapse show" id="toc-collapse"> - <div class="card-body" id="toc"> - <table class="table table-responsive"> - {% for content in toc %} - {% with content.get_toc_text as toc_name %} - <tr> - <td> - <a href="#" onclick="select_toc(this);" data-toc="{{content.id}}" data-toc-type="{{content.content}}"> - {{ toc_name }} - </a> - </td> - <td> - {{content.get_content_display}} - </td> - <td id="toc_time_{{content.id}}"> - {{content.time}} - </td> - <input type="hidden" id="toc_{{content.id}}" value="{% url 'yaksh:get_marker_quiz' course.id content.id %}" data-content="{{content.content}}"/> - <input type="hidden" id="toc_desc_{{content.id}}" value="{{content.content_object.description|safe}}" data-content="{{content.content}}"/> - </tr> - {% endwith %} - {% empty %} - <center class=table-responsive> - <span class="badge badge-warning">No Table of contents added</span> - </center> - {% endfor %} - </table> + </div> + {% if toc %} + <div class="col-md-4"> + <div class="card"> + <div class="card-header"> + <a class="card-link" data-toggle="collapse" href="#toc-collapse"> + Table Of Contents <i class="fa fa-angle-down"></i> + </a> + </div> + <div class="collapse show" id="toc-collapse"> + <div class="card-body" id="toc" style="max-height: 400px; overflow-y: auto;"> + <table class="table table-responsive"> + {% for content in toc %} + {% with content.get_toc_text as toc_name %} + <tr> + <td> + <a href="#" onclick="select_toc(this);" data-toc="{{content.id}}" data-toc-type="{{content.content}}"> + {{ toc_name }} + </a> + </td> + <td> + {{content.get_content_display}} + </td> + <td id="toc_time_{{content.id}}"> + {{content.time}} + </td> + <input type="hidden" id="toc_{{content.id}}" value="{% url 'yaksh:get_marker_quiz' course.id content.id %}" data-content="{{content.content}}"/> + <input type="hidden" id="toc_desc_{{content.id}}" value="{{content.content_object.description|safe}}" data-content="{{content.content}}"/> + </tr> + {% endwith %} + {% empty %} + <center class=table-responsive> + <span class="badge badge-warning">No Table of contents added</span> + </center> + {% endfor %} + </table> + </div> </div> </div> </div> - </div> - {% endif %} + {% endif %} {% endif %} <div class="col-md-8"> <div class="card"> |