Add support for "new-style grids" and "model master views".
Finally, an API that makes some sense... We don't yet have feature parity with the old-style grids and CRUD views, but this is already a significant improvement to the design. Still needs a lot of docs though...
This commit is contained in:
parent
62b7194c21
commit
585eb09bec
26 changed files with 2296 additions and 94 deletions
16
tailbone/templates/master/create.mako
Normal file
16
tailbone/templates/master/create.mako
Normal file
|
@ -0,0 +1,16 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">New ${model_title}</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to {0}".format(model_title_plural), index_url)}</li>
|
||||
</%def>
|
||||
|
||||
<ul id="context-menu">
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
<div class="form-wrapper">
|
||||
${form.render()|n}
|
||||
</div><!-- form-wrapper -->
|
19
tailbone/templates/master/edit.mako
Normal file
19
tailbone/templates/master/edit.mako
Normal file
|
@ -0,0 +1,19 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">${model_title}: ${unicode(instance)}</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to {0}".format(model_title_plural), url(route_prefix))}</li>
|
||||
% if request.has_perm('{0}.view'.format(permission_prefix)):
|
||||
<li>${h.link_to("View this {0}".format(model_title), action_url('view', instance))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<ul id="context-menu">
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
<div class="form-wrapper">
|
||||
${form.render()|n}
|
||||
</div><!-- form-wrapper -->
|
22
tailbone/templates/master/index.mako
Normal file
22
tailbone/templates/master/index.mako
Normal file
|
@ -0,0 +1,22 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
## ##############################################################################
|
||||
##
|
||||
## Default master 'index' template. Features a prominent data table and
|
||||
## exposes a way to filter and sort the data, etc.
|
||||
##
|
||||
## ##############################################################################
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">${grid.model_title_plural}</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if request.has_perm('{0}.create'.format(grid.permission_prefix)):
|
||||
<li>${h.link_to("Create a new {0}".format(grid.model_title), url('{0}.create'.format(grid.route_prefix)))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<ul id="context-menu">
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
${grid.render_complete()|n}
|
19
tailbone/templates/master/view.mako
Normal file
19
tailbone/templates/master/view.mako
Normal file
|
@ -0,0 +1,19 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">${model_title}: ${unicode(instance)}</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to {0}".format(model_title_plural), url(route_prefix))}</li>
|
||||
% if request.has_perm('{0}.edit'.format(permission_prefix)):
|
||||
<li>${h.link_to("Edit this {0}".format(model_title), action_url('edit', instance))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<ul id="context-menu">
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
<div class="form-wrapper">
|
||||
${form.render()|n}
|
||||
</div><!-- form-wrapper -->
|
Loading…
Add table
Add a link
Reference in a new issue