From 10dda5cd1e5bd650c06d5629dd56160ea446082a Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 26 Sep 2011 10:14:38 +0200 Subject: [PATCH 1/1] Diplay changes --- apps/quiz/admin.py | 13 +++++- apps/quiz/locale/pl/LC_MESSAGES/django.mo | Bin 1133 -> 1127 bytes apps/quiz/locale/pl/LC_MESSAGES/django.po | 41 ++++++++++-------- apps/quiz/models.py | 1 + apps/quiz/static/css/style.css | 14 ++++-- apps/quiz/templates/quiz/question_detail.html | 20 +++++---- apps/quiz/templates/quiz/result_detail.html | 14 +++--- koedquiz/locale/pl/LC_MESSAGES/django.mo | Bin 0 -> 560 bytes koedquiz/locale/pl/LC_MESSAGES/django.po | 23 ++++++++++ koedquiz/templates/home.html | 3 +- 10 files changed, 91 insertions(+), 38 deletions(-) create mode 100644 koedquiz/locale/pl/LC_MESSAGES/django.mo create mode 100644 koedquiz/locale/pl/LC_MESSAGES/django.po 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 7b3fdb213f46b70d3c9e929779a9ba8bcb8a6421..1d1719465ef0c1d21ca864482d408bdac97d0783 100644 GIT binary patch delta 207 zcmaFM@tkAAntCAy28Q3v3=ASbnvaEnfeT10LuoxA%?{*SLTN`J4MYr{K!O!W`vGYV zARPjvIe~O6kY)tZd_W8X+&~7K8dE48>PxhhqmD6vW*KSiM+Ke_5iYe{zL IWL}mi01<2-mH+?% 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 0000000000000000000000000000000000000000..be99f3b5bb571e7b742d6da01563c6c984c31786 GIT binary patch literal 560 zcmZ{h!EV$r5QYPSOSmA;l^70Gt*93}ASh{4x?Q%_irqG(X>S~c#0}m}?bPMn(kNx}EqhA5VLt=y2As!P6(M3i)A-)jz4}#z;txt*PWT0*D zqh%du9<7J#rCPlRGHd3t^lVbG3u&D)I)-dG`aC=y!^Jp1o1C76xonN~Z02fJvBPEU zSYcuav(ti&tVB;H_6fa=A>u+X{((jBK=4?+f5jutNyu_}qq^q*)d|u~(Ro%_)UH8q zYz#S8asi_i&KC%Y#mdmh?V#)n2in}4awVO{)--N`17qt!+w4;xT`#egtdMvW!*qCZ zeBRBIOs5Bp>SSvT%`uzI#_Qq5fQKWaz0`DOe5!+qs zx;tM=%f`AimC|(#yWf-#vu0_rVMoSZxfpcYZ(aIk5B{d, 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 %} -- 2.20.1