diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2024-12-27 16:02:38 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2024-12-27 16:02:38 +0000 |
commit | 2b97c8f7839e127f80d367810a2578cb920c5c29 (patch) | |
tree | cb35192d680f7cb68b7588ce06b4c856e1f26ce7 /core/views/expo.py | |
parent | 5ee26af02ad53bbb5ddcd2fa7f7c9fca29bb0f72 (diff) | |
download | troggle-2b97c8f7839e127f80d367810a2578cb920c5c29.tar.gz troggle-2b97c8f7839e127f80d367810a2578cb920c5c29.tar.bz2 troggle-2b97c8f7839e127f80d367810a2578cb920c5c29.zip |
git-compatible editor field for updated page
Diffstat (limited to 'core/views/expo.py')
-rw-r--r-- | core/views/expo.py | 14 |
1 files changed, 12 insertions, 2 deletions
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 <mta@loveshack.expo>'", + "style": "vertical-align: text-top;"} + ), + label = "Editor" + ) + |