2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 12:37:07 +00:00

git-compatible editor field for updated page

This commit is contained in:
2024-12-27 16:02:38 +00:00
parent 5ee26af02a
commit 2b97c8f783
2 changed files with 37 additions and 5 deletions

View File

@@ -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"
)