A new Riff-radio.org site with a static approach.

tags.tmpl.py 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # -*- coding:utf-8 -*-
  2. from mako import runtime, filters, cache
  3. UNDEFINED = runtime.UNDEFINED
  4. STOP_RENDERING = runtime.STOP_RENDERING
  5. __M_dict_builtin = dict
  6. __M_locals_builtin = locals
  7. _magic_number = 10
  8. _modified_time = 1676236796.4125721
  9. _enable_loop = True
  10. _template_filename = 'themes/bootstrap3/templates/tags.tmpl'
  11. _template_uri = 'tags.tmpl'
  12. _source_encoding = 'utf-8'
  13. _exports = ['extra_head', 'content']
  14. def _mako_get_namespace(context, name):
  15. try:
  16. return context.namespaces[(__name__, name)]
  17. except KeyError:
  18. _mako_generate_namespaces(context)
  19. return context.namespaces[(__name__, name)]
  20. def _mako_generate_namespaces(context):
  21. ns = runtime.TemplateNamespace('feeds_translations', context._clean_inheritance_tokens(), templateuri='feeds_translations_helper.tmpl', callables=None, calling_uri=_template_uri)
  22. context.namespaces[(__name__, 'feeds_translations')] = ns
  23. def _mako_inherit(template, context):
  24. _mako_generate_namespaces(context)
  25. return runtime._inherit_from(context, 'base.tmpl', _template_uri)
  26. def render_body(context,**pageargs):
  27. __M_caller = context.caller_stack._push_frame()
  28. try:
  29. __M_locals = __M_dict_builtin(pageargs=pageargs)
  30. _import_ns = {}
  31. _mako_get_namespace(context, 'feeds_translations')._populate(_import_ns, ['*'])
  32. cat_items = _import_ns.get('cat_items', context.get('cat_items', UNDEFINED))
  33. title = _import_ns.get('title', context.get('title', UNDEFINED))
  34. len = _import_ns.get('len', context.get('len', UNDEFINED))
  35. range = _import_ns.get('range', context.get('range', UNDEFINED))
  36. def extra_head():
  37. return render_extra_head(context._locals(__M_locals))
  38. def content():
  39. return render_content(context._locals(__M_locals))
  40. feeds_translations = _mako_get_namespace(context, 'feeds_translations')
  41. cat_hierarchy = _import_ns.get('cat_hierarchy', context.get('cat_hierarchy', UNDEFINED))
  42. hidden_tags = _import_ns.get('hidden_tags', context.get('hidden_tags', UNDEFINED))
  43. messages = _import_ns.get('messages', context.get('messages', UNDEFINED))
  44. items = _import_ns.get('items', context.get('items', UNDEFINED))
  45. kind = _import_ns.get('kind', context.get('kind', UNDEFINED))
  46. __M_writer = context.writer()
  47. __M_writer('\n')
  48. __M_writer('\n\n')
  49. if 'parent' not in context._data or not hasattr(context._data['parent'], 'extra_head'):
  50. context['self'].extra_head(**pageargs)
  51. __M_writer('\n\n')
  52. if 'parent' not in context._data or not hasattr(context._data['parent'], 'content'):
  53. context['self'].content(**pageargs)
  54. __M_writer('\n')
  55. return ''
  56. finally:
  57. context.caller_stack._pop_frame()
  58. def render_extra_head(context,**pageargs):
  59. __M_caller = context.caller_stack._push_frame()
  60. try:
  61. _import_ns = {}
  62. _mako_get_namespace(context, 'feeds_translations')._populate(_import_ns, ['*'])
  63. feeds_translations = _mako_get_namespace(context, 'feeds_translations')
  64. def extra_head():
  65. return render_extra_head(context)
  66. kind = _import_ns.get('kind', context.get('kind', UNDEFINED))
  67. __M_writer = context.writer()
  68. __M_writer('\n ')
  69. __M_writer(str(feeds_translations.head(kind=kind, feeds=False)))
  70. __M_writer('\n')
  71. return ''
  72. finally:
  73. context.caller_stack._pop_frame()
  74. def render_content(context,**pageargs):
  75. __M_caller = context.caller_stack._push_frame()
  76. try:
  77. _import_ns = {}
  78. _mako_get_namespace(context, 'feeds_translations')._populate(_import_ns, ['*'])
  79. cat_items = _import_ns.get('cat_items', context.get('cat_items', UNDEFINED))
  80. title = _import_ns.get('title', context.get('title', UNDEFINED))
  81. len = _import_ns.get('len', context.get('len', UNDEFINED))
  82. range = _import_ns.get('range', context.get('range', UNDEFINED))
  83. def content():
  84. return render_content(context)
  85. feeds_translations = _mako_get_namespace(context, 'feeds_translations')
  86. cat_hierarchy = _import_ns.get('cat_hierarchy', context.get('cat_hierarchy', UNDEFINED))
  87. hidden_tags = _import_ns.get('hidden_tags', context.get('hidden_tags', UNDEFINED))
  88. messages = _import_ns.get('messages', context.get('messages', UNDEFINED))
  89. items = _import_ns.get('items', context.get('items', UNDEFINED))
  90. kind = _import_ns.get('kind', context.get('kind', UNDEFINED))
  91. __M_writer = context.writer()
  92. __M_writer('\n<h1>')
  93. __M_writer(filters.html_escape(str(title)))
  94. __M_writer('</h1>\n<div class="metadata">\n ')
  95. __M_writer(str(feeds_translations.translation_link(kind)))
  96. __M_writer('\n</div>\n')
  97. if cat_items:
  98. if items:
  99. __M_writer(' <h2>')
  100. __M_writer(str(messages("Categories")))
  101. __M_writer('</h2>\n')
  102. for text, full_name, path, link, indent_levels, indent_change_before, indent_change_after in cat_hierarchy:
  103. for i in range(indent_change_before):
  104. __M_writer(' <ul class="list-inline">\n')
  105. __M_writer(' <li><a class="reference badge" href="')
  106. __M_writer(str(link))
  107. __M_writer('">')
  108. __M_writer(filters.html_escape(str(text)))
  109. __M_writer('</a>\n')
  110. if indent_change_after <= 0:
  111. __M_writer(' </li>\n')
  112. for i in range(-indent_change_after):
  113. __M_writer(' </ul>\n')
  114. if i + 1 < len(indent_levels):
  115. __M_writer(' </li>\n')
  116. if items:
  117. __M_writer(' <h2>')
  118. __M_writer(str(messages("Tags")))
  119. __M_writer('</h2>\n')
  120. if items:
  121. __M_writer(' <ul class="list-inline">\n')
  122. for text, link in items:
  123. if text not in hidden_tags:
  124. __M_writer(' <li><a class="reference badge" href="')
  125. __M_writer(str(link))
  126. __M_writer('">')
  127. __M_writer(filters.html_escape(str(text)))
  128. __M_writer('</a></li>\n')
  129. __M_writer(' </ul>\n')
  130. return ''
  131. finally:
  132. context.caller_stack._pop_frame()
  133. """
  134. __M_BEGIN_METADATA
  135. {"filename": "themes/bootstrap3/templates/tags.tmpl", "uri": "tags.tmpl", "source_encoding": "utf-8", "line_map": {"23": 3, "29": 0, "50": 2, "51": 3, "56": 7, "61": 46, "67": 5, "77": 5, "78": 6, "79": 6, "85": 9, "103": 9, "104": 10, "105": 10, "106": 12, "107": 12, "108": 14, "109": 15, "110": 16, "111": 16, "112": 16, "113": 18, "114": 19, "115": 20, "116": 22, "117": 22, "118": 22, "119": 22, "120": 22, "121": 23, "122": 24, "123": 26, "124": 27, "125": 28, "126": 29, "127": 33, "128": 34, "129": 34, "130": 34, "131": 37, "132": 38, "133": 39, "134": 40, "135": 41, "136": 41, "137": 41, "138": 41, "139": 41, "140": 44, "146": 140}}
  136. __M_END_METADATA
  137. """