From 75e8fb06b42420f21c8571341ef8300a102cd2c7 Mon Sep 17 00:00:00 2001
From: CruiseDevice
Date: Thu, 2 Jan 2020 16:18:59 +0530
Subject: Resolve conflicts
---
yaksh/forms.py | 11 +-
yaksh/static/yaksh/css/custom.css | 9 ++
yaksh/templates/base.html | 3 +-
yaksh/templates/yaksh/showquestions.html | 268 ++++++++++++++-----------------
yaksh/views.py | 9 ++
5 files changed, 146 insertions(+), 154 deletions(-)
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 8cc3d0a..4a90ef7 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -295,13 +295,16 @@ class QuestionFilterForm(forms.Form):
points_options = [(None, 'Select Marks')]
points_options.extend([(point, point) for point in points_list])
self.fields['marks'] = forms.FloatField(
- widget=forms.Select(choices=points_options)
+ widget=forms.Select(choices=points_options,
+ attrs={'class': 'custom-select'})
)
self.fields['marks'].required = False
language = forms.CharField(
- max_length=8, widget=forms.Select(choices=languages))
+ max_length=8, widget=forms.Select(choices=languages,
+ attrs={'class': 'custom-select'}))
question_type = forms.CharField(
- max_length=8, widget=forms.Select(choices=question_types)
+ max_length=8, widget=forms.Select(choices=question_types,
+ attrs={'class': 'custom-select'})
)
@@ -396,7 +399,7 @@ class ProfileForm(forms.ModelForm):
)
class UploadFileForm(forms.Form):
- file = forms.FileField()
+ file = forms.FileField(widget=forms.FileInput(attrs={'class':'upload'}))
class QuestionPaperForm(forms.ModelForm):
diff --git a/yaksh/static/yaksh/css/custom.css b/yaksh/static/yaksh/css/custom.css
index d0d5c82..55d5d6d 100644
--- a/yaksh/static/yaksh/css/custom.css
+++ b/yaksh/static/yaksh/css/custom.css
@@ -24,6 +24,15 @@ body, .dropdown-menu {
font-size: 1.25rem;
}
+.base-content {
+ padding-top: 5em;
+ padding-bottom: 5em;
+}
+
#login-btn, #signup-btn, #forgot-btn{
width: 75%;
}
+
+.dropdown {
+ display: flex;
+}
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html
index 9021e3d..0cfe8a3 100644
--- a/yaksh/templates/base.html
+++ b/yaksh/templates/base.html
@@ -43,7 +43,6 @@
{% block script %}
{% endblock %}
-
@@ -58,7 +57,7 @@
{% block nav %}
{% endblock %}
-
+
diff --git a/yaksh/templates/yaksh/showquestions.html b/yaksh/templates/yaksh/showquestions.html
index e146878..31312e2 100644
--- a/yaksh/templates/yaksh/showquestions.html
+++ b/yaksh/templates/yaksh/showquestions.html
@@ -1,39 +1,38 @@
{% extends "manage.html" %}
+{% load staticfiles %}
{% block title %} Questions {% endblock %}
{% block pagetitle %} Questions {% endblock pagetitle %}
{% block script %}
-
-
-
+
+
+
{% endblock %}
{% block content %}
-
-
-
-
-
-
-
-
-
-
-
-
You can upload question files the following ways -
-
Yaml File
+
+
+
+
+
+
+
+
+
+
You can upload question files the following ways -
+
Yaml File
One can upload Yaml file with extensions .yaml or .yml. Please note
that you cannot upload files associated to a question. Yaml file can
have any name.
-
-
Zip File
- One can also upload zip with the following zip structure -
+
+
Zip File
+ One can also upload zip with the following zip structure -
.zip
|-- .yaml or .yml
@@ -43,87 +42,82 @@
|-- folder2
| |-- Files required by questions
-
-
-
-
+
-
-
+
+
-
-
And
- Upload File
+ Upload File
@@ -72,19 +72,19 @@
{% if message %}
{%if message == "Questions Uploaded Successfully"%}
{%else %}
{% endif %}
{% endif %}
{% if msg %}
{% endif %}
@@ -112,7 +112,7 @@
-
+
@@ -133,13 +133,14 @@
-
- Clear Filters
+
+ Clear Filters
{% if questions %}
+ {% include "yaksh/paginator.html" %}
{% endif %}
- {% include "yaksh/paginator.html" %}
- Add Question
+ Add Question
+
{% if questions %}
- Download Selected
- Test Selected
+ Download Selected
+ Test Selected
{% endif %}
- Delete Selected
+ Delete Selected
diff --git a/yaksh/views.py b/yaksh/views.py
index d82d4e0..f5a4b82 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1324,10 +1324,21 @@ def ajax_questions_filter(request):
if language:
filter_dict['language'] = str(language)
- questions = Question.objects.filter(**filter_dict)
-
+ questions = Question.objects.get_queryset().filter(
+ **filter_dict).order_by('id')
+ paginator = Paginator(questions, 10)
+ page = request.GET.get('page')
+ try:
+ questions = paginator.page(page)
+ except PageNotAnInteger:
+ questions = paginator.page(1)
+ except EmptyPage:
+ questions = paginator.page(paginator.num_pages)
return my_render_to_response(
- request, 'yaksh/ajax_question_filter.html', {'questions': questions}
+ request, 'yaksh/ajax_question_filter.html', {
+ 'questions': questions,
+ 'objects': questions
+ }
)
@@ -1492,7 +1503,8 @@ def show_all_questions(request):
if not is_moderator(user):
raise Http404("You are not allowed to view this page !")
- questions = Question.objects.filter(user_id=user.id, active=True)
+ questions = Question.objects.get_queryset().filter(
+ user_id=user.id, active=True).order_by('id')
form = QuestionFilterForm(user=user)
user_tags = questions.values_list('tags', flat=True).distinct()
all_tags = Tag.objects.filter(id__in=user_tags)
--
cgit
From 122e841eecd8d322eba1c24dadde392617a5c231 Mon Sep 17 00:00:00 2001
From: CruiseDevice
Date: Thu, 26 Dec 2019 15:10:29 +0530
Subject: Resolve comments
---
yaksh/templates/yaksh/showquestions.html | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/yaksh/templates/yaksh/showquestions.html b/yaksh/templates/yaksh/showquestions.html
index 3353e4a..d0c33dd 100644
--- a/yaksh/templates/yaksh/showquestions.html
+++ b/yaksh/templates/yaksh/showquestions.html
@@ -59,7 +59,7 @@
And
- Upload File
+ Upload File
@@ -133,13 +133,14 @@
-
+
Clear Filters
--
cgit
From e7f83b0f9e098ffb4066fce50f1d60972b5edfcb Mon Sep 17 00:00:00 2001
From: CruiseDevice
Date: Thu, 2 Jan 2020 16:16:29 +0530
Subject: set template debug to True to avoid restarting django server
---
online_test/settings.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/online_test/settings.py b/online_test/settings.py
index 6838865..6ff31f8 100644
--- a/online_test/settings.py
+++ b/online_test/settings.py
@@ -165,7 +165,7 @@ TEMPLATES = [
'social_django.context_processors.login_redirect',
'django.contrib.messages.context_processors.messages',
],
- 'debug': False,
+ 'debug': True, # make this False in production
}
},
]
--
cgit