From 11638ba3582e7f10bfea218a80e436358f54aca8 Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Wed, 20 Apr 2016 16:20:49 +0530 Subject: [PATCH] Changes 3 --- .../doctype/sales_invoice/sales_invoice.py | 1 + erpnext/hr/doctype/job_opening/job_opening.py | 1 + erpnext/projects/doctype/project/project.py | 1 + erpnext/public/css/website.css | 30 +++++++++++---- erpnext/public/js/shopping_cart.js | 6 +-- erpnext/public/less/website.less | 30 ++++++++++++--- .../doctype/sales_order/sales_order.py | 1 + .../setup/doctype/item_group/item_group.py | 13 +++++-- .../doctype/delivery_note/delivery_note.py | 1 + erpnext/stock/doctype/item/item.py | 1 + erpnext/support/doctype/issue/issue.py | 3 +- erpnext/templates/generators/item.html | 37 ++++++++++--------- erpnext/templates/generators/item_group.html | 29 ++++++--------- .../includes/footer/footer_extension.html | 2 +- erpnext/templates/includes/projects.css | 6 --- .../includes/projects/project_row.html | 6 +-- erpnext/templates/pages/order.py | 1 + erpnext/templates/pages/projects.html | 32 +++++----------- erpnext/templates/pages/projects.py | 3 +- 19 files changed, 116 insertions(+), 88 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 025a6b72cec..9a817f13f7b 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -678,6 +678,7 @@ def get_list_context(context=None): list_context = get_list_context(context) list_context["title"] = _("My Invoices") list_context["show_sidebar"] = True + list_context["show_search"] = True return list_context @frappe.whitelist() diff --git a/erpnext/hr/doctype/job_opening/job_opening.py b/erpnext/hr/doctype/job_opening/job_opening.py index 6b7131e1925..90993c77768 100644 --- a/erpnext/hr/doctype/job_opening/job_opening.py +++ b/erpnext/hr/doctype/job_opening/job_opening.py @@ -28,3 +28,4 @@ def get_list_context(context): context.title = _("Jobs") context.introduction = _('Current Job Openings') context.show_sidebar=True + context.show_search=True diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index dd12f5b67c4..ffeedd695ce 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -161,6 +161,7 @@ def get_project_list(doctype, txt, filters, limit_start, limit_page_length=20): def get_list_context(context=None): return { "show_sidebar": True, + "show_search": True, "title": _("My Projects"), "get_list": get_project_list, "row_template": "templates/includes/projects/project_row.html" diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css index 77ce04b11cb..a36a5db9d3e 100644 --- a/erpnext/public/css/website.css +++ b/erpnext/public/css/website.css @@ -10,9 +10,13 @@ text-align: center; } .product-image-wrapper { - max-width: 300px; - margin: auto; + max-width: 600px; + width: 187px; + margin: 31.5px; border-radius: 4px; + border: 1px solid #EBEFF2; + padding-left: 0px; + padding-right: 0px; } @media (max-width: 767px) { .product-image { @@ -28,8 +32,7 @@ background-size: cover; background-repeat: no-repeat; background-position: center top; - border-radius: 0.5em; - border: 1px solid #EBEFF2; + border-bottom: 1px dashed #EBEFF2; } .product-image.missing-image { width: 100%; @@ -38,10 +41,8 @@ background-size: cover; background-repeat: no-repeat; background-position: center top; - border-radius: 0.5em; - border: 1px solid #EBEFF2; - border: 1px dashed #d1d8dd; position: relative; + border-bottom: 1px dashed #EBEFF2; } .product-image.missing-image .octicon { font-size: 32px; @@ -50,9 +51,24 @@ .product-text { padding: 15px 0px; } +.product-label { + padding-bottom: 4px; + text-transform: uppercase; + font-size: 12px; +} @media (max-width: 767px) { .product-search { width: 100%; margin-bottom: 13px; } } +.borderless td, +.borderless th { + border-bottom: 1px solid #EBEFF2; + padding-left: 0px !important; + line-height: 1.8em !important; +} +.item-desc { + border-top: 2px solid #EBEFF2; + padding-top: 10px; +} diff --git a/erpnext/public/js/shopping_cart.js b/erpnext/public/js/shopping_cart.js index 666e104fe6c..a3f7d3f0c67 100644 --- a/erpnext/public/js/shopping_cart.js +++ b/erpnext/public/js/shopping_cart.js @@ -45,10 +45,10 @@ $.extend(shopping_cart, { if($(".cart-icon").length == 0) { $('
\ - \ + border: 1px solid #7575ff;">\ + \ Cart\ - 5\ + 5\
').appendTo($('.shopping-cart')) } diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less index 96dd0966abc..ffc338a5673 100644 --- a/erpnext/public/less/website.less +++ b/erpnext/public/less/website.less @@ -15,9 +15,13 @@ } .product-image-wrapper { - max-width: 300px; - margin: auto; + max-width: 600px; + width: 187px; + margin: 31.5px; border-radius: 4px; + border: 1px solid @light-border-color; + padding-left: 0px; + padding-right: 0px; } @media (max-width: 767px) { @@ -35,14 +39,13 @@ background-size: cover; background-repeat: no-repeat; background-position: center top; - border-radius: 0.5em; - border: 1px solid @light-border-color; + border-bottom: 1px dashed @light-border-color; } .product-image.missing-image { .product-image-square; - border: 1px dashed @border-color; position: relative; + border-bottom: 1px dashed @light-border-color; } .product-image.missing-image .octicon { @@ -54,9 +57,26 @@ padding: 15px 0px; } +.product-label{ + padding-bottom: 4px; + text-transform: uppercase; + font-size: 12px; +} + @media (max-width: 767px) { .product-search { width: 100%; margin-bottom: 13px; } } + +.borderless td, .borderless th { + border-bottom: 1px solid @light-border-color; + padding-left:0px !important; + line-height: 1.8em !important; +} + +.item-desc { + border-top: 2px solid @light-border-color; + padding-top:10px; +} diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 60bac8de335..878eb9b8649 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -311,6 +311,7 @@ def get_list_context(context=None): from erpnext.controllers.website_list_for_contact import get_list_context list_context = get_list_context(context) list_context["show_sidebar"] = True + list_context["show_search"] = True list_context["title"] = _("My Orders") list_context["parents"] = [{"title": _("My Account"), "name": "me"}] return list_context diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 7669bff2fd3..43b88d65f80 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -53,11 +53,12 @@ class ItemGroup(NestedSet, WebsiteGenerator): frappe.throw(frappe._("An item exists with same name ({0}), please change the item group name or rename the item").format(self.name)) def get_context(self, context): + context.show_search=True start = int(frappe.form_dict.start or 0) if start < 0: start = 0 context.update({ - "items": get_product_list_for_group(product_group = self.name, start=start, limit=24), + "items": get_product_list_for_group(product_group = self.name, start=start, limit=24, search=frappe.form_dict.get("q")), "parent_groups": get_parent_item_groups(self.name), "title": self.name }) @@ -68,7 +69,7 @@ class ItemGroup(NestedSet, WebsiteGenerator): return context @frappe.whitelist(allow_guest=True) -def get_product_list_for_group(product_group=None, start=0, limit=10): +def get_product_list_for_group(product_group=None, start=0, limit=10, search=None): child_groups = ", ".join(['"' + i[0] + '"' for i in get_child_groups(product_group)]) # base query @@ -83,10 +84,16 @@ def get_product_list_for_group(product_group=None, start=0, limit=10): and (item_group in ({child_groups}) or name in (select parent from `tabWebsite Item Group` where item_group in ({child_groups}))) """.format(child_groups=child_groups) + # search term condition + if search: + query += """ and (web_long_description like %(search)s + or item_name like %(search)s + or name like %(search)s)""" + search = "%" + cstr(search) + "%" query += """order by weightage desc, modified desc limit %s, %s""" % (start, limit) - data = frappe.db.sql(query, {"product_group": product_group, "today": nowdate()}, as_dict=1) + data = frappe.db.sql(query, {"product_group": product_group,"search": search, "today": nowdate()}, as_dict=1) return [get_item_for_list_in_html(r) for r in data] diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index ddfa3e40684..79a4ea61466 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -331,6 +331,7 @@ def get_list_context(context=None): list_context = get_list_context(context) list_context["title"] = _("My Shipments") list_context["show_sidebar"] = True + list_context["show_search"] = True return list_context def get_invoiced_qty_map(delivery_note): diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 649f97be2db..113d8624196 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -214,6 +214,7 @@ class Item(WebsiteGenerator): self.thumbnail = file_doc.thumbnail_url def get_context(self, context): + context.show_search=True if self.variant_of: # redirect to template page! template_item = frappe.get_doc("Item", self.variant_of) diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py index af1759d1f51..fcc1edf71eb 100644 --- a/erpnext/support/doctype/issue/issue.py +++ b/erpnext/support/doctype/issue/issue.py @@ -58,7 +58,8 @@ def get_list_context(context=None): "title": _("My Issues"), "get_list": get_issue_list, "row_template": "templates/includes/issue_row.html", - "show_sidebar": True + "show_sidebar": True, + "show_search": True } def get_issue_list(doctype, txt, filters, limit_start, limit_page_length=20): diff --git a/erpnext/templates/generators/item.html b/erpnext/templates/generators/item.html index 34d345fd2f1..dabbf480824 100644 --- a/erpnext/templates/generators/item.html +++ b/erpnext/templates/generators/item.html @@ -2,33 +2,25 @@ {% block title %} {{ title }} {% endblock %} -{% block header %}

{{ title }}

{% endblock %} - -{% block header_actions %} -{% include 'templates/includes/product_search_box.html' %} -{% endblock %} - {% block breadcrumbs %} {% include "templates/includes/breadcrumbs.html" %} {% endblock %} {% block page_content %} {% from "erpnext/templates/includes/macros.html" import product_image %} -
+
-
+
{% if slideshow %} {% include "templates/includes/slideshow.html" %} {% else %} {{ product_image(website_image, "product-full-image") }} {% endif %}
-
- -
- {{ web_long_description or description or _("No description given") }} -
+
+

{{ item_name }}

+

{{ _("Item Code") }}: {{ variant and variant.name or name }}


@@ -77,15 +69,24 @@
- {% if website_specifications -%} -
+
-

{{ _("Specifications") }}

+

{{ _("DESCRIPTION") }}

+
+ {{ web_long_description or description or _("No description given") }} +
+
+
+ + {% if website_specifications -%} +
+
+

{{ _("SPECIFICATIONS") }}

- +
{% for d in website_specifications -%} - + {%- endfor %} diff --git a/erpnext/templates/generators/item_group.html b/erpnext/templates/generators/item_group.html index 7e68bc77014..195b3c500c1 100644 --- a/erpnext/templates/generators/item_group.html +++ b/erpnext/templates/generators/item_group.html @@ -1,11 +1,18 @@ {% extends "templates/web.html" %} -{% block header_actions %} +{#{% block header_actions %} {% include 'templates/includes/product_search_box.html' %} -{% endblock %} - +{% endblock %}#} +{% block header %}

{{ _("Products") }}

{% endblock %} {% block breadcrumbs %} - {% include "templates/includes/breadcrumbs.html" %} + {% endblock %} {% block page_content %} @@ -38,16 +45,4 @@ {% endif %} -{% endblock %} - -{% block style %} - -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/erpnext/templates/includes/footer/footer_extension.html b/erpnext/templates/includes/footer/footer_extension.html index 69953ab062a..e32e13ddf84 100644 --- a/erpnext/templates/includes/footer/footer_extension.html +++ b/erpnext/templates/includes/footer/footer_extension.html @@ -4,7 +4,7 @@ style="display: inline-block; max-width: 50%;margin-right:15px;" placeholder="{{ _('Your email address') }}..."> + id="footer-subscribe-button" style="float:right; border-radius:8px; border:1px solid #7575ff; color:#7575ff; background-color:white;">{{ _("Get Updates") }}
{{ d.label }}{{ d.label }} {{ d.description }}