Merge pull request #5197 from KanchanChauhan/UXChanges_ERPNext
[WIP] No not merge
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 53747bf..9a817f1 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -677,6 +677,8 @@
from erpnext.controllers.website_list_for_contact import get_list_context
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/config/docs.py b/erpnext/config/docs.py
index 82cb1fb..07d14b6 100644
--- a/erpnext/config/docs.py
+++ b/erpnext/config/docs.py
@@ -19,6 +19,7 @@
splash_light_background = True
def get_context(context):
+ context.brand_html = "ERPNext"
context.app.splash_light_background = True
context.top_bar_items = [
{"label": "User Manual", "url": context.docs_base_url + "/user/manual", "right": 1},
diff --git a/erpnext/hr/doctype/job_opening/job_opening.py b/erpnext/hr/doctype/job_opening/job_opening.py
index 7c42a76..90993c7 100644
--- a/erpnext/hr/doctype/job_opening/job_opening.py
+++ b/erpnext/hr/doctype/job_opening/job_opening.py
@@ -7,6 +7,8 @@
import frappe
from frappe.website.website_generator import WebsiteGenerator
+from frappe.utils import quoted
+from frappe.utils.user import get_fullname_and_avatar
from frappe import _
class JobOpening(WebsiteGenerator):
@@ -15,6 +17,9 @@
condition_field = "publish",
page_title_field = "job_title",
)
+
+ def get_route(self):
+ return 'jobs/' + quoted(self.page_name)
def get_context(self, context):
context.parents = [{'name': 'jobs', 'title': _('All Jobs') }]
@@ -22,3 +27,5 @@
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 c6a996c..2cca7e2 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -172,11 +172,14 @@
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"
}
+
@frappe.whitelist()
def get_cost_center_name(project):
return frappe.db.get_value("Project", project, "cost_center")
diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css
index 77ce04b..a36a5db 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 b667177..a3f7d3f 100644
--- a/erpnext/public/js/shopping_cart.js
+++ b/erpnext/public/js/shopping_cart.js
@@ -44,14 +44,12 @@
var cart_count = getCookie("cart_count");
if($(".cart-icon").length == 0) {
- $('<div class="cart-icon" style="float:right;padding-top:10px;">\
- <a href="/cart" class="text-muted small">\
- <div class="btn btn-primary cart"> Cart\
- <span id="cart-count" class="label" style="padding-left:5px;margin-left:5px;\
- margin-right:-5px;background-color: #2905E2;">\
- </span>\
- </div>\
- </a></div>').appendTo($('.hidden-xs'))
+ $('<div class="cart-icon small" style="float:right;padding:3px;border-radius:10px;\
+ border: 1px solid #7575ff;">\
+ <a href="/cart" style="color:#7575ff; text-decoration: none">\
+ Cart\
+ <span style="color:#7575ff;" class="badge" id="cart-count">5</span>\
+ </a></div>').appendTo($('.shopping-cart'))
}
var $cart = $('.cart-icon');
diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less
index 96dd096..ffc338a 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 4111eb4..878eb9b 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -310,6 +310,8 @@
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 7669bff..43b88d6 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -53,11 +53,12 @@
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 @@
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 @@
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 6712ee8..79a4ea6 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -330,6 +330,8 @@
from erpnext.controllers.website_list_for_contact import get_list_context
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 649f97b..113d862 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -214,6 +214,7 @@
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 b6ee0b6..fcc1edf 100644
--- a/erpnext/support/doctype/issue/issue.py
+++ b/erpnext/support/doctype/issue/issue.py
@@ -57,7 +57,9 @@
return {
"title": _("My Issues"),
"get_list": get_issue_list,
- "row_template": "templates/includes/issue_row.html"
+ "row_template": "templates/includes/issue_row.html",
+ "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 34d345f..dabbf48 100644
--- a/erpnext/templates/generators/item.html
+++ b/erpnext/templates/generators/item.html
@@ -2,33 +2,25 @@
{% block title %} {{ title }} {% endblock %}
-{% block header %}<h2>{{ title }}</h2>{% 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 %}
-<div class="item-content">
+<div class="item-content" style="margin-top:20px;">
<div class="product-page-content" itemscope itemtype="http://schema.org/Product">
<div class="row">
- <div class="col-sm-5">
+ <div class="col-sm-6">
{% if slideshow %}
{% include "templates/includes/slideshow.html" %}
{% else %}
{{ product_image(website_image, "product-full-image") }}
{% endif %}
</div>
- <div class="col-sm-7">
- <!-- <h3 itemprop="name" style="margin-top: 0px;">{{ item_name }}</h3> -->
- <div itemprop="description">
- {{ web_long_description or description or _("No description given") }}
- </div>
+ <div class="col-sm-6" style="padding-left:20px;">
+ <h2 itemprop="name" style="margin-top: 0px;">{{ item_name }}</h2>
+
<p class="text-muted">
{{ _("Item Code") }}: <span itemprop="productID">{{ variant and variant.name or name }}</span></p>
<br>
@@ -77,15 +69,24 @@
</div>
</div>
</div>
- {% if website_specifications -%}
- <div class="row item-website-specification" style="margin-top: 20px">
+ <div class="row item-website-description" style="margin-top:30px; margin-bottom:20px">
<div class="col-md-12">
- <h4>{{ _("Specifications") }}</h4>
+ <h4>{{ _("DESCRIPTION") }}</h4>
+ <div itemprop="description" class="item-desc">
+ {{ web_long_description or description or _("No description given") }}
+ </div>
+ </div>
+ </div>
+
+ {% if website_specifications -%}
+ <div class="row item-website-specification" style="margin-top: 40px">
+ <div class="col-md-12">
+ <h4>{{ _("SPECIFICATIONS") }}</h4>
- <table class="table table-bordered" style="width: 100%">
+ <table class="table borderless" style="width: 100%">
{% for d in website_specifications -%}
<tr>
- <td style="width: 30%;">{{ d.label }}</td>
+ <td class="product-label text-muted" style="width: 30%;">{{ d.label }}</td>
<td>{{ d.description }}</td>
</tr>
{%- endfor %}
diff --git a/erpnext/templates/generators/item_group.html b/erpnext/templates/generators/item_group.html
index 7e68bc7..195b3c5 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 %}<h1>{{ _("Products") }}</h1>{% endblock %}
{% block breadcrumbs %}
- {% include "templates/includes/breadcrumbs.html" %}
+ <div class="page-breadcrumbs" data-html-block="breadcrumbs">
+ <ul class="breadcrumb">
+ <li>
+ <span class="icon icon-angle-left"></span>
+ <a href="/me">My Account</a>
+ </li>
+ </ul>
+ </div>
{% endblock %}
{% block page_content %}
@@ -38,16 +45,4 @@
{% endif %}
</div>
</div>
-{% endblock %}
-
-{% block style %}
-<style>
- .product-image.missing-image {
- border: 1px dashed {{ theme.border_color or "#d1d8dd" }};
- }
-
- .product-image.missing-image .octicon {
- color: {{ theme.border_color or "#d1d8dd" }};
- }
-</style>
-{% endblock %}
+{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/generators/job_opening.html b/erpnext/templates/generators/job_opening.html
index bbc5fee..ad7f942 100644
--- a/erpnext/templates/generators/job_opening.html
+++ b/erpnext/templates/generators/job_opening.html
@@ -10,8 +10,9 @@
{% block page_content %}
+{%- if description -%}
<div>{{ description }}</div>
-
+{% endif %}
<p>
<a class='btn btn-primary'
href='/job_application?job_title={{ doc.name }}'>
diff --git a/erpnext/templates/includes/footer/footer_extension.html b/erpnext/templates/includes/footer/footer_extension.html
index e24b862..e32e13d 100644
--- a/erpnext/templates/includes/footer/footer_extension.html
+++ b/erpnext/templates/includes/footer/footer_extension.html
@@ -1,19 +1,11 @@
{% if not hide_footer_signup %}
-<div class="container">
- <div class="row">
- <div class="col-sm-6 col-sm-offset-3 text-center" style="margin-top: 15px;">
+
<input class="form-control" type="text" id="footer-subscribe-email"
- style="display: inline-block; max-width: 50%; margin-right: 10px;"
+ style="display: inline-block; max-width: 50%;margin-right:15px;"
placeholder="{{ _('Your email address') }}...">
- <button class="btn btn-default btn-sm" type="button"
- id="footer-subscribe-button">{{ _("Get Updates") }}</button>
- </div>
- </div>
- <div class="text-center text-muted small" style="padding: 30px;">
- <a href="https://erpnext.com?source=website_footer" target="_blank" class="text-extra-muted">
- Powered by ERPNext</a>
- </div>
-</div>
+ <button class="btn btn-default btn-sm btn-subscribe" type="button"
+ id="footer-subscribe-button" style="float:right; border-radius:8px; border:1px solid #7575ff; color:#7575ff; background-color:white;">{{ _("Get Updates") }}</button>
+
<script>
frappe.ready(function() {
$("#footer-subscribe-button").click(function() {
diff --git a/erpnext/templates/includes/footer/footer_powered.html b/erpnext/templates/includes/footer/footer_powered.html
index c44c342..e9d5f56 100644
--- a/erpnext/templates/includes/footer/footer_powered.html
+++ b/erpnext/templates/includes/footer/footer_powered.html
@@ -1 +1,2 @@
-<!-- blank -->
+<a href="https://erpnext.com?source=website_footer" target="_blank" class="text-muted">
+ Powered by ERPNext</a>
diff --git a/erpnext/templates/includes/projects.css b/erpnext/templates/includes/projects.css
index 8c83e17..e4aa81b 100644
--- a/erpnext/templates/includes/projects.css
+++ b/erpnext/templates/includes/projects.css
@@ -4,12 +4,6 @@
text-decoration: underline;
}
-.page-container {
- font-weight: normal;
- margin: 50px auto;
- max-width: 700px;
-}
-
.project-item:hover {
background-color: #f7f7f7;
}
diff --git a/erpnext/templates/includes/projects/project_row.html b/erpnext/templates/includes/projects/project_row.html
index fcd0e22..55b02e2 100644
--- a/erpnext/templates/includes/projects/project_row.html
+++ b/erpnext/templates/includes/projects/project_row.html
@@ -2,11 +2,11 @@
<div class="web-list-item">
<a class="no-decoration" href="/projects?project={{ doc.name }}">
<div class="row">
- <div class="col-xs-4">
+ <div class="col-xs-6">
{{ doc.name }}
</div>
- <div class="col-xs-4">
+ <div class="col-xs-3">
{% if doc.percent_complete %}
<div class="progress" style="margin-bottom: 0!important; margin-top: 10px!important; height:5px;">
<div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success"}}" role="progressbar"
@@ -19,7 +19,7 @@
{{ doc.status }}</span>
{% endif %}
</div>
- <div class="col-xs-4 text-right small text-muted">
+ <div class="col-xs-3 text-right small text-muted">
{{ frappe.utils.pretty_date(doc.modified) }}
</div>
</div>
diff --git a/erpnext/templates/includes/transaction_row.html b/erpnext/templates/includes/transaction_row.html
index 7c03579..a52bb60 100644
--- a/erpnext/templates/includes/transaction_row.html
+++ b/erpnext/templates/includes/transaction_row.html
@@ -1,23 +1,16 @@
<div class="web-list-item">
<a href="/{{ pathname }}/{{ doc.name }}">
<div class="row">
- <div class="col-sm-8 col-xs-7">
- <div class="row">
- <div class="col-sm-9">
- <div>{{ doc.name }}</div>
+ <div class="col-sm-6">
+
+ <span class="indicator {{ doc.indicator_color or "darkgrey" }}">{{ doc.name }}</span>
<div class="small text-muted">{{ doc.items_preview }}</div>
- </div>
- <div class="col-sm-3">
- <span class="indicator {{ doc.indicator_color or "darkgrey" }}">
- {{ doc.indicator_title or doc.status or "Submitted" }}
- </span>
- </div>
- </div>
+
</div>
- <div class="col-sm-2 col-xs-5 text-right">
+ <div class="col-sm-3 col-xs-5">
{{ doc.get_formatted("grand_total") }}
</div>
- <div class="col-sm-2 small text-muted text-right" title="{{ frappe.utils.format_datetime(doc.creation, "medium") }}">
+ <div class="col-sm-3 small text-muted text-right" title="{{ frappe.utils.format_datetime(doc.creation, "medium") }}">
{{ frappe.utils.pretty_date(doc.creation) }}</div>
</div>
</a>
diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py
index bf1514a..d390ebf 100644
--- a/erpnext/templates/pages/order.py
+++ b/erpnext/templates/pages/order.py
@@ -8,6 +8,7 @@
def get_context(context):
context.no_cache = 1
+ context.show_sidebar = True
context.doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name)
if hasattr(context.doc, "set_indicator"):
context.doc.set_indicator()
diff --git a/erpnext/templates/pages/projects.html b/erpnext/templates/pages/projects.html
index 6ecdfb6..1cac25e 100644
--- a/erpnext/templates/pages/projects.html
+++ b/erpnext/templates/pages/projects.html
@@ -3,11 +3,15 @@
{% block title %}{{ doc.project_name }}{% endblock %}
{%- from "templates/includes/projects/macros.html" import back_link -%}
-
-{% block header_actions %}
-{% include 'templates/includes/projects/project_search_box.html' %}
-{% endblock %}
-
+{% block header %}<h1>{{ doc.project_name }}</h1>{% endblock %}
+{% block header_actions %}{% if doc.percent_complete %}
+ <div class="progress progress-hg">
+ <div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success" }} active" role="progressbar"
+ aria-valuenow="{{ doc.percent_complete|round|int }}"
+ aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
+ </div>
+ </div>
+ {% endif %}{% endblock %}
{% block breadcrumbs %}
<div class="page-breadcrumbs" data-html-block="breadcrumbs">
<ul class="breadcrumb">
@@ -29,24 +33,6 @@
{% block page_content %}
-<div class="row">
-<div class="col-xs-6">
-<h2 class= "title">
- {{ doc.project_name }}
-</h2>
-</div>
-<div class="col-xs-6">
- {% if doc.percent_complete %}
- <div class="progress progress-hg">
- <div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success" }} active" role="progressbar"
- aria-valuenow="{{ doc.percent_complete|round|int }}"
- aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
- </div>
- </div>
- {% endif %}
-</div>
-</div>
-<hr class="small">
<div class="clearfix">
<h4 style="float: left;">{{ _("Tasks") }}</h4>
diff --git a/erpnext/templates/pages/projects.py b/erpnext/templates/pages/projects.py
index 218f63c..f10b2fb 100644
--- a/erpnext/templates/pages/projects.py
+++ b/erpnext/templates/pages/projects.py
@@ -11,7 +11,8 @@
raise frappe.PermissionError
context.no_cache = 1
-
+ context.show_search = True
+ context.show_sidebar = True
project = frappe.get_doc('Project', frappe.form_dict.project)
project.has_permission('read')