Skip to content

Commit

Permalink
Merge branch 'release/0.5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
JackMorganNZ committed Aug 30, 2017
2 parents e2252c4 + 4cbf8ef commit af9ab3a
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 9 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Changelog

## 0.5.3

- Allow manual configuration of slug values ([fixes #14](https://github.com/uccser/cs4teachers/issues/14))
- Fix email address in footer ([fixes #93](https://github.com/uccser/cs4teachers/issues/93))
- Fix displaying events if not public ([fixes #94](https://github.com/uccser/cs4teachers/issues/94))

## 0.5.2

- Update favicon to be readable ([fixes #46](https://github.com/uccser/cs4teachers/issues46))
- Add TinyMCE editor for session inline forms on admin site ([fixes #83](https://github.com/uccser/cs4teachers/issues83))
- Update favicon to be readable ([fixes #46](https://github.com/uccser/cs4teachers/issues/46))
- Add TinyMCE editor for session inline forms on admin site ([fixes #83](https://github.com/uccser/cs4teachers/issues/83))

## 0.5.1

Expand Down
2 changes: 1 addition & 1 deletion cs4teachers/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Configuration for Django system."""

__version__ = "0.5.2"
__version__ = "0.5.3"
7 changes: 7 additions & 0 deletions cs4teachers/events/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ class EventAdmin(admin.ModelAdmin):
"fields": ["is_published"]
}
),
(
"Advanced",
{
"fields": ["slug"],
"classes": ("grp-collapse", "grp-closed")
}
),
]
inlines = [SessionInline]
formfield_overrides = {
Expand Down
27 changes: 27 additions & 0 deletions cs4teachers/events/migrations/0031_auto_20170828_2006.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-28 20:06
from __future__ import unicode_literals

import autoslug.fields
from django.db import migrations
import events.models


class Migration(migrations.Migration):

dependencies = [
('events', '0030_series_subtitle'),
]

operations = [
migrations.AlterField(
model_name='event',
name='slug',
field=autoslug.fields.AutoSlugField(editable=True, populate_from=events.models.EventBase.create_slug, unique=True),
),
migrations.AlterField(
model_name='thirdpartyevent',
name='slug',
field=autoslug.fields.AutoSlugField(editable=True, populate_from=events.models.EventBase.create_slug, unique=True),
),
]
2 changes: 1 addition & 1 deletion cs4teachers/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def create_slug(self):
else:
return self.name

slug = AutoSlugField(unique=True, populate_from=create_slug)
slug = AutoSlugField(unique=True, populate_from=create_slug, editable=True, blank=True)
name = models.CharField(max_length=150)
description = models.TextField()
start_date = models.DateField()
Expand Down
12 changes: 11 additions & 1 deletion cs4teachers/events/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,19 @@ class EventView(generic.DetailView):

model = Event
template_name = "events/event.html"
slug_url_kwarg = "event_slug"
context_object_name = "event"

def get_object(self, **kwargs):
"""Retrieve object for the event view.
Returns:
Event object, or raises 404 error if not found.
"""
return get_object_or_404(
self.model.objects.filter(is_published=True).select_related(),
slug=self.kwargs.get("event_slug", None),
)

def get_context_data(self, **kwargs):
"""Provide the context data for the session view.
Expand Down
2 changes: 1 addition & 1 deletion cs4teachers/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1>{% block page_heading %}{% endblock page_heading %}</h1>
<div class="container text-center">
<img src="{% static 'img/uc-computer-science-education-logo.png' %}" class="logo my-3 mx-auto">
<p class="mt-3">
<strong>Contact us:</strong> <a href="mailto:csse.education.research@canterbury.ac.nz">csse.education.research@canterbury.ac.nz</a>
<strong>Contact us:</strong> <a href="mailto:csse-teacher-events@canterbury.ac.nz">csse-teacher-events@canterbury.ac.nz</a>
</p>
<p>
<strong>cs4teachers</strong> is a project by the <a href="http://www.cosc.canterbury.ac.nz/research/RG/CSE/">Computer Science Education Research Group</a> at the <a href="http://www.canterbury.ac.nz/">University of Canterbury</a>, New Zealand.
Expand Down
6 changes: 3 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ django-autoslug==1.9.3
django-grappelli==2.10.1

# Configuration
django-environ==0.4.3
django-environ==0.4.4
whitenoise==3.3.0
django-storages==1.6.5

# Python-PostgreSQL Database Adapter
psycopg2==2.7.3
psycopg2==2.7.3.1

# Password storage
argon2-cffi==16.3.0
Expand All @@ -23,7 +23,7 @@ django-google-maps==0.7.0
Pillow==4.2.1

# Storage
google-cloud-storage==1.2.0
google-cloud-storage==1.4.0

# Text editor
django-tinymce==2.6.0

0 comments on commit af9ab3a

Please sign in to comment.