# HG changeset patch # User BenoƮt Allard # Date 1413274988 -7200 # Node ID 21a1a69b4525c296a8c5879299bd18352d47bfde # Parent 5535ac5fef3786b8401761362e8bfde742823f50 Introduce a POST_button macro and use it in the delete_button one. diff -r 5535ac5fef37 -r 21a1a69b4525 farol/static/style.css --- a/farol/static/style.css Fri Oct 10 10:25:35 2014 +0200 +++ b/farol/static/style.css Tue Oct 14 10:23:08 2014 +0200 @@ -14,7 +14,7 @@ } */ -form.delete { +form.inlined-form { display: inline-block; } diff -r 5535ac5fef37 -r 21a1a69b4525 farol/templates/macros.j2 --- a/farol/templates/macros.j2 Fri Oct 10 10:25:35 2014 +0200 +++ b/farol/templates/macros.j2 Tue Oct 14 10:23:08 2014 +0200 @@ -169,15 +169,28 @@ {% endif %} {% endmacro %} +{% macro POST_button(url, text, fields, out=False, style='btn-default') %} +{% if caller and out %} + {{ caller('$(this).next()') }} +{% endif %} + +{% endmacro %} + {% macro delete_button(url, hiddens={}, text="delete") %} -
- {% for elem in hiddens %} - - {% endfor %} - + {% call(selector) POST_button(url, text, hiddens) %} + {{ text }} -
+ {% endcall %} {% endmacro %}