diff --git a/.travis.yml b/.travis.yml
index 2b39e2d..b637672 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,8 +13,7 @@ jobs:
include:
- stage: test
script: coverage run --rcfile=.coveragerc manage.py test tests --settings=config.settings.testing -v=3
- - script: python manage.py loadpikau
- - script: python manage.py loadlicences
+ - script: python manage.py loaddata
- script: flake8
- script: pydocstyle --count --explain
after_success:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fdfee28..71d7fdc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelog
+## 0.6.0 (Pre-release)
+
+*This release requires a database wipe due to new migrations.*
+
+- Add "Why digital technologies?" pīkau.
+- Store and load readiness level for pīkau.
+- Ensure pīkau title fits within pathway diagram nodes. (fixes #56)
+- Fix bug where file licence warning displayed wrong licence. (fixes #60)
+- Load file data from loader.
+- Check files used in pīkau are listed within files application.
+- Display links between files and pīkau. (fixes #61)
+- Display image preview for files. (fixes #35)
+- Add test cases.
+- Dependency updates:
+ - Update django from 2.0.5 to 2.0.6.
+ - Update django-anymail 2.2 to 3.0.
+
## 0.5.1 (Pre-release)
- Fix bug where slug max length was too short for titles.
diff --git a/config/__init__.py b/config/__init__.py
index 106cd83..2d5feb3 100644
--- a/config/__init__.py
+++ b/config/__init__.py
@@ -1,3 +1,3 @@
"""Module for Django system configuration."""
-__version__ = "0.5.1"
+__version__ = "0.6.0"
diff --git a/files/content/files.yaml b/files/content/files.yaml
new file mode 100644
index 0000000..69bcb78
--- /dev/null
+++ b/files/content/files.yaml
@@ -0,0 +1,158 @@
+banner-mahuika-maui-png:
+ name: "Mahuika and Māui Banner"
+ filename: "banner-mahuika-maui.png"
+ location: "https://drive.google.com/open?id=1NJfnUmj6et78-o8Eov2i7fgZdauR_myE"
+ direct-link: "images/core-education/banner-mahuika-maui.png"
+maui-face-png:
+ name: "Māui face"
+ filename: "maui-face.png"
+ location: "https://drive.google.com/open?id=1NU2glbUDS928aBwKgivX4GdoyKKkbMmo"
+ direct-link: "images/core-education/maui-face.png"
+mahuika-face-png:
+ name: "Mahuika face"
+ filename: "mahuika-face.png"
+ location: "https://drive.google.com/open?id=1396r4RQjZxZdyAPVzDm3o0heDJit1m_E"
+ direct-link: "images/core-education/mahuika-face.png"
+what-is-ct-png:
+ name: "What is CT?"
+ filename: "what-is-ct.png"
+ location: "images/pikau/what-is-ct.png"
+ direct-link: "images/pikau/what-is-ct.png"
+ licence: cc-by-sa-4
+ct-around-the-world-png:
+ name: "CT around the world"
+ filename: "ct-around-the-world.png"
+ location: "images/pikau/ct-around-the-world.png"
+ direct-link: "images/pikau/ct-around-the-world.png"
+ licence: cc-by-sa-4
+arnold-the-wonder-parrot-jpg:
+ name: "Arnold the Wonder Parrot"
+ filename: "arnold-the-wonder-parrot.jpg"
+ location: "images/pikau/arnold-the-wonder-parrot.jpg"
+ direct-link: "images/pikau/arnold-the-wonder-parrot.jpg"
+ licence: cc-by-sa-4
+information-theory-activity-jpg:
+ name: "Information Theory CS Unplugged Activity"
+ filename: "information-theory-activity.jpg"
+ location: "images/pikau/information-theory-activity.jpg"
+ direct-link: "images/pikau/information-theory-activity.jpg"
+ licence: cc-by-sa-4
+placeholder-video:
+ name: "Kia Takatū ā-Matihiko Placeholder Video"
+ filename: "https://www.youtube.com/embed/zSfzB-Z-mKM"
+ location: "https://www.youtube.com/embed/zSfzB-Z-mKM"
+ direct-link: "https://www.youtube.com/embed/zSfzB-Z-mKM"
+ licence: cc-by-sa-4
+ct-loading-planes-trimmed-mov:
+ name: "CT Loading Planes - Trimmed"
+ filename: "CT loading planes trimmed.mov"
+ location: "https://vimeo.com/273809039/eb5cb42933"
+ direct-link: "https://vimeo.com/273809039/eb5cb42933"
+ licence: cc-by-sa-4
+ct-six-elements-of-digital-devices-mp4:
+ name: "Six elements of digital devices"
+ filename: "six elements of digital devices.mp4"
+ location: "https://vimeo.com/273813250/f251e2a3d4"
+ direct-link: "https://vimeo.com/273813250/f251e2a3d4"
+ licence: cc-by-sa-4
+digital-images-mp4:
+ name: "Digital images"
+ filename: "digital images.mp4"
+ location: "https://vimeo.com/273824548/770c5c1c48"
+ direct-link: "https://vimeo.com/273824548/770c5c1c48"
+ licence: cc-by-sa-4
+csfg-algorithms-trailer-mp4:
+ name: "Computer Science Field Guide: Algorithms"
+ filename: "Computer Science Field Guide - Algorithms.mp4"
+ location: "https://vimeo.com/69609500"
+ direct-link: "https://vimeo.com/69609500"
+ licence: cc-by-sa-4
+getting-the-most-out-of-pikau:
+ name: Getting the most out of pīkau
+ filename: "https://vimeo.com/272882311/8e4cf1de3f"
+ location: "https://vimeo.com/272882311/8e4cf1de3f"
+ direct-link: "https://vimeo.com/272882311/8e4cf1de3f"
+1983-cpa-5426-png:
+ name: Muḥammad ibn Mūsā al-Ḵwārizmī
+ filename: 1983 CPA 5426 (1).png
+ location: "https://commons.wikimedia.org/wiki/File:1983_CPA_5426_(1).png"
+ direct-link: "https://upload.wikimedia.org/wikipedia/commons/1/11/1983_CPA_5426_%281%29.png"
+ licence: public-domain
+ description: "This work is not an object of copyright according to article 1259 of Book IV of the Civil Code of the Russian Federation No. 230-FZ of December 18, 2006."
+euklid-von-alexandria-1-jpg:
+ name: Euklid-von-Alexandria
+ filename: Euklid-von-Alexandria_1.jpg
+ location: "https://commons.wikimedia.org/wiki/File:Euklid-von-Alexandria_1.jpg"
+ direct-link: "https://upload.wikimedia.org/wikipedia/commons/3/30/Euklid-von-Alexandria_1.jpg"
+ licence: public-domain
+ description: "This work is in the public domain in its country of origin and other countries and areas where the copyright term is the author's life plus 70 years or less."
+telescope-with-stars-jpg:
+ name: Telescope in front of stars
+ filename: science.jpg
+ location: "https://www.timelinecoverbanner.com/covers/telescope-knowledge-mystery-and-science-Facebook-cover/"
+ direct-link: "https://www.timelinecoverbanner.com/facebook-covers/2013/01/science.jpg"
+ licence: cc0
+design-desk-display-jpg:
+ name: User frustrated in front of computer
+ filename: design-desk-display-313690.jpg
+ location: "https://www.pexels.com/photo/design-desk-display-eyewear-313690/"
+ licence: cc0
+dt3e-interviews-with-teachers-mp4:
+ name: "DT3e - Interviews with teachers"
+ filename: "DT3e interviews with teachers.mp4"
+ location: "https://vimeo.com/273841538"
+ direct-link: "https://vimeo.com/273841538"
+ licence: cc-by-sa-4
+use-modify-create-diagram-svg:
+ name: Use-Modify-Create Learning Progression Diagram
+ filename: "use-modify-create-diagram.svg"
+ location: "images/pikau/use-modify-create-diagram.svg"
+ direct-link: "images/pikau/use-modify-create-diagram.svg"
+ licence: cc-by-sa-4
+technology-diagram-jpg:
+ name: NZ Curriculum Technology Diagram
+ filename: "technology-diagram.jpg"
+ location: "images/core-education/technology-diagram.jpg"
+ direct-link: "images/core-education/technology-diagram.jpg"
+oudjat-svg:
+ name: Oudjat
+ filename: "Oudjat.SVG"
+ location: "https://commons.wikimedia.org/wiki/File:Oudjat.SVG"
+ direct-link: "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/Oudjat.SVG/500px-Oudjat.SVG.png"
+ licence: cc-by-sa-3
+eratosthene-png:
+ name: Eratosthene
+ filename: "Eratosthene.01.png"
+ location: "https://commons.wikimedia.org/wiki/File:Eratosthene.01.png"
+ direct-link: "https://upload.wikimedia.org/wikipedia/commons/b/b3/Eratosthene.01.png"
+ licence: public-domain
+ada-lovelace-jpg:
+ name: Ada Lovelace
+ filename: "Ada Lovelace portrait.jpg"
+ location: "https://commons.wikimedia.org/wiki/File:Ada_Lovelace_portrait.jpg"
+ direct-link: "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Ada_Lovelace_portrait.jpg/334px-Ada_Lovelace_portrait.jpg"
+ licence: public-domain
+edsger-wybe-dijkstra-jpg:
+ name: Edsger Wybe Dijkstra
+ filename: "Edsger Wybe Dijkstra.jpg"
+ location: "https://commons.wikimedia.org/wiki/File:Edsger_Wybe_Dijkstra.jpg"
+ direct-link: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Edsger_Wybe_Dijkstra.jpg/450px-Edsger_Wybe_Dijkstra.jpg"
+ licence: cc-by-sa-3
+pagerank-png:
+ name: PageRank
+ filename: "PageRank-hi-res.png"
+ location: "https://commons.wikimedia.org/wiki/File:PageRank-hi-res.png"
+ direct-link: "https://upload.wikimedia.org/wikipedia/commons/thumb/6/69/PageRank-hi-res.png/640px-PageRank-hi-res.png"
+ licence: cc-by-sa-2-5
+jeannette-wing-jpg:
+ name: Jeannette Wing
+ filename: "Jeannette Wing, Davos 2013.jpg"
+ location: "https://commons.wikimedia.org/wiki/File:Jeannette_Wing,_Davos_2013.jpg"
+ direct-link: "https://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Jeannette_Wing%2C_Davos_2013.jpg/532px-Jeannette_Wing%2C_Davos_2013.jpg"
+ licence: cc-by-sa-2
+khwarizmi-amirkabir-png:
+ name: Khwarizmi Amirkabir University of Technology
+ filename: "Khwarizmi Amirkabir University of Technology.png"
+ location: "https://commons.wikimedia.org/wiki/File:Khwarizmi_Amirkabir_University_of_Technology.png"
+ direct-link: "https://upload.wikimedia.org/wikipedia/commons/a/a6/Khwarizmi_Amirkabir_University_of_Technology.png"
+ licence: cc-by-sa-3
diff --git a/files/content/licences.yaml b/files/content/licences.yaml
index ee092c3..ff7757d 100644
--- a/files/content/licences.yaml
+++ b/files/content/licences.yaml
@@ -1,6 +1,24 @@
-- name: "Unknown"
+unknown:
+ name: "Unknown"
url: "https://creativecommons.org/choose/"
-- name: "Creative Commons (BY-SA 4.0)"
+cc0:
+ name: "CC0 - No Rights Reserved"
+ url: "https://creativecommons.org/share-your-work/public-domain/cc0/"
+cc-by-sa-2:
+ name: "Creative Commons (BY-SA 2.0)"
+ url: "https://creativecommons.org/licenses/by-sa/2.0/"
+cc-by-sa-2-5:
+ name: "Creative Commons (BY-SA 2.5)"
+ url: "https://creativecommons.org/licenses/by-sa/2.5/"
+cc-by-sa-3:
+ name: "Creative Commons (BY-SA 3.0)"
+ url: "https://creativecommons.org/licenses/by-sa/3.0/"
+cc-by-sa-4:
+ name: "Creative Commons (BY-SA 4.0)"
url: "https://creativecommons.org/licenses/by-sa/4.0/"
-- name: "Creative Commons (BY-NC-SA 4.0)"
+cc-by-nc-sa-4:
+ name: "Creative Commons (BY-NC-SA 4.0)"
url: "https://creativecommons.org/licenses/by-nc-sa/4.0/"
+public-domain:
+ name: Public Domain
+ url: "https://wiki.creativecommons.org/wiki/Public_domain"
diff --git a/files/management/commands/_FileLoader.py b/files/management/commands/_FileLoader.py
new file mode 100644
index 0000000..ada92bb
--- /dev/null
+++ b/files/management/commands/_FileLoader.py
@@ -0,0 +1,32 @@
+"""Custom loader for loading files."""
+
+from django.db import transaction
+from files.models import File, Licence
+from utils.BaseLoader import BaseLoader
+
+
+class FileLoader(BaseLoader):
+ """Custom loader for loading files."""
+
+ @transaction.atomic
+ def load(self):
+ """Load the files into the database."""
+ files = self.load_yaml_file("files.yaml")
+
+ for file_slug, file_data in files.items():
+ licence = Licence.objects.get(slug=file_data.get("licence", "unknown"))
+ defaults = {
+ "name": file_data["name"],
+ "filename": file_data["filename"],
+ "location": file_data["location"],
+ "direct_link": file_data.get("direct-link", ""),
+ "licence": licence,
+ "description": file_data.get("description", ""),
+ }
+ file_object, created = File.objects.update_or_create(
+ slug=file_slug,
+ defaults=defaults,
+ )
+ self.log_object_creation(created, file_object)
+
+ self.log("All files loaded!\n")
diff --git a/files/management/commands/_LicenceLoader.py b/files/management/commands/_LicenceLoader.py
index 14e2dfe..1668521 100644
--- a/files/management/commands/_LicenceLoader.py
+++ b/files/management/commands/_LicenceLoader.py
@@ -13,12 +13,13 @@ def load(self):
"""Load the licences into the database."""
licences = self.load_yaml_file("licences.yaml")
- for licence_data in licences:
+ for licence_slug, licence_data in licences.items():
defaults = {
+ "name": licence_data["name"],
"url": licence_data["url"],
}
licence, created = Licence.objects.update_or_create(
- name=licence_data["name"],
+ slug=licence_slug,
defaults=defaults,
)
self.log_object_creation(created, licence)
diff --git a/files/management/commands/loadlicences.py b/files/management/commands/loadfiles.py
similarity index 54%
rename from files/management/commands/loadlicences.py
rename to files/management/commands/loadfiles.py
index 1733050..2130a8a 100644
--- a/files/management/commands/loadlicences.py
+++ b/files/management/commands/loadfiles.py
@@ -1,16 +1,18 @@
-"""Module for the custom Django loadlicences command."""
+"""Module for the custom Django loadfiles command."""
from django.conf import settings
from django.core import management
from files.management.commands._LicenceLoader import LicenceLoader
+from files.management.commands._FileLoader import FileLoader
class Command(management.base.BaseCommand):
- """Required command class for the custom Django loadlicences command."""
+ """Required command class for the custom Django loadfiles command."""
help = "Loads licences into the website"
def handle(self, *args, **options):
- """Automatically called when the loadlicences command is given."""
+ """Automatically called when the loadfiles command is given."""
base_path = settings.FILES_CONTENT_BASE_PATH
LicenceLoader(base_path).load()
+ FileLoader(base_path).load()
diff --git a/files/migrations/0001_initial.py b/files/migrations/0001_initial.py
index 2db3918..b005ff9 100644
--- a/files/migrations/0001_initial.py
+++ b/files/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 2.0.5 on 2018-05-21 04:19
+# Generated by Django 2.0.5 on 2018-06-07 02:53
from django.db import migrations, models
import django.db.models.deletion
@@ -18,15 +18,17 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('slug', models.SlugField(unique=True)),
- ('filename', models.CharField(max_length=200)),
+ ('name', models.CharField(max_length=200, unique=True)),
+ ('filename', models.CharField(max_length=200, unique=True)),
('description', models.TextField(blank=True)),
- ('location', models.URLField()),
+ ('location', models.URLField(unique=True)),
],
),
migrations.CreateModel(
name='Licence',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('slug', models.SlugField(unique=True)),
('name', models.CharField(max_length=200, unique=True)),
('url', models.URLField()),
],
diff --git a/files/migrations/0002_auto_20180607_2117.py b/files/migrations/0002_auto_20180607_2117.py
new file mode 100644
index 0000000..419d175
--- /dev/null
+++ b/files/migrations/0002_auto_20180607_2117.py
@@ -0,0 +1,23 @@
+# Generated by Django 2.0.5 on 2018-06-07 09:17
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('files', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='file',
+ name='direct_link',
+ field=models.URLField(blank=True),
+ ),
+ migrations.AlterField(
+ model_name='file',
+ name='location',
+ field=models.URLField(),
+ ),
+ ]
diff --git a/files/models.py b/files/models.py
index eb0a2a7..6f59372 100644
--- a/files/models.py
+++ b/files/models.py
@@ -2,8 +2,22 @@
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
+from django.template.loader import render_to_string
from django.urls import reverse
+VIDEO_PROVIDERS = (
+ "youtube",
+ "vimeo",
+)
+
+IMAGE_EXTENSIONS = (
+ ".jpeg",
+ ".jpg",
+ ".png",
+ ".gif",
+ ".svg",
+)
+
def default_licence():
"""Return default licence object.
@@ -12,7 +26,7 @@ def default_licence():
Licence 'Unknown' if available, otherwise None.
"""
try:
- default = Licence.objects.get(name="Unknown").pk
+ default = Licence.objects.get(slug="unknown").pk
except ObjectDoesNotExist:
default = None
return default
@@ -21,6 +35,7 @@ def default_licence():
class Licence(models.Model):
"""Model for licence."""
+ slug = models.SlugField(unique=True)
name = models.CharField(max_length=200, unique=True)
url = models.URLField()
@@ -50,9 +65,11 @@ class File(models.Model):
"""Model for file."""
slug = models.SlugField(unique=True)
- filename = models.CharField(max_length=200)
- description = models.TextField(blank=True)
+ name = models.CharField(max_length=200, unique=True)
+ filename = models.CharField(max_length=200, unique=True)
location = models.URLField()
+ direct_link = models.URLField(blank=True)
+ description = models.TextField(blank=True)
licence = models.ForeignKey(
Licence,
on_delete=models.CASCADE,
@@ -61,6 +78,47 @@ class File(models.Model):
null=True,
)
+ def media_type(self):
+ """Return label for media type.
+
+ Returns:
+ String label of media type.
+ """
+ if any(substring in self.direct_link for substring in VIDEO_PROVIDERS):
+ label = "Video"
+ elif self.direct_link.endswith(IMAGE_EXTENSIONS):
+ label = "Image"
+ else:
+ label = "Unknown"
+ return label
+
+ def preview_html(self):
+ """Return HTML for preview.
+
+ Returns:
+ HTML as a string.
+ """
+ # YouTube video
+ if "youtube" in self.direct_link:
+ context = {"direct_link": self.direct_link}
+ html = render_to_string("files/previews/youtube.html", context=context)
+ # Vimeo video
+ elif "vimeo" in self.direct_link:
+ context = {"video_id": self.direct_link.split("/")[3]}
+ html = render_to_string("files/previews/vimeo.html", context=context)
+ # Direct image URL
+ elif self.direct_link.startswith("http"):
+ context = {"direct_link": self.direct_link}
+ html = render_to_string("files/previews/external-image.html", context=context)
+ # Relative image
+ elif self.direct_link:
+ context = {"direct_link": self.direct_link}
+ html = render_to_string("files/previews/internal-image.html", context=context)
+ # Unsupported preview
+ else:
+ html = "No preview available"
+ return html
+
def get_absolute_url(self):
"""Return the URL for a file.
@@ -75,7 +133,7 @@ def __str__(self):
Returns:
String describing file.
"""
- return self.filename
+ return self.name
def __repr__(self):
"""Text representation of File object for developers.
diff --git a/files/tables.py b/files/tables.py
index 53bb4ad..432e9ad 100644
--- a/files/tables.py
+++ b/files/tables.py
@@ -1,5 +1,6 @@
"""Tables for the files application."""
+from django.template.loader import render_to_string
import django_tables2 as tables
from files.models import (
File,
@@ -9,12 +10,35 @@
class FileTable(tables.Table):
"""Table to display all files."""
- filename = tables.LinkColumn()
+ name = tables.LinkColumn()
+ preview = tables.TemplateColumn(
+ template_name="files/previews/preview.html",
+ verbose_name="Preview",
+ )
+ media_type_rendered = tables.TemplateColumn(
+ template_name="files/previews/type-icon.html",
+ verbose_name="Media type",
+ )
licence = tables.RelatedLinkColumn()
+ def render_media_type(self, value):
+ """Render template for media type column.
+
+ Args:
+ value: Value for column.
+
+ Returns:
+ Rendered string for column.
+ """
+ if value in ("Image", "Video"):
+ context = {"image_path": "images/icons/icons8/{}.png".format(value)}
+ image = render_to_string("files/previews/type-icon.html", context=context)
+ value = image + value
+ return value
+
class Meta:
"""Meta attributes for FileTable class."""
model = File
- fields = ("filename", "licence")
- order_by = "filename"
+ fields = ("name", "media_type_rendered", "licence")
+ order_by = "name"
diff --git a/files/views.py b/files/views.py
index 939f81e..c299971 100644
--- a/files/views.py
+++ b/files/views.py
@@ -14,6 +14,7 @@
from files.filters import FileFilter
from files.models import (
File,
+ default_licence,
)
from files.forms import (
FileForm,
@@ -36,6 +37,7 @@ def get_context_data(self, **kwargs):
"""
context = super(FileList, self).get_context_data(**kwargs)
context["unknown_licences"] = File.objects.filter(licence__name="Unknown").count()
+ context["unknown_licence_id"] = default_licence()
return context
diff --git a/pikau/content/pikau-courses.yaml b/pikau/content/pikau-courses.yaml
index 6dd21c4..d3f0515 100644
--- a/pikau/content/pikau-courses.yaml
+++ b/pikau/content/pikau-courses.yaml
@@ -1,4 +1,5 @@
courses:
- getting-the-most-out-of-pikau
+ - why-digital-technologies
- what-is-computational-thinking
- computational-thinking-the-international-perspective
diff --git a/pikau/content/pikau-courses/computational-thinking-the-international-perspective/metadata.yaml b/pikau/content/pikau-courses/computational-thinking-the-international-perspective/metadata.yaml
index 4f8324f..d288ea4 100644
--- a/pikau/content/pikau-courses/computational-thinking-the-international-perspective/metadata.yaml
+++ b/pikau/content/pikau-courses/computational-thinking-the-international-perspective/metadata.yaml
@@ -1,5 +1,6 @@
name: "Computational thinking - The international perspective"
status: 2
+readiness-level: 1
language: en
topic: ct
level: all
@@ -7,6 +8,8 @@ tags:
- introductory
cover-photo: images/pikau/ct-around-the-world.png
trailer-video: https://www.youtube.com/embed/zSfzB-Z-mKM
+prerequisites:
+ - what-is-computational-thinking
overview: overview.md
content:
@@ -24,3 +27,6 @@ content:
- slug: references
file: references.md
assessment-items: assessment-items.md
+
+extra-files:
+ - jeannette-wing-jpg
diff --git a/pikau/content/pikau-courses/getting-the-most-out-of-pikau/metadata.yaml b/pikau/content/pikau-courses/getting-the-most-out-of-pikau/metadata.yaml
index 99a2f97..b7705aa 100644
--- a/pikau/content/pikau-courses/getting-the-most-out-of-pikau/metadata.yaml
+++ b/pikau/content/pikau-courses/getting-the-most-out-of-pikau/metadata.yaml
@@ -1,5 +1,6 @@
name: "Getting the most out of pīkau"
status: 6
+readiness-level: 1
overview: overview.md
language: en
topic: housekeeping
@@ -7,6 +8,7 @@ level: all
tags:
- introductory
cover-photo: images/core-education/banner-mahuika-maui.png
+trailer-video: https://vimeo.com/272882311/8e4cf1de3f
content:
- slug: introduction-to-pikau
file: introduction-to-pikau.md
diff --git a/pikau/content/pikau-courses/what-is-computational-thinking/metadata.yaml b/pikau/content/pikau-courses/what-is-computational-thinking/metadata.yaml
index 29ee69c..64f4088 100644
--- a/pikau/content/pikau-courses/what-is-computational-thinking/metadata.yaml
+++ b/pikau/content/pikau-courses/what-is-computational-thinking/metadata.yaml
@@ -1,5 +1,6 @@
name: "What is computational thinking?"
status: 5
+readiness-level: 1
language: en
topic: ct
level: all
@@ -7,6 +8,8 @@ tags:
- introductory
cover-photo: images/pikau/what-is-ct.png
trailer-video: https://www.youtube.com/embed/zSfzB-Z-mKM
+prerequisites:
+ - getting-the-most-out-of-pikau
overview: overview.md
content:
@@ -24,3 +27,8 @@ content:
- slug: references
file: references.md
assessment-items: assessment-items.md
+
+extra-files:
+ - ct-loading-planes-trimmed-mov
+ - csfg-algorithms-trailer-mp4
+ - ct-six-elements-of-digital-devices-mp4
diff --git a/pikau/content/pikau-courses/why-digital-technologies/assessment-items.md b/pikau/content/pikau-courses/why-digital-technologies/assessment-items.md
new file mode 100644
index 0000000..eedc397
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/assessment-items.md
@@ -0,0 +1 @@
+**Ngā kiriahi question:** What excites and concerns you about teaching Digital Technologies?
diff --git a/pikau/content/pikau-courses/why-digital-technologies/metadata.yaml b/pikau/content/pikau-courses/why-digital-technologies/metadata.yaml
new file mode 100644
index 0000000..1bf7f96
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/metadata.yaml
@@ -0,0 +1,51 @@
+name: "Why digital technologies?"
+status: 5
+readiness-level: 1
+language: en
+topic: general
+level: all
+tags:
+ - introductory
+cover-photo: images/pikau/information-theory-activity.jpg
+trailer-video: https://www.youtube.com/embed/zSfzB-Z-mKM
+prerequisites:
+ - getting-the-most-out-of-pikau
+
+overview: overview.md
+content:
+ - slug: users-or-creators
+ file: why-this-matters/users-or-creators.md
+ module: Why this matters...
+ - slug: already-know-this
+ file: why-this-matters/already-know-this.md
+ module: Why this matters...
+ - slug: how-are-students-better-off
+ file: why-this-matters/how-are-students-better-off.md
+ module: Why this matters...
+ - slug: is-it-all-about-devices
+ file: why-this-matters/is-it-all-about-devices.md
+ module: Why this matters...
+ - slug: what-about-all-the-jargon
+ file: why-this-matters/what-about-all-the-jargon.md
+ module: Why this matters...
+ - slug: structure-of-learning-area
+ file: why-this-matters/structure-of-learning-area.md
+ module: Why this matters...
+ - slug: where-to-next
+ file: where-to-next.md
+
+assessment-items: assessment-items.md
+
+extra-files:
+ - digital-images-mp4
+ - 1983-cpa-5426-png
+ - euklid-von-alexandria-1-jpg
+ - telescope-with-stars-jpg
+ - design-desk-display-jpg
+ - dt3e-interviews-with-teachers-mp4
+ - use-modify-create-diagram-svg
+ - oudjat-svg
+ - eratosthene-png
+ - ada-lovelace-jpg
+ - edsger-wybe-dijkstra-jpg
+ - pagerank-png
diff --git a/pikau/content/pikau-courses/why-digital-technologies/overview.md b/pikau/content/pikau-courses/why-digital-technologies/overview.md
new file mode 100644
index 0000000..d972f32
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/overview.md
@@ -0,0 +1,5 @@
+By the end of this pīkau you should be able to:
+
+- explain the purpose of the new digital technologies content in the technology learning area
+- explain how digital technologies is primarily about people, and not devices
+- identify the two components of digital technologies – Computational Thinking (CT) and Designing Developing Digital Outcomes (DDDO, or Digital Outcomes)
diff --git a/pikau/content/pikau-courses/why-digital-technologies/where-to-next.md b/pikau/content/pikau-courses/why-digital-technologies/where-to-next.md
new file mode 100644
index 0000000..c10485d
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/where-to-next.md
@@ -0,0 +1,22 @@
+# Where to next?
+
+The readiness programme has two main supports for exploring digital technologies and getting prepared to teach it:
+
+The first set of supports consists of:
+- the website Kia Takatū a- Matihiko:
+- Te Tokorima-a-Mahuika | The online self review tool,
+- Pīkau | Toolkits.
+
+The second set of supports are the face to face and collaborative components:
+- Ki te Ahikāroa | Local meet ups
+- Ngā Kiriahi | Online communities of practice
+- Te Pā Pouahi | The Digital Leaders programme and the digital leaders courses/pouahi.
+
+These have been developed with the aim of a personalised feel and approach that will engage and sustain your long-term learning journey, about and with digital technologies, to reach the ultimate goal: being ready to effectively implement this new content by 2020.
+
+If you want some background reading:
+
+- [This report from the Royal Society in 2012](https://royalsociety.org/~/media/education/computing-in-schools/2012-01-12-computing-in-schools.pdf) explains the thinking that catalysed the introduction of the equivalent curriculum in England.
+- The [following talk by Hinerangi Edwards and Tim Bell](https://vimeo.com/228628929) in Rotorua was given during the consultation before the design of the new curriculum was finalised. It touches on many of the topics discussed in this pīkau/toolkit.
+- This [collection of videos](http://www.digipubs.vic.edu.au/curriculum/digitaltechnologies/digital-technologies-curriculum_why) was put together in Australia to support the introduction of Digital Technologies as an area of the Australian curriculum. The videos cover a lot of the ideas around the introduction of Digital Technologies.
+- If you’re interested in looking at some significant algorithms discussed in simple terms, you may enjoy “[Nine Algorithms That Changed the Future - The Ingenious Ideas That Drive Today's Computers](https://press.princeton.edu/titles/9528.html)”, by John MacCormick.
diff --git a/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/already-know-this.md b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/already-know-this.md
new file mode 100644
index 0000000..b774df3
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/already-know-this.md
@@ -0,0 +1,35 @@
+# You might already know some of this
+
+{comment Mahuika: You have already done some relevant teaching}
+
+Digital technologies relates to many ideas that are already taught in schools - but perhaps not the ones that people might think of first!
+
+
+
+
+
+Learning about DT will draw heavily on the capabilities that are expressed in the key competencies of [The New Zealand Curriculum](http://nzcurriculum.tki.org.nz/Key-competencies) (thinking; using language, symbols, and texts; managing self; relating to others; participating and contributing).
+
+For example, when we look at programming in more detail, we’ll see that it involves:
+
+- figuring out what you are going to program (which exercises communication skills to find out what the program should do for others)
+- designing and writing the program (often working with others)
+- testing that it works as needed (which exercises rigour – you want to have the self-discipline to find faults rather than have the users of your program find them)
+- persistence (once a fault has been identified, the cause needs to be tracked down).
+
+Language, symbols, and text are a big part of digital technologies, and students will be exploring new ways to represent and communicate ideas.
+
+Coming up with ideas for digital outcomes involves creativity.
+Perhaps counter-intuitively, creativity thrives when there are constraints on what can be done. Working within the constraints of what can be done digitally provides opportunities for creativity in the rich realm of possibilities to explore.
+
+These are all capabilities that you may have already been encouraging in your students.
+
+And while *digital* technologies may seem new, you may already have been doing parts of it while you have been teaching and learning in the technology learning area.
+
+Inquiry learning and problem solving activities are often located in the technology strands – in the “doing and thinking” in [technological practice](http://technology.tki.org.nz/Technology-in-the-NZC/Technological-practice) (brief development, planning, and outcome development and evaluation).
+
+When learners apply specialist disciplinary knowledge and understandings, this falls within the [technological knowledge strand](http://technology.tki.org.nz/Technology-in-the-NZC/Technological-knowledge) – the “knowing” (modelling/testing/trialing, and systems).
+
+The deeper questioning is the “why”, (such as, why does technology change, what drives it and what are the results in made outcomes?) This falls within the [nature of technology strand](http://technology.tki.org.nz/Technology-in-the-NZC/Nature-of-technology) (characteristics of technology and characteristics of technological outcomes).
+
+These strands are woven into the new digital technologies and hangarau matihikocontent through the progress outcomes.
diff --git a/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/how-are-students-better-off.md b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/how-are-students-better-off.md
new file mode 100644
index 0000000..958bafe
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/how-are-students-better-off.md
@@ -0,0 +1,29 @@
+# How are your students better off?
+
+{comment Mahuika: How do we look after our students?}
+
+You may have heard people say that young people know all about digital technology.
+But many of them **don’t know what they don’t know**, and often they base their views on stereotypes of the field.
+A devastating consequence of this is that some of the people most needed in the field don’t even know that it might be an exciting option for them.
+Watch these videos from senior tertiary computer science students who nearly missed out on the whole opportunity.
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
+
+Another concern is that the subject might only appeal to a particular group of students, and shouldn’t be required for everyone.
+Have a look at these comments from teachers who have been teaching digital technologies for the last few years.
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
+
+There’s also the question of how this relates to careers.
+Having digital technologies in the curriculum is not all about preparing students for careers, but we hope that some will find that this is their passion.
+There are incredible opportunities for employment in this area.
+Employees with strong skills in this area (combining technical and “soft” skills) are in short supply in NZ and overseas, especially in software development.
+
+TechHub NZ has information about the kinds of jobs available:
+
+- [TechHub – IT Careers](https://techhub.nz/IT-Careers)
+- [TechHub – Why IT?](https://techhub.nz/Why-IT)
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
diff --git a/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/is-it-all-about-devices.md b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/is-it-all-about-devices.md
new file mode 100644
index 0000000..e109648
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/is-it-all-about-devices.md
@@ -0,0 +1,39 @@
+# Is it all about devices?
+
+{comment Mahuika: Let’s focus on people, not things}
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
+
+{boxed-text type="pull-out"}
+
+**Activity: Explore a digital view of your own photo**
+
+Try the Pixel viewer demonstrated in the video above by going to the [Computer Science Field Guide – Pixel Value Interactive](http://csfieldguide.org.nz/en/interactives/pixel-viewer/index.html).
+You can drop your own photo onto the page to explore the colours in it.
+
+The RGB colour mixer used in the video is from the [Computer Science field Guide – RGB Colour Mixer](http://www.csfieldguide.org.nz/en/interactives/rgb-mixer/index.html).
+You can use it to see how the three numbers specify the colour.
+
+{boxed-text end}
+
+## Green screening - the hard way!
+
+{image file-path="images/pikau/arnold-the-wonder-parrot.jpg" alignment="center" caption="true"}
+
+Arnold the Wonder Parrot
+
+{image end}
+
+This is Arnold the Wonder Parrot, the mascot of the CS Unplugged project.
+You can explore this photo of Arnold at the [following link](http://csfieldguide.org.nz/en/interactives/pixel-viewer/index.html?hide-menu&no-pixel-fill&image=arnold.jpg), but it doesn’t have the colours visible, just their numbers.
+Can you see where the edge of the green is?
+(The G value will be high, and R and B will be low.)
+How about Arnold?
+(Orange pixels will have a high R and G value.)
+What you’re doing manually is green-screening – working out which pixels are the background, and which are the actor in front of the green.
+
+The activity above is looking at green-screen pixels.
+This is a good example of the relationship between CT (computational thinking) and DDDO (designing and developing digital outcomes).
+In DDDO, students use existing software to do green-screening to create new digital outcomes, while in CT, students would consider how to design an algorithm to do the green-screening.
diff --git a/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/structure-of-learning-area.md b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/structure-of-learning-area.md
new file mode 100644
index 0000000..c9b20ac
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/structure-of-learning-area.md
@@ -0,0 +1,26 @@
+# What’s the structure of the learning area?
+
+{comment Mahuika: What’s the big picture? How does it all fit together?}
+
+Not only is there new terminology to learn about technical topics, but there are also several names to know used for the new areas in the curriculum.
+We’ve been using the names already (such as “computational thinking”), but in this module we’ll look at exactly how they fit together.
+
+The following diagram shows how digital technologies fits into The New Zealand Curriculum.
+Digital Technologies is part of the technology learning area, and is made up of two “technological areas”.
+The full names of the two technological areas are “computational thinking for digital technologies” and “designing and developing digital outcomes”.
+These are a bit of a mouthful, so they are sometimes referred to as just “computational thinking”, or CT for short, and digital outcomes, DDDO, or 3DO.
+CT and 3DO together are referred to as “digital technologies”, or DT for short.
+
+{image file-path="images/core-education/technology-diagram.jpg" alignment="center"}
+
+The other technological areas (material outcomes, processed outcomes, and design and visual communication) have [achievement objectives](http://nzcurriculum.tki.org.nz/The-New-Zealand-Curriculum/Technology/Achievement-objectives).
+
+The new CT and DDDO technological areas use [progress outcomes (PO’s)](http://nzcurriculum.tki.org.nz/The-New-Zealand-Curriculum/Technology/Progress-outcomes), which describe the significant learning steps students take in building their digital capability.
+
+These PO’s link to the New Zealand Curriculum levels giving a broad indication of the approximate stage the learning takes place.
+We’ll explore that further in a separate pīkau!
+
+See The New Zealand Curriculum Online:
+
+- [Technology – Achievement objectives](http://nzcurriculum.tki.org.nz/The-New-Zealand-Curriculum/Technology/Achievement-objectives) (for areas other than Digital Technologies)
+- [Technology – Progress outcomes](http://nzcurriculum.tki.org.nz/The-New-Zealand-Curriculum/Technology/Progress-outcomes) (for Digital Technologies)
diff --git a/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/users-or-creators.md b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/users-or-creators.md
new file mode 100644
index 0000000..6f97989
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/users-or-creators.md
@@ -0,0 +1,10 @@
+# Users or creators?
+
+{comment Māui: We’re turning conventional thinking upside down}
+
+How much do young people actually know about digital technologies?
+Watch these videos for some ideas about this...
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
diff --git a/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/what-about-all-the-jargon.md b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/what-about-all-the-jargon.md
new file mode 100644
index 0000000..7407091
--- /dev/null
+++ b/pikau/content/pikau-courses/why-digital-technologies/why-this-matters/what-about-all-the-jargon.md
@@ -0,0 +1,28 @@
+# What about all the jargon?
+
+{comment Māui: Some pretty weird words, but how hard could it be?}
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
+
+{video url="https://www.youtube.com/embed/zSfzB-Z-mKM"}
+
+{boxed-text type="quote"}
+
+*“Why do you use such big words for such simple ideas?”* -
+(Primary school student doing a computer science activity)
+
+{boxed-text end}
+
+{boxed-text type="example"}
+
+**Challenge: Algorithms in the news**
+
+Is the word “algorithm” used in everyday news articles?
+Go to a newspaper website, and search for the world “algorithm”.
+Where does it come up, and how are algorithms affecting society?
+
+{boxed-text end}
+
+To look into the past, explore the following timeline to see where the idea of an algorithm has been used in the past, where the name comes from, and how algorithms have become important to us as digital devices become more common.
+
+
diff --git a/pikau/content/topics.yaml b/pikau/content/topics.yaml
index df5a126..c6bdab8 100644
--- a/pikau/content/topics.yaml
+++ b/pikau/content/topics.yaml
@@ -2,3 +2,4 @@ dddo: Designing and Developing Digital Outcomes
ct: Computational Thinking
dl: Digital Leaders
housekeeping: Housekeeping
+general: General
diff --git a/pikau/management/commands/_PikauCourseLoader.py b/pikau/management/commands/_PikauCourseLoader.py
index 2869b62..6128972 100644
--- a/pikau/management/commands/_PikauCourseLoader.py
+++ b/pikau/management/commands/_PikauCourseLoader.py
@@ -3,6 +3,7 @@
import os.path
from django.db import transaction
from utils.BaseLoader import BaseLoader
+from pikau.utils.find_file import find_file
from pikau.models import (
PikauCourse,
PikauUnit,
@@ -62,14 +63,17 @@ def load(self):
remove_title=False,
).html_string
+ cover_photo = pikau_course_metadata.get("cover-photo", COVER_PHOTO_DEFAULT)
+ trailer_video = pikau_course_metadata.get("trailer-video", "")
+
defaults = {
"name": pikau_course_metadata["name"],
"status": pikau_course_metadata["status"],
"language": pikau_course_metadata["language"],
"topic": Topic.objects.get(slug=pikau_course_metadata["topic"]),
"level": Level.objects.get(slug=pikau_course_metadata["level"]),
- "trailer_video": pikau_course_metadata.get("trailer-video", ""),
- "cover_photo": pikau_course_metadata.get("cover-photo", COVER_PHOTO_DEFAULT),
+ "trailer_video": trailer_video,
+ "cover_photo": cover_photo,
"overview": pikau_course_overview,
"readiness_level": pikau_course_metadata.get("readiness-level"),
"study_plan": pikau_course_study_plan,
@@ -82,6 +86,13 @@ def load(self):
defaults=defaults,
)
+ # Check cover photo, trailer video, and extra files are logged
+ pikau_course.files.add(find_file(filename=cover_photo))
+ if trailer_video:
+ pikau_course.files.add(find_file(filename=trailer_video))
+ for file_slug in pikau_course_metadata.get("extra-files", list()):
+ pikau_course.files.add(find_file(slug=file_slug))
+
# Delete all existing units for course
# since the will be loaded from raw data.
PikauUnit.objects.filter(pikau_course=pikau_course).delete()
@@ -92,6 +103,10 @@ def load(self):
heading_required=True,
remove_title=True,
)
+ # Check files in content
+ for filename in unit_content.required_files["images"]:
+ pikau_course.files.add(find_file(filename=filename))
+
pikau_course.content.create(
slug=unit_data["slug"],
pikau_course=pikau_course,
@@ -111,6 +126,9 @@ def load(self):
for pikau_course_glossary_term_slug in pikau_course_metadata.get("glossary", list()):
pikau_course.glossary_terms.add(GlossaryTerm.objects.get(slug=pikau_course_glossary_term_slug))
+ for pikau_course_prerequisite_slug in pikau_course_metadata.get("prerequisites", list()):
+ pikau_course.prerequisites.add(PikauCourse.objects.get(slug=pikau_course_prerequisite_slug))
+
self.log_object_creation(created, pikau_course)
self.log("All pikau courses loaded!\n")
diff --git a/pikau/management/commands/loaddata.py b/pikau/management/commands/loaddata.py
new file mode 100644
index 0000000..a572b90
--- /dev/null
+++ b/pikau/management/commands/loaddata.py
@@ -0,0 +1,14 @@
+"""Module for the custom Django loaddata command."""
+
+from django.core import management
+
+
+class Command(management.base.BaseCommand):
+ """Required command class for the custom Django loaddata command."""
+
+ help = "Update all data from content folders for all applications"
+
+ def handle(self, *args, **options):
+ """Automatically called when the updatedata command is given."""
+ management.call_command("loadfiles")
+ management.call_command("loadpikau")
diff --git a/pikau/migrations/0031_pikaucourse_files.py b/pikau/migrations/0031_pikaucourse_files.py
new file mode 100644
index 0000000..af55bb2
--- /dev/null
+++ b/pikau/migrations/0031_pikaucourse_files.py
@@ -0,0 +1,19 @@
+# Generated by Django 2.0.5 on 2018-06-07 02:53
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('files', '0001_initial'),
+ ('pikau', '0030_auto_20180529_0956'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='pikaucourse',
+ name='files',
+ field=models.ManyToManyField(blank=True, related_name='pikau_courses', to='files.File'),
+ ),
+ ]
diff --git a/pikau/models.py b/pikau/models.py
index 8342ccd..3a52cb6 100644
--- a/pikau/models.py
+++ b/pikau/models.py
@@ -5,6 +5,8 @@
from django.contrib.auth.models import User
from django.template import defaultfilters
from django.urls import reverse
+from files.models import File
+
LANGUAGE_CHOICES = (
("en", "English"),
@@ -242,7 +244,11 @@ class PikauCourse(models.Model):
study_plan = models.TextField(blank=True)
assessment_description = models.TextField(blank=True)
assessment_items = models.TextField(blank=True)
- # TODO: Add resources
+ files = models.ManyToManyField(
+ File,
+ related_name="pikau_courses",
+ blank=True,
+ )
# Development attributes
development_folder = models.URLField(blank=True)
diff --git a/pikau/utils/find_file.py b/pikau/utils/find_file.py
new file mode 100644
index 0000000..f106214
--- /dev/null
+++ b/pikau/utils/find_file.py
@@ -0,0 +1,40 @@
+"""Find file object for given filename or slug."""
+
+from os.path import basename
+from django.core.exceptions import ObjectDoesNotExist
+from files.models import File
+
+
+def find_file(filename=None, slug=None):
+ """Find file object for given filename or slug.
+
+ Args:
+ filename (str): String of file filename.
+ slug (str): String of file slug.
+
+ Returns:
+ File object.
+
+ Raises:
+ ValueError: If file object cannot be found.
+ """
+ if not filename and not slug:
+ raise ValueError("One keyword argument is required: filename or slug")
+ try:
+ if filename:
+ file_object = File.objects.get(filename=filename)
+ else:
+ file_object = File.objects.get(slug=slug)
+ except ObjectDoesNotExist:
+ if filename and not filename.startswith("http"):
+ try:
+ filename = basename(filename)
+ file_object = File.objects.get(filename=filename)
+ except ObjectDoesNotExist:
+ file_object = None
+ else:
+ file_object = None
+ if not file_object:
+ raise ValueError("File '{}' not listed in files list".format(filename or slug))
+ else:
+ return file_object
diff --git a/pikau/utils/pathways.py b/pikau/utils/pathways.py
index 7da2dde..ae23c59 100644
--- a/pikau/utils/pathways.py
+++ b/pikau/utils/pathways.py
@@ -6,8 +6,8 @@
GRAPH_TEMPLATE = (
"digraph {{"
- "graph [bgcolor=transparent,fontname=inherit];"
- "node [shape=box,fillcolor=white,style=filled,fontname=inherit];"
+ 'graph [bgcolor=transparent,fontname="helvetica"];'
+ 'node [shape=box,fillcolor=white,style=filled,fontname="helvetica", margin=0.1];'
"{nodes}"
"{edges}"
"}}"
diff --git a/pikau/views.py b/pikau/views.py
index e828429..ab607f5 100644
--- a/pikau/views.py
+++ b/pikau/views.py
@@ -39,6 +39,7 @@
from pikau.forms import (
GlossaryForm,
)
+from files.tables import FileTable
NUMBER_OF_FLAME_STAGES = 7
@@ -220,6 +221,16 @@ class PikauCourseDetailView(LoginRequiredMixin, DetailView):
context_object_name = "pikau_course"
model = PikauCourse
+ def get_context_data(self, **kwargs):
+ """Provide the context data for the pikau course view.
+
+ Returns:
+ Dictionary of context data.
+ """
+ context = super(PikauCourseDetailView, self).get_context_data(**kwargs)
+ context["table"] = FileTable(self.object.files.all())
+ return context
+
class PikauCourseContentView(LoginRequiredMixin, DetailView):
"""View for a pīkau course's content."""
diff --git a/release.sh b/release.sh
index 23a0bba..b86601d 100755
--- a/release.sh
+++ b/release.sh
@@ -1,5 +1,4 @@
#!/bin/bash
python manage.py collectstatic --no-input --settings=config.settings.production
python manage.py migrate --no-input --settings=config.settings.production
-python manage.py loadlicences --settings=config.settings.production
-python manage.py loadpikau --settings=config.settings.production
+python manage.py loaddata --settings=config.settings.production
diff --git a/requirements/base.txt b/requirements/base.txt
index fa4ccdc..eb440e6 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -1,7 +1,7 @@
# Base dependencies go here
# Django
-django==2.0.5
+django==2.0.6
whitenoise==3.3.1
django-heroku==0.3.1
django-environ==0.4.4
@@ -22,4 +22,4 @@ argon2-cffi==18.1.0
# Users
django-allauth==0.36.0
django-crispy-forms==1.7.2
-django-anymail==2.2
+django-anymail==3.0
diff --git a/static/css/website.css b/static/css/website.css
index ba711b5..01b3d38 100644
--- a/static/css/website.css
+++ b/static/css/website.css
@@ -99,6 +99,9 @@ footer > .container {
.icon {
width: 2.5rem;
}
+.icon-1-1 {
+ width: 1.1rem;
+}
.icon-small {
width: 1rem;
}
@@ -136,3 +139,9 @@ footer > .container {
.no-underline:hover {
text-decoration: none !important;
}
+#file-image-preview {
+ max-height: 25em;
+}
+.file-image-preview-small {
+ max-width: 10em;
+}
diff --git a/static/images/core-education/technology-diagram.jpg b/static/images/core-education/technology-diagram.jpg
new file mode 100644
index 0000000..74329fb
Binary files /dev/null and b/static/images/core-education/technology-diagram.jpg differ
diff --git a/static/images/icons/icons8/image.png b/static/images/icons/icons8/image.png
new file mode 100644
index 0000000..6918c5a
Binary files /dev/null and b/static/images/icons/icons8/image.png differ
diff --git a/static/images/icons/icons8/video.png b/static/images/icons/icons8/video.png
new file mode 100644
index 0000000..4b875f6
Binary files /dev/null and b/static/images/icons/icons8/video.png differ
diff --git a/static/images/pikau/arnold-the-wonder-parrot.jpg b/static/images/pikau/arnold-the-wonder-parrot.jpg
new file mode 100644
index 0000000..2dbe6f9
Binary files /dev/null and b/static/images/pikau/arnold-the-wonder-parrot.jpg differ
diff --git a/static/images/pikau/information-theory-activity.jpg b/static/images/pikau/information-theory-activity.jpg
new file mode 100644
index 0000000..2d03021
Binary files /dev/null and b/static/images/pikau/information-theory-activity.jpg differ
diff --git a/static/images/pikau/use-modify-create-diagram.svg b/static/images/pikau/use-modify-create-diagram.svg
new file mode 100644
index 0000000..8a053e7
--- /dev/null
+++ b/static/images/pikau/use-modify-create-diagram.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/static/js/lite.render.js b/static/js/lite.render.js
index fc8a76b..bd0fcac 100644
--- a/static/js/lite.render.js
+++ b/static/js/lite.render.js
@@ -1,5 +1,5 @@
/*
-Viz.js 2.0.0-pre.8 (Graphviz 2.40.1, Emscripten 1.37.36)
+Viz.js 2.0.0 (Graphviz 2.40.1, Emscripten 1.37.36)
*/
(function(global) {
var Module = function(Module) {
diff --git a/templates/files/file_detail.html b/templates/files/file_detail.html
index 801c986..f654f47 100644
--- a/templates/files/file_detail.html
+++ b/templates/files/file_detail.html
@@ -9,7 +9,7 @@
{% endblock breadcrumbs %}
{% block page_heading %}
- File: {{ file.filename }}
+ {{ file.name }}
{% with text='Update file' %}
{% url 'files:file_update' file.slug as update_url %}
@@ -18,12 +18,40 @@
{% blocktrans trimmed %}
- This page lists files used within Kia Takatū ā-Matihiko.
+ This page lists files used within Kia Takatū ā-Matihiko.
+ For retrieving licence information for images from Wikipedia and Wikimedia Commons use the Attribution Generator.
{% endblocktrans %}
- {% for pikau_course in level.pikau_courses.all %}
+ {% for pikau_course in glossaryterm.pikau_courses.all %}
{% include "pikau/snippets/pikau_course_card.html" %}
{% endfor %}