From: Radek Czajka Date: Wed, 6 Feb 2013 14:35:13 +0000 (+0100) Subject: Nicer displaying of advanced lessons. X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/84ffd6f6aeef8c7898dfa9d9d97aa323647172b7?ds=sidebyside Nicer displaying of advanced lessons. --- diff --git a/catalogue/management/commands/importlessons.py b/catalogue/management/commands/importlessons.py index 1d65d18..43823bb 100755 --- a/catalogue/management/commands/importlessons.py +++ b/catalogue/management/commands/importlessons.py @@ -88,7 +88,8 @@ class Command(BaseCommand): # We're in a loop, nothing's being imported - some lesson is really missing. raise e except BaseException, e: - print e + import trackback + trackback.print_exc() files_skipped += 1 # Print results diff --git a/catalogue/models.py b/catalogue/models.py index e5ee3a9..46338c4 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -56,10 +56,9 @@ class Section(models.Model): return section - - def syntetic_lesson(self): + def syntetic_lesson(self, level): try: - return self.lesson_set.filter(type='synthetic')[0] + return self.lesson_set.filter(type='synthetic', level=level)[0] except IndexError: return None @@ -166,6 +165,9 @@ class Lesson(models.Model): "%s%s.zip" % (self.slug, "_student" if student else ""), ContentFile(buff.getvalue())) + def get_syntetic(self): + return self.section.syntetic_lesson(self.level) + class Attachment(models.Model): slug = models.CharField(max_length=255) diff --git a/catalogue/static/catalogue/css/layout.css b/catalogue/static/catalogue/css/layout.css index b972784..0757538 100644 --- a/catalogue/static/catalogue/css/layout.css +++ b/catalogue/static/catalogue/css/layout.css @@ -42,6 +42,16 @@ #sidebar .section-minor h1 { font-weight: normal; font-size: 1em; } + #sidebar .section-micro { + font-size: .8em; + color: #888; + border-top: 1px solid #c9ccce; + padding-top: 1.063em; } + #sidebar .section-micro h1 { + font-weight: normal; + font-size: 1em; } + #sidebar .section-micro .link-list a { + color: #888; } #main-bar { width: 40em; } diff --git a/catalogue/static/catalogue/css/layout.scss b/catalogue/static/catalogue/css/layout.scss index ed4cb33..318c444 100755 --- a/catalogue/static/catalogue/css/layout.scss +++ b/catalogue/static/catalogue/css/layout.scss @@ -58,6 +58,19 @@ $new_black: #363a3e; font-size: 1em; } } + .section-micro { + font-size: .8em; + color: #888; + border-top: 1px solid #c9ccce; + padding-top: 17*$px; + h1 { + font-weight: normal; + font-size: 1em; + } + .link-list a { + color: #888; + } + } } #main-bar { width: 640*$px; diff --git a/catalogue/static/catalogue/css/section_list.css b/catalogue/static/catalogue/css/section_list.css index 2446ded..1793d85 100644 --- a/catalogue/static/catalogue/css/section_list.css +++ b/catalogue/static/catalogue/css/section_list.css @@ -2,6 +2,8 @@ width: 40em; border-radius: 0.938em; margin: 1em 0; } + .section-level a:hover { + text-decoration: underline; } .section-type { display: inline-block; @@ -24,7 +26,7 @@ .section-level-gimnazjum { background: #f4ae83; color: #67584f; } - .section-level-gimnazjum a { + .section-level-gimnazjum a, .section-level-gimnazjum a:hover { color: #67584f; } .section-level-gimnazjum .section-type-course { background: #ed7831; @@ -33,12 +35,12 @@ color: #fff; } .section-level-liceum { - background: #f4ae83; - color: #67584f; } - .section-level-liceum a { - color: #67584f; } + background: #44b69f; + color: #363a3e; } + .section-level-liceum a, .section-level-liceum a:hover { + color: #363a3e; } .section-level-liceum .section-type-course { - background: #ed7831; + background: #16a487; color: #fff; } .section-level-liceum .section-type-course a { color: #fff; } diff --git a/catalogue/static/catalogue/css/section_list.scss b/catalogue/static/catalogue/css/section_list.scss index 23f248b..141cba1 100755 --- a/catalogue/static/catalogue/css/section_list.scss +++ b/catalogue/static/catalogue/css/section_list.scss @@ -4,6 +4,9 @@ $px: 0.0625em; width: 640*$px; border-radius: 15*$px; margin: 1em 0; + a:hover { + text-decoration: underline; + } } .section-type { @@ -32,7 +35,7 @@ $px: 0.0625em; .section-level-gimnazjum { background: #f4ae83; color: #67584f; - a { + a, a:hover { color: #67584f; } @@ -49,16 +52,16 @@ $px: 0.0625em; .section-level-liceum { - background: #f4ae83; - color: #67584f; - a { - color: #67584f; + background: #44b69f; + color: #363a3e; + a, a:hover { + color: #363a3e; } .section-type-synthetic { } .section-type-course { - background: #ed7831; + background: #16a487; color: #fff; a { color: #fff; diff --git a/catalogue/templates/catalogue/lesson_detail.html b/catalogue/templates/catalogue/lesson_detail.html index 74e6c3a..629af17 100755 --- a/catalogue/templates/catalogue/lesson_detail.html +++ b/catalogue/templates/catalogue/lesson_detail.html @@ -14,7 +14,9 @@

Realizacja i czas lekcji

{% if object.type == 'synthetic' %}

To lekcja jest syntezą działu - {{ object.section }}. + {{ object.section }}{% if object.level.slug = "liceum" %} + (na poziomie zaawansowanym) + {% endif %}. Dostępny jest również szczegółowy kurs dla tego działu. @@ -22,10 +24,16 @@

Czas trwania: 45 minut.

{% elif object.type == 'course' %}

Ta lekcja jest częścią działu - {{ object.section }}. + {{ object.section }}{% if object.level.slug = "liceum" %} + (na poziomie zaawansowanym) + {% endif %}. + {% with object.get_syntetic as synth %} + {% if synth %} Dostępna jest również - lekcja syntetyczna + lekcja syntetyczna dla tego działu. + {% endif %} + {% endwith %}

Czas trwania: 45 minut.

{% else %} @@ -44,20 +52,9 @@ {% lesson_nav object %} -
-

Autor: {{ object.dc.authors|person_list }}

-

Licencja: {{ object.dc.license_description }}.

-
- -
- -
- {% if object.dc.competences %}
+

Kompetencje:

{% endif %} -
+
+

Informacje:

+

+ {% if object.dc.authors_textbook %} + Autor podręcznika: {{ object.dc.authors_textbook|person_list }}
+ {% endif %} + {% if object.dc.authors_scenario %} + Autor scenariusza: {{ object.dc.authors_scenario|person_list }}
+ {% endif %} + {% if object.dc.authors_expert %} + Ekspert: {{ object.dc.authors_expert|person_list }}
+ {% endif %} + Licencja: {{ object.dc.license_description }}.

+
+ +
+

Narzędzia:

+ +
+ +

{{ object.dc.description }}

diff --git a/catalogue/templates/catalogue/snippets/section_box.html b/catalogue/templates/catalogue/snippets/section_box.html index 6a3b6ec..8e8a581 100755 --- a/catalogue/templates/catalogue/snippets/section_box.html +++ b/catalogue/templates/catalogue/snippets/section_box.html @@ -13,15 +13,19 @@ {% else %}

Pełny kurs

{% endif %} -
{% endfor %} {% endspaceless %}