Purge things for legacy (jquery) mobile, and unused template themes

gosh it feels good to get rid of this stuff...  fingers crossed that nothing
was broken, but am thinking it's safe
This commit is contained in:
Lance Edgar 2021-01-30 15:52:47 -06:00
parent fac00e6ecd
commit 708641a8f1
70 changed files with 196 additions and 4886 deletions

View file

@ -82,7 +82,6 @@ class ProductView(MasterView):
Master view for the Product class.
"""
model_class = model.Product
supports_mobile = True
has_versions = True
results_downloadable_xlsx = True
@ -157,8 +156,6 @@ class ProductView(MasterView):
'inventory_on_order',
]
mobile_form_fields = form_fields
# These aliases enable the grid queries to filter products which may be
# purchased from *any* vendor, and yet sort by only the "preferred" vendor
# (since that's what shows up in the grid column).
@ -936,7 +933,7 @@ class ProductView(MasterView):
else:
code = pack.item_id
text = "({}) {}".format(code, pack.full_description)
url = self.get_action_url('view', pack, mobile=self.mobile)
url = self.get_action_url('view', pack)
links.append(tags.link_to(text, url))
items = [HTML.tag('li', c=[link]) for link in links]
@ -955,7 +952,7 @@ class ProductView(MasterView):
code = unit.item_id
text = "({}) {}".format(code, unit.full_description)
url = self.get_action_url('view', unit, mobile=self.mobile)
url = self.get_action_url('view', unit)
return tags.link_to(text, url)
def render_current_price_ends(self, product, field):
@ -1494,37 +1491,6 @@ class ProductView(MasterView):
'instance_title': self.get_instance_title(instance),
'form': form})
def mobile_index(self):
"""
Mobile "home" page for products
"""
self.mobile = True
context = {
'quick_lookup': False,
'placeholder': "Enter {}".format(self.rattail_config.product_key_title()),
'quick_lookup_keyboard_wedge': True,
}
if self.rattail_config.getbool('rattail', 'products.mobile.quick_lookup', default=False):
context['quick_lookup'] = True
else:
self.listing = True
grid = self.make_mobile_grid()
context['grid'] = grid
return self.render_to_response('index', context, mobile=True)
def mobile_quick_lookup(self):
entry = self.request.POST['quick_entry'].strip()
provided = GPC(entry, calc_check_digit=False)
product = api.get_product_by_upc(self.Session(), provided)
if not product:
checked = GPC(entry, calc_check_digit='upc')
product = api.get_product_by_upc(self.Session(), checked)
if not product:
product = api.get_product_by_code(self.Session(), entry)
if not product:
raise self.notfound()
return self.redirect(self.get_action_url('view', product, mobile=True))
def get_version_child_classes(self):
return [
(model.ProductCode, 'product_uuid'),
@ -1746,7 +1712,6 @@ class ProductView(MasterView):
template_prefix = cls.get_template_prefix()
permission_prefix = cls.get_permission_prefix()
model_title = cls.get_model_title()
legacy_mobile = cls.legacy_mobile_enabled(rattail_config)
# print labels
config.add_tailbone_permission('products', 'products.print_labels',
@ -1787,11 +1752,6 @@ class ProductView(MasterView):
renderer='json',
permission='{}.versions'.format(permission_prefix))
# mobile quick lookup
if legacy_mobile:
config.add_route('mobile.products.quick_lookup', '/mobile/products/quick-lookup')
config.add_view(cls, attr='mobile_quick_lookup', route_name='mobile.products.quick_lookup')
# TODO: deprecate / remove this
ProductsView = ProductView