From 99476a87c028a360d00c8d37c6177d2199cb25f4 Mon Sep 17 00:00:00 2001 From: Kalle Westerling Date: Wed, 24 Jun 2020 21:11:30 -0400 Subject: [PATCH] Addresses #68 and beyond --- app/frontmatter/models.py | 2 +- app/workshop/templates/workshop/___base.html | 34 ------------------- .../workshop/frontmatter-elements/hero.html | 13 +++++++ .../templates/workshop/frontmatter.html | 10 +++--- .../workshop-wide-elements/navbar.html | 4 +-- 5 files changed, 21 insertions(+), 42 deletions(-) delete mode 100644 app/workshop/templates/workshop/___base.html diff --git a/app/frontmatter/models.py b/app/frontmatter/models.py index a85fcbca..a076d477 100644 --- a/app/frontmatter/models.py +++ b/app/frontmatter/models.py @@ -17,7 +17,7 @@ def __str__(self): class LearningObjective(models.Model): - frontmatter = models.ForeignKey(Frontmatter, on_delete=models.CASCADE) + frontmatter = models.ForeignKey(Frontmatter, on_delete=models.CASCADE, related_name="learning_objectives") label = models.TextField(max_length=500) def __str__(self): diff --git a/app/workshop/templates/workshop/___base.html b/app/workshop/templates/workshop/___base.html deleted file mode 100644 index 7d5b6c3e..00000000 --- a/app/workshop/templates/workshop/___base.html +++ /dev/null @@ -1,34 +0,0 @@ -{% load static %} - - - - - - - - - Workshop - - - - - - - - {% include "website/navbar.html" %} - -
- {% block header %}{% endblock %} - {% block hero %}{% endblock %} - {% block main %}{% endblock %} -
- - - - - - - - diff --git a/app/workshop/templates/workshop/frontmatter-elements/hero.html b/app/workshop/templates/workshop/frontmatter-elements/hero.html index ffd57e9d..7b40d3ab 100644 --- a/app/workshop/templates/workshop/frontmatter-elements/hero.html +++ b/app/workshop/templates/workshop/frontmatter-elements/hero.html @@ -5,6 +5,19 @@

{{ workshop.name }}

{{ workshop.frontmatter.abstract | markdown | safe }}
+ + +{% if frontmatter.learning_objectives %} +
+
+

In this workshop, you will learn how to

+ {% for objective in frontmatter.learning_objectives.all %} +
  • {{ objective }}
  • + {% endfor %} +
    +{% endif %} + +
    Get started This workshop is estimated to take {{ frontmatter.estimated_time }} hours to complete. diff --git a/app/workshop/templates/workshop/frontmatter.html b/app/workshop/templates/workshop/frontmatter.html index 231cbf24..fbcb7360 100644 --- a/app/workshop/templates/workshop/frontmatter.html +++ b/app/workshop/templates/workshop/frontmatter.html @@ -19,7 +19,7 @@ {% if frontmatter.prerequisites.count and frontmatter.resources.count %}
    -
    +

    Before you start

    Here is an introduction to the section "Before you start," and something about what it means. @@ -51,8 +51,8 @@

    Requirements

    {% endif %} -
    -
    +
    +

    Contexts

    Here is an introduction to the section "Contexts," and something about what it means. @@ -70,7 +70,7 @@

    Ethical considerations

    {% if frontmatter.readings.count %}
    -

    Readings

    +

    Readings before you get started


    Here is an introductory paragraph about what the following readings are. It might contain a link to our "library" for the curriculum website, which can contain all kinds of information.

    {% for reading in frontmatter.readings.all %} @@ -87,7 +87,7 @@

    Readings

    {% if frontmatter.projects.count %}
    -

    Project related to {{ workshop.name }}

    +

    Projects related to {{ workshop.name }}


    Here is an introductory paragraph about what the following projects are and why they are listed here. It might contain a link to our "library" for the curriculum website, which can contain all kinds of information.

    {% for project in frontmatter.projects.all %} diff --git a/app/workshop/templates/workshop/workshop-wide-elements/navbar.html b/app/workshop/templates/workshop/workshop-wide-elements/navbar.html index 5cfd5d57..ab5711f3 100644 --- a/app/workshop/templates/workshop/workshop-wide-elements/navbar.html +++ b/app/workshop/templates/workshop/workshop-wide-elements/navbar.html @@ -2,7 +2,7 @@