Skip to content

Commit 93b4d6f

Browse files
committed
Added Closing Notes to history and about pages for groups. Fixes issue ietf-tools#2725. Commit ready for merge.
- Legacy-Id: 16559
1 parent c3ffd09 commit 93b4d6f

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

ietf/group/forms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def clean(self):
5757
raise forms.ValidationError("NULL TXT file input is not a valid option")
5858

5959
class ConcludeGroupForm(forms.Form):
60-
instructions = forms.CharField(widget=forms.Textarea(attrs={'rows': 30}), required=True, strip=False)
60+
instructions = forms.CharField(widget=forms.Textarea(attrs={'rows': 15}), required=True, strip=False)
61+
closing_note = forms.CharField(widget=forms.Textarea(attrs={'rows': 5}), label='Closing note, for WG history (optional)', required=False, strip=False)
6162

6263
class GroupForm(forms.Form):
6364
name = forms.CharField(max_length=80, label="Name", required=True)
@@ -78,6 +79,7 @@ class GroupForm(forms.Form):
7879
list_subscribe = forms.CharField(max_length=255, required=False)
7980
list_archive = forms.CharField(max_length=255, required=False)
8081
urls = forms.CharField(widget=forms.Textarea, label="Additional URLs", help_text="Format: https://site/path (Optional description). Separate multiple entries with newline. Prefer HTTPS URLs where possible.", required=False)
82+
closing_note = forms.CharField(widget=forms.Textarea, label="Closing note", required=False)
8183

8284
def __init__(self, *args, **kwargs):
8385
self.group = kwargs.pop('group', None)

ietf/group/views.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,10 @@ def group_about(request, acronym, group_type=None):
523523
e = group.latest_event(type__in=("changed_state", "requested_close",))
524524
requested_close = group.state_id != "conclude" and e and e.type == "requested_close"
525525

526+
e = None
527+
if group.state_id == "conclude":
528+
e = group.latest_event(type='closing_note')
529+
526530
can_manage = can_manage_group_type(request.user, group)
527531
charter_submit_url = ""
528532
if group.features.has_chartering_process:
@@ -542,6 +546,7 @@ def group_about(request, acronym, group_type=None):
542546
"status_update": status_update,
543547
"charter_submit_url": charter_submit_url,
544548
"editable_roles": roles_for_group_type(group_type),
549+
"closing_note": e,
545550
}))
546551

547552
def all_status(request):
@@ -1000,13 +1005,36 @@ def diff(attr, name):
10001005

10011006
group.save()
10021007

1008+
#Handle changes to Closing Note, if any. It's an event, not a group attribute like the others
1009+
closing_note = ""
1010+
e = group.latest_event(type='closing_note')
1011+
if e:
1012+
closing_note = e.desc
1013+
1014+
if closing_note != clean["closing_note"]:
1015+
closing_note = clean["closing_note"]
1016+
e = GroupEvent(group=group, by=request.user.person)
1017+
e.type = "closing_note"
1018+
if closing_note == "":
1019+
e.desc = "(Closing note deleted)" #Flag value so something shows up in history
1020+
else:
1021+
e.desc = closing_note
1022+
e.save()
1023+
10031024
if action=="charter":
10041025
return redirect('ietf.doc.views_charter.submit', name=charter_name_for_group(group), option="initcharter")
10051026

10061027
return HttpResponseRedirect(group.about_url())
10071028
else: # Not POST:
10081029
if not new_group:
10091030
ad_role = group.ad_role()
1031+
closing_note = ""
1032+
e = group.latest_event(type='closing_note')
1033+
if e:
1034+
closing_note = e.desc
1035+
if closing_note == "(Closing note deleted)":
1036+
closing_note = ""
1037+
10101038
init = dict(name=group.name,
10111039
acronym=group.acronym,
10121040
state=group.state,
@@ -1016,6 +1044,7 @@ def diff(attr, name):
10161044
list_subscribe=group.list_subscribe if group.list_subscribe else None,
10171045
list_archive=group.list_archive if group.list_archive else None,
10181046
urls=format_urls(group.groupurl_set.all()),
1047+
closing_note = closing_note,
10191048
)
10201049

10211050
for slug in roles_for_group_type(group_type):
@@ -1042,14 +1071,23 @@ def conclude(request, acronym, group_type=None):
10421071
form = ConcludeGroupForm(request.POST)
10431072
if form.is_valid():
10441073
instructions = form.cleaned_data['instructions']
1074+
closing_note = form.cleaned_data['closing_note']
10451075

1076+
if closing_note != "":
1077+
instructions = instructions+"\n\n=====\nClosing note:\n\n"+closing_note
10461078
email_admin_re_charter(request, group, "Request closing of group", instructions, 'group_closure_requested')
10471079

10481080
e = GroupEvent(group=group, by=request.user.person)
10491081
e.type = "requested_close"
10501082
e.desc = "Requested closing group"
10511083
e.save()
10521084

1085+
if closing_note != "":
1086+
e = GroupEvent(group=group, by=request.user.person)
1087+
e.type = "closing_note"
1088+
e.desc = closing_note
1089+
e.save()
1090+
10531091
kwargs = {'acronym':group.acronym}
10541092
if group_type:
10551093
kwargs['group_type'] = group_type

ietf/templates/group/group_about.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@
221221
{% endif %}
222222
</table>
223223

224+
{% if closing_note and closing_note.desc != "(Closing note deleted)" %}
225+
<h2>Closing note for {{ group.type.desc.title }}</h2>
226+
{{ closing_note.desc }}
227+
{% endif %}
228+
224229
{% if group.features.has_chartering_process %}
225230
<h2>Charter for {% if group.state_id == "proposed" %}proposed{% endif %} {{ group.type.desc.title }}</h2>
226231
{# the linebreaks filter adds <p/>, no surrounding <p/> necessary: #}

0 commit comments

Comments
 (0)