mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
[fix] product search in new block header_actions
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user