{# Copyright (C) 2006-2014 Edgewall Software This software is licensed as described in the file COPYING, which you should have received as part of this distribution. The terms are also available at https://trac.edgewall.org/wiki/TracLicense. This software consists of voluntary contributions made by many individuals. For the exact contribution history, see the revision history and logs, available at https://trac.edgewall.org/. #} ## Macros and constants {# Usage: # import 'macros.html' as jmacros with context Note that this import is not necessary in templates that extend the "layout.html" template, as the latter contains that import. However, in secondary templates included from a template extending "layout.html", jmacros is no longer accessible and the import statement has to be written again. #} {# Creates an form field containing the CSRF protection token. All form with method POST should include this field. Example:
${jmacros.form_token_input()} ...
#} # macro form_token_input() # endmacro ## jinjacheck: "input" OK {# Utilities for the repetitive help divs #} # macro note() ${_("Note:")} # endmacro # macro wikihelp(page, anchor='')
# set trac_page ${page} # endset ${caller(note(), trac_page)}
#endmacro # macro wikiformatting_link() WikiFormatting # endmacro # macro warnings(messages, id='warning', close_message=True) # if messages:
# if close_message: ${_("close")} # endif ${_("Warning:")} # if len(messages) == 1: ${messages[0]} # else: # endif
# endif # endmacro # macro notices(messages, id='notice', close_message=True) # if messages:
# if close_message: ${_("close")} # endif # if len(messages) == 1: ${messages[0]} # else: # endif
# endif # endmacro