[fix] product search in new block header_actions
diff --git a/erpnext/templates/generators/item.html b/erpnext/templates/generators/item.html
index aa02376..535edcd 100644
--- a/erpnext/templates/generators/item.html
+++ b/erpnext/templates/generators/item.html
@@ -2,10 +2,13 @@
{% block header %}<h2>{{ title }}</h2>{% endblock %}
+{% block header_actions %}
+{% include 'templates/includes/product_search_box.html' %}
+{% endblock %}
+
{% block content %}
{% from "erpnext/templates/includes/macros.html" import product_image %}
<div class="item-content">
- {% include 'templates/includes/product_search_box.html' %}
<div class="product-page-content" itemscope itemtype="http://schema.org/Product">
<div class="row">
<div class="col-sm-5">
diff --git a/erpnext/templates/generators/item_group.html b/erpnext/templates/generators/item_group.html
index 348d330..2652f6f 100644
--- a/erpnext/templates/generators/item_group.html
+++ b/erpnext/templates/generators/item_group.html
@@ -1,6 +1,9 @@
+{% block header_actions %}
+{% include 'templates/includes/product_search_box.html' %}
+{% endblock %}
+
{% block content %}
<div class="item-group-content">
- {% include 'templates/includes/product_search_box.html' %}
<div>
{% if slideshow %}<!-- slideshow -->
{% include "templates/includes/slideshow.html" %}
diff --git a/erpnext/templates/includes/product_in_grid.html b/erpnext/templates/includes/product_in_grid.html
index ea49812..d2c1c46 100644
--- a/erpnext/templates/includes/product_in_grid.html
+++ b/erpnext/templates/includes/product_in_grid.html
@@ -1,6 +1,6 @@
{% from "erpnext/templates/includes/macros.html" import product_image_square %}
-<a class="product-link" href="{{ (route or page_name)|with_leading_slash }}">
+<a class="product-link" href="{{ (route or page_name)|abs_url }}">
<div class="col-sm-2 col-xs-4 product-image-wrapper">
{{ product_image_square(website_image) }}
<div class="text-ellipsis inline-block small product-text">{{ item_name }}</div>
diff --git a/erpnext/templates/includes/product_in_list.html b/erpnext/templates/includes/product_in_list.html
index 98e46a7..2a6cbe1 100644
--- a/erpnext/templates/includes/product_in_list.html
+++ b/erpnext/templates/includes/product_in_list.html
@@ -1,15 +1,15 @@
<!-- TODO product listing -->
<div class="container content">
<div style="height: 120px; overflow: hidden;">
- <a href="{{ (route or page_name)|with_leading_slash }}">
+ <a href="{{ (route or page_name)|abs_url }}">
{%- if website_image -%}
- <img class="product-image" style="width: 80%; margin: auto;" src="{{ website_image|with_leading_slash }}">
+ <img class="product-image" style="width: 80%; margin: auto;" src="{{ website_image|abs_url }}">
{%- else -%}
<div style="width: 80%; height: 120px; background-color: #F7FAFC;"></div>
{%- endif -%}
</a>
</div>
<div style="height: 100px; overflow: hidden; font-size: 80%;">
- <div><a href="{{ (route or page_name)|with_leading_slash }}">{{ item_name }}</a></div>
+ <div><a href="{{ (route or page_name)|abs_url }}">{{ item_name }}</a></div>
</div>
</div>
diff --git a/erpnext/templates/includes/product_search_box.html b/erpnext/templates/includes/product_search_box.html
index a5592c1..a135396 100644
--- a/erpnext/templates/includes/product_search_box.html
+++ b/erpnext/templates/includes/product_search_box.html
@@ -1,20 +1,17 @@
+<div class="product-search pull-right">
+ <form class="form-inline form-search">
+ <div class="input-group">
+ <input class="form-control" type="text" id="product-search"
+ placeholder="Product Search...">
+ <span class="input-group-btn">
+ <button class="btn btn-default" type="button" id="btn-product-search">
+ <i class="icon-search"></i></button>
+ </span>
+ </div>
+ </form>
+</div>
<script>
frappe.ready(function() {
- $(".product-search").remove();
-
- $('<div class="product-search pull-right">\
- <form class="form-inline form-search">\
- <div class="input-group">\
- <input class="form-control" type="text" id="product-search" placeholder="Product Search...">\
- <span class="input-group-btn">\
- <button class="btn btn-default" type="button" id="btn-product-search">\
- <i class="icon-search"></i></button>\
- </span>\
- </div>\
- </form>\
- </div>').prependTo(".page-header-block");
-
- $('.dropdown-toggle').dropdown();
$("#btn-product-search").click(function() {
var txt = $("#product-search").val();
if(txt) {
diff --git a/erpnext/templates/pages/product_search.html b/erpnext/templates/pages/product_search.html
index 9b51c18..07e6c6e 100644
--- a/erpnext/templates/pages/product_search.html
+++ b/erpnext/templates/pages/product_search.html
@@ -2,6 +2,10 @@
{% block header %}<h2>Product Search</h2>{% endblock %}
+{% block header_actions %}
+{% include 'templates/includes/product_search_box.html' %}
+{% endblock %}
+
{% block content %}
<script>{% include "templates/includes/product_list.js" %}</script>
@@ -15,7 +19,6 @@
});
</script>
-{% include "templates/includes/product_search_box.html" %}
<div class="product-search-content">
<h3 class="search-results">Search Results</h3>
<div id="search-list" class="row">