diff --git a/webpage/forms.py b/webpage/forms.py index 22634fa..8342ff4 100644 --- a/webpage/forms.py +++ b/webpage/forms.py @@ -21,7 +21,7 @@ class WebpageForm(forms.ModelForm): self.subject = kwargs['initial'].get('subject', None) if self.instance.id: - self.subject = self.instance.subject + self.subject = self.instance.topic.subject self.initial['tags'] = ", ".join(self.instance.tags.all().values_list("name", flat = True)) self.initial['control_subject'] = self.subject.id diff --git a/webpage/templates/webpages/list.html b/webpage/templates/webpages/list.html index f61eb49..36b5e91 100644 --- a/webpage/templates/webpages/list.html +++ b/webpage/templates/webpages/list.html @@ -25,7 +25,7 @@
diff --git a/webpage/templates/webpages/update.html b/webpage/templates/webpages/update.html new file mode 100644 index 0000000..25e3d1f --- /dev/null +++ b/webpage/templates/webpages/update.html @@ -0,0 +1,37 @@ +{% extends 'subjects/view.html' %} + +{% load static i18n django_bootstrap_breadcrumbs %} + +{% block style %} + {{block.super}} + +{% endblock %} + +{% block javascript %} + {{block.super}} + + +{% endblock %} + +{% block breadcrumbs %} + {{ block.super }} + + {% breadcrumb topic 'subjects:view' topic.subject.slug %} + + {% trans 'Edit: ' as bread %} + {% with bread|add:webpage.name as bread_slug %} + {% breadcrumb bread_slug 'webpages:update' topic.slug webpage.slug %} + {% endwith %} +{% endblock %} + +{% block content %} +