From: Radek Czajka Date: Mon, 26 Sep 2011 08:14:38 +0000 (+0200) Subject: Diplay changes X-Git-Url: https://git.mdrn.pl/koed-quiz.git/commitdiff_plain/10dda5cd1e5bd650c06d5629dd56160ea446082a?ds=sidebyside Diplay changes --- diff --git a/apps/quiz/admin.py b/apps/quiz/admin.py index ddc66d4..ce56cc8 100644 --- a/apps/quiz/admin.py +++ b/apps/quiz/admin.py @@ -14,6 +14,15 @@ class QuestionAdmin(admin.ModelAdmin): list_display = ['title', 'quiz'] +class ResultAdmin(admin.ModelAdmin): + list_display = ['title', 'quiz'] + + +class QuizAdmin(admin.ModelAdmin): + list_display = ['name'] + + + admin.site.register(Question, QuestionAdmin) -admin.site.register(Result) -admin.site.register(Quiz) +admin.site.register(Result, ResultAdmin) +admin.site.register(Quiz, QuizAdmin) diff --git a/apps/quiz/locale/pl/LC_MESSAGES/django.mo b/apps/quiz/locale/pl/LC_MESSAGES/django.mo index 7b3fdb2..1d17194 100644 Binary files a/apps/quiz/locale/pl/LC_MESSAGES/django.mo and b/apps/quiz/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/quiz/locale/pl/LC_MESSAGES/django.po b/apps/quiz/locale/pl/LC_MESSAGES/django.po index 62433dd..94ad015 100644 --- a/apps/quiz/locale/pl/LC_MESSAGES/django.po +++ b/apps/quiz/locale/pl/LC_MESSAGES/django.po @@ -7,65 +7,70 @@ msgid "" msgstr "" "Project-Id-Version: Quiz 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-20 17:10+0200\n" -"PO-Revision-Date: 2011-09-20 17:10+0100\n" +"POT-Creation-Date: 2011-09-26 10:15+0200\n" +"PO-Revision-Date: 2011-09-26 10:16+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: forms.py:9 msgid "Please select an option" msgstr "Proszę wybrać jedną z odpowiedzi" -#: models.py:11 +#: models.py:12 msgid "quiz" msgstr "quiz" -#: models.py:12 +#: models.py:13 msgid "quizzes" msgstr "quizy" -#: models.py:40 +#: models.py:41 msgid "result" msgstr "rezultat" -#: models.py:41 +#: models.py:42 msgid "results" msgstr "rezultaty" -#: models.py:60 +#: models.py:61 msgid "question" msgstr "pytanie" -#: models.py:61 +#: models.py:62 msgid "questions" msgstr "pytania" -#: models.py:90 +#: models.py:91 msgid "answer" msgstr "odpowiedź" -#: models.py:91 +#: models.py:92 msgid "answers" msgstr "odpowiedzi" -#: templates/quiz/question_detail.html:26 templates/quiz/result_detail.html:20 +#: templates/quiz/question_detail.html:30 +msgid "Send answer" +msgstr "Wyślij odpowiedź" + +#: templates/quiz/question_detail.html:33 +#: templates/quiz/result_detail.html:24 msgid "Back to last question" msgstr "Wróć do poprzedniego pytania" -#: templates/quiz/question_detail.html:31 templates/quiz/result_detail.html:24 +#: templates/quiz/question_detail.html:38 +#: templates/quiz/result_detail.html:28 msgid "Back to my test" msgstr "Wróć do testu" -#: templates/quiz/question_detail.html:33 templates/quiz/result_detail.html:26 +#: templates/quiz/question_detail.html:40 +#: templates/quiz/result_detail.html:33 msgid "Start from the beginning" msgstr "Zacznij od początku" -#: templates/quiz/result_detail.html:32 -msgid "Start again" -msgstr "Jeszcze raz od początku" +#~ msgid "Start again" +#~ msgstr "Jeszcze raz od początku" diff --git a/apps/quiz/models.py b/apps/quiz/models.py index ccde81e..9043b74 100644 --- a/apps/quiz/models.py +++ b/apps/quiz/models.py @@ -40,6 +40,7 @@ class Result(models.Model): class Meta: verbose_name = _('result') verbose_name_plural = _('results') + ordering = ['quiz', 'title'] def __unicode__(self): return self.title diff --git a/apps/quiz/static/css/style.css b/apps/quiz/static/css/style.css index 55eac96..4b1666c 100755 --- a/apps/quiz/static/css/style.css +++ b/apps/quiz/static/css/style.css @@ -27,6 +27,7 @@ h1 { button { background: #999; color: white; + font-size: 1em; padding: 1em; text-decoration:none; border: 1px solid #ddd; @@ -37,10 +38,9 @@ button:hover { background: #aaa; } -a.big-button { +a.big-button, a.button { background: #999; color: white; - padding: 1em; text-decoration:none; border: 1px solid #ddd; border-radius: 1em; @@ -49,7 +49,15 @@ a.big-button { margin-top: 1em; } -a.big-button:hover { +a.button { + padding: .3em; +} + +a.big-button { + padding: 1em; +} + +a.big-button:hover, a.button:hover { background: #aaa; } diff --git a/apps/quiz/templates/quiz/question_detail.html b/apps/quiz/templates/quiz/question_detail.html index c74742c..48e595b 100755 --- a/apps/quiz/templates/quiz/question_detail.html +++ b/apps/quiz/templates/quiz/question_detail.html @@ -11,9 +11,11 @@

