From 130abd86860e435a3a054667c2325133270c5e89 Mon Sep 17 00:00:00 2001 From: Rehan Dalal Date: Wed, 17 Jun 2015 16:46:31 -0400 Subject: [PATCH 1/3] [bug 1172603] [bug 1172604] Search on mobile product pages --- kitsune/bundles.py | 13 +++++++ .../templates/products/mobile/documents.html | 11 ++++++ .../templates/products/mobile/product.html | 12 ++++++ kitsune/sumo/static/sumo/js/instant_search.js | 23 +++++++---- .../sumo/static/sumo/js/mobile/products.js | 32 ++++++++++++++++ .../static/sumo/less/mobile/products.less | 38 ++++++++++++++++--- .../tpl/mobile-product-search-results.html | 7 ++++ 7 files changed, 122 insertions(+), 14 deletions(-) create mode 100644 kitsune/sumo/static/sumo/js/mobile/products.js create mode 100644 kitsune/sumo/static/sumo/tpl/mobile-product-search-results.html diff --git a/kitsune/bundles.py b/kitsune/bundles.py index 42fef80ebca..3a5c30bcbc7 100644 --- a/kitsune/bundles.py +++ b/kitsune/bundles.py @@ -407,6 +407,19 @@ ), 'output_filename': 'build/products-min.js' }, + 'mobile-products': { + 'source_filenames': ( + 'sumo/js/templates/mobile-product-search-results.js', + 'nunjucks/browser/nunjucks-slim.js', + 'sumo/js/nunjucks.js', + 'moment/moment.js', + 'sumo/js/cached_xhr.js', + 'sumo/js/search_utils.js', + 'sumo/js/instant_search.js', + 'sumo/js/mobile/products.js', + ), + 'output_fiename': 'build/mobile-products-min.js' + }, 'search': { 'source_filenames': ( 'sumo/js/search.js', diff --git a/kitsune/products/templates/products/mobile/documents.html b/kitsune/products/templates/products/mobile/documents.html index 785b169cea6..18f9a149d36 100644 --- a/kitsune/products/templates/products/mobile/documents.html +++ b/kitsune/products/templates/products/mobile/documents.html @@ -1,6 +1,7 @@ {% extends 'mobile/base.html' %} {% set styles = ('mobile-products',) %} +{% set scripts = ('mobile-products',) %} {% set classes = 'documents' %} {% if subtopic %} {% set headline = _(subtopic.title, 'DB: products.Topic.title') %} @@ -14,6 +15,16 @@ {% set return_url = url('products.product', slug=product.slug) %} {% endif %} +{% block after_header %} + +{% endblock %} + {% block content %} {% if subtopic %}
diff --git a/kitsune/products/templates/products/mobile/product.html b/kitsune/products/templates/products/mobile/product.html index f3afd843efb..670544adddd 100644 --- a/kitsune/products/templates/products/mobile/product.html +++ b/kitsune/products/templates/products/mobile/product.html @@ -2,11 +2,23 @@ {% set title = _(product.title, 'DB: products.Product.title') %} {% set headline = title %} +{% set classes = 'product-landing' %} {% set styles = ('mobile-products',) %} +{% set scripts = ('mobile-products',) %} {% set return_url = url('products') %} {% block title %}{{ _('{product} Help')|f(product=_(product.title, 'DB: products.Product.title')) }}{% endblock %} +{% block after_header %} + +{% endblock %} + {% block content %}