From: Radek Czajka Date: Mon, 22 Jul 2013 08:56:31 +0000 (+0200) Subject: Add project as course type. X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/a1fc6bb1bbb481ba116d8873ffd7cb3f4f0a6488?hp=--cc Add project as course type. --- a1fc6bb1bbb481ba116d8873ffd7cb3f4f0a6488 diff --git a/catalogue/admin.py b/catalogue/admin.py index 43488ce..f79b375 100755 --- a/catalogue/admin.py +++ b/catalogue/admin.py @@ -7,6 +7,7 @@ class AttachmentInline(admin.TabularInline): class LessonAdmin(admin.ModelAdmin): inlines = [AttachmentInline] list_display = ['title', 'section', 'type'] + list_filter = ['level', 'type'] admin.site.register(Section) admin.site.register(Lesson, LessonAdmin) diff --git a/catalogue/models.py b/catalogue/models.py index 8e6793f..3ae4490 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -71,7 +71,7 @@ class Lesson(models.Model): type = models.CharField(max_length=15, db_index=True) order = models.IntegerField(db_index=True) dc = JSONField(default='{}') - curriculum_courses = models.ManyToManyField(CurriculumCourse) + curriculum_courses = models.ManyToManyField(CurriculumCourse, blank=True) xml_file = models.FileField(upload_to="catalogue/lesson/xml", null=True, blank=True, max_length=255) diff --git a/catalogue/static/catalogue/css/section_list.css b/catalogue/static/catalogue/css/section_list.css index 1b6749a..d079abe 100644 --- a/catalogue/static/catalogue/css/section_list.css +++ b/catalogue/static/catalogue/css/section_list.css @@ -1,7 +1,8 @@ .section-level { width: 40em; - border-radius: 0.938em; - margin: 1em 0; } + border-radius: 0.9375em; + margin: 1em 0; + overflow: hidden; } .section-level a:hover { text-decoration: underline; } @@ -18,9 +19,11 @@ width: 16.25em; } .section-type-course { - border-radius: 0 0.938em 0.938em 0; width: 18.75em; } +.section-type-project { + width: 37.5em; } + .section-level-gimnazjum { background: #f4ae83; color: #67584f; } @@ -31,6 +34,8 @@ color: #fff; } .section-level-gimnazjum .section-type-course a { color: #fff; } + .section-level-gimnazjum .section-type-project { + background-color: #f8cdb2; } .section-level-liceum { background: #44b69f; @@ -42,17 +47,18 @@ color: #fff; } .section-level-liceum .section-type-course a { color: #fff; } + .section-level-liceum .section-type-project { + background-color: #9fdbcf; } .course-boxes h1 { color: #363a3e; } .course-boxes .section-level { background: white; - border: 1px solid #777; } + border: 1px solid #777777; } .course-boxes .section-level a, .course-boxes .section-level a:hover { color: #363a3e; } - .course-boxes .section-level .section-type-course { - background: white; - bborder-left: 1px solid #363a3e; } + .course-boxes .section-level .section-type { + background: white; } .section-links { float: right; } diff --git a/catalogue/static/catalogue/css/section_list.scss b/catalogue/static/catalogue/css/section_list.scss index 535ebb4..72e0f96 100755 --- a/catalogue/static/catalogue/css/section_list.scss +++ b/catalogue/static/catalogue/css/section_list.scss @@ -4,6 +4,8 @@ $px: 0.0625em; width: 640*$px; border-radius: 15*$px; margin: 1em 0; + overflow: hidden; + a:hover { text-decoration: underline; } @@ -24,9 +26,11 @@ $px: 0.0625em; width: 300*$px - 2 * 20*$px; } .section-type-course { - border-radius: 0 15*$px 15*$px 0; width: 340*$px - 2 * 20*$px; } +.section-type-project { + width: 640*$px - 2 * 20*$px; +} .section-level-gimnazjum { background: #f4ae83; @@ -44,6 +48,9 @@ $px: 0.0625em; color: #fff; } } + .section-type-project { + background-color: lighten(#f4ae83, 10); + } } @@ -63,6 +70,9 @@ $px: 0.0625em; color: #fff; } } + .section-type-project { + background-color: lighten(#44b69f, 25); + } } @@ -76,9 +86,8 @@ $px: 0.0625em; a, a:hover { color: #363a3e; } - .section-type-course { + .section-type { background: white; - bborder-left: 1px solid #363a3e; } } } diff --git a/catalogue/templates/catalogue/snippets/section_box.html b/catalogue/templates/catalogue/snippets/section_box.html index 271b6c6..bbca27a 100755 --- a/catalogue/templates/catalogue/snippets/section_box.html +++ b/catalogue/templates/catalogue/snippets/section_box.html @@ -10,6 +10,8 @@
{% if lesson_type == 'synthetic' %}

Lekcja syntetyczna

+ {% elif lesson_type == 'project' %} +

Projekt

{% else %}

Pełny kurs

{% endif %} diff --git a/curriculum/templates/curriculum/snippets/course_box.html b/curriculum/templates/curriculum/snippets/course_box.html index c647b83..f1bd074 100755 --- a/curriculum/templates/curriculum/snippets/course_box.html +++ b/curriculum/templates/curriculum/snippets/course_box.html @@ -10,6 +10,8 @@
{% if lesson_type == 'synthetic' %}

Lekcje syntetyczne

+ {% elif lesson_type == 'project' %} +

Projekty

{% else %}

Lekcje z pełnych kursów

{% endif %}