Add MasterView.has_rows
concept and related logic
Now the `BatchMasterView` no longer provides most of these goodies. Also tweak some custom batch views to reflect changes etc.
This commit is contained in:
parent
8a19b90efa
commit
901c2fc573
9 changed files with 410 additions and 226 deletions
17
tailbone/templates/master/edit_row.mako
Normal file
17
tailbone/templates/master/edit_row.mako
Normal file
|
@ -0,0 +1,17 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/master/edit.mako" />
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to {}".format(model_title), index_url)}</li>
|
||||
% if master.rows_viewable and request.has_perm('{}.view'.format(row_permission_prefix)):
|
||||
<li>${h.link_to("View this {}".format(row_model_title), row_action_url('view', instance))}</li>
|
||||
% endif
|
||||
% if master.rows_deletable and instance_deletable and request.has_perm('{}.delete'.format(row_permission_prefix)):
|
||||
<li>${h.link_to("Delete this {}".format(row_model_title), row_action_url('delete', instance))}</li>
|
||||
% endif
|
||||
% if master.rows_creatable and request.has_perm('{}.create'.format(row_permission_prefix)):
|
||||
<li>${h.link_to("Create a new {}".format(row_model_title), url('{}.create'.format(row_route_prefix)))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -4,7 +4,7 @@
|
|||
<%def name="title()">${model_title}</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to {}".format(batch_model_title), index_url)}</li>
|
||||
<li>${h.link_to("Back to {}".format(parent_model_title), index_url)}</li>
|
||||
% if master.rows_editable and instance_editable and request.has_perm('{}.edit'.format(permission_prefix)):
|
||||
<li>${h.link_to("Edit this {}".format(model_title), action_url('edit', instance))}</li>
|
||||
% endif
|
||||
|
@ -16,4 +16,10 @@
|
|||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
||||
<ul id="context-menu">
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
<div class="form-wrapper">
|
||||
${form.render()|n}
|
||||
</div><!-- form-wrapper -->
|
|
@ -42,7 +42,7 @@
|
|||
% if master.listing:
|
||||
<span class="global">${model_title_plural}</span>
|
||||
% else:
|
||||
${h.link_to(model_title_plural, index_url, class_='global')}
|
||||
${h.link_to(index_title, index_url, class_='global')}
|
||||
% if master.viewing and grid_index:
|
||||
${grid_index_nav()}
|
||||
% endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue