From 2b97c8f7839e127f80d367810a2578cb920c5c29 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 27 Dec 2024 16:02:38 +0000 Subject: git-compatible editor field for updated page --- core/views/expo.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'core/views/expo.py') diff --git a/core/views/expo.py b/core/views/expo.py index bf9e78d..f6cd76e 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -482,7 +482,8 @@ def editexpopage(request, path): if not filefound or result != html: # Check if content changed at all try: change_message = pageform.cleaned_data["change_message"] - write_and_commit([(filepath, result, "utf-8")], f"{change_message} - online edit of {path}") + editor = pageform.cleaned_data["who_are_you"] + write_and_commit([(filepath, result, "utf-8")], f"{change_message} - online edit of {path}", editor) except WriteAndCommitError as e: return render(request, "errors/generic.html", {"message": e.message}) @@ -521,6 +522,15 @@ class ExpoPageForm(forms.Form): ) change_message = forms.CharField( widget=forms.Textarea( - attrs={"cols": 80, "rows": 3, "placeholder": "Describe the change made (for version control records)"} + attrs={"cols": 80, "rows": 2, "placeholder": "Describe the change made (for version control records)", + "style": "vertical-align: text-top;"} ) ) + who_are_you = forms.CharField( + widget=forms.Textarea( + attrs={"cols": 90, "rows": 1, "placeholder": "You have edited this page, who are you ? e.g. 'Animal '", + "style": "vertical-align: text-top;"} + ), + label = "Editor" + ) + -- cgit v1.2.3