{% 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 %}
{% if object.dc.competences %}
<section class="section-minor">
<h1>Kompetencje:</h1>
- <ul class="link-list">
- {% for comp_text in object.dc.competences %}
- {% with comp_text|find_competence as competence %}
- {% if competence %}
- <li><a href="{{ competence|url_for_level:object.level }}">
- {{ competence }}</a></li>
- {% else %}
- {{ comp_text }}
- {% endif %}
- {% endwith %}
- {% endfor %}
+ <ul class="plain">
+ {% competence object.dc.competences %}
+ </ul>
+ </section>
+ {% endif %}
+
+ {% if object.dc.curriculum %}
+ <section class="section-minor">
+ <h1>Podstawa programowa:</h1>
+ <ul class="plain">
+ {% curriculum object.dc.curriculum %}
</ul>
</section>
{% endif %}
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
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)
--- /dev/null
+[
+ {
+ "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."
+ }
+ }
+]
--- /dev/null
+# 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 <EMAIL@ADDRESS>, 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 <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
+"Language-Team: LANGUAGE <LL@li.org>\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"
+
--- /dev/null
+# -*- 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
+# -*- coding: utf-8
+import re
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
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<level>[^/]+)/(?P<course>[^/]+)/"
+ "(?P<type>(?:%s))[^/]+(?P<roz>/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
+
--- /dev/null
+{% load url_for_level from curriculum_tags %}
+{% if comps %}
+ {% for comp in comps %}
+ <li><a href="{{ competence|url_for_level:object.level }}">
+ {{ competence }}</a></li>
+ {% endfor %}
+{% else %}
+ {% for text in texts %}
+ <li>{{ text }}</li>
+ {% endfor %}
+{% endif %}
+
--- /dev/null
+{% if currset %}
+ {% for what, types in currset.items %}
+ <li>
+ {{ what.0 }}, {{ what.1 }} poziom edukacyjny<br/>
+ {% for type, currs in types.items %}
+ {{ type }}:<br>
+ {% for curr in currs %}
+ {{ curr.title }}<br>
+ {% endfor %}
+ {% endfor %}
+ </li>
+ {% endfor %}
+{% else %}
+ {% for identifier in identifiers %}
+ <li>{{ identifier }}</li>
+ {% endfor %}
+{% endif %}
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):
color: #363a3e; }
.link-list a:hover {
color: #ed7831; }
+
+.plain {
+ margin: 0;
+ padding: 0;
+ list-style: none; }
+ .plain li {
+ margin: 1em 0; }
color: $oranji;
}
}
+.plain {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ li {
+ margin: 1em 0;
+ }
+}