# macro order_by_link(property, title, ignore='cursor', hash=None, inverse=False) # if request.args.get('order') == property {{title}} # elif request.args.get('order') == '-' + property {{title}} #else {{title}} #endif # endmacro # macro filter_by_link(property, value, icon=None, ignore='cursor', is_list=False, hash=None, label=None) # set value = '%s' % value # if icon # elif label {{label|safe}} # else {{value}} # endif # endmacro # macro back_link(title, route) # endmacro # macro next_link(next_url, prev_url=None, next_caption='', prev_caption='') # if next_url or prev_url # endif # endmacro # macro prefetch_link(url) # if url # endif # endmacro # macro signin_button(brand, class_btn, class_icon, url, is_icon=False) # set caption = 'Sign in with %s' % brand {{caption if not is_icon}} # endmacro # macro auth_icon(auth_id) # if auth_id == 'email_auth' # elif auth_id.startswith('azure_ad') # elif auth_id.startswith('bitbucket') # elif auth_id.startswith('dropbox') # elif auth_id.startswith('facebook') # elif auth_id.startswith('github') # elif auth_id.startswith('google') # elif auth_id.startswith('federated') # elif auth_id.startswith('instagram') # elif auth_id.startswith('linkedin') # elif auth_id.startswith('mailru') # elif auth_id.startswith('microsoft') # elif auth_id.startswith('reddit') # elif auth_id.startswith('twitter') # elif auth_id.startswith('yahoo') # else # endif # endmacro # macro auth_icons(user_db, max=0) # set count = user_db.auth_ids|length # set max = 3 if max > 0 and max < 3 else max # if user_db.password_hash # set max = max - 1 if max else max {{auth_icon('email_auth')}} # endif # set max = max - 1 if max and count > max else max # set more = count - max if max else 0 # for auth_id in user_db.auth_ids # if not max or loop.index0 < max {{auth_icon(auth_id)}} # elif max and loop.index0 == max # endif # endfor # endmacro # macro html_element(name, content) <{{name}} #- for arg in kwargs {{arg}}="{{kwargs[arg]}}" #- endfor > #- if content {{content}} #- endif # endmacro # macro include_md(file, class='')
# markdown # include file # endmarkdown
# endmacro # macro render_md(text, class='')
# markdown {{text|safe}} # endmarkdown
# endmacro