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

listing.tmpl.py 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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.419754
  9. _enable_loop = True
  10. _template_filename = 'themes/bootstrap3/templates/listing.tmpl'
  11. _template_uri = 'listing.tmpl'
  12. _source_encoding = 'utf-8'
  13. _exports = ['content', 'sourcelink']
  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('ui', context._clean_inheritance_tokens(), templateuri='crumbs.tmpl', callables=None, calling_uri=_template_uri)
  22. context.namespaces[(__name__, 'ui')] = 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, 'ui')._populate(_import_ns, ['bar'])
  32. title = _import_ns.get('title', context.get('title', UNDEFINED))
  33. code = _import_ns.get('code', context.get('code', UNDEFINED))
  34. crumbs = _import_ns.get('crumbs', context.get('crumbs', UNDEFINED))
  35. files = _import_ns.get('files', context.get('files', UNDEFINED))
  36. messages = _import_ns.get('messages', context.get('messages', UNDEFINED))
  37. def content():
  38. return render_content(context._locals(__M_locals))
  39. ui = _mako_get_namespace(context, 'ui')
  40. def sourcelink():
  41. return render_sourcelink(context._locals(__M_locals))
  42. source_link = _import_ns.get('source_link', context.get('source_link', UNDEFINED))
  43. folders = _import_ns.get('folders', context.get('folders', UNDEFINED))
  44. __M_writer = context.writer()
  45. __M_writer('\n')
  46. __M_writer('\n')
  47. if 'parent' not in context._data or not hasattr(context._data['parent'], 'content'):
  48. context['self'].content(**pageargs)
  49. __M_writer('\n\n')
  50. if 'parent' not in context._data or not hasattr(context._data['parent'], 'sourcelink'):
  51. context['self'].sourcelink(**pageargs)
  52. __M_writer('\n')
  53. return ''
  54. finally:
  55. context.caller_stack._pop_frame()
  56. def render_content(context,**pageargs):
  57. __M_caller = context.caller_stack._push_frame()
  58. try:
  59. _import_ns = {}
  60. _mako_get_namespace(context, 'ui')._populate(_import_ns, ['bar'])
  61. title = _import_ns.get('title', context.get('title', UNDEFINED))
  62. code = _import_ns.get('code', context.get('code', UNDEFINED))
  63. crumbs = _import_ns.get('crumbs', context.get('crumbs', UNDEFINED))
  64. files = _import_ns.get('files', context.get('files', UNDEFINED))
  65. messages = _import_ns.get('messages', context.get('messages', UNDEFINED))
  66. def content():
  67. return render_content(context)
  68. ui = _mako_get_namespace(context, 'ui')
  69. source_link = _import_ns.get('source_link', context.get('source_link', UNDEFINED))
  70. folders = _import_ns.get('folders', context.get('folders', UNDEFINED))
  71. __M_writer = context.writer()
  72. __M_writer('\n')
  73. __M_writer(str(ui.bar(crumbs)))
  74. __M_writer('\n')
  75. if folders or files:
  76. __M_writer('<ul>\n')
  77. for name in folders:
  78. __M_writer(' <li><a href="')
  79. __M_writer(filters.url_escape(str(name)))
  80. __M_writer('"><i class="glyphicon glyphicon-folder-open"></i> ')
  81. __M_writer(filters.html_escape(str(name)))
  82. __M_writer('</a>\n')
  83. for name in files:
  84. __M_writer(' <li><a href="')
  85. __M_writer(filters.url_escape(str(name)))
  86. __M_writer('.html"><i class="glyphicon glyphicon-file"></i> ')
  87. __M_writer(filters.html_escape(str(name)))
  88. __M_writer('</a>\n')
  89. __M_writer('</ul>\n')
  90. if code:
  91. __M_writer('<h1>')
  92. __M_writer(str(title))
  93. __M_writer('\n')
  94. if source_link:
  95. __M_writer(' <small><a href="')
  96. __M_writer(str(source_link))
  97. __M_writer('">(')
  98. __M_writer(str(messages("Source")))
  99. __M_writer(')</a></small>\n')
  100. __M_writer(' </h1>\n ')
  101. __M_writer(str(code))
  102. __M_writer('\n')
  103. return ''
  104. finally:
  105. context.caller_stack._pop_frame()
  106. def render_sourcelink(context,**pageargs):
  107. __M_caller = context.caller_stack._push_frame()
  108. try:
  109. _import_ns = {}
  110. _mako_get_namespace(context, 'ui')._populate(_import_ns, ['bar'])
  111. messages = _import_ns.get('messages', context.get('messages', UNDEFINED))
  112. def sourcelink():
  113. return render_sourcelink(context)
  114. source_link = _import_ns.get('source_link', context.get('source_link', UNDEFINED))
  115. __M_writer = context.writer()
  116. __M_writer('\n')
  117. if source_link:
  118. __M_writer(' <li>\n <a href="')
  119. __M_writer(str(source_link))
  120. __M_writer('" id="sourcelink">')
  121. __M_writer(str(messages("Source")))
  122. __M_writer('</a>\n </li>\n')
  123. return ''
  124. finally:
  125. context.caller_stack._pop_frame()
  126. """
  127. __M_BEGIN_METADATA
  128. {"filename": "themes/bootstrap3/templates/listing.tmpl", "uri": "listing.tmpl", "source_encoding": "utf-8", "line_map": {"23": 3, "29": 0, "48": 2, "49": 3, "54": 24, "59": 32, "65": 4, "81": 4, "82": 5, "83": 5, "84": 6, "85": 7, "86": 8, "87": 9, "88": 9, "89": 9, "90": 9, "91": 9, "92": 11, "93": 12, "94": 12, "95": 12, "96": 12, "97": 12, "98": 14, "99": 16, "100": 17, "101": 17, "102": 17, "103": 18, "104": 19, "105": 19, "106": 19, "107": 19, "108": 19, "109": 21, "110": 22, "111": 22, "117": 26, "127": 26, "128": 27, "129": 28, "130": 29, "131": 29, "132": 29, "133": 29, "139": 133}}
  129. __M_END_METADATA
  130. """