{{ question.title }}

-
-{{ question.text|safe }} -
+{% if question.test %} +
+ {{ question.text|safe }} +
+{% endif %}
@@ -33,9 +35,9 @@ {% else %} {% if valid_url %} - {% trans "Back to my test" %} + {% trans "Back to my test" %} {% else %} - {% trans "Start from the beginning" %} + {% trans "Start from the beginning" %} {% endif %} {% endif %} @@ -43,9 +45,11 @@
-
-{{ question.description|safe }} -
+{% if question.description %} +
+ {{ question.description|safe }} +
+{% endif %} {% endblock %} diff --git a/apps/quiz/templates/quiz/result_detail.html b/apps/quiz/templates/quiz/result_detail.html index 6a06ec0..2da4bfa 100755 --- a/apps/quiz/templates/quiz/result_detail.html +++ b/apps/quiz/templates/quiz/result_detail.html @@ -11,23 +11,25 @@

{{ result.title }}

-
-{{ result.text|safe }} -
+{% if result.text %} +
+ {{ result.text|safe }} +
+{% endif %} {% if valid %} {% if previous_url %} - {% trans "Back to last question" %} + {% trans "Back to last question" %} {% endif %} {% else %} {% if valid_url %} - {% trans "Back to my test" %} + {% trans "Back to my test" %} {% endif %} {% endif %} -{% trans "Start from the beginning" %} +{% trans "Start from the beginning" %} {% endblock %} diff --git a/koedquiz/locale/pl/LC_MESSAGES/django.mo b/koedquiz/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 0000000..be99f3b Binary files /dev/null and b/koedquiz/locale/pl/LC_MESSAGES/django.mo differ diff --git a/koedquiz/locale/pl/LC_MESSAGES/django.po b/koedquiz/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000..dbc6fe5 --- /dev/null +++ b/koedquiz/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-09-26 10:17+0200\n" +"PO-Revision-Date: 2011-09-26 10:17+0100\n" +"Last-Translator: Radek Czajka \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" + +#: templates/home.html:15 +msgid "Start quiz!" +msgstr "Rozpocznij quiz!" + diff --git a/koedquiz/templates/home.html b/koedquiz/templates/home.html index 1e0c763..78dd39a 100644 --- a/koedquiz/templates/home.html +++ b/koedquiz/templates/home.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load i18n %} {% block "title" %}{{ quiz.name }}{% endblock %} @@ -11,6 +12,6 @@ {{ quiz.description|safe }} -Start quiz! +{% trans "Start quiz!" %} {% endblock %}