diff farol/templates/document/edit_tracking.j2 @ 126:e0830bcab004

Add (optional) regex matching to our input fields
author Benoît Allard <benoit.allard@greenbone.net>
date Thu, 23 Oct 2014 16:32:33 +0200
parents c79082d0d44d
children
line wrap: on
line diff
--- a/farol/templates/document/edit_tracking.j2	Thu Oct 23 16:18:30 2014 +0200
+++ b/farol/templates/document/edit_tracking.j2	Thu Oct 23 16:32:33 2014 +0200
@@ -52,7 +52,7 @@
 </dl>
 <p>Issuing parties are strongly recommended to set <strong>Status</strong> to <samp>Draft</samp> when initiating a new document and to implement procedures to ensure that the status is changed to the appropriate value before the document is released.</p>
 {% endcall %}
-{% call textinput("version", "Version", value=version, required=True) %}
+{% call textinput("version", "Version", value=version, required=True, regex='(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*)){0,3}') %}
 <p>Version is a simple counter to track the version of the document. This is a numeric tokenized field of the format “nn” – “nn.nn.nn.nn”. It may be incremented in either major or minor notation to denote clearly the evolution of the content of the document. Issuing parties must ensure that this field is incremented appropriately, even for the least editorial or grammatical changes, when the field is used. It is validated using the following regular expression: <code>(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*)){0,3}</code>.</p>
 {{ examples(['1.0', '1.0.1', '1.0.0.1']) }}
 {% endcall %}

http://farol.wald.intevation.org