cleanup main batch route

This commit is contained in:
Lance Edgar 2012-11-26 14:24:10 -08:00
parent 619818f486
commit 472d2cfd7b
4 changed files with 10 additions and 6 deletions

View file

@ -3,6 +3,9 @@
<%def name="context_menu_items()">
<li>${h.link_to("Back to Batches", url('batches'))}</li>
<li>${h.link_to("View Batch Rows", url('batch.rows', uuid=form.fieldset.model.uuid))}</li>
% if not form.readonly:
<li>${h.link_to("View this Batch", url('batch.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -33,7 +33,7 @@
<%def name="context_menu_items()">
<li>${h.link_to("Back to Batches", url('batches'))}</li>
<li>${h.link_to("Back to Batch", url('batch', uuid=batch.uuid))}</li>
<li>${h.link_to("Back to Batch", url('batch.read', uuid=batch.uuid))}</li>
</%def>
<%def name="tools()">

View file

@ -101,7 +101,7 @@ class BatchesGrid(SearchableAlchemyGridView):
'batch.rows', uuid=row.uuid))
g.add_column('rows', "", rows)
g.clickable = True
g.click_route_name = 'batch'
g.click_route_name = 'batch.read'
if self.request.has_perm('batches.update'):
g.editable = True
g.edit_route_name = 'batch.update'
@ -127,7 +127,7 @@ class BatchCrud(CrudView):
fs.action_type,
fs.description,
fs.rowcount.label("Row Count").readonly(),
fs.executed,
fs.executed.readonly(),
])
return fs
@ -180,8 +180,9 @@ def includeme(config):
renderer='/batches/index.mako',
permission='batches.list')
config.add_route('batch', '/batches/{uuid}')
config.add_view(BatchCrud, attr='read', route_name='batch',
config.add_route('batch.read', '/batches/{uuid}')
config.add_view(BatchCrud, attr='read',
route_name='batch.read',
renderer='/batches/read.mako',
permission='batches.read')

View file

@ -268,7 +268,7 @@ class CreateProductsBatch(ProductsGrid):
progress.session.load()
progress.session['complete'] = True
progress.session['success_url'] = self.request.route_url('batch', uuid=batch.uuid)
progress.session['success_url'] = self.request.route_url('batch.read', uuid=batch.uuid)
progress.session['success_msg'] = "Batch \"%s\" has been created." % batch.description
progress.session.save()