# HG changeset patch # User BenoƮt Allard # Date 1412771309 -7200 # Node ID aad7db3f93b6cf49a1b29965b06ffece054595cf # Parent b4fb652484b441d70965299aca5bca226bfb9386 Add support for Acknowledgments with multiple names and organizations diff -r b4fb652484b4 -r aad7db3f93b6 farol/document.py --- a/farol/document.py Wed Oct 08 14:15:16 2014 +0200 +++ b/farol/document.py Wed Oct 08 14:28:29 2014 +0200 @@ -240,7 +240,10 @@ except IndexError: abort(404) if request.method != 'POST': - return render_template('document/edit_acknowledgment.j2', name=ack._name, organization=ack._organization, description=ack._description, url=ack._url, action='Update') + return render_template('document/edit_acknowledgment.j2', + names=ack._names, organizations=ack._organizations, + description=ack._description, url=ack._url, + action='Update') update_acknowledgment_from_request(ack) return redirect(url_for('.view')) @@ -249,7 +252,8 @@ @document_required def add_acknowledgment(): if request.method != 'POST': - return render_template('document/edit_acknowledgment.j2', action='Add') + return render_template('document/edit_acknowledgment.j2', + action='Add') ack = create_acknowledgment_from_request() get_current().addAcknowledgment(ack) diff -r b4fb652484b4 -r aad7db3f93b6 farol/templates/common_edits.j2 --- a/farol/templates/common_edits.j2 Wed Oct 08 14:15:16 2014 +0200 +++ b/farol/templates/common_edits.j2 Wed Oct 08 14:28:29 2014 +0200 @@ -96,14 +96,14 @@ {% endcall %} {% endmacro %} -{% macro edit_acknowledgment(name, organization, description, url) %} +{% macro edit_acknowledgment(names, organizations, description, url) %}

Acknowledgment contains recognition of external parties that reported noncritical/low-severity security issues or provided information, observations, or suggestions that contributed to improved security or improved documentation in future releases of the document producer's products. This may also contain recognition to external parties that contributed toward producing this document.

This element indicates collaboration with the security community in a positive fashion and is an important part of a notice or advisory. Care should be taken to ensure that individuals would like to be acknowledged before they are included.

-{% call textinput("name", "Names", "", name, help="Multiple names should be comma-separated.") %} +{% call textinput("names", "Names", "", names | join(', '), help="Multiple names should be comma-separated.") %}

The Name should contain the name of the party being acknowledged.

{% endcall %} -{% call textinput("organization", "Organizations", "", organization, help="Multiple organizations should be comma-separated.") %} +{% call textinput("organizations", "Organizations", "", organizations | join(', '), help="Multiple organizations should be comma-separated.") %}

The Organization should contain the organization of the party or if the Name is omitted, the organization itself that is being acknowledged.

{% endcall %} {% call textarea("description", "Description", "", description, 5) %} diff -r b4fb652484b4 -r aad7db3f93b6 farol/templates/document/edit_acknowledgment.j2 --- a/farol/templates/document/edit_acknowledgment.j2 Wed Oct 08 14:15:16 2014 +0200 +++ b/farol/templates/document/edit_acknowledgment.j2 Wed Oct 08 14:28:29 2014 +0200 @@ -30,7 +30,7 @@ {% block content %}
- {{ edit_acknowledgment(name, organization, description, url) }} + {{ edit_acknowledgment(names, organizations, description, url) }} Cancel diff -r b4fb652484b4 -r aad7db3f93b6 farol/templates/document/view_acknowledgment.j2 --- a/farol/templates/document/view_acknowledgment.j2 Wed Oct 08 14:15:16 2014 +0200 +++ b/farol/templates/document/view_acknowledgment.j2 Wed Oct 08 14:28:29 2014 +0200 @@ -30,7 +30,7 @@ {% block content %} edit
{{ label_value('Description', acknowledgment._description or '') }} diff -r b4fb652484b4 -r aad7db3f93b6 farol/templates/vulnerability/edit_acknowledgment.j2 --- a/farol/templates/vulnerability/edit_acknowledgment.j2 Wed Oct 08 14:15:16 2014 +0200 +++ b/farol/templates/vulnerability/edit_acknowledgment.j2 Wed Oct 08 14:28:29 2014 +0200 @@ -32,7 +32,7 @@ {% block content %} - {{ edit_acknowledgment(name, organization, description, url) }} + {{ edit_acknowledgment(names, organizations, description, url) }} Cancel diff -r b4fb652484b4 -r aad7db3f93b6 farol/templates/vulnerability/view_acknowledgment.j2 --- a/farol/templates/vulnerability/view_acknowledgment.j2 Wed Oct 08 14:15:16 2014 +0200 +++ b/farol/templates/vulnerability/view_acknowledgment.j2 Wed Oct 08 14:28:29 2014 +0200 @@ -30,7 +30,7 @@ {% block i_content %} edit
{{ label_value('Description', acknowledgment._description or '') }} diff -r b4fb652484b4 -r aad7db3f93b6 farol/vulnerability.py --- a/farol/vulnerability.py Wed Oct 08 14:15:16 2014 +0200 +++ b/farol/vulnerability.py Wed Oct 08 14:28:29 2014 +0200 @@ -446,7 +446,10 @@ ack = get_vuln(ordinal)._acknowledgments[index] except IndexError: abort(404) - return render_template('vulnerability/view_acknowledgment.j2', ordinal=ordinal, acknowledgment=ack, index=index, action='Update') + return render_template('vulnerability/view_acknowledgment.j2', + ordinal=ordinal, + acknowledgment=ack, index=index, + action='Update') @vulnerability.route('//acknowledgment//edit', methods=['GET', 'POST']) @document_required @@ -456,7 +459,11 @@ except IndexError: abort(404) if request.method != 'POST': - return render_template('vulnerability/edit_acknowledgment.j2', ordinal=ordinal, name=ack._name, organization=ack._organization, description=ack._description, url=ack._url, action='Update') + return render_template('vulnerability/edit_acknowledgment.j2', + ordinal=ordinal, + names=ack._names, organizations=ack._organizations, + description=ack._description, url=ack._url, + action='Update') update_acknowledgment_from_request(ack) return redirect(url_for('.view', ordinal=ordinal))