Misc. tweaks to vendor catalog views
for sake of titeship
This commit is contained in:
parent
ee3d32d60a
commit
3cd5fa7f4a
11
tailbone/templates/batch/vendorcatalog/index.mako
Normal file
11
tailbone/templates/batch/vendorcatalog/index.mako
Normal file
|
@ -0,0 +1,11 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/batch/index.mako" />
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
${parent.context_menu_items()}
|
||||
% if request.has_perm('vendors.list'):
|
||||
<li>${h.link_to("View Vendors", url('vendors'))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -186,14 +186,6 @@ class VendorCatalogsView(FileBatchMasterView):
|
|||
if not self.creating:
|
||||
f.set_readonly('effective')
|
||||
|
||||
def render_vendor(self, batch, field):
|
||||
vendor = batch.vendor
|
||||
if not vendor:
|
||||
return ""
|
||||
text = "({}) {}".format(vendor.id, vendor.name)
|
||||
url = self.request.route_url('vendors.view', uuid=vendor.uuid)
|
||||
return tags.link_to(text, url)
|
||||
|
||||
def get_batch_kwargs(self, batch):
|
||||
kwargs = super(VendorCatalogsView, self).get_batch_kwargs(batch)
|
||||
kwargs['parser_key'] = batch.parser_key
|
||||
|
|
|
@ -928,7 +928,10 @@ class MasterView(View):
|
|||
vendor = getattr(obj, field)
|
||||
if not vendor:
|
||||
return ""
|
||||
if vendor.id:
|
||||
text = "({}) {}".format(vendor.id, vendor.name)
|
||||
else:
|
||||
text = six.text_type(vendor)
|
||||
url = self.request.route_url('vendors.view', uuid=vendor.uuid)
|
||||
return tags.link_to(text, url)
|
||||
|
||||
|
|
Loading…
Reference in a new issue