tailbone/tailbone/templates/page.mako
Lance Edgar 1bb0330ab5 Refactory Buefy templates to use WholePage and ThisPage components
plus add `GridFilter.set_choices()` method
2019-08-03 16:57:13 -05:00

72 lines
1.4 KiB
Mako

## -*- coding: utf-8; -*-
<%inherit file="/base.mako" />
<%def name="context_menu_items()"></%def>
<%def name="page_content()"></%def>
<%def name="render_this_page()">
<div style="display: flex;">
<div class="this-page-content" style="flex-grow: 1;">
${self.page_content()}
</div>
<ul id="context-menu">
${self.context_menu_items()}
</ul>
</div>
</%def>
<%def name="render_this_page_template()">
<script type="text/x-template" id="this-page-template">
<div>
${self.render_this_page()}
</div>
</script>
</%def>
<%def name="declare_this_page_vars()">
<script type="text/javascript">
let ThisPage = {
template: '#this-page-template',
methods: {}
}
let ThisPageData = {}
</script>
</%def>
<%def name="modify_this_page_vars()">
## NOTE: if you override this, must use <script> tags
</%def>
<%def name="finalize_this_page_vars()">
## NOTE: if you override this, must use <script> tags
</%def>
<%def name="make_this_page_component()">
${self.declare_this_page_vars()}
${self.modify_this_page_vars()}
${self.finalize_this_page_vars()}
<script type="text/javascript">
ThisPage.data = function() { return ThisPageData }
Vue.component('this-page', ThisPage)
</script>
</%def>
% if use_buefy:
${self.render_this_page_template()}
${self.make_this_page_component()}
% else:
${self.render_this_page()}
% endif