From 47c2742878c60c27a5762ac7b5a3f15ad69955cc Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 3 Aug 2019 17:56:18 -0500 Subject: [PATCH] Move the "HUD" content title section into WholePage component that way, ThisPage can dynamically trigger a change in the title HTML --- tailbone/templates/themes/falafel/base.mako | 150 ++++++++++---------- 1 file changed, 77 insertions(+), 73 deletions(-) diff --git a/tailbone/templates/themes/falafel/base.mako b/tailbone/templates/themes/falafel/base.mako index c8fb0d71..7f746362 100644 --- a/tailbone/templates/themes/falafel/base.mako +++ b/tailbone/templates/themes/falafel/base.mako @@ -210,78 +210,15 @@ - ## Page Title -
-
- % if capture(self.content_title): + ${self.body()} - % if show_prev_next is not Undefined and show_prev_next: -
- % if prev_url: - ${h.link_to(u"« Older", prev_url, class_='button autodisable')} - % else: - ${h.link_to(u"« Older", '#', class_='button', disabled='disabled')} - % endif - % if next_url: - ${h.link_to(u"Newer »", next_url, class_='button autodisable')} - % else: - ${h.link_to(u"Newer »", '#', class_='button', disabled='disabled')} - % endif -
- % endif +
+ +
-

${self.content_title()}

- % endif -
-
- -
- - ## Page Body -
- - % if request.session.peek_flash('error'): - % for error in request.session.pop_flash('error'): -
- - ${error} -
- % endfor - % endif - - % if request.session.peek_flash(): - % for msg in request.session.pop_flash(): -
- - ${msg} -
- % endfor - % endif - - ## ############################## - ## whole page - ## ############################## - - ${self.body()} - -
- -
- - ${self.render_whole_page_template()} - ${self.make_whole_page_component()} - ${self.make_whole_page_app()} - -
- - ## Footer -
-
- ${base_meta.footer()} -
-
- -
+ ${self.render_whole_page_template()} + ${self.make_whole_page_component()} + ${self.make_whole_page_app()} @@ -427,7 +364,68 @@ <%def name="render_whole_page_template()"> @@ -437,10 +435,16 @@ let WholePage = { template: '#whole-page-template', - methods: {} + methods: { + changeContentTitle(newTitle) { + this.contentTitleHTML = newTitle + } + }, } - let WholePageData = {} + let WholePageData = { + contentTitleHTML: ${json.dumps(capture(self.content_title))|n} + }