Source

ryshcate / ryshcate / templates / _helpers.html

{# _helpers.html -- Helper tags for other templates
   (C) 2010 Matthew "LeafStorm" Frazier
   Part of Ryshcate, see LICENSE for details
#}

{% macro link_to(endpoint, text) -%}
<a href="{{ url_for(endpoint, **kwargs) }}">{{ text|safe }}</a>
{%- endmacro %}

{% macro form_tag(endpoint, method='post') -%}
<form action="{{ url_for(endpoint, **kwargs) }}" 
      method="{{ method }}">
  {{ caller () }}
</form>
{%- endmacro %}

{% macro submit(name) -%}
<input type="submit" value="{{ name }}" />
{%- endmacro %}

{% macro desc(field) -%}
<span class="fielddesc">({{ field.description }})</span>
{%- endmacro %}