diff --git a/app/grandchallenge/documentation/forms.py b/app/grandchallenge/documentation/forms.py index bea49862ff..7575fe37e1 100644 --- a/app/grandchallenge/documentation/forms.py +++ b/app/grandchallenge/documentation/forms.py @@ -2,7 +2,8 @@ from crispy_forms.layout import Submit from django import forms -from grandchallenge.core.widgets import MarkdownEditorInlineWidget +from grandchallenge.core.forms import SaveFormInitMixin +from grandchallenge.core.widgets import MarkdownEditorFullPageWidget from grandchallenge.documentation.models import DocPage @@ -14,13 +15,21 @@ def __init__(self, *args, **kwargs): class Meta: model = DocPage - fields = ("title", "content", "parent") - widgets = {"content": MarkdownEditorInlineWidget} + fields = ("title", "parent") -class DocPageUpdateForm(DocPageCreateForm): - """Like the create form but you can also move the page.""" +class DocPageMetadataUpdateForm(DocPageCreateForm): + """Like the create form, but you can also move the page.""" position = forms.IntegerField() position.label = "Move to index position" position.required = False + + +class DocPageContentUpdateForm(SaveFormInitMixin, forms.ModelForm): + class Meta: + model = DocPage + fields = ("content",) + widgets = { + "content": MarkdownEditorFullPageWidget, + } diff --git a/app/grandchallenge/documentation/templates/documentation/docpage_content_update.html b/app/grandchallenge/documentation/templates/documentation/docpage_content_update.html new file mode 100644 index 0000000000..07b977a99e --- /dev/null +++ b/app/grandchallenge/documentation/templates/documentation/docpage_content_update.html @@ -0,0 +1,11 @@ +{% extends "documentation/docpage_form.html" %} +{% load crispy from crispy_forms_tags %} + +{% block container %}container-fluid{% endblock %} + +{% block outer_content %} + +