Mercurial > farol > farol
comparison farol/templates/macros.j2 @ 128:79abdecb2d0b
Add a regex for dates
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Thu, 23 Oct 2014 16:57:36 +0200 |
parents | e0830bcab004 |
children | a7ce1660aaaf |
comparison
equal
deleted
inserted
replaced
127:d49c1ee6bc07 | 128:79abdecb2d0b |
---|---|
40 type="{{ type }}" | 40 type="{{ type }}" |
41 {%- if type != 'file' %} class="form-control"{% endif %} | 41 {%- if type != 'file' %} class="form-control"{% endif %} |
42 id="{{ name }}" name="{{ name }}" | 42 id="{{ name }}" name="{{ name }}" |
43 {%- if placeholder %} placeholder="{{ placeholder }}"{% endif %} | 43 {%- if placeholder %} placeholder="{{ placeholder }}"{% endif %} |
44 {%- if value %} value="{{ value }}"{% endif %} | 44 {%- if value %} value="{{ value }}"{% endif %} |
45 {%- if regex %} pattern="{{ regex }}"{% endif %} | 45 {%- if regex %} pattern="{{ regex }}" |
46 {%- elif type == "datetime" %} pattern="\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?([+-]\d+(:\d+)?|Z)?)?" | |
47 {%- endif %} | |
46 {%- if required %} required{% endif %} | 48 {%- if required %} required{% endif %} |
47 {{- extras | xmlattr }}> | 49 {{- extras | xmlattr }}> |
48 {% if type == "datetime" %} | 50 {% if type == "datetime" %} |
49 <span class="input-group-btn"> | 51 <span class="input-group-btn"> |
50 <button class="btn btn-default" type="button" onclick="{{ name }}.value = new Date().toISOString()">now</button> | 52 <button class="btn btn-default" type="button" onclick="{{ name }}.value = new Date().toISOString()">now</button> |