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

list.tmpl.py 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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.3507113
  9. _enable_loop = True
  10. _template_filename = '/home/thomas/.local/lib/python3.9/site-packages/nikola/data/themes/base/templates/list.tmpl'
  11. _template_uri = 'list.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('archive_nav', context._clean_inheritance_tokens(), templateuri='archive_navigation_helper.tmpl', callables=None, calling_uri=_template_uri)
  22. context.namespaces[(__name__, 'archive_nav')] = ns
  23. ns = runtime.TemplateNamespace('feeds_translations', context._clean_inheritance_tokens(), templateuri='feeds_translations_helper.tmpl', callables=None, calling_uri=_template_uri)
  24. context.namespaces[(__name__, 'feeds_translations')] = ns
  25. def _mako_inherit(template, context):
  26. _mako_generate_namespaces(context)
  27. return runtime._inherit_from(context, 'base.tmpl', _template_uri)
  28. def render_body(context,**pageargs):
  29. __M_caller = context.caller_stack._push_frame()
  30. try:
  31. __M_locals = __M_dict_builtin(pageargs=pageargs)
  32. _import_ns = {}
  33. _mako_get_namespace(context, 'archive_nav')._populate(_import_ns, ['*'])
  34. _mako_get_namespace(context, 'feeds_translations')._populate(_import_ns, ['*'])
  35. title = _import_ns.get('title', context.get('title', UNDEFINED))
  36. archive_nav = _mako_get_namespace(context, 'archive_nav')
  37. def extra_head():
  38. return render_extra_head(context._locals(__M_locals))
  39. def content():
  40. return render_content(context._locals(__M_locals))
  41. feeds_translations = _mako_get_namespace(context, 'feeds_translations')
  42. has_no_feeds = _import_ns.get('has_no_feeds', context.get('has_no_feeds', 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')
  49. __M_writer('\n\n')
  50. if 'parent' not in context._data or not hasattr(context._data['parent'], 'extra_head'):
  51. context['self'].extra_head(**pageargs)
  52. __M_writer('\n\n')
  53. if 'parent' not in context._data or not hasattr(context._data['parent'], 'content'):
  54. context['self'].content(**pageargs)
  55. __M_writer('\n')
  56. return ''
  57. finally:
  58. context.caller_stack._pop_frame()
  59. def render_extra_head(context,**pageargs):
  60. __M_caller = context.caller_stack._push_frame()
  61. try:
  62. _import_ns = {}
  63. _mako_get_namespace(context, 'archive_nav')._populate(_import_ns, ['*'])
  64. _mako_get_namespace(context, 'feeds_translations')._populate(_import_ns, ['*'])
  65. feeds_translations = _mako_get_namespace(context, 'feeds_translations')
  66. has_no_feeds = _import_ns.get('has_no_feeds', context.get('has_no_feeds', UNDEFINED))
  67. def extra_head():
  68. return render_extra_head(context)
  69. kind = _import_ns.get('kind', context.get('kind', UNDEFINED))
  70. __M_writer = context.writer()
  71. __M_writer('\n ')
  72. __M_writer(str(feeds_translations.head(kind=kind, rss_override=False, has_no_feeds=has_no_feeds)))
  73. __M_writer('\n')
  74. return ''
  75. finally:
  76. context.caller_stack._pop_frame()
  77. def render_content(context,**pageargs):
  78. __M_caller = context.caller_stack._push_frame()
  79. try:
  80. _import_ns = {}
  81. _mako_get_namespace(context, 'archive_nav')._populate(_import_ns, ['*'])
  82. _mako_get_namespace(context, 'feeds_translations')._populate(_import_ns, ['*'])
  83. title = _import_ns.get('title', context.get('title', UNDEFINED))
  84. archive_nav = _mako_get_namespace(context, 'archive_nav')
  85. def content():
  86. return render_content(context)
  87. feeds_translations = _mako_get_namespace(context, 'feeds_translations')
  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<article class="listpage">\n <header>\n <h1>')
  93. __M_writer(filters.html_escape(str(title)))
  94. __M_writer('</h1>\n </header>\n ')
  95. __M_writer(str(archive_nav.archive_navigation()))
  96. __M_writer('\n ')
  97. __M_writer(str(feeds_translations.translation_link(kind)))
  98. __M_writer('\n')
  99. if items:
  100. __M_writer(' <ul class="postlist">\n')
  101. for text, link, count in items:
  102. __M_writer(' <li><a href="')
  103. __M_writer(str(link))
  104. __M_writer('">')
  105. __M_writer(filters.html_escape(str(text)))
  106. __M_writer('</a>\n')
  107. if count:
  108. __M_writer(' (')
  109. __M_writer(str(count))
  110. __M_writer(')\n')
  111. __M_writer(' </ul>\n')
  112. else:
  113. __M_writer(' <p>')
  114. __M_writer(str(messages("Nothing found.")))
  115. __M_writer('</p>\n')
  116. __M_writer('</article>\n')
  117. return ''
  118. finally:
  119. context.caller_stack._pop_frame()
  120. """
  121. __M_BEGIN_METADATA
  122. {"filename": "/home/thomas/.local/lib/python3.9/site-packages/nikola/data/themes/base/templates/list.tmpl", "uri": "list.tmpl", "source_encoding": "utf-8", "line_map": {"23": 3, "26": 4, "32": 0, "51": 2, "52": 3, "53": 4, "58": 8, "63": 30, "69": 6, "81": 6, "82": 7, "83": 7, "89": 10, "104": 10, "105": 13, "106": 13, "107": 15, "108": 15, "109": 16, "110": 16, "111": 17, "112": 18, "113": 19, "114": 20, "115": 20, "116": 20, "117": 20, "118": 20, "119": 21, "120": 22, "121": 22, "122": 22, "123": 25, "124": 26, "125": 27, "126": 27, "127": 27, "128": 29, "134": 128}}
  123. __M_END_METADATA
  124. """