From: Radek Czajka Date: Fri, 8 Feb 2013 12:07:06 +0000 (+0100) Subject: official curriculum X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/cf52e60f9665dc878fc2b3ab9db17d981c52030b?ds=inline official curriculum --- diff --git a/catalogue/templates/catalogue/lesson_detail.html b/catalogue/templates/catalogue/lesson_detail.html index c22a74c..6ccce2d 100755 --- a/catalogue/templates/catalogue/lesson_detail.html +++ b/catalogue/templates/catalogue/lesson_detail.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load url from future %} {% load lesson_nav person_list from catalogue_tags %} -{% load find_competence url_for_level from curriculum_tags %} +{% load competence curriculum url_for_level from curriculum_tags %} {% block title %}{{ object }}{% endblock %} @@ -55,17 +55,17 @@ {% if object.dc.competences %}

Kompetencje:

-
+ {% endif %} + + {% if object.dc.curriculum %} +
+

Podstawa programowa:

+
{% endif %} diff --git a/curriculum/admin.py b/curriculum/admin.py index d825e6f..275baf8 100755 --- a/curriculum/admin.py +++ b/curriculum/admin.py @@ -1,5 +1,6 @@ from django.contrib import admin -from .models import Competence, CompetenceLevel, Level, Section +from .models import (Competence, CompetenceLevel, Level, Section, + CurriculumCourse, CurriculumLevel, Curriculum) class CompetenceLevelInline(admin.TabularInline): model = CompetenceLevel @@ -21,3 +22,7 @@ class SectionAdmin(admin.ModelAdmin): admin.site.register(Level, LevelAdmin) admin.site.register(Section, SectionAdmin) admin.site.register(Competence, CompetenceAdmin) + +admin.site.register(CurriculumCourse) +admin.site.register(CurriculumLevel) +admin.site.register(Curriculum) diff --git a/curriculum/fixtures/curriculum.json b/curriculum/fixtures/curriculum.json new file mode 100644 index 0000000..286018d --- /dev/null +++ b/curriculum/fixtures/curriculum.json @@ -0,0 +1,562 @@ +[ + { + "pk": 1, + "model": "curriculum.curriculumlevel", + "fields": { + "title": "III" + } + }, + { + "pk": 2, + "model": "curriculum.curriculumlevel", + "fields": { + "title": "IV" + } + }, + { + "pk": 1, + "model": "curriculum.curriculumcourse", + "fields": { + "slug": "POLSKI", + "title": "J\u0119zyk polski" + } + }, + { + "pk": 2, + "model": "curriculum.curriculumcourse", + "fields": { + "slug": "PLASTYKA", + "title": "Plastyka" + } + }, + { + "pk": 3, + "model": "curriculum.curriculumcourse", + "fields": { + "slug": "WOS", + "title": "Wiedza o spo\u0142ecze\u0144stwie" + } + }, + { + "pk": 4, + "model": "curriculum.curriculumcourse", + "fields": { + "slug": "INFORMATYKA", + "title": "Informatyka" + } + }, + { + "pk": 5, + "model": "curriculum.curriculumcourse", + "fields": { + "slug": "ETYKA", + "title": "Etyka" + } + }, + { + "pk": 1, + "model": "curriculum.curriculum", + "fields": { + "course": 1, + "level": 1, + "identifier": "2012/III/POLSKI/c1", + "type": "c", + "title": "I. Odbi\u00f3r wypowiedzi i wykorzystanie zawartych w nich informacji." + } + }, + { + "pk": 2, + "model": "curriculum.curriculum", + "fields": { + "course": 1, + "level": 1, + "identifier": "2012/III/POLSKI/c2", + "type": "c", + "title": "II. Analiza i interpretacja tekst\u00f3w kultury." + } + }, + { + "pk": 3, + "model": "curriculum.curriculum", + "fields": { + "course": 1, + "level": 1, + "identifier": "2012/III/POLSKI/c3", + "type": "c", + "title": "III. Tworzenie wypowiedzi." + } + }, + { + "pk": 4, + "model": "curriculum.curriculum", + "fields": { + "course": 2, + "level": 1, + "identifier": "2012/III/PLASTYKA/c1", + "type": "c", + "title": "I. Odbi\u00f3r wypowiedzi i wykorzystanie zawartych w nich informacji \u2013 percepcja sztuki." + } + }, + { + "pk": 5, + "model": "curriculum.curriculum", + "fields": { + "course": 2, + "level": 1, + "identifier": "2012/III/PLASTYKA/c2", + "type": "c", + "title": "II. Tworzenie wypowiedzi \u2013 ekspresja przez sztuk\u0119." + } + }, + { + "pk": 6, + "model": "curriculum.curriculum", + "fields": { + "course": 2, + "level": 1, + "identifier": "2012/III/PLASTYKA/c3", + "type": "c", + "title": "III. Analiza i interpretacja tekst\u00f3w kultury \u2013 recepcja sztuki." + } + }, + { + "pk": 7, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/c1", + "type": "c", + "title": "I. Wykorzystanie i tworzenie informacji." + } + }, + { + "pk": 8, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/c2", + "type": "c", + "title": "II. Rozpoznawanie i rozwi\u0105zywanie problem\u00f3w." + } + }, + { + "pk": 9, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/c3", + "type": "c", + "title": "III. Wsp\u00f3\u0142dzia\u0142anie w sprawach publicznych." + } + }, + { + "pk": 10, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/c4", + "type": "c", + "title": "IV. Znajomo\u015b\u0107 zasad i procedur demokracji." + } + }, + { + "pk": 11, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/c5", + "type": "c", + "title": "V. Znajomo\u015b\u0107 podstaw ustroju Rzeczypospolitej Polskiej." + } + }, + { + "pk": 12, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t1", + "type": "t", + "title": "Podstawowe umiej\u0119tno\u015bci \u017cycia w grupie." + } + }, + { + "pk": 13, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t2", + "type": "t", + "title": "\u017bycie spo\u0142eczne" + } + }, + { + "pk": 14, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t3", + "type": "t", + "title": "Wsp\u00f3\u0142czesne spo\u0142ecze\u0144stwo polskie." + } + }, + { + "pk": 15, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t4", + "type": "t", + "title": "By\u0107 obywatelem." + } + }, + { + "pk": 16, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t5", + "type": "t", + "title": "Udzia\u0142 obywateli w \u017cyciu publicznym" + } + }, + { + "pk": 17, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t6", + "type": "t", + "title": "\u015arodki masowego przekazu." + } + }, + { + "pk": 18, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t9", + "type": "t", + "title": "Patriotyzm dzisiaj." + } + }, + { + "pk": 19, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t10", + "type": "t", + "title": "Pa\u0144stwo i w\u0142adza demokratyczna." + } + }, + { + "pk": 20, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t11", + "type": "t", + "title": "Rzeczpospolita Polska jako demokracja konstytucyjna." + } + }, + { + "pk": 21, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t24", + "type": "t", + "title": "Praca i przedsi\u0119biorczo\u015b\u0107." + } + }, + { + "pk": 22, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t25", + "type": "t", + "title": "Gospodarka rynkowa." + } + }, + { + "pk": 23, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 1, + "identifier": "2012/III/WOS/t26", + "type": "t", + "title": "Gospodarstwo domowe." + } + }, + { + "pk": 24, + "model": "curriculum.curriculum", + "fields": { + "course": 4, + "level": 1, + "identifier": "2012/III/INFORMATYKA/c1", + "type": "c", + "title": "I. Bezpieczne pos\u0142ugiwanie si\u0119 komputerem i jego oprogramowaniem, wykorzystanie sieci komputerowej; komunikowanie si\u0119 za pomoc\u0105 komputera i technologii informacyjno-komunikacyjnych." + } + }, + { + "pk": 25, + "model": "curriculum.curriculum", + "fields": { + "course": 4, + "level": 1, + "identifier": "2012/III/INFORMATYKA/c2", + "type": "c", + "title": "II. Wyszukiwanie, gromadzenie i przetwarzanie informacji z r\u00f3\u017cnych \u017ar\u00f3de\u0142; opracowywanie za pomoc\u0105 komputera: rysunk\u00f3w, tekst\u00f3w, danych liczbowych, motyw\u00f3w, animacji, prezentacji multimedialnych." + } + }, + { + "pk": 26, + "model": "curriculum.curriculum", + "fields": { + "course": 4, + "level": 1, + "identifier": "2012/III/INFORMATYKA/c5", + "type": "c", + "title": "V. Ocena zagro\u017ce\u0144 i ogranicze\u0144, docenianie spo\u0142ecznych aspekt\u00f3w rozwoju i zastosowa\u0144 informatyki." + } + }, + { + "pk": 27, + "model": "curriculum.curriculum", + "fields": { + "course": 5, + "level": 1, + "identifier": "2012/III/ETYKA/c1", + "type": "c", + "title": "I. Kszta\u0142towanie refleksyjnej postawy wobec cz\u0142owieka, jego natury, powinno\u015bci moralnych oraz wobec r\u00f3\u017cnych sytuacji \u017cyciowych." + } + }, + { + "pk": 28, + "model": "curriculum.curriculum", + "fields": { + "course": 5, + "level": 1, + "identifier": "2012/III/ETYKA/c4", + "type": "c", + "title": "IV. Podj\u0119cie odpowiedzialno\u015bci za siebie i innych oraz za dokonywane wybory moralne; rozstrzyganie w\u0105tpliwo\u015bci i problem\u00f3w moralnych zgodnie z przyj\u0119t\u0105 hierarchi\u0105 warto\u015bci i dobrem wsp\u00f3lnym." + } + }, + { + "pk": 29, + "model": "curriculum.curriculum", + "fields": { + "course": 5, + "level": 1, + "identifier": "2012/III/ETYKA/t1", + "type": "t", + "title": "Cz\u0142owiek jako osoba; natura i godno\u015b\u0107 cz\u0142owieka." + } + }, + { + "pk": 30, + "model": "curriculum.curriculum", + "fields": { + "course": 5, + "level": 1, + "identifier": "2012/III/ETYKA/t5", + "type": "t", + "title": "Cz\u0142owiek wobec warto\u015bci; cz\u0142owiek wobec cierpienia i \u015bmierci." + } + }, + { + "pk": 31, + "model": "curriculum.curriculum", + "fields": { + "course": 5, + "level": 1, + "identifier": "2012/III/ETYKA/t9", + "type": "t", + "title": "Normy i warto\u015bci demokratyczne le\u017c\u0105ce u podstaw aktywno\u015bci spo\u0142ecznej na poziomie ma\u0142ej grupy, szko\u0142y, spo\u0142eczno\u015bci lokalnej." + } + }, + { + "pk": 32, + "model": "curriculum.curriculum", + "fields": { + "course": 5, + "level": 1, + "identifier": "2012/III/ETYKA/t11", + "type": "t", + "title": "Praca i jej warto\u015b\u0107 dla cz\u0142owieka, znaczenie etyki zawodowej." + } + }, + { + "pk": 33, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/c4", + "type": "c", + "title": "IV. Znajomo\u015b\u0107 zasad i procedur demokracji." + } + }, + { + "pk": 34, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/c6", + "type": "c", + "title": "VI. Znajomo\u015b\u0107 praw cz\u0142owieka i sposob\u00f3w ich ochrony." + } + }, + { + "pk": 35, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t1", + "type": "t", + "title": "M\u0142ody obywatel w urz\u0119dzie." + } + }, + { + "pk": 36, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t2", + "type": "t", + "title": "Prawo i s\u0105dy." + } + }, + { + "pk": 37, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t5", + "type": "t", + "title": "Prawa cz\u0142owieka." + } + }, + { + "pk": 38, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t6", + "type": "t", + "title": "Ochrona praw i wolno\u015bci." + } + }, + { + "pk": 39, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t10/roz", + "type": "t", + "title": "Edukacja w XXI w. (zakres rozszerzony)" + } + }, + { + "pk": 40, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t14/roz", + "type": "t", + "title": "\u015arodki masowego przekazu. (zakres rozszerzony)" + } + }, + { + "pk": 41, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t15/roz", + "type": "t", + "title": "Demokracja \u2013 zasady i procedury. (zakres rozszerzony)" + } + }, + { + "pk": 42, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t27/roz", + "type": "t", + "title": "Organy kontroli pa\u0144stwowej, ochrony prawa i zaufania publicznego. (zakres rozszerzony)" + } + }, + { + "pk": 43, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t32/roz", + "type": "t", + "title": "Prawo cywilne i rodzinne. (zakres rozszerzony)" + } + }, + { + "pk": 44, + "model": "curriculum.curriculum", + "fields": { + "course": 3, + "level": 2, + "identifier": "2012/IV/WOS/t36/roz", + "type": "t", + "title": "Obywatel wobec prawa. (zakres rozszerzony)" + } + }, + { + "pk": 45, + "model": "curriculum.curriculum", + "fields": { + "course": 4, + "level": 2, + "identifier": "2012/IV/INFORMATYKA/c1", + "type": "c", + "title": "I. Bezpieczne pos\u0142ugiwanie si\u0119 komputerem i jego oprogramowaniem, wykorzystanie sieci komputerowej; komunikowanie si\u0119 za pomoc\u0105 komputera i technologii informacyjno-komunikacyjnych." + } + }, + { + "pk": 46, + "model": "curriculum.curriculum", + "fields": { + "course": 4, + "level": 2, + "identifier": "2012/IV/INFORMATYKA/c5", + "type": "c", + "title": "V. Ocena zagro\u017ce\u0144 i ogranicze\u0144, docenianie spo\u0142ecznych aspekt\u00f3w rozwoju i zastosowa\u0144 informatyki." + } + } +] diff --git a/curriculum/locale/pl/LC_MESSAGES/django.mo b/curriculum/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 0000000..51d7de4 Binary files /dev/null and b/curriculum/locale/pl/LC_MESSAGES/django.mo differ diff --git a/curriculum/locale/pl/LC_MESSAGES/django.po b/curriculum/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000..3c5d709 --- /dev/null +++ b/curriculum/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,101 @@ +# 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: 2013-02-08 13:11+0100\n" +"PO-Revision-Date: 2013-02-08 13:16+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" + +#: models.py:8 +#: models.py:22 +#: models.py:47 +msgid "name" +msgstr "nazwa" + +#: models.py:9 +#: models.py:23 +#: models.py:48 +msgid "slug" +msgstr "" + +#: models.py:10 +#: models.py:24 +#: models.py:49 +msgid "order" +msgstr "kolejność" + +#: models.py:14 +msgid "section" +msgstr "dział" + +#: models.py:15 +msgid "sections" +msgstr "działy" + +#: models.py:28 +msgid "competence" +msgstr "kompetencja" + +#: models.py:29 +msgid "competences" +msgstr "kompetencje" + +#: models.py:46 +msgid "group" +msgstr "grupa" + +#: models.py:53 +msgid "educational level" +msgstr "poziom edukacyjny" + +#: models.py:54 +msgid "educational levels" +msgstr "poziomy edukacyjne" + +#: models.py:62 +msgid "description" +msgstr "opis" + +#: models.py:66 +msgid "competence on level" +msgstr "kompetencja na poziomie" + +#: models.py:67 +msgid "competences on levels" +msgstr "kompetencje na poziomach" + +#: models.py:81 +msgid "curriculum level" +msgstr "poziom w podstawie programowej" + +#: models.py:82 +msgid "curriculum levels" +msgstr "poziomy w podstawie programowej" + +#: models.py:93 +msgid "curriculum course" +msgstr "przedmiot w podstawie programowej" + +#: models.py:94 +msgid "curriculum courses" +msgstr "przedmioty w podstawie programowej" + +#: models.py:111 +msgid "curriculum item" +msgstr "pozycja w podstawie programowej" + +#: models.py:112 +msgid "curriculum items" +msgstr "podstawa programowa" + diff --git a/curriculum/migrations/0004_auto__add_curriculum__add_curriculumlevel__add_curriculumcourse.py b/curriculum/migrations/0004_auto__add_curriculum__add_curriculumlevel__add_curriculumcourse.py new file mode 100644 index 0000000..3a45ff5 --- /dev/null +++ b/curriculum/migrations/0004_auto__add_curriculum__add_curriculumlevel__add_curriculumcourse.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding model 'Curriculum' + db.create_table('curriculum_curriculum', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('identifier', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), + ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), + ('course', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['curriculum.CurriculumCourse'])), + ('level', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['curriculum.CurriculumLevel'])), + ('type', self.gf('django.db.models.fields.CharField')(max_length=16)), + )) + db.send_create_signal('curriculum', ['Curriculum']) + + # Adding model 'CurriculumLevel' + db.create_table('curriculum_curriculumlevel', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('title', self.gf('django.db.models.fields.CharField')(max_length=16, db_index=True)), + )) + db.send_create_signal('curriculum', ['CurriculumLevel']) + + # Adding model 'CurriculumCourse' + db.create_table('curriculum_curriculumcourse', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), + ('slug', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), + )) + db.send_create_signal('curriculum', ['CurriculumCourse']) + + + def backwards(self, orm): + # Deleting model 'Curriculum' + db.delete_table('curriculum_curriculum') + + # Deleting model 'CurriculumLevel' + db.delete_table('curriculum_curriculumlevel') + + # Deleting model 'CurriculumCourse' + db.delete_table('curriculum_curriculumcourse') + + + models = { + 'curriculum.competence': { + 'Meta': {'ordering': "['order']", 'object_name': 'Competence'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'order': ('django.db.models.fields.IntegerField', [], {}), + 'section': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['curriculum.Section']"}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}) + }, + 'curriculum.competencelevel': { + 'Meta': {'ordering': "['competence', 'level']", 'object_name': 'CompetenceLevel'}, + 'competence': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['curriculum.Competence']"}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'level': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['curriculum.Level']"}) + }, + 'curriculum.curriculum': { + 'Meta': {'object_name': 'Curriculum'}, + 'course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['curriculum.CurriculumCourse']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'level': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['curriculum.CurriculumLevel']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '16'}) + }, + 'curriculum.curriculumcourse': { + 'Meta': {'object_name': 'CurriculumCourse'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'slug': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) + }, + 'curriculum.curriculumlevel': { + 'Meta': {'object_name': 'CurriculumLevel'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_index': 'True'}) + }, + 'curriculum.level': { + 'Meta': {'ordering': "['order']", 'object_name': 'Level'}, + 'group': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'order': ('django.db.models.fields.IntegerField', [], {}), + 'slug': ('django.db.models.fields.CharField', [], {'max_length': '255'}) + }, + 'curriculum.section': { + 'Meta': {'ordering': "['order']", 'object_name': 'Section'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'order': ('django.db.models.fields.IntegerField', [], {}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}) + } + } + + complete_apps = ['curriculum'] \ No newline at end of file diff --git a/curriculum/models.py b/curriculum/models.py index 8b99f61..14c916f 100644 --- a/curriculum/models.py +++ b/curriculum/models.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 +import re from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ @@ -69,3 +71,72 @@ class CompetenceLevel(models.Model): def get_absolute_url(self): return "%s?c=%d&level=%s&d=1" % (reverse("curriculum"), self.competence.pk, self.level.slug) + + + +class CurriculumLevel(models.Model): + title = models.CharField(max_length=16, db_index=True) + + class Meta: + verbose_name = _("curriculum level") + verbose_name_plural = _("curriculum levels") + + def __unicode__(self): + return self.title + + +class CurriculumCourse(models.Model): + title = models.CharField(max_length=255) + slug = models.CharField(max_length=255, db_index=True) + + class Meta: + verbose_name = _("curriculum course") + verbose_name_plural = _("curriculum courses") + + def __unicode__(self): + return self.title + + +class Curriculum(models.Model): + """Official curriculum.""" + TYPES = {'c': u'Cele kształcenia', 't': u'Treści nauczania'} + + identifier = models.CharField(max_length=255, db_index=True) + title = models.CharField(max_length=255) + course = models.ForeignKey(CurriculumCourse) + level = models.ForeignKey(CurriculumLevel) + type = models.CharField(max_length=16, choices=TYPES.items()) + + class Meta: + verbose_name = _("curriculum item") + verbose_name_plural = _("curriculum items") + + def __unicode__(self): + return self.identifier + + @classmethod + def from_text(cls, identifier, title): + m = re.match(r"^\d+/(?P[^/]+)/(?P[^/]+)/" + "(?P(?:%s))[^/]+(?P/roz)?" % + "|".join(cls.TYPES), identifier) + assert m is not None, "Curriculum identifier doesn't match template." + level, created = CurriculumLevel.objects.get_or_create( + title=m.group('level')) + course, created = CurriculumCourse.objects.get_or_create( + slug=m.group('course'), + defaults={'title': m.group('course').title()}) + type_ = m.group('type') + if m.group('roz'): + title += " (zakres rozszerzony)" + + try: + curr = cls.objects.get(identifier=identifier) + except cls.DoesNotExist: + curr = cls(identifier=identifier) + curr.title = title + curr.course = course + curr.level = level + curr.type = type_ + curr.save() + return curr + diff --git a/curriculum/templates/curriculum/snippets/competence.html b/curriculum/templates/curriculum/snippets/competence.html new file mode 100755 index 0000000..5fa071c --- /dev/null +++ b/curriculum/templates/curriculum/snippets/competence.html @@ -0,0 +1,12 @@ +{% load url_for_level from curriculum_tags %} +{% if comps %} + {% for comp in comps %} +
  • + {{ competence }}
  • + {% endfor %} +{% else %} + {% for text in texts %} +
  • {{ text }}
  • + {% endfor %} +{% endif %} + diff --git a/curriculum/templates/curriculum/snippets/curriculum.html b/curriculum/templates/curriculum/snippets/curriculum.html new file mode 100755 index 0000000..ea4f3fb --- /dev/null +++ b/curriculum/templates/curriculum/snippets/curriculum.html @@ -0,0 +1,17 @@ +{% if currset %} + {% for what, types in currset.items %} +
  • + {{ what.0 }}, {{ what.1 }} poziom edukacyjny
    + {% for type, currs in types.items %} + {{ type }}:
    + {% for curr in currs %} + {{ curr.title }}
    + {% endfor %} + {% endfor %} +
  • + {% endfor %} +{% else %} + {% for identifier in identifiers %} +
  • {{ identifier }}
  • + {% endfor %} +{% endif %} diff --git a/curriculum/templatetags/curriculum_tags.py b/curriculum/templatetags/curriculum_tags.py index 9981411..00959ee 100755 --- a/curriculum/templatetags/curriculum_tags.py +++ b/curriculum/templatetags/curriculum_tags.py @@ -1,15 +1,42 @@ from django import template -from ..models import Competence +from django.utils.datastructures import SortedDict +from ..models import Competence, Curriculum register = template.Library() -@register.filter -def find_competence(text): +@register.inclusion_tag("curriculum/snippets/competence.html") +def competence(texts): try: - return Competence.from_text(text) + comps = [Competence.from_text(text) for text in texts] except: - return None + return {'texts': texts} + return { + 'comps': comps, + } + +@register.inclusion_tag("curriculum/snippets/curriculum.html") +def curriculum(identifiers): + try: + currs = [Curriculum.objects.get(identifier=identifier) + for identifier in identifiers] + except Curriculum.DoesNotExist: + return {'identifiers': identifiers} + + currset = SortedDict() + for curr in currs: + k = curr.course, curr.level + if k not in currset: + currset[k] = SortedDict() + typename = Curriculum.TYPES[curr.type] + if typename not in currset[k]: + currset[k][typename] = [] + currset[k][typename].append(curr) + + return { + 'currset': currset, + } + @register.filter def url_for_level(comp, level): diff --git a/edumed/static/css/base.css b/edumed/static/css/base.css index c971f39..126a98f 100644 --- a/edumed/static/css/base.css +++ b/edumed/static/css/base.css @@ -169,3 +169,10 @@ footer.main { color: #363a3e; } .link-list a:hover { color: #ed7831; } + +.plain { + margin: 0; + padding: 0; + list-style: none; } + .plain li { + margin: 1em 0; } diff --git a/edumed/static/css/base.scss b/edumed/static/css/base.scss index e2be168..093c979 100644 --- a/edumed/static/css/base.scss +++ b/edumed/static/css/base.scss @@ -219,3 +219,11 @@ footer.main { color: $oranji; } } +.plain { + margin: 0; + padding: 0; + list-style: none; + li { + margin: 1em 0; + } +}