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

base.tmpl.py 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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.1666944
  9. _enable_loop = True
  10. _template_filename = 'themes/bootblog/templates/base.tmpl'
  11. _template_uri = 'base.tmpl'
  12. _source_encoding = 'utf-8'
  13. _exports = ['extra_head', 'belowtitle', 'sourcelink', 'content', 'extra_js']
  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('base', context._clean_inheritance_tokens(), templateuri='base_helper.tmpl', callables=None, calling_uri=_template_uri)
  22. context.namespaces[(__name__, 'base')] = ns
  23. def render_body(context,**pageargs):
  24. __M_caller = context.caller_stack._push_frame()
  25. try:
  26. __M_locals = __M_dict_builtin(pageargs=pageargs)
  27. _import_ns = {}
  28. _mako_get_namespace(context, 'base')._populate(_import_ns, ['*'])
  29. content_footer = _import_ns.get('content_footer', context.get('content_footer', UNDEFINED))
  30. set_locale = _import_ns.get('set_locale', context.get('set_locale', UNDEFINED))
  31. blog_sidebar = _import_ns.get('blog_sidebar', context.get('blog_sidebar', UNDEFINED))
  32. momentjs_locales = _import_ns.get('momentjs_locales', context.get('momentjs_locales', UNDEFINED))
  33. def extra_js():
  34. return render_extra_js(context._locals(__M_locals))
  35. abs_link = _import_ns.get('abs_link', context.get('abs_link', UNDEFINED))
  36. def extra_head():
  37. return render_extra_head(context._locals(__M_locals))
  38. lang = _import_ns.get('lang', context.get('lang', UNDEFINED))
  39. def belowtitle():
  40. return render_belowtitle(context._locals(__M_locals))
  41. search_form = _import_ns.get('search_form', context.get('search_form', UNDEFINED))
  42. messages = _import_ns.get('messages', context.get('messages', UNDEFINED))
  43. template_hooks = _import_ns.get('template_hooks', context.get('template_hooks', UNDEFINED))
  44. show_sourcelink = _import_ns.get('show_sourcelink', context.get('show_sourcelink', UNDEFINED))
  45. translations = _import_ns.get('translations', context.get('translations', UNDEFINED))
  46. base = _mako_get_namespace(context, 'base')
  47. blog_title = _import_ns.get('blog_title', context.get('blog_title', UNDEFINED))
  48. len = _import_ns.get('len', context.get('len', UNDEFINED))
  49. js_date_format = _import_ns.get('js_date_format', context.get('js_date_format', UNDEFINED))
  50. show_blog_title = _import_ns.get('show_blog_title', context.get('show_blog_title', UNDEFINED))
  51. logo_url = _import_ns.get('logo_url', context.get('logo_url', UNDEFINED))
  52. body_end = _import_ns.get('body_end', context.get('body_end', UNDEFINED))
  53. _link = _import_ns.get('_link', context.get('_link', UNDEFINED))
  54. def content():
  55. return render_content(context._locals(__M_locals))
  56. def sourcelink():
  57. return render_sourcelink(context._locals(__M_locals))
  58. date_fanciness = _import_ns.get('date_fanciness', context.get('date_fanciness', UNDEFINED))
  59. blog_description = _import_ns.get('blog_description', context.get('blog_description', UNDEFINED))
  60. __M_writer = context.writer()
  61. __M_writer('\n')
  62. __M_writer(str(set_locale(lang)))
  63. __M_writer('\n')
  64. __M_writer(str(base.html_headstart()))
  65. __M_writer('\n')
  66. if 'parent' not in context._data or not hasattr(context._data['parent'], 'extra_head'):
  67. context['self'].extra_head(**pageargs)
  68. __M_writer('\n')
  69. __M_writer(str(template_hooks['extra_head']()))
  70. __M_writer('\n</head>\n<body>\n<a href="#content" class="sr-only sr-only-focusable">')
  71. __M_writer(str(messages("Skip to main content")))
  72. __M_writer('</a>\n\n<!-- Menubar -->\n\n<div class="blog-masthead">\n <div class="container"><!-- This keeps the margins nice -->\n <nav class="blog-nav" role="navigation">\n ')
  73. __M_writer(str(base.html_navigation_links()))
  74. __M_writer('\n ')
  75. __M_writer(str(template_hooks['menu']()))
  76. __M_writer('\n')
  77. if search_form:
  78. __M_writer(' ')
  79. __M_writer(str(search_form))
  80. __M_writer('\n')
  81. __M_writer('\n ')
  82. if 'parent' not in context._data or not hasattr(context._data['parent'], 'belowtitle'):
  83. context['self'].belowtitle(**pageargs)
  84. __M_writer('\n')
  85. if show_sourcelink:
  86. __M_writer(' ')
  87. if 'parent' not in context._data or not hasattr(context._data['parent'], 'sourcelink'):
  88. context['self'].sourcelink(**pageargs)
  89. __M_writer('\n')
  90. __M_writer(' ')
  91. __M_writer(str(template_hooks['menu_alt']()))
  92. __M_writer('\n </ul>\n </nav>\n </div><!-- /.container -->\n</div>\n<!-- End of Menubar -->\n\n<div class="container" id="content" role="main">\n <div class="body-content">\n <div class="blog-header">\n <h1 class="blog-title">\n <a href="')
  93. __M_writer(str(abs_link(_link("root", None, lang))))
  94. __M_writer('">\n')
  95. if logo_url:
  96. __M_writer(' <img src="')
  97. __M_writer(str(logo_url))
  98. __M_writer('" alt="')
  99. __M_writer(str(blog_title))
  100. __M_writer('" id="logo">\n')
  101. __M_writer('\n')
  102. if show_blog_title:
  103. __M_writer(' <span id="blog-title">')
  104. __M_writer(str(blog_title))
  105. __M_writer('</span>\n')
  106. __M_writer(' </a>\n </h1>\n <p class="lead blog-description">')
  107. __M_writer(str(blog_description))
  108. __M_writer('</p>\n ')
  109. __M_writer(str(template_hooks['page_header']()))
  110. __M_writer('\n </div>\n <!--Body content-->\n <div class="row">\n <div class="col-sm-8 blog-main">\n ')
  111. if 'parent' not in context._data or not hasattr(context._data['parent'], 'content'):
  112. context['self'].content(**pageargs)
  113. __M_writer('\n </div>\n <div class="col-sm-3 col-sm-offset-1 blog-sidebar">\n ')
  114. __M_writer(str(blog_sidebar))
  115. __M_writer('\n </div>\n <!--End of body content-->\n </div>\n </div>\n</div>\n\n<footer class="blog-footer" id="footer">\n ')
  116. __M_writer(str(content_footer))
  117. __M_writer('\n ')
  118. __M_writer(str(template_hooks['page_footer']()))
  119. __M_writer('\n</footer>\n\n')
  120. __M_writer(str(base.late_load_js()))
  121. __M_writer('\n <!-- fancy dates -->\n <script>\n moment.locale("')
  122. __M_writer(str(momentjs_locales[lang]))
  123. __M_writer('");\n fancydates(')
  124. __M_writer(str(date_fanciness))
  125. __M_writer(', ')
  126. __M_writer(str(js_date_format))
  127. __M_writer(');\n </script>\n <!-- end fancy dates -->\n ')
  128. if 'parent' not in context._data or not hasattr(context._data['parent'], 'extra_js'):
  129. context['self'].extra_js(**pageargs)
  130. __M_writer("\n <script>\n baguetteBox.run('div#content', {\n ignoreClass: 'islink',\n captions: function(element) {\n return element.getElementsByTagName('img')[0].alt;\n }});\n </script>\n")
  131. __M_writer(str(body_end))
  132. __M_writer('\n')
  133. __M_writer(str(template_hooks['body_end']()))
  134. __M_writer('\n</body>\n</html>\n')
  135. return ''
  136. finally:
  137. context.caller_stack._pop_frame()
  138. def render_extra_head(context,**pageargs):
  139. __M_caller = context.caller_stack._push_frame()
  140. try:
  141. _import_ns = {}
  142. _mako_get_namespace(context, 'base')._populate(_import_ns, ['*'])
  143. def extra_head():
  144. return render_extra_head(context)
  145. __M_writer = context.writer()
  146. __M_writer('\n')
  147. return ''
  148. finally:
  149. context.caller_stack._pop_frame()
  150. def render_belowtitle(context,**pageargs):
  151. __M_caller = context.caller_stack._push_frame()
  152. try:
  153. _import_ns = {}
  154. _mako_get_namespace(context, 'base')._populate(_import_ns, ['*'])
  155. len = _import_ns.get('len', context.get('len', UNDEFINED))
  156. translations = _import_ns.get('translations', context.get('translations', UNDEFINED))
  157. base = _mako_get_namespace(context, 'base')
  158. def belowtitle():
  159. return render_belowtitle(context)
  160. __M_writer = context.writer()
  161. __M_writer('\n')
  162. if len(translations) > 1:
  163. __M_writer(' ')
  164. __M_writer(str(base.html_translations()))
  165. __M_writer('\n')
  166. __M_writer(' ')
  167. return ''
  168. finally:
  169. context.caller_stack._pop_frame()
  170. def render_sourcelink(context,**pageargs):
  171. __M_caller = context.caller_stack._push_frame()
  172. try:
  173. _import_ns = {}
  174. _mako_get_namespace(context, 'base')._populate(_import_ns, ['*'])
  175. def sourcelink():
  176. return render_sourcelink(context)
  177. __M_writer = context.writer()
  178. return ''
  179. finally:
  180. context.caller_stack._pop_frame()
  181. def render_content(context,**pageargs):
  182. __M_caller = context.caller_stack._push_frame()
  183. try:
  184. _import_ns = {}
  185. _mako_get_namespace(context, 'base')._populate(_import_ns, ['*'])
  186. def content():
  187. return render_content(context)
  188. __M_writer = context.writer()
  189. return ''
  190. finally:
  191. context.caller_stack._pop_frame()
  192. def render_extra_js(context,**pageargs):
  193. __M_caller = context.caller_stack._push_frame()
  194. try:
  195. _import_ns = {}
  196. _mako_get_namespace(context, 'base')._populate(_import_ns, ['*'])
  197. def extra_js():
  198. return render_extra_js(context)
  199. __M_writer = context.writer()
  200. return ''
  201. finally:
  202. context.caller_stack._pop_frame()
  203. """
  204. __M_BEGIN_METADATA
  205. {"filename": "themes/bootblog/templates/base.tmpl", "uri": "base.tmpl", "source_encoding": "utf-8", "line_map": {"23": 2, "26": 0, "64": 2, "65": 3, "66": 3, "67": 4, "68": 4, "73": 7, "74": 8, "75": 8, "76": 11, "77": 11, "78": 18, "79": 18, "80": 19, "81": 19, "82": 20, "83": 21, "84": 21, "85": 21, "86": 23, "91": 28, "92": 29, "93": 30, "98": 30, "99": 32, "100": 32, "101": 32, "102": 43, "103": 43, "104": 44, "105": 45, "106": 45, "107": 45, "108": 45, "109": 45, "110": 47, "111": 48, "112": 49, "113": 49, "114": 49, "115": 51, "116": 53, "117": 53, "118": 54, "119": 54, "124": 59, "125": 62, "126": 62, "127": 70, "128": 70, "129": 71, "130": 71, "131": 74, "132": 74, "133": 77, "134": 77, "135": 78, "136": 78, "137": 78, "138": 78, "143": 81, "144": 89, "145": 89, "146": 90, "147": 90, "153": 5, "161": 5, "167": 24, "178": 24, "179": 25, "180": 26, "181": 26, "182": 26, "183": 28, "189": 30, "202": 59, "215": 81, "228": 215}}
  206. __M_END_METADATA
  207. """