Mercurial > libervia-templates
comparison sat_templates/default/input/form.html @ 153:b84d20af0ed3
macros (field, form, textbox): general improvments:
- use a generic "field" macro for most fields
- added "required" class on input labels if suitable
- extra kw args are used as input field attributes. Same thing for forms
- better handling of id if label is missing
- added blog_text macro in textbox for basic text blog input
- textbox is more customisable (class and textarea class can be specified)
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 21 Jun 2018 01:09:00 +0200 |
parents | 33c7ce833d3f |
children |
comparison
equal
deleted
inserted
replaced
152:da2c0dc7c1ff | 153:b84d20af0ed3 |
---|---|
1 {% macro form(action='', class='') %} | 1 {% macro form(action='', class='') %} |
2 <form method="post" action="{{action}}" {{ {'class': class}|xmlattr }}> | 2 <form method="post" action="{{action}}" {{ {'class': class}|xmlattr }} {{kwargs|xmlattr}} > |
3 {% if csrf_token is defined %} | 3 {% if csrf_token is defined %} |
4 <input type="hidden" name="csrf_token" value="{{csrf_token}}"> | 4 <input type="hidden" name="csrf_token" value="{{csrf_token}}"> |
5 {% endif %} | 5 {% endif %} |
6 {{ caller() }} | 6 {{ caller() }} |
7 </form> | 7 </form> |