diff --git a/courses/courses.yml b/courses/courses.yml index b6bc9fbe29..5d548135d8 100644 --- a/courses/courses.yml +++ b/courses/courses.yml @@ -1,6 +1,9 @@ -- name: Začátečnický kurz Pyladies - description: Naučte se Python vážně od začátku. Žádné předchozí znalosti nejsou potřeba. +pyladies: link: pyladies -- name: MI-PYT - description: Základy již znáte a chcete se dozvědět o dalších možnostech využití Pythonu. + title: Začátečnický kurz Pyladies + description: Naučte se Python vážně od začátku. Žádné předchozí znalosti nejsou potřeba. + +mi-pyt: link: mi-pyt + title: MI-PYT + description: Základy již znáte a chcete se dozvědět o dalších možnostech využití Pythonu. diff --git a/courses/index.html b/courses/index.html index 776ac58430..c04d8652f3 100644 --- a/courses/index.html +++ b/courses/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Seznam online kurzů Pythonu{% endblock %} - {% block content %}

Momentálně jsou dostupné tyto kurzy:

@@ -10,16 +8,8 @@
{% for course in courses %}
- {% if 'link' in course %} -

{{ course['name'] }}

- {% else %} - {{ course['name'] }} - {% endif %} - - {% if 'description' in course %} - - {% endif %} - +

{{ courses[course]['title'] }}

+
{% endfor %}
diff --git a/courses/mi-pyt/12-micropython/info.yml b/courses/mi-pyt/12-micropython/info.yml index b3238f41b2..bd37da796c 100644 --- a/courses/mi-pyt/12-micropython/info.yml +++ b/courses/mi-pyt/12-micropython/info.yml @@ -1,3 +1,3 @@ course: MI-PYT -title: MictoPython +title: MicroPython style: md diff --git a/courses/mi-pyt/index.html b/courses/mi-pyt/index.html index 7b534a9918..c24a9764e1 100644 --- a/courses/mi-pyt/index.html +++ b/courses/mi-pyt/index.html @@ -1,32 +1,9 @@ -{% extends 'templates/_base.html' %} +{% extends 'templates/course_page.html' %} -{% block title %}MI-PYT kurz{% endblock %} - -{% block content %} +{% block headline %}

Kurz MI-PYT

Díváte se na materiály předmětu MI-PYT (Pokročilý Python) na FIT ČVUT. Materiály jsou dostupné v dvojí podobě, interně pro studenty FITu na Eduxu a pro všechny veřejně na GitHubu.

Kde není uvedeno jinak, jsou materiály dostupné pod licencí Creative Commons Attribution-ShareAlike 4.0 International, kde autorem je Petr Viktorin a Miro Hrončok (vyučující předmětu) a další přispěvatelé. Tento kurz vzniká pod záštitou firmy Red Hat Czech, s.r.o.

- - -
-
-
- {% for lesson in plan %} -
-

- {{ lesson['name'] }} -

