mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-06 15:00:27 +00:00
website updates and fix to sessions
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
<style>
|
||||
.img-area {
|
||||
float:left;
|
||||
width: 115px;
|
||||
}
|
||||
|
||||
.product-list-description {
|
||||
float:left;
|
||||
width: 400px;
|
||||
}
|
||||
</style>
|
||||
@@ -9,7 +9,7 @@
|
||||
</header>
|
||||
<div id="body_div">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar navbar-inverse"
|
||||
<div class="navbar"
|
||||
style="margin-bottom: 0px;">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
|
||||
@@ -1 +1,35 @@
|
||||
{% extends "html/page.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="layout-wrapper layout-wrapper-background">
|
||||
<div class="web-content" id="content-product_group">
|
||||
<div class="layout-main" style="padding: 30px;">
|
||||
{% include 'html/product_search_box.html' %}
|
||||
{% if description %}
|
||||
<div>{{ description or ""}}</div>
|
||||
{% else %}
|
||||
<h3>{{ name }}</h3>
|
||||
{% endif %}
|
||||
{% if sub_groups %}
|
||||
<div class="well">
|
||||
<div class="container-fluid">
|
||||
{% for d in sub_groups %}
|
||||
<div class="span2">
|
||||
<i class="icon-chevron-right"></i>
|
||||
<a href="{{ d.page_name }}">{{ d.name }}</a></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if obj.doclist.get({"doctype":"Featured Item"}) %}
|
||||
<hr>
|
||||
<h3>Featured Products</h3>
|
||||
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -22,6 +22,7 @@
|
||||
<div class="layout-main" style="padding: 30px;">
|
||||
{% include 'html/product_search_box.html' %}
|
||||
<h1>{{ item_name }}</h1>
|
||||
<p class="help">Item Code: {{ name }}</p>
|
||||
<div class="product-page-content">
|
||||
<div class="span6">
|
||||
{% if website_image %}
|
||||
@@ -29,7 +30,7 @@
|
||||
{% else %}
|
||||
<div class="img-area">
|
||||
<div style='background-color: #eee; padding: 40px;
|
||||
width: 32px; font-size: 32px; color: #888;'>
|
||||
width: 32px; font-size: 32px; color: #888;' title='No Image'>
|
||||
<i class='icon-camera'></i></div>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +47,8 @@
|
||||
<div class="span9">
|
||||
<h3>Product Description</h3>
|
||||
<div>
|
||||
{{ web_long_description or web_short_description }}
|
||||
{{ web_long_description or web_short_description or
|
||||
"[No description given]" }}
|
||||
</div>
|
||||
<hr>
|
||||
{% if obj.doclist.get({"doctype":"Item Website Specification"}) %}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<div class="pull-right">
|
||||
<div class="pull-right" style="margin-top:-15px;">
|
||||
<form class="form-search">
|
||||
<div class="input-append">
|
||||
<input type="text" class="span2 search-query" id="product-search">
|
||||
<input type="text" class="span2 search-query"
|
||||
id="product-search" placeholder="Product Search...">
|
||||
<button class="btn" id="btn-product-search">
|
||||
<i class="icon-search"></i></button>
|
||||
</div>
|
||||
@@ -21,4 +22,5 @@
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
@@ -59,10 +59,17 @@ var blog = {
|
||||
<p><a href="%(page_name)s">Read with comments...</a></p>\
|
||||
<hr /><br />', b)).appendTo($wrap);
|
||||
});
|
||||
blog.start += data.length;
|
||||
blog.start += (data.length || 0);
|
||||
if(!data.length) {
|
||||
$("#next-page").toggle(false)
|
||||
.parent().append("<div class='alert'>Nothing more to show.</div>");
|
||||
if(blog.start) {
|
||||
$("#next-page").toggle(false)
|
||||
.parent().append("<div class='alert'>Nothing more to show.</div>");
|
||||
} else {
|
||||
$("#next-page").toggle(false)
|
||||
.parent().append("<div class='alert'>No blogs written yet.</div>");
|
||||
}
|
||||
} else {
|
||||
$("#next-page").toggle(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
wn.provide('erpnext.blog');
|
||||
|
||||
(function() {
|
||||
$('body').on('click', '.btn-blog-subscribe', function() {
|
||||
var d = new wn.ui.Dialog({
|
||||
title: "Get Blog Updates via Email",
|
||||
fields: [
|
||||
{label: "Your Name", fieldtype:"Data", reqd:1},
|
||||
{label: "Your Email Address", fieldtype:"Data", reqd:1
|
||||
,description: "You can unsubscribe anytime."},
|
||||
{label: "Subscribe", fieldtype:"Button"}
|
||||
]
|
||||
});
|
||||
$(d.fields_dict.subscribe.input).click(function() {
|
||||
var args = d.get_values();
|
||||
if(!args) return;
|
||||
wn.call({
|
||||
method: 'website.helpers.blog.add_subscriber',
|
||||
args: args,
|
||||
callback: function(r) {
|
||||
if(r.exc) {
|
||||
msgprint('Opps there seems to be some error, Please check back after some time.');
|
||||
} else {
|
||||
msgprint('Thanks for subscribing!');
|
||||
}
|
||||
d.hide();
|
||||
},
|
||||
btn: this
|
||||
})
|
||||
})
|
||||
d.show()
|
||||
})
|
||||
})()
|
||||
@@ -1,18 +0,0 @@
|
||||
wn.provide('erpnext.products');
|
||||
|
||||
erpnext.products.make_product_categories = function(wrapper) {
|
||||
if (!wrapper) { wrapper = erpnext.products.wrapper; }
|
||||
if (!wrapper) { return; }
|
||||
|
||||
wrapper.category_list = new wn.ui.Listing({
|
||||
parent: $(wrapper).find('.more-categories').get(0),
|
||||
method: 'website.helpers.product.get_product_category_list',
|
||||
hide_refresh: true,
|
||||
render_row: function(parent, data) {
|
||||
parent.innerHTML = repl(
|
||||
'<a href="products.html#!products/%(item_group)s">%(item_group)s</a> (%(items)s)',
|
||||
data);
|
||||
}
|
||||
});
|
||||
wrapper.category_list.run();
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
// ERPNext - web based ERP (http://erpnext.com)
|
||||
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// js inside blog page
|
||||
|
||||
{% include "js/product_category.js" %}
|
||||
|
||||
wn.pages['{{ name }}'].onload = function(wrapper) {
|
||||
erpnext.products.wrapper = wrapper;
|
||||
|
||||
// make product categories in the sidebar
|
||||
erpnext.products.make_product_categories(wrapper);
|
||||
|
||||
// make lists
|
||||
erpnext.products.make_product_list(wrapper);
|
||||
|
||||
// bind search button or enter key
|
||||
$(wrapper).find('.products-search .btn').click(function() {
|
||||
erpnext.products.product_list.run();
|
||||
});
|
||||
|
||||
$(wrapper).find('.products-search input').keypress(function(ev) {
|
||||
if(ev.which==13) $(wrapper).find('.products-search .btn').click();
|
||||
});
|
||||
}
|
||||
|
||||
erpnext.products.make_product_list = function(wrapper) {
|
||||
if (!wrapper) { wrapper = erpnext.products.wrapper; }
|
||||
if (!wrapper) { return; }
|
||||
|
||||
erpnext.products.product_list = new wn.ui.Listing({
|
||||
parent: $(wrapper).find('#products-list').get(0),
|
||||
run_btn: $(wrapper).find('.products-search .btn').get(0),
|
||||
no_toolbar: true,
|
||||
method: 'website.helpers.product.get_product_list',
|
||||
get_args: function() {
|
||||
return {
|
||||
search: $('input[name="products-search"]').val() || '',
|
||||
product_group: erpnext.products.cur_group || '',
|
||||
};
|
||||
},
|
||||
render_row: function(parent, data) {
|
||||
if (!data.web_short_description) {
|
||||
data.web_short_description = data.description;
|
||||
}
|
||||
parent.innerHTML = repl('\
|
||||
<a href="%(page_name)s.html"><div class="img-area"></div></a>\
|
||||
<div class="product-list-description">\
|
||||
<h4><a href="%(page_name)s.html">%(item_name)s</a></h4>\
|
||||
<p>%(web_short_description)s</p></div>\
|
||||
<div style="clear: both;"></div>', data);
|
||||
|
||||
if(data.website_image) {
|
||||
$(parent).find('.img-area').append(repl(
|
||||
'<img src="files/%(website_image)s" style="width:100px;">', data))
|
||||
} else {
|
||||
$(parent).find('.img-area').append(wn.dom.placeholder(100,
|
||||
data.item_name));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
wn.pages['{{ name }}'].onshow = function(wrapper) {
|
||||
// show default product category
|
||||
erpnext.products.set_group();
|
||||
}
|
||||
|
||||
erpnext.products.set_group = function() {
|
||||
var cat = erpnext.products.get_group();
|
||||
|
||||
// get erpnext.products.default_category
|
||||
var wrapper = erpnext.products.wrapper;
|
||||
|
||||
$(wrapper).find('h1').html(cat.label);
|
||||
erpnext.products.product_list.run();
|
||||
}
|
||||
|
||||
erpnext.products.get_group = function() {
|
||||
route = wn.get_route();
|
||||
if(route && route.length>1) {
|
||||
// from url
|
||||
var grp = route[1];
|
||||
var label = route[1];
|
||||
erpnext.products.cur_group = grp;
|
||||
} else {
|
||||
// default
|
||||
var grp = 'Products';
|
||||
var label = 'Products';
|
||||
erpnext.products.cur_group = null;
|
||||
}
|
||||
return {grp:grp, label:label};
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
{% block content %}
|
||||
<div class="content">
|
||||
<div class="layout-wrapper layout-main">
|
||||
<h3>Page missing or moved</h3>
|
||||
<h3><i class="icon-exclamation-sign"></i> Page missing or moved</h3>
|
||||
<br>
|
||||
<p>We are very sorry for this, but the page you are looking for is missing
|
||||
(this could be because of a typo in the address) or moved.</p>
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
<div class="layout-main">
|
||||
<h1>Blog</h1>
|
||||
<br>
|
||||
<div id="blog-list" style="min-height: 400px;">
|
||||
<div id="blog-list">
|
||||
<!-- blog list will be generated dynamically -->
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<button id="next-page" class="btn">More...</button>
|
||||
<button id="next-page" class="btn"
|
||||
style="display:none;">More...</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
11
website/templates/pages/error.html
Normal file
11
website/templates/pages/error.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends "html/outer.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content">
|
||||
<div class="layout-wrapper layout-main">
|
||||
<h3><i class="icon-exclamation-sign"></i> Oops, a server error has occured</h3>
|
||||
<br>
|
||||
<pre>%(error)s</pre>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -56,7 +56,13 @@ $(document).ready(function() {
|
||||
|
||||
}
|
||||
if(data.length < 10) {
|
||||
$(".more-btn").replaceWith("<div class='alert'>Nothing more to show</div>");
|
||||
if(!table) {
|
||||
$(".more-btn")
|
||||
.replaceWith("<div class='alert'>No results found for your search.</div>");
|
||||
} else {
|
||||
$(".more-btn")
|
||||
.replaceWith("<div class='alert'>Nothing more to show.</div>");
|
||||
}
|
||||
} else {
|
||||
$(".more-btn").toggle(true)
|
||||
}
|
||||
@@ -78,8 +84,11 @@ $(document).ready(function() {
|
||||
<div id="search-list">
|
||||
|
||||
</div>
|
||||
<div class="more-btn" style="text-align: middle; display: none;">
|
||||
<button class="btn">More...</button>
|
||||
<div style="text-align: center;">
|
||||
<div class="more-btn"
|
||||
style="display: none; text-align: center;">
|
||||
<button class="btn">More...</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
{% extends "html/page.html" %}
|
||||
|
||||
{% block javascript %}
|
||||
{% include "js/products.js" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{% include "css/products.css" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}
|
||||
Products
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="layout-wrapper layout-wrapper-background">
|
||||
<div class="web-content" id="content-products">
|
||||
|
||||
<div class="layout-main-section">
|
||||
<h1 class="products-category"></h1>
|
||||
<div class="products-search" style="margin-bottom: 15px;">
|
||||
<input name="products-search" />
|
||||
<button class="btn" style="margin-left: 7px">Search</button>
|
||||
</div>
|
||||
<div id="products-list">
|
||||
<!-- product list will be generated dynamically -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layout-side-section">
|
||||
<h3>Categories</h3>
|
||||
<div class="more-categories"></div>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user