Skip to content

Commit

Permalink
Merge branch 'release/0.4.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
JackMorganNZ committed May 24, 2018
2 parents 6ba0f69 + dd01eca commit c7f2922
Show file tree
Hide file tree
Showing 12 changed files with 471 additions and 21 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Changelog

## 0.4.4 (Pre-release)

- Update glossary definitions from CS Field Guide material.
- Remove 'Example Pikau' from being loaded (but keep source files as example).
- Dependency updates:
- Update django-tables2 from 2.0.0a2 to 2.0.0a3.

## 0.4.3 (Pre-release)

- Update pīkau course content rendering to match iQualify.
- Ensure all pīkau models can be modified via admin interface.


## 0.4.2 (Pre-release)

- Display pīkau cover photos with center positioning.
Expand Down
2 changes: 1 addition & 1 deletion config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Module for Django system configuration."""

__version__ = "0.4.3"
__version__ = "0.4.4"
445 changes: 436 additions & 9 deletions pikau/content/glossary.yaml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pikau/content/pikau-courses.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
courses:
- example-pikau-course
- getting-the-most-out-of-pikau
4 changes: 2 additions & 2 deletions pikau/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.layout = Layout(
Field("term", css_class="slug-source"),
"description",
"definition",
Field("slug", css_class="slug-input"),
Submit("submit", "Submit"),
)
Expand All @@ -26,4 +26,4 @@ class Meta:
"""Meta attributes of GlossaryForm."""

model = GlossaryTerm
fields = ("term", "description", "slug")
fields = ("term", "definition", "slug")
4 changes: 2 additions & 2 deletions pikau/management/commands/_GlossaryTermLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def load(self):

for term_slug, term_data in glossary_data.items():
term_name = term_data["term"]
term_description = term_data["description"]
term_definition = term_data["definition"]
defaults = {
"term": term_name,
"description": term_description,
"definition": term_definition,
}
glossary_term, created = GlossaryTerm.objects.update_or_create(
slug=term_slug,
Expand Down
18 changes: 18 additions & 0 deletions pikau/migrations/0028_auto_20180524_1528.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.0.5 on 2018-05-24 03:28

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('pikau', '0027_auto_20180522_1652'),
]

operations = [
migrations.RenameField(
model_name='glossaryterm',
old_name='description',
new_name='definition',
),
]
2 changes: 1 addition & 1 deletion pikau/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class GlossaryTerm(models.Model):
help_text="A unique readable identifier",
)
term = models.CharField(max_length=200, unique=True)
description = models.TextField()
definition = models.TextField()

def get_absolute_url(self):
"""Return the canonical URL for a glossary term.
Expand Down
3 changes: 1 addition & 2 deletions pikau/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ class GlossaryTermTable(tables.Table):
"""Table to display all glossary terms."""

term = tables.LinkColumn()
slug = tables.TemplateColumn(template_code="<code>{{ record.slug }}</code>")

class Meta:
"""Meta attributes for GlossaryTermTable class."""

model = GlossaryTerm
fields = ("term", "slug", "description")
fields = ("term", "definition")
order_by = "term"
attrs = {"class": "table table-hover"}
1 change: 1 addition & 0 deletions pikau/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class GlossaryListView(LoginRequiredMixin, SingleTableView):

model = GlossaryTerm
table_class = tables.GlossaryTermTable
table_pagination = False


class GlossaryDetailView(LoginRequiredMixin, DetailView):
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ django-environ==0.4.4
django-bootstrap-breadcrumbs==0.9.1
# File 'templates/tables/table.hmtl' is based off their 'bootstrap4'
# template so should be updated when original is updated in package.
django-tables2==2.0.0a2
django-tables2==2.0.0a3
django-filter==1.1.0

# Content Loading
Expand Down
2 changes: 1 addition & 1 deletion templates/pikau/glossaryterm_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{% endblock page_heading %}

{% block content %}
<p>{{ glossaryterm.description }}</p>
<p>{{ glossaryterm.definition }}</p>

<p><strong>Slug:</strong> <code>{{ glossaryterm.slug }}</code></p>

Expand Down

0 comments on commit c7f2922

Please sign in to comment.