More standalone operation stuff.
Stop using `edbob.db.engine`, stop using all edbob templates, etc.
This commit is contained in:
parent
2a50e704ef
commit
7d19700c3c
22 changed files with 438 additions and 54 deletions
13
tailbone/templates/form.mako
Normal file
13
tailbone/templates/form.mako
Normal file
|
@ -0,0 +1,13 @@
|
|||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="context_menu_items()"></%def>
|
||||
|
||||
<div class="form-wrapper">
|
||||
|
||||
<ul class="context-menu">
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
${form.render()|n}
|
||||
|
||||
</div>
|
39
tailbone/templates/forms/fieldset.mako
Normal file
39
tailbone/templates/forms/fieldset.mako
Normal file
|
@ -0,0 +1,39 @@
|
|||
<% _focus_rendered = False %>
|
||||
|
||||
% for error in fieldset.errors.get(None, []):
|
||||
<div class="fieldset-error">${error}</div>
|
||||
% endfor
|
||||
|
||||
% for field in fieldset.render_fields.itervalues():
|
||||
|
||||
% if field.requires_label:
|
||||
<div class="field-wrapper ${field.name}">
|
||||
% for error in field.errors:
|
||||
<div class="field-error">${error}</div>
|
||||
% endfor
|
||||
${field.label_tag()|n}
|
||||
<div class="field">
|
||||
${field.render()|n}
|
||||
</div>
|
||||
% if 'instructions' in field.metadata:
|
||||
<span class="instructions">${field.metadata['instructions']}</span>
|
||||
% endif
|
||||
</div>
|
||||
|
||||
% if not _focus_rendered and (fieldset.focus == field or fieldset.focus is True):
|
||||
% if not field.is_readonly() and getattr(field.renderer, 'needs_focus', True):
|
||||
<script language="javascript" type="text/javascript">
|
||||
$(function() {
|
||||
% if hasattr(field.renderer, 'focus_name'):
|
||||
$('#${field.renderer.focus_name}').focus();
|
||||
% else:
|
||||
$('#${field.renderer.name}').focus();
|
||||
% endif
|
||||
});
|
||||
</script>
|
||||
<% _focus_rendered = True %>
|
||||
% endif
|
||||
% endif
|
||||
% endif
|
||||
|
||||
% endfor
|
12
tailbone/templates/forms/fieldset_readonly.mako
Normal file
12
tailbone/templates/forms/fieldset_readonly.mako
Normal file
|
@ -0,0 +1,12 @@
|
|||
<div class="fieldset">
|
||||
% for field in fieldset.render_fields.itervalues():
|
||||
% if field.requires_label:
|
||||
<div class="field-wrapper ${field.name}">
|
||||
${field.label_tag()|n}
|
||||
<div class="field">
|
||||
${field.render_readonly()}
|
||||
</div>
|
||||
</div>
|
||||
% endif
|
||||
% endfor
|
||||
</div>
|
15
tailbone/templates/forms/form.mako
Normal file
15
tailbone/templates/forms/form.mako
Normal file
|
@ -0,0 +1,15 @@
|
|||
<div class="form">
|
||||
${h.form(form.action_url, enctype='multipart/form-data')}
|
||||
|
||||
${form.fieldset.render()|n}
|
||||
|
||||
<div class="buttons">
|
||||
${h.submit('create', form.create_label if form.creating else form.update_label)}
|
||||
% if form.creating and form.allow_successive_creates:
|
||||
${h.submit('create_and_continue', form.successive_create_label)}
|
||||
% endif
|
||||
<button type="button" onclick="location.href = '${form.cancel_url}';">Cancel</button>
|
||||
</div>
|
||||
|
||||
${h.end_form()}
|
||||
</div>
|
3
tailbone/templates/forms/form_readonly.mako
Normal file
3
tailbone/templates/forms/form_readonly.mako
Normal file
|
@ -0,0 +1,3 @@
|
|||
<div class="form">
|
||||
${form.fieldset.render()|n}
|
||||
</div>
|
37
tailbone/templates/grid.mako
Normal file
37
tailbone/templates/grid.mako
Normal file
|
@ -0,0 +1,37 @@
|
|||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="context_menu_items()"></%def>
|
||||
|
||||
<%def name="form()">
|
||||
% if search:
|
||||
${search.render()}
|
||||
% else:
|
||||
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="tools()"></%def>
|
||||
|
||||
<div class="grid-wrapper">
|
||||
|
||||
<table class="grid-header">
|
||||
<tr>
|
||||
<td rowspan="2" class="form">
|
||||
${self.form()}
|
||||
</td>
|
||||
<td class="context-menu">
|
||||
<ul>
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tools">
|
||||
${self.tools()}
|
||||
</td>
|
||||
</tr>
|
||||
</table><!-- grid-header -->
|
||||
|
||||
${grid}
|
||||
|
||||
</div><!-- grid-wrapper -->
|
36
tailbone/templates/grids/search.mako
Normal file
36
tailbone/templates/grids/search.mako
Normal file
|
@ -0,0 +1,36 @@
|
|||
<div class="filters" url="${search.request.current_route_url()}">
|
||||
${search.begin()}
|
||||
${search.hidden('filters', 'true')}
|
||||
<% visible = [] %>
|
||||
% for f in search.sorted_filters():
|
||||
<div class="filter" id="filter-${f.name}"${' style="display: none;"' if not search.config.get('include_filter_'+f.name) else ''|n}>
|
||||
${search.checkbox('include_filter_'+f.name)}
|
||||
<label for="${f.name}">${f.label}</label>
|
||||
${f.types_select()}
|
||||
<div class="value">
|
||||
${f.value_control()}
|
||||
</div>
|
||||
</div>
|
||||
% if search.config.get('include_filter_'+f.name):
|
||||
<% visible.append(f.name) %>
|
||||
% endif
|
||||
% endfor
|
||||
<div class="buttons">
|
||||
${search.add_filter(visible)}
|
||||
${search.submit('submit', "Search", style='display: none;' if not visible else None)}
|
||||
<button type="reset"${' style="display: none;"' if not visible else ''|n}>Reset</button>
|
||||
</div>
|
||||
${search.end()}
|
||||
% if visible:
|
||||
<script language="javascript" type="text/javascript">
|
||||
filters_to_disable = [
|
||||
% for field in visible:
|
||||
'${field}',
|
||||
% endfor
|
||||
];
|
||||
$(function() {
|
||||
disable_filter_options();
|
||||
});
|
||||
</script>
|
||||
% endif
|
||||
</div>
|
37
tailbone/templates/login.mako
Normal file
37
tailbone/templates/login.mako
Normal file
|
@ -0,0 +1,37 @@
|
|||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">Login</%def>
|
||||
|
||||
<%def name="head_tags()">
|
||||
${parent.head_tags()}
|
||||
${h.javascript_link(request.static_url('tailbone:static/js/login.js'))}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/login.css'))}
|
||||
</%def>
|
||||
|
||||
${h.image(request.static_url('tailbone:static/img/home_logo.png'), "Rattail Logo", id='logo')}
|
||||
|
||||
<div class="form">
|
||||
${h.form('')}
|
||||
<input type="hidden" name="referrer" value="${referrer}" />
|
||||
|
||||
% if error:
|
||||
<div class="error">${error}</div>
|
||||
% endif
|
||||
|
||||
<div class="field-wrapper">
|
||||
<label for="username">Username</label>
|
||||
<input type="text" name="username" id="username" value="" />
|
||||
</div>
|
||||
|
||||
<div class="field-wrapper">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" id="password" value="" />
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
${h.submit('submit', "Login")}
|
||||
<input type="reset" value="Reset" />
|
||||
</div>
|
||||
|
||||
${h.end_form()}
|
||||
</div>
|
11
tailbone/templates/people/index.mako
Normal file
11
tailbone/templates/people/index.mako
Normal file
|
@ -0,0 +1,11 @@
|
|||
<%inherit file="/grid.mako" />
|
||||
|
||||
<%def name="title()">People</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
## % if request.has_perm('people.create'):
|
||||
## <li>${h.link_to("Create a new Person", url('person.new'))}</li>
|
||||
## % endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
18
tailbone/templates/roles/crud.mako
Normal file
18
tailbone/templates/roles/crud.mako
Normal file
|
@ -0,0 +1,18 @@
|
|||
<%inherit file="edbob.pyramid:templates/crud.mako" />
|
||||
|
||||
<%def name="head_tags()">
|
||||
${parent.head_tags()}
|
||||
${h.stylesheet_link(request.static_url('edbob.pyramid:static/css/perms.css'))}
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to Roles", url('roles'))}</li>
|
||||
% if form.readonly:
|
||||
<li>${h.link_to("Edit this Role", url('role.update', uuid=form.fieldset.model.uuid))}</li>
|
||||
% elif form.updating:
|
||||
<li>${h.link_to("View this Role", url('role.read', uuid=form.fieldset.model.uuid))}</li>
|
||||
% endif
|
||||
<li>${h.link_to("Delete this Role", url('role.delete', uuid=form.fieldset.model.uuid), class_='delete')}</li>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
11
tailbone/templates/roles/index.mako
Normal file
11
tailbone/templates/roles/index.mako
Normal file
|
@ -0,0 +1,11 @@
|
|||
<%inherit file="/grid.mako" />
|
||||
|
||||
<%def name="title()">Roles</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if request.has_perm('roles.create'):
|
||||
<li>${h.link_to("Create a new Role", url('role.create'))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
11
tailbone/templates/users/index.mako
Normal file
11
tailbone/templates/users/index.mako
Normal file
|
@ -0,0 +1,11 @@
|
|||
<%inherit file="/grid.mako" />
|
||||
|
||||
<%def name="title()">Users</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if request.has_perm('users.create'):
|
||||
<li>${h.link_to("Create a new User", url('user.create'))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
Loading…
Add table
Add a link
Reference in a new issue