summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorCruiseDevice2019-12-23 13:06:48 +0530
committerCruiseDevice2020-01-02 16:20:31 +0530
commit925d616c4137f014f2f55a979b2350ef0409a5b9 (patch)
treed1747de34407fde93e108810a5feeee242a8e341 /yaksh/templates
parent75e8fb06b42420f21c8571341ef8300a102cd2c7 (diff)
downloadonline_test-925d616c4137f014f2f55a979b2350ef0409a5b9.tar.gz
online_test-925d616c4137f014f2f55a979b2350ef0409a5b9.tar.bz2
online_test-925d616c4137f014f2f55a979b2350ef0409a5b9.zip
Resolve comments
- Fix PEP8 - Change the url as per django urlpattern - Replace all the buttons by <a> tag - Use get_queryset() for filtering data for pagination - Make buttons large - Add Pagination in ajax_question_filter.html - Hide Pagination when there is no question object
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/ajax_question_filter.html5
-rw-r--r--yaksh/templates/yaksh/showquestions.html30
2 files changed, 20 insertions, 15 deletions
diff --git a/yaksh/templates/yaksh/ajax_question_filter.html b/yaksh/templates/yaksh/ajax_question_filter.html
index ea0d0b5..7dba6df 100644
--- a/yaksh/templates/yaksh/ajax_question_filter.html
+++ b/yaksh/templates/yaksh/ajax_question_filter.html
@@ -16,6 +16,8 @@
});
</script>
{% if questions %}
+ {% include "yaksh/paginator.html" %}
+
<h5 class="highlight"><input type="checkbox" id="checkall">
Select All
</h5>
@@ -36,7 +38,7 @@
<td>
<input type="checkbox" name="question" value="{{ question.id }}">
</td>
- <td><a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}">{{question.summary|capfirst}}</a></td>
+ <td><a href="{% url 'yaksh:add_question' question.id %}">{{question.summary|capfirst}}</a></td>
<td>{{question.language|capfirst}}</td>
<td>{{question.type|capfirst}}</td>
<td>{{question.points}}</td>
@@ -45,5 +47,6 @@
</tbody>
</table>
</ul>
+ {% include "yaksh/paginator.html" %}
{% endif %}
</div>
diff --git a/yaksh/templates/yaksh/showquestions.html b/yaksh/templates/yaksh/showquestions.html
index 31312e2..3353e4a 100644
--- a/yaksh/templates/yaksh/showquestions.html
+++ b/yaksh/templates/yaksh/showquestions.html
@@ -46,7 +46,7 @@
</p>
</div>
<div class="card-body">
- <div><a class="btn btn-primary" href="{% url 'yaksh:download_yaml_template' %}">Download Template</a></div>
+ <div><a class="btn btn-lg btn-primary" href="{% url 'yaksh:download_yaml_template' %}">Download Template</a></div>
<br/>
<h4> Or </h4>
<form action="" method="post" enctype="multipart/form-data">
@@ -59,7 +59,7 @@
</div>
</div>
<h4>And</h4>
- <button class="btn btn-success" type="submit" name="upload" value="upload">Upload File</button>
+ <a class="btn btn-lg btn-success" type="submit" name="upload" value="upload">Upload File</a>
</form>
</div>
</div>
@@ -72,19 +72,19 @@
{% if message %}
{%if message == "Questions Uploaded Successfully"%}
<div class="alert alert-success alert-dismissable">
- <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
+ <a href="#" class="close" data-dismiss="alert" aria-label="close"><span class="fa fa-window-close"></span></a>
{{ message }}
</div>
{%else %}
<div class="alert alert-danger alert-dismissable">
- <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
+ <a href="#" class="close" data-dismiss="alert" aria-label="close"><span class="fa fa-window-close"></span></a>
{{ message }}
</div>
{% endif %}
{% endif %}
{% if msg %}
<div class="alert alert-danger alert-dismissable animated flash">
- <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
+ <a href="#" class="close" data-dismiss="alert" aria-label="close"><span class="fa fa-window-close"></span></a>
{{ msg }}
</div>
{% endif %}
@@ -112,7 +112,7 @@
</div>
<input type="text" name="question_tags" id="question_tags" class="form-control" type="search" placeholder="Search using comma separated Tags">
<span class="input-group-append">
- <button class="btn btn-outline-secondary" type="submit"><i class="fa fa-search yakshred"></i></button>
+ <a class="btn btn-outline-secondary" type="submit"><i class="fa fa-search yakshred"></i></a>
</span>
</div>
</div>
@@ -133,13 +133,14 @@
</div>
</div>
<br/>
- <button class="btn btn-primary" type="button" onClick='location.replace("{{URL_ROOT}}");'>
- Clear Filters</button>
+ <a class="btn btn-lg btn-primary" type="button" onClick='location.replace("{% url 'yaksh:show_questions' %}");'>
+ Clear Filters</a>
</div>
</div>
<div id="filtered-questions">
{% if questions %}
<div>
+ {% include "yaksh/paginator.html" %}
<br>
<h5><input id="checkall" type="checkbox"> Select All </h5>
<div class="table-wrapper-2">
@@ -159,7 +160,7 @@
<td>
<input type="checkbox" name="question" value="{{ question.id }}">
</td>
- <td><a href="{{URL_ROOT}}/exam/manage/addquestion/{{ question.id }}">{{question.summary|capfirst}}</a></td>
+ <td><a href="{% url 'yaksh:add_question' question.id %}">{{question.summary|capfirst}}</a></td>
<td>{{question.language|capfirst}}</td>
<td>{{question.type|capfirst}}</td>
<td>{{question.points}}</td>
@@ -169,16 +170,17 @@
</table>
</div>
</div>
+ {% include "yaksh/paginator.html" %}
{% endif %}
</div>
- {% include "yaksh/paginator.html" %}
<center>
- <button class="btn btn-primary" type="button" onclick='location.replace("{{URL_ROOT}}/exam/manage/addquestion/");'>Add Question</button>
+ <a class="btn btn-lg btn-primary" type="button" onclick='location.replace("{% url 'yaksh:add_question' %}");'>Add Question</a>
+
{% if questions %}
- <button class="btn btn-primary" type="submit" name='download' value='download'>Download Selected</button>
- <button class="btn btn-primary" type="submit" name="test" value="test">Test Selected</button>
+ <a class="btn btn-lg btn-primary" type="submit" name='download' value='download'>Download Selected</a>
+ <a class="btn btn-lg btn-primary" type="submit" name="test" value="test">Test Selected</a>
{% endif %}
- <button class="btn btn-danger" type="submit" onClick="return confirm_delete(frm);" name='delete' value='delete'>Delete Selected</button>
+ <a class="btn btn-lg btn-danger" type="submit" onClick="return confirm_delete(frm);" name='delete' value='delete'>Delete Selected</a>
</center>
</form>
</div>