Mercurial > farol > farol
diff farol/templates/document/edit_note.j2 @ 49:5583ddcd6164
Unify the edit_note page
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Tue, 07 Oct 2014 16:15:43 +0200 |
parents | 5e6eed63ff07 |
children |
line wrap: on
line diff
--- a/farol/templates/document/edit_note.j2 Tue Oct 07 15:30:22 2014 +0200 +++ b/farol/templates/document/edit_note.j2 Tue Oct 07 16:15:43 2014 +0200 @@ -24,45 +24,14 @@ -#} {% extends "base.j2" %} -{% from "macros.j2" import textinput, textarea, selectinput %} +{% from "common_edits.j2" import edit_note %} + {% block title %}Edit the type{% endblock %} {% block content %} <form role="form" method="POST"> -{% call selectinput("type", "Type", types, note and note._type or '') %} -<p><em>Type</em> can be one of the following:</p> -<dl class="dl-horizontal"> - <dt>General:</dt> - <dd>A general, high-level note (<em>Title</em> may have more information).</dd> - <dt>Details:</dt> - <dd>A low-level detailed discussion (<em>Title</em> may have more information).</dd> - <dt>Description:</dt> - <dd>A description of something (<em>Title</em> may have more information).</dd> - <dt>Summary:</dt> - <dd>A summary of something (<em>Title</em> may have more information).</dd> - <dt>FAQ:</dt> - <dd>A list of frequently asked questions.</dd> - <dt>Legal Disclaimer:</dt> - <dd>Any possible legal discussion, including constraints, surrounding the document.</dd> - <dt>Other:</dt> - <dd>Something that doesn’t fit (<em>Title</em> should have more information).</dd> -</dl> -{% endcall %} -{% call textinput("ordinal", "Ordinal", "", ordinal or note._ordinal, type="number", required=True, extras={'min': '1'}) %} -<p><em>Ordinal</em> is a mandatory, locally significant value used to track notes inside a CVRF document at the root (document) level. It is provided to uniquely identify a <strong>Note</strong>.</p> -<p>There should be one of these values for every <strong>Note</strong> inside <strong>Document Notes</strong>, and it is recommended that <em>Ordinal</em> should be instantiated as a monotonically increasing counter, indexed from 1. Each <em>Ordinal</em> that tracks a <strong>Note</strong> inside <strong>Document Notes</strong> is completely independent from an <em>Ordinal</em> tracking a <strong>Note</strong> inside <strong>Vulnerability/Notes</strong>.</p> -{% endcall %} -{% call textinput("title", "Title", "", note and note._title or '') %} -<p><em>Title</em> should be a concise description of what is contained in the text.</p> -{% endcall %} -{% call textinput("audience", "Audience", "", note and note._audience or '') %} -<p><em>Audience</em> will indicate who is intended to read it.</p> -{% endcall %} -{% call textarea("note", "Note", "", note and note._note or '', 10, required=True) %} -<p><strong>Note</strong> is a place to put all manner of text blobs related to the document as a whole. It can be a concise summary of the overall document or a more compartmentalized and area-specific textual discussion.</p> -<p>The note should contain a compartmentalized textual discussion constrained by its <em>Type</em> attribute.</p> -{% endcall %} + {{ edit_note(types, note, ordinal) }} <button class="btn btn-primary" type="submit">{{ action or 'Update' }}</button> <a class="btn btn-danger" href="{% if action=='Add' %}{{ url_for('.view') }}{% else %}{{ url_for('.view_note', ordinal=note._ordinal) }}{% endif %}">Cancel</a>