- {% for mat in lesson['materials'] %} - - {% endfor %} -
- {% endfor %} -
-
-
-{% endblock content %} +{% endblock headline %} diff --git a/courses/pyladies/and-or/index.html b/courses/pyladies/and-or/index.html index f90684b3c5..024628b4ba 100644 --- a/courses/pyladies/and-or/index.html +++ b/courses/pyladies/and-or/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Nebo anebo a{% endblock %} - {% block content %}
diff --git a/courses/pyladies/asteroids/index.html b/courses/pyladies/asteroids/index.html index b1620b61f8..0028333227 100644 --- a/courses/pyladies/asteroids/index.html +++ b/courses/pyladies/asteroids/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Asteroids{% endblock %} - {% block content %}
diff --git a/courses/pyladies/branching/index.html b/courses/pyladies/branching/index.html index 5999030262..851ac07513 100644 --- a/courses/pyladies/branching/index.html +++ b/courses/pyladies/branching/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Větvení v Gitu{% endblock %} - {% block style %} .green { color: #0A3; } .red { color: #D30; } diff --git a/courses/pyladies/circular_imports/index.html b/courses/pyladies/circular_imports/index.html index 9633eb156a..fe3e38230c 100644 --- a/courses/pyladies/circular_imports/index.html +++ b/courses/pyladies/circular_imports/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Poznámka k importu{% endblock %} - {% block content %}
diff --git a/courses/pyladies/classes/index.html b/courses/pyladies/classes/index.html index 3fe27ef954..4acbbaaf8c 100644 --- a/courses/pyladies/classes/index.html +++ b/courses/pyladies/classes/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Třídy{% endblock %} - {% block content %}
diff --git a/courses/pyladies/cmdline/index.html b/courses/pyladies/cmdline/index.html index 4fcad96977..2f6f4b3cd6 100644 --- a/courses/pyladies/cmdline/index.html +++ b/courses/pyladies/cmdline/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Příkazová řádka{% endblock %} - {% block content %}
diff --git a/courses/pyladies/comparisons/index.html b/courses/pyladies/comparisons/index.html index e615ac6e97..8d563a1e58 100644 --- a/courses/pyladies/comparisons/index.html +++ b/courses/pyladies/comparisons/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Porovnávání{% endblock %} - {% block content %}
diff --git a/courses/pyladies/cooperation_and_OSS/index.html b/courses/pyladies/cooperation_and_OSS/index.html index ba7738943d..d73094f369 100644 --- a/courses/pyladies/cooperation_and_OSS/index.html +++ b/courses/pyladies/cooperation_and_OSS/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Spolupráce a Open source{% endblock %} - {% block content %}
diff --git a/courses/pyladies/dicts/index.html b/courses/pyladies/dicts/index.html index a098146d10..e958d6fc85 100644 --- a/courses/pyladies/dicts/index.html +++ b/courses/pyladies/dicts/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Slovníky{% endblock %} - {% block content %}
diff --git a/courses/pyladies/exceptions/index.html b/courses/pyladies/exceptions/index.html index d76afd7683..8bc5dde3e7 100644 --- a/courses/pyladies/exceptions/index.html +++ b/courses/pyladies/exceptions/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Výjimky{% endblock %} - {% block style %} .err-lineno { display: inline-block; diff --git a/courses/pyladies/files/index.html b/courses/pyladies/files/index.html index 5bf2e6dc02..d3b9e363bd 100644 --- a/courses/pyladies/files/index.html +++ b/courses/pyladies/files/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Soubory{% endblock %} - {% block content %}
diff --git a/courses/pyladies/functions/index.html b/courses/pyladies/functions/index.html index 1b08f18063..3de7513f75 100644 --- a/courses/pyladies/functions/index.html +++ b/courses/pyladies/functions/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Funkce{% endblock %} - {% block content %}
diff --git a/courses/pyladies/git/index.html b/courses/pyladies/git/index.html index 98eac0ae96..f4a3299de7 100644 --- a/courses/pyladies/git/index.html +++ b/courses/pyladies/git/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Git{% endblock %} - {% block style %} .green { color: #0A3; } .red { color: #D30; } diff --git a/courses/pyladies/github-api/index.html b/courses/pyladies/github-api/index.html index 9655f074d7..c3e7ca0dbb 100644 --- a/courses/pyladies/github-api/index.html +++ b/courses/pyladies/github-api/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Github API{% endblock %} - {% block content %}
diff --git a/courses/pyladies/hello-world/index.html b/courses/pyladies/hello-world/index.html index fc08ce2926..2c626a2e9e 100644 --- a/courses/pyladies/hello-world/index.html +++ b/courses/pyladies/hello-world/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}První program{% endblock %} - {% block style %} .example-command { text-align: center; diff --git a/courses/pyladies/index.html b/courses/pyladies/index.html index 940f9ec3d6..385ae16f6f 100644 --- a/courses/pyladies/index.html +++ b/courses/pyladies/index.html @@ -1,32 +1,9 @@ -{% extends 'templates/_base.html' %} +{% extends 'templates/course_page.html' %} -{% block title %}Začátečnický kurz PyLadies{% endblock %} - -{% block content %} +{% block headline %}

Začátečnický kurz PyLadies

Pyladies jsou (mezinárodní) aktivita, která se snaží přiblížit IT ženám a ženy k IT. K tomuto účelu využívá programovací jazyk Python. Zde najdeš materiály, které se používají na začátečnických kurzech v Praze, Brně a Ostravě.

Jednotlivé lekce jsou určeny naprostým začátečníkům, žádné předchozí znalosti nejsou nutné. Instrukce jsou uvedeny pro operační systémy Linux, Windows i macOS.

- -
-
-
- {% for lesson in plan %} -
-

- {{ lesson['name'] }} -

- {% for mat in lesson['materials'] %} - - {% endfor %} -
- {% endfor %} -
-
-
- -{% endblock content %} +{% endblock headline %} diff --git a/courses/pyladies/inheritance/index.html b/courses/pyladies/inheritance/index.html index 28ae60aefb..af39e5611c 100644 --- a/courses/pyladies/inheritance/index.html +++ b/courses/pyladies/inheritance/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Dědičnost{% endblock %} - {% block style %} .changed { background-color: #eef560; diff --git a/courses/pyladies/install/index.html b/courses/pyladies/install/index.html index 68e59c31a5..0ecfa0ce70 100644 --- a/courses/pyladies/install/index.html +++ b/courses/pyladies/install/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Instalace{% endblock %} - {% block content %}
diff --git a/courses/pyladies/install_editor/index.html b/courses/pyladies/install_editor/index.html index 24e3bdebda..5db36d3747 100644 --- a/courses/pyladies/install_editor/index.html +++ b/courses/pyladies/install_editor/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Nastavení editoru{% endblock %} - {% block content %}
diff --git a/courses/pyladies/install_git/index.html b/courses/pyladies/install_git/index.html index 8c8e8ce2ac..0e44813d65 100644 --- a/courses/pyladies/install_git/index.html +++ b/courses/pyladies/install_git/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Instalace gitu{% endblock %} - {% block content %}
diff --git a/courses/pyladies/json/index.html b/courses/pyladies/json/index.html index 3ebebbc55c..bab96a62ae 100644 --- a/courses/pyladies/json/index.html +++ b/courses/pyladies/json/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}JSON{% endblock %} - {% block content %}
diff --git a/courses/pyladies/lists/index.html b/courses/pyladies/lists/index.html index 73a1df3c0b..630054fa47 100644 --- a/courses/pyladies/lists/index.html +++ b/courses/pyladies/lists/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Seznamy{% endblock %} - {% block content %}
diff --git a/courses/pyladies/modules/index.html b/courses/pyladies/modules/index.html index 068410bb96..4a58b2a319 100644 --- a/courses/pyladies/modules/index.html +++ b/courses/pyladies/modules/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Moduly{% endblock %} - {% block content %}
diff --git a/courses/pyladies/own_functions/index.html b/courses/pyladies/own_functions/index.html index 92299d2bb3..c58f3d7726 100644 --- a/courses/pyladies/own_functions/index.html +++ b/courses/pyladies/own_functions/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Vlastní funkce{% endblock %} - {% block content %}
diff --git a/courses/pyladies/pong/index.html b/courses/pyladies/pong/index.html index 8b64a68216..379c60fd27 100644 --- a/courses/pyladies/pong/index.html +++ b/courses/pyladies/pong/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Pong{% endblock %} - {% block content %}
diff --git a/courses/pyladies/printing/index.html b/courses/pyladies/printing/index.html index 9198391c83..4bbcf7b24b 100644 --- a/courses/pyladies/printing/index.html +++ b/courses/pyladies/printing/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Chybové hlášky a print{% endblock %} - {% block style %} .err-lineno { display: inline-block; diff --git a/courses/pyladies/pyglet/index.html b/courses/pyladies/pyglet/index.html index 0a7116d256..f257372f46 100644 --- a/courses/pyladies/pyglet/index.html +++ b/courses/pyladies/pyglet/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Grafika{% endblock %} - {% block content %}
diff --git a/courses/pyladies/strings/index.html b/courses/pyladies/strings/index.html index 7f71035b99..8ca1f407d9 100644 --- a/courses/pyladies/strings/index.html +++ b/courses/pyladies/strings/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Řetězce{% endblock %} - {% block content %}
diff --git a/courses/pyladies/testing/index.html b/courses/pyladies/testing/index.html index 336234f8f0..2b34477eb7 100644 --- a/courses/pyladies/testing/index.html +++ b/courses/pyladies/testing/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Testování{% endblock %} - {% block content %}
diff --git a/courses/pyladies/tuples/index.html b/courses/pyladies/tuples/index.html index 1f3f73b75b..a7cee5f6aa 100644 --- a/courses/pyladies/tuples/index.html +++ b/courses/pyladies/tuples/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}N-tice{% endblock %} - {% block content %}
diff --git a/courses/pyladies/turtle/index.html b/courses/pyladies/turtle/index.html index f0adcf1c3a..2dede3d480 100644 --- a/courses/pyladies/turtle/index.html +++ b/courses/pyladies/turtle/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Želva a cykly{% endblock %} - {% block content %}
diff --git a/courses/pyladies/variables/index.html b/courses/pyladies/variables/index.html index 2fb9c8d0ba..38ed51f719 100644 --- a/courses/pyladies/variables/index.html +++ b/courses/pyladies/variables/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Proměnné{% endblock %} - {% block style %} .extra { background-color: #f8f8f8; margin: -10px -1000px; padding: 10px 1000px; } {% endblock %} diff --git a/courses/pyladies/while/index.html b/courses/pyladies/while/index.html index 26b34d8fdb..6a02cb6815 100644 --- a/courses/pyladies/while/index.html +++ b/courses/pyladies/while/index.html @@ -1,7 +1,5 @@ {% extends 'templates/_base.html' %} -{% block title %}Cyklus While{% endblock %} - {% block content %}
diff --git a/naucse/routes.py b/naucse/routes.py index f49cecc88c..789cba2e8d 100644 --- a/naucse/routes.py +++ b/naucse/routes.py @@ -36,7 +36,7 @@ def about(): # Page with listed online courses. @app.route('/courses/') def courses(): - return render_template("courses/index.html", courses=read_yaml("courses/courses.yml")) + return render_template("courses/index.html", courses=read_yaml("courses/courses.yml"), title="Seznam online kurzů Pythonu") # Course page. @@ -44,6 +44,7 @@ def courses(): def course_page(course): template = 'courses/{}/index.html'.format(course) plan = read_yaml("courses/" + course + "/plan.yml") + title = (read_yaml("courses/courses.yml"))[course]['title'] lesson_dict = {} @@ -60,7 +61,7 @@ def course_page(course): lesson_dict[mat['link']] = (the_course, info_file['title']) try: - return render_template(template, plan=read_yaml("courses/" + course + "/plan.yml"), names=lesson_dict) + return render_template(template, plan=read_yaml("courses/" + course + "/plan.yml"), names=lesson_dict, title=title) except TemplateNotFound: abort(404) @@ -93,7 +94,7 @@ def lesson_url(lesson): elif info['style'] == "ipynb": return render_template('templates/ipython_page.html', static=lesson_static_url, lesson=lesson_url, title=title, content=content) else: - return render_template(template, static=lesson_static_url, lesson=lesson_url) + return render_template(template, static=lesson_static_url, lesson=lesson_url, title=title) except TemplateNotFound: abort(404) diff --git a/naucse/templates/_base.html b/naucse/templates/_base.html index cfecdb96fd..03e96cf386 100644 --- a/naucse/templates/_base.html +++ b/naucse/templates/_base.html @@ -2,10 +2,17 @@ - {% block title %}{% endblock %} - Nauč se Python + + {% if title is defined %} + {{ title }} + {% else %} + Nauč se Python + {% endif %} + + - +