mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 10:36:31 +00:00
[website] [minor] moving to framework
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
<style>
|
||||
h2 > a, h2 > a:link, h2 > a:visited, h2 > a:active,
|
||||
h2 > a:hover, h2 > a:focus {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +0,0 @@
|
||||
<style>
|
||||
.comment-title {
|
||||
color:#777;
|
||||
}
|
||||
|
||||
.comment-content {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 240px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +0,0 @@
|
||||
<style>
|
||||
.item-main-image {
|
||||
max-width: 100%;
|
||||
margin: auto;
|
||||
}
|
||||
.web-long-description {
|
||||
font-size: 18px;
|
||||
line-height: 200%;
|
||||
}
|
||||
.item-stock {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,39 +0,0 @@
|
||||
{% if slideshow %}
|
||||
{{ slideshow_header }}
|
||||
|
||||
|
||||
<div id="the-carousel" class="carousel slide">
|
||||
<!-- Indicators -->
|
||||
<ol class="carousel-indicators">
|
||||
{% for slide in obj.slides %}
|
||||
<li data-target="#the-carousel" data-slide-to="0"
|
||||
{%- if loop.index==0 %}class="active"{% endif %}></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
||||
<!-- Wrapper for slides -->
|
||||
<div class="carousel-inner">
|
||||
{% for slide in obj.slides %}
|
||||
<div class="{% if slide.idx==1 %}active {% endif %}item">
|
||||
<img src="{{ slide.image }}" />
|
||||
{% if slide.heading or slide.description %}
|
||||
<div class="carousel-caption">
|
||||
{% if slide.heading %}<h4>{{ slide.heading }}</h4>{% endif %}
|
||||
{% if slide.description %}<p>{{ slide.description }}</p>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Controls -->
|
||||
<a class="left carousel-control" href="#the-carousel" data-slide="prev">
|
||||
<span class="icon icon-chevron-left"></span>
|
||||
</a>
|
||||
<a class="right carousel-control" href="#the-carousel" data-slide="next">
|
||||
<span class="icon icon-chevron-right"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script>$(".carousel").carousel();</script>
|
||||
{% endif %}
|
||||
@@ -1,59 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% block content -%}
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="index">Home</a></li>
|
||||
<li><a href="account">My Account</a></li>
|
||||
<li class="active"><i class="{{ icon }} icon-fixed-width"></i> {{ title }}</li>
|
||||
</ul>
|
||||
<div class="list-group transaction-list">
|
||||
<div class="progress progress-striped active">
|
||||
<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button class="btn btn-default btn-show-more hide">More</button>
|
||||
</div>
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
||||
{% block javascript -%}
|
||||
$(document).ready(function() {
|
||||
window.start = 0;
|
||||
window.$list = $(".transaction-list");
|
||||
window.$show_more = $(".btn-show-more").on("click", function() { get_transactions(this); })
|
||||
|
||||
get_transactions();
|
||||
});
|
||||
|
||||
var get_transactions = function(btn) {
|
||||
wn.call({
|
||||
method: "{{ method }}",
|
||||
args: { start: start },
|
||||
btn: btn,
|
||||
callback: function(r) {
|
||||
$list.find(".progress").remove();
|
||||
$show_more.toggleClass("hide", !(r.message && r.message.length===20));
|
||||
|
||||
if(!(r.message && r.message.length)) {
|
||||
console.log("empty");
|
||||
if(!$list.html().trim()) {
|
||||
$list.html("<div class='alert alert-warning'>\
|
||||
{{ empty_list_message }}</div>");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
start += r.message.length;
|
||||
|
||||
$.each(r.message, function(i, doc) {
|
||||
render(doc);
|
||||
});
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
// var render = function(doc) { };
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,14 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% block javascript %}
|
||||
{% if insert_code %}
|
||||
{{ javascript }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12" style="margin-top: 15px;">
|
||||
{% include "app/website/templates/html/slideshow.html" %}
|
||||
{{ main_section }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,86 +0,0 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
// js inside blog page
|
||||
|
||||
$(document).ready(function() {
|
||||
// make list of blogs
|
||||
blog.get_list();
|
||||
|
||||
$("#next-page").click(function() {
|
||||
blog.get_list();
|
||||
})
|
||||
|
||||
if(get_url_arg("by_name")) {
|
||||
$("#blot-subtitle").html("Posts by " + get_url_arg("by_name")).toggle(true);
|
||||
}
|
||||
|
||||
if(get_url_arg("category")) {
|
||||
$("#blot-subtitle").html("Posts filed under " + get_url_arg("category")).toggle(true);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var blog = {
|
||||
start: 0,
|
||||
get_list: function() {
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: "server.py",
|
||||
data: {
|
||||
cmd: "website.doctype.blog_post.blog_post.get_blog_list",
|
||||
start: blog.start,
|
||||
by: get_url_arg("by"),
|
||||
category: get_url_arg("category")
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$(".progress").toggle(false);
|
||||
if(data.exc) console.log(data.exc);
|
||||
blog.render(data.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
render: function(data) {
|
||||
var $wrap = $("#blog-list");
|
||||
$.each(data, function(i, b) {
|
||||
// comments
|
||||
if(!b.comments) {
|
||||
b.comment_text = 'No comments yet.'
|
||||
} else if (b.comments===1) {
|
||||
b.comment_text = '1 comment.'
|
||||
} else {
|
||||
b.comment_text = b.comments + ' comments.'
|
||||
}
|
||||
|
||||
b.page_name = encodeURIComponent(b.page_name);
|
||||
|
||||
$(repl('<div class="row">\
|
||||
<div class="col-md-1">\
|
||||
<div class="avatar avatar-medium" style="margin-top: 6px;">\
|
||||
<img src="%(avatar)s" />\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="col-md-11">\
|
||||
<h4><a href="%(page_name)s">%(title)s</a></h4>\
|
||||
<p>%(content)s</p>\
|
||||
<p style="color: #aaa; font-size: 90%">\
|
||||
<a href="blog?by=%(blogger)s&by_name=%(full_name)s">\
|
||||
%(full_name)s</a> wrote this on %(published)s / %(comment_text)s</p>\
|
||||
</div>\
|
||||
</div><hr>', b)).appendTo($wrap);
|
||||
});
|
||||
blog.start += (data.length || 0);
|
||||
if(!data.length || data.length < 20) {
|
||||
if(blog.start) {
|
||||
$("#next-page").toggle(false)
|
||||
.parent().append("<div class='text-muted'>Nothing more to show.</div>");
|
||||
} else {
|
||||
$("#next-page").toggle(false)
|
||||
.parent().append("<div class='alert alert-warning'>No blogs written yet.</div>");
|
||||
}
|
||||
} else {
|
||||
$("#next-page").toggle(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
// js inside blog page
|
||||
|
||||
$(document).ready(function() {
|
||||
var n_comments = $(".comment-row").length;
|
||||
|
||||
if(n_comments) {
|
||||
$(".no_comment").toggle(false);
|
||||
}
|
||||
if(n_comments > 50) {
|
||||
$(".add-comment").toggle(false)
|
||||
.parent().append("<div class='alert alert-warning'>Comments are closed.</div>")
|
||||
}
|
||||
$(".add-comment").click(function() {
|
||||
$(this).toggle(false);
|
||||
$("#comment-form").toggle();
|
||||
$("#comment-form input, #comment-form, textarea").val("");
|
||||
})
|
||||
$("#submit-comment").click(function() {
|
||||
var args = {
|
||||
comment_by_fullname: $("[name='comment_by_fullname']").val(),
|
||||
comment_by: $("[name='comment_by']").val(),
|
||||
comment: $("[name='comment']").val(),
|
||||
cmd: "website.doctype.blog_post.blog_post.add_comment",
|
||||
comment_doctype: "Blog Post",
|
||||
comment_docname: "{{ name }}",
|
||||
page_name: "{{ page_name }}",
|
||||
_type: "POST"
|
||||
}
|
||||
|
||||
$("#comment-form .alert").toggle(false);
|
||||
|
||||
if(!args.comment_by_fullname || !args.comment_by || !args.comment) {
|
||||
$("#comment-form .alert")
|
||||
.html("All fields are necessary to submit the comment.")
|
||||
.toggle(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "server.py",
|
||||
data: args,
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.exc) {
|
||||
$("#comment-form .alert")
|
||||
.html(data.exc)
|
||||
.toggle(true)
|
||||
} else {
|
||||
$(data.message).appendTo(".blog-comments");
|
||||
$(".no_comment").toggle(false);
|
||||
$(".add-comment").toggle(false);
|
||||
$("#comment-form")
|
||||
.replaceWith("<div class='alert alert-success'>Thank you for your comment!</div>")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return false;
|
||||
})
|
||||
})
|
||||
@@ -1,294 +0,0 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
// js inside blog page
|
||||
|
||||
$(document).ready(function() {
|
||||
wn.cart.bind_events();
|
||||
return wn.call({
|
||||
type: "POST",
|
||||
method: "selling.utils.cart.get_cart_quotation",
|
||||
callback: function(r) {
|
||||
console.log(r);
|
||||
$("#cart-container").removeClass("hide");
|
||||
$(".progress").remove();
|
||||
if(r.exc) {
|
||||
if(r.exc.indexOf("WebsitePriceListMissingError")!==-1) {
|
||||
wn.cart.show_error("Oops!", "Price List not configured.");
|
||||
} else if(r["403"]) {
|
||||
wn.cart.show_error("Hey!", "You need to be logged in to view your cart.");
|
||||
} else {
|
||||
wn.cart.show_error("Oops!", "Something went wrong.");
|
||||
}
|
||||
} else {
|
||||
wn.cart.set_cart_count();
|
||||
wn.cart.render(r.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// shopping cart
|
||||
if(!wn.cart) wn.cart = {};
|
||||
$.extend(wn.cart, {
|
||||
show_error: function(title, text) {
|
||||
$("#cart-container").html('<div class="well"><h4>' + title + '</h4> ' + text + '</div>');
|
||||
},
|
||||
|
||||
bind_events: function() {
|
||||
// bind update button
|
||||
$(document).on("click", ".item-update-cart button", function() {
|
||||
var item_code = $(this).attr("data-item-code");
|
||||
wn.cart.update_cart({
|
||||
item_code: item_code,
|
||||
qty: $('input[data-item-code="'+item_code+'"]').val(),
|
||||
with_doclist: 1,
|
||||
btn: this,
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
wn.cart.render(r.message);
|
||||
var $button = $('button[data-item-code="'+item_code+'"]').addClass("btn-success");
|
||||
setTimeout(function() { $button.removeClass("btn-success"); }, 1000);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
$("#cart-add-shipping-address").on("click", function() {
|
||||
window.location.href = "address?address_fieldname=shipping_address_name";
|
||||
});
|
||||
|
||||
$("#cart-add-billing-address").on("click", function() {
|
||||
window.location.href = "address?address_fieldname=customer_address";
|
||||
});
|
||||
|
||||
$(".btn-place-order").on("click", function() {
|
||||
wn.cart.place_order();
|
||||
});
|
||||
},
|
||||
|
||||
render: function(out) {
|
||||
var doclist = out.doclist;
|
||||
var addresses = out.addresses;
|
||||
|
||||
var $cart_items = $("#cart-items").empty();
|
||||
var $cart_taxes = $("#cart-taxes").empty();
|
||||
var $cart_totals = $("#cart-totals").empty();
|
||||
var $cart_billing_address = $("#cart-billing-address").empty();
|
||||
var $cart_shipping_address = $("#cart-shipping-address").empty();
|
||||
|
||||
var no_items = $.map(doclist, function(d) { return d.item_code || null;}).length===0;
|
||||
if(no_items) {
|
||||
wn.cart.show_error("Empty :-(", "Go ahead and add something to your cart.");
|
||||
$("#cart-addresses").toggle(false);
|
||||
return;
|
||||
}
|
||||
|
||||
var shipping_rule_added = false;
|
||||
var taxes_exist = false;
|
||||
var shipping_rule_labels = $.map(out.shipping_rules || [], function(rule) { return rule[1]; });
|
||||
$.each(doclist, function(i, doc) {
|
||||
if(doc.doctype === "Quotation Item") {
|
||||
wn.cart.render_item_row($cart_items, doc);
|
||||
} else if (doc.doctype === "Sales Taxes and Charges") {
|
||||
if(out.shipping_rules && out.shipping_rules.length &&
|
||||
shipping_rule_labels.indexOf(doc.description)!==-1) {
|
||||
shipping_rule_added = true;
|
||||
wn.cart.render_tax_row($cart_taxes, doc, out.shipping_rules);
|
||||
} else {
|
||||
wn.cart.render_tax_row($cart_taxes, doc);
|
||||
}
|
||||
|
||||
taxes_exist = true;
|
||||
}
|
||||
});
|
||||
|
||||
if(out.shipping_rules && out.shipping_rules.length && !shipping_rule_added) {
|
||||
wn.cart.render_tax_row($cart_taxes, {description: "", formatted_tax_amount: ""},
|
||||
out.shipping_rules);
|
||||
taxes_exist = true;
|
||||
}
|
||||
|
||||
if(taxes_exist)
|
||||
$('<hr>').appendTo($cart_taxes);
|
||||
|
||||
wn.cart.render_tax_row($cart_totals, {
|
||||
description: "<strong>Total</strong>",
|
||||
formatted_tax_amount: "<strong>" + doclist[0].formatted_grand_total_export + "</strong>"
|
||||
});
|
||||
|
||||
if(!(addresses && addresses.length)) {
|
||||
$cart_shipping_address.html('<div class="well">Hey! Go ahead and add an address</div>');
|
||||
} else {
|
||||
wn.cart.render_address($cart_shipping_address, addresses, doclist[0].shipping_address_name);
|
||||
wn.cart.render_address($cart_billing_address, addresses, doclist[0].customer_address);
|
||||
}
|
||||
},
|
||||
|
||||
render_item_row: function($cart_items, doc) {
|
||||
doc.image_html = doc.image ?
|
||||
'<div style="height: 120px; overflow: hidden;"><img src="' + doc.image + '" /></div>' :
|
||||
'{% include "app/website/templates/html/product_missing_image.html" %}';
|
||||
|
||||
if(doc.description === doc.item_name) doc.description = "";
|
||||
|
||||
$(repl('<div class="row">\
|
||||
<div class="col-md-9 col-sm-9">\
|
||||
<div class="row">\
|
||||
<div class="col-md-3">%(image_html)s</div>\
|
||||
<div class="col-md-9">\
|
||||
<h4><a href="%(page_name)s">%(item_name)s</a></h4>\
|
||||
<p>%(description)s</p>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="col-md-3 col-sm-3 text-right">\
|
||||
<div class="input-group item-update-cart">\
|
||||
<input type="text" placeholder="Qty" value="%(qty)s" \
|
||||
data-item-code="%(item_code)s" class="text-right form-control">\
|
||||
<div class="input-group-btn">\
|
||||
<button class="btn btn-primary" data-item-code="%(item_code)s">\
|
||||
<i class="icon-ok"></i></button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<p style="margin-top: 10px;">at %(formatted_rate)s</p>\
|
||||
<small class="text-muted" style="margin-top: 10px;">= %(formatted_amount)s</small>\
|
||||
</div>\
|
||||
</div><hr>', doc)).appendTo($cart_items);
|
||||
},
|
||||
|
||||
render_tax_row: function($cart_taxes, doc, shipping_rules) {
|
||||
var shipping_selector;
|
||||
if(shipping_rules) {
|
||||
shipping_selector = '<select class="form-control">' + $.map(shipping_rules, function(rule) {
|
||||
return '<option value="' + rule[0] + '">' + rule[1] + '</option>' }).join("\n") +
|
||||
'</select>';
|
||||
}
|
||||
|
||||
var $tax_row = $(repl('<div class="row">\
|
||||
<div class="col-md-9 col-sm-9">\
|
||||
<div class="row">\
|
||||
<div class="col-md-9 col-md-offset-3">' +
|
||||
(shipping_selector || '<p>%(description)s</p>') +
|
||||
'</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="col-md-3 col-sm-3 text-right">\
|
||||
<p' + (shipping_selector ? ' style="margin-top: 5px;"' : "") + '>%(formatted_tax_amount)s</p>\
|
||||
</div>\
|
||||
</div>', doc)).appendTo($cart_taxes);
|
||||
|
||||
if(shipping_selector) {
|
||||
$tax_row.find('select option').each(function(i, opt) {
|
||||
if($(opt).html() == doc.description) {
|
||||
$(opt).attr("selected", "selected");
|
||||
}
|
||||
});
|
||||
$tax_row.find('select').on("change", function() {
|
||||
wn.cart.apply_shipping_rule($(this).val(), this);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
apply_shipping_rule: function(rule, btn) {
|
||||
return wn.call({
|
||||
btn: btn,
|
||||
type: "POST",
|
||||
method: "selling.utils.cart.apply_shipping_rule",
|
||||
args: { shipping_rule: rule },
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
wn.cart.render(r.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
render_address: function($address_wrapper, addresses, address_name) {
|
||||
$.each(addresses, function(i, address) {
|
||||
$(repl('<div class="panel panel-default"> \
|
||||
<div class="panel-heading"> \
|
||||
<div class="row"> \
|
||||
<div class="col-md-10 address-title" \
|
||||
data-address-name="%(name)s"><strong>%(name)s</strong></div> \
|
||||
<div class="col-md-2"><input type="checkbox" \
|
||||
data-address-name="%(name)s"></div> \
|
||||
</div> \
|
||||
</div> \
|
||||
<div class="panel-collapse collapse" data-address-name="%(name)s"> \
|
||||
<div class="panel-body">%(display)s</div> \
|
||||
</div> \
|
||||
</div>', address))
|
||||
.css({"margin": "10px auto"})
|
||||
.appendTo($address_wrapper);
|
||||
});
|
||||
|
||||
$address_wrapper.find(".panel-heading")
|
||||
.find(".address-title")
|
||||
.css({"cursor": "pointer"})
|
||||
.on("click", function() {
|
||||
$address_wrapper.find('.panel-collapse[data-address-name="'
|
||||
+$(this).attr("data-address-name")+'"]').collapse("toggle");
|
||||
});
|
||||
|
||||
$address_wrapper.find('input[type="checkbox"]').on("click", function() {
|
||||
if($(this).prop("checked")) {
|
||||
var me = this;
|
||||
$address_wrapper.find('input[type="checkbox"]').each(function(i, chk) {
|
||||
if($(chk).attr("data-address-name")!=$(me).attr("data-address-name")) {
|
||||
$(chk).prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
return wn.call({
|
||||
type: "POST",
|
||||
method: "selling.utils.cart.update_cart_address",
|
||||
args: {
|
||||
address_fieldname: $address_wrapper.attr("data-fieldname"),
|
||||
address_name: $(this).attr("data-address-name")
|
||||
},
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
wn.cart.render(r.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$address_wrapper.find('input[type="checkbox"][data-address-name="'+ address_name +'"]')
|
||||
.prop("checked", true);
|
||||
|
||||
$address_wrapper.find(".panel-collapse").collapse({
|
||||
parent: $address_wrapper,
|
||||
toggle: false
|
||||
});
|
||||
|
||||
$address_wrapper.find('.panel-collapse[data-address-name="'+ address_name +'"]')
|
||||
.collapse("show");
|
||||
},
|
||||
|
||||
place_order: function() {
|
||||
return wn.call({
|
||||
type: "POST",
|
||||
method: "selling.utils.cart.place_order",
|
||||
callback: function(r) {
|
||||
if(r.exc) {
|
||||
var msg = "";
|
||||
if(r._server_messages) {
|
||||
msg = JSON.parse(r._server_messages || []).join("<br>");
|
||||
}
|
||||
|
||||
$("#cart-error")
|
||||
.empty()
|
||||
.html(msg || "Something went wrong!")
|
||||
.toggle(true);
|
||||
} else {
|
||||
window.location.href = "order?name=" + encodeURIComponent(r.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.btn-send').click(function() {
|
||||
var email = $('[name="email"]').val();
|
||||
var message = $('[name="message"]').val();
|
||||
|
||||
if(!(email && message)) {
|
||||
msgprint("Please enter both your email and message so that we \
|
||||
can get back to you. Thanks!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!valid_email(email)) {
|
||||
msgprint("You seem to have written your name instead of your email. \
|
||||
Please enter a valid email address so that we can get back.");
|
||||
$('[name="email"]').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#contact-alert").toggle(false);
|
||||
erpnext.send_message({
|
||||
subject: $('[name="subject"]').val(),
|
||||
sender: email,
|
||||
message: message,
|
||||
callback: function(r) {
|
||||
if(r.status==="okay") {
|
||||
msgprint(r.message || "Thank you for your message.")
|
||||
} else {
|
||||
msgprint("There were errors");
|
||||
console.log(r.exc);
|
||||
}
|
||||
$(':input').val('');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var msgprint = function(txt) {
|
||||
if(txt) $("#contact-alert").html(txt).toggle(true);
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
window.get_product_list = function() {
|
||||
$(".more-btn .btn").click(function() {
|
||||
window.get_product_list()
|
||||
});
|
||||
|
||||
if(window.start==undefined) {
|
||||
throw "product list not initialized (no start)"
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: "server.py",
|
||||
dataType: "json",
|
||||
data: {
|
||||
cmd: "selling.utils.product.get_product_list",
|
||||
start: window.start,
|
||||
search: window.search,
|
||||
product_group: window.product_group
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
window.render_product_list(data.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
window.render_product_list = function(data) {
|
||||
if(data.length) {
|
||||
var table = $("#search-list .table");
|
||||
if(!table.length)
|
||||
var table = $("<table class='table'>").appendTo("#search-list");
|
||||
|
||||
$.each(data, function(i, d) {
|
||||
$(d).appendTo(table);
|
||||
});
|
||||
}
|
||||
if(data.length < 10) {
|
||||
if(!table) {
|
||||
$(".more-btn")
|
||||
.replaceWith("<div class='alert alert-warning'>No products found.</div>");
|
||||
} else {
|
||||
$(".more-btn")
|
||||
.replaceWith("<div class='text-muted'>Nothing more to show.</div>");
|
||||
}
|
||||
} else {
|
||||
$(".more-btn").toggle(true)
|
||||
}
|
||||
window.start += (data.length || 0);
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
$(document).ready(function() {
|
||||
var item_code = $('[itemscope] [itemprop="name"]').text().trim();
|
||||
var qty = 0;
|
||||
|
||||
wn.call({
|
||||
type: "POST",
|
||||
method: "selling.utils.product.get_product_info",
|
||||
args: {
|
||||
item_code: "{{ name }}"
|
||||
},
|
||||
callback: function(r) {
|
||||
if(r.message && r.message.price) {
|
||||
$(".item-price")
|
||||
.html(r.message.price.formatted_price + " per " + r.message.uom);
|
||||
|
||||
if(r.message.stock==0) {
|
||||
$(".item-stock").html("<div class='help'>Not in stock</div>");
|
||||
}
|
||||
else if(r.message.stock==1) {
|
||||
$(".item-stock").html("<div style='color: green'>\
|
||||
<i class='icon-check'></i> Available (in stock)</div>");
|
||||
}
|
||||
|
||||
$(".item-price-info").toggle(true);
|
||||
|
||||
if(r.message.qty) {
|
||||
qty = r.message.qty;
|
||||
toggle_update_cart(qty);
|
||||
$("#item-update-cart input").val(qty);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$("#item-add-to-cart button").on("click", function() {
|
||||
wn.cart.update_cart({
|
||||
item_code: item_code,
|
||||
qty: 1,
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
toggle_update_cart(1);
|
||||
qty = 1;
|
||||
}
|
||||
},
|
||||
btn: this,
|
||||
});
|
||||
});
|
||||
|
||||
$("#item-update-cart button").on("click", function() {
|
||||
wn.cart.update_cart({
|
||||
item_code: item_code,
|
||||
qty: $("#item-update-cart input").val(),
|
||||
btn: this,
|
||||
callback: function(r) {
|
||||
if(r.exc) {
|
||||
$("#item-update-cart input").val(qty);
|
||||
} else {
|
||||
qty = $("#item-update-cart input").val();
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
if(localStorage && localStorage.getItem("pending_add_to_cart") && full_name) {
|
||||
localStorage.removeItem("pending_add_to_cart");
|
||||
$("#item-add-to-cart button").trigger("click");
|
||||
}
|
||||
});
|
||||
|
||||
var toggle_update_cart = function(qty) {
|
||||
$("#item-add-to-cart").toggle(qty ? false : true);
|
||||
$("#item-update-cart")
|
||||
.toggle(qty ? true : false)
|
||||
.find("input").val(qty);
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% set title="About Us" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
{{ obj.doc.company_introduction or "<h2>About Us</h2><p>Some Introduction about your company that you would like your website visitor to know. More people than you think will read your About page. People always like to know who the are doing business with. Be authentic and avoid using jargon like 'value added services' etc. Be sure to update your company history and list of key team members in Website > About Us Settings</p>" }}
|
||||
{% if obj.doclist.get({"doctype":"Company History"}) %}
|
||||
<h3>{{ obj.doc.company_history_heading or "Company History" }}</h3>
|
||||
{% for d in obj.doclist.get({"doctype":"Company History"}) %}
|
||||
<div class="row">
|
||||
<span class="col-md-2"><h4 style="margin:0px;">{{ d.year }}</h4></span>
|
||||
<span class="col-md-10"><p>{{ d.highlight }}</p></span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if obj.doclist.get({"doctype":"About Us Team Member"}) %}
|
||||
<h3>{{ obj.doc.team_members_heading or "Team Members" }}</h3>
|
||||
{% for d in obj.doclist.get({"doctype":"About Us Team Member"}) %}
|
||||
<div class="row" itemscope itemtype="http://schema.org/Person">
|
||||
<span class="col-md-2">
|
||||
<div class="avatar avatar-large">
|
||||
<img class="avatar" src="{{ d.image_link }}" style="" itemprop="image">
|
||||
</div>
|
||||
</span>
|
||||
<span class="col-md-10"><h4 itemprop="name">{{ d.full_name }}</h4>
|
||||
<p itemprop="description">{{ d.bio }}</p>
|
||||
</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{{ obj.doc.footer or "" }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,27 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% set title="My Account" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="index">Home</a></li>
|
||||
<li class="active">My Account</li>
|
||||
</ul>
|
||||
<!-- <h3>My Account</h3> -->
|
||||
<ul class="nav nav-stacked pull-left">
|
||||
<li><a href="profile"><i class="icon-user icon-fixed-width"></i>
|
||||
Change my name, password</a></li>
|
||||
<li><a href="addresses"><i class="icon-map-marker icon-fixed-width"></i>
|
||||
My Addresses</a></li>
|
||||
<li><a href="orders"><i class="icon-list icon-fixed-width"></i> My Orders</a></li>
|
||||
<li><a href="tickets"><i class="icon-tags icon-fixed-width"></i> My Tickets</a></li>
|
||||
<li style="border-top: 1px solid #ddd"></li>
|
||||
<li><a href="invoices"><i class="icon-file-text icon-fixed-width"></i> Invoices</a></li>
|
||||
<li><a href="shipments"><i class="icon-truck icon-fixed-width"></i> Shipments</a></li>
|
||||
<li style="border-top: 1px solid #ddd"></li>
|
||||
<li><a href="server.py?cmd=web_logout"><i class="icon-signout icon-fixed-width"></i>
|
||||
Logout</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,115 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% set title=doc and doc.name or "New Address" %}
|
||||
{% set docname=(doc and doc.name or "") %}
|
||||
|
||||
{% macro render_fields(docfields) -%}
|
||||
{% for df in docfields -%}
|
||||
{% if df.fieldtype in ["Data", "Link"] -%}
|
||||
<fieldset>
|
||||
<label>{{ df.label }}</label>
|
||||
<input class="form-control" type="text" placeholder="Type {{ df.label }}"
|
||||
data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"
|
||||
{% if doc and doc.fields.get(df.fieldname) -%} value="{{ doc.fields[df.fieldname] }}" {%- endif %}>
|
||||
</fieldset>
|
||||
{% elif df.fieldtype == "Check" -%}
|
||||
<fieldset class="checkbox">
|
||||
<label><input type="checkbox" data-fieldname="{{ df.fieldname }}"
|
||||
data-fieldtype="{{ df.fieldtype }}"
|
||||
{% if doc and cint(doc.fields.get(df.fieldname)) -%} checked="checked" {%- endif %}>
|
||||
{{ df.label }}</label>
|
||||
</fieldset>
|
||||
{% elif df.fieldtype == "Select" -%}
|
||||
<fieldset>
|
||||
<label>{{ df.label }}</label>
|
||||
<select class="form-control" data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}">
|
||||
{% for value in df.options.split("\n") -%}
|
||||
{% if doc and doc.fields.get(df.fieldname) == value -%}
|
||||
<option selected="selected">{{ value }}</option>
|
||||
{% else -%}
|
||||
<option>{{ value }}</option>
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
</select>
|
||||
</fieldset>
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="index">Home</a></li>
|
||||
<li><a href="account">My Account</a></li>
|
||||
<li><a href="addresses">My Addresses</a></li>
|
||||
<li class="active"><i class="icon-map-marker icon-fixed-width"></i> {{ title }}</li>
|
||||
</ul>
|
||||
<h3><i class="icon-map-marker icon-fixed-width"></i> {{ title }}</h3>
|
||||
<button type="button" class="btn btn-primary pull-right" id="address-save"><i class="icon-ok"></i>
|
||||
{{ doc and "Save" or "Insert" }}</button>
|
||||
<div class="clearfix"></div>
|
||||
<hr>
|
||||
<div id="address-error" class="alert alert-danger" style="display: none;"></div>
|
||||
<form autocomplete="on">
|
||||
<div class="row">
|
||||
<section class="col-md-6">
|
||||
{{ render_fields(meta.left_fields) }}
|
||||
</section>
|
||||
<section class="col-md-6">
|
||||
{{ render_fields(meta.right_fields) }}
|
||||
</section>
|
||||
</section>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
;(function() {
|
||||
$(document).ready(function() {
|
||||
bind_save();
|
||||
});
|
||||
|
||||
var bind_save = function() {
|
||||
$("#address-save").on("click", function() {
|
||||
var fields = {
|
||||
name: "{{ docname }}"
|
||||
};
|
||||
|
||||
$("form").find("[data-fieldname]").each(function(i, input) {
|
||||
var $input = $(input);
|
||||
var fieldname = $(input).attr("data-fieldname");
|
||||
var fieldtype = $(input).attr("data-fieldtype");
|
||||
|
||||
if(fieldtype == "Check") {
|
||||
fields[fieldname] = $input.is(":checked") ? 1 : 0;
|
||||
} else {
|
||||
fields[fieldname] = $input.val();
|
||||
}
|
||||
});
|
||||
|
||||
wn.call({
|
||||
btn: $(this),
|
||||
type: "POST",
|
||||
method: "selling.utils.cart.save_address",
|
||||
args: { fields: fields, address_fieldname: get_url_arg("address_fieldname") },
|
||||
callback: function(r) {
|
||||
if(r.exc) {
|
||||
var msg = "";
|
||||
if(r._server_messages) {
|
||||
msg = JSON.parse(r._server_messages || []).join("<br>");
|
||||
}
|
||||
|
||||
$("#address-error")
|
||||
.html(msg || "Something went wrong!")
|
||||
.toggle(true);
|
||||
} else if(get_url_arg("address_fieldname")) {
|
||||
window.location.href = "cart";
|
||||
} else {
|
||||
window.location.href = "address?name=" + encodeURIComponent(r.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,52 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% set title="My Addresses" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="index">Home</a></li>
|
||||
<li><a href="account">My Account</a></li>
|
||||
<li class="active"><i class="icon-map-marker icon-fixed-width"></i> My Addresses</li>
|
||||
</ul>
|
||||
<p><a class="btn btn-default" href="address"><i class="icon-plus"> New Address</i></a></p>
|
||||
<hr>
|
||||
<div id="address-list">
|
||||
<div class="progress progress-striped active">
|
||||
<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
;(function() {
|
||||
$(document).ready(function() {
|
||||
fetch_addresses();
|
||||
});
|
||||
|
||||
var fetch_addresses = function() {
|
||||
wn.call({
|
||||
method: "selling.utils.cart.get_addresses",
|
||||
callback: function(r) {
|
||||
$("#address-list .progress").remove();
|
||||
var $list = $("#address-list");
|
||||
|
||||
if(!(r.message && r.message.length)) {
|
||||
$list.html("<div class='alert'>No Addresses Found</div>");
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(r.message, function(i, address) {
|
||||
address.url_name = encodeURIComponent(address.name);
|
||||
$(repl('<div> \
|
||||
<p><a href="address?name=%(url_name)s">%(name)s</a></p> \
|
||||
<p>%(display)s</p> \
|
||||
<hr> \
|
||||
</div>', address)).appendTo($list);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,57 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% block javascript %}
|
||||
{% include "app/website/templates/js/cart.js" %}
|
||||
{% endblock %}
|
||||
|
||||
{% set title="Shopping Cart" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<h2><i class="icon-shopping-cart"></i> {{ title }}</h2>
|
||||
<div class="progress progress-striped active">
|
||||
<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
|
||||
</div>
|
||||
<div id="cart-container" class="hide">
|
||||
<button class="btn btn-success pull-right btn-place-order" type="button">Place Order</button>
|
||||
<div class="clearfix"></div>
|
||||
<div id="cart-error" class="alert alert-danger" style="display: none;"></div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-9 col-sm-9">
|
||||
<div class="row">
|
||||
<div class="col-md-9 col-md-offset-3"><h4>Item Details</h4></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-3 text-right"><h4>Qty, Amount</h4></div>
|
||||
</div><hr>
|
||||
<div id="cart-items">
|
||||
</div>
|
||||
<div id="cart-taxes">
|
||||
</div>
|
||||
<div id="cart-totals">
|
||||
</div>
|
||||
<hr>
|
||||
<div id="cart-addresses">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4>Shipping Address</h4>
|
||||
<div id="cart-shipping-address" class="panel-group"
|
||||
data-fieldname="shipping_address_name"></div>
|
||||
<button class="btn btn-default" type="button" id="cart-add-shipping-address">
|
||||
<span class="icon icon-plus"></span> New Shipping Address</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h4>Billing Address</h4>
|
||||
<div id="cart-billing-address" class="panel-group"
|
||||
data-fieldname="customer_address"></div>
|
||||
<button class="btn btn-default" type="button" id="cart-add-billing-address">
|
||||
<span class="icon icon-plus"></span> New Billing Address</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<button class="btn btn-success pull-right btn-place-order" type="button">Place Order</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,60 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% block javascript %}
|
||||
{% include "app/website/templates/js/contact.js" %}
|
||||
{% endblock %}
|
||||
|
||||
{% set title="Contact Us" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<h3>{{ obj.doc.heading or "Contact Us"}}</h3>
|
||||
<div class="row">
|
||||
<div class="web-form col-md-8">
|
||||
<p id="contact-alert" class="alert alert-warning"
|
||||
style="display: none;"> </p>
|
||||
<p>
|
||||
<select name="subject" class="form-control">
|
||||
{% for option in obj.query_options %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<input class="form-control" name="email" type="text"
|
||||
placeholder="Your Email Address" />
|
||||
</p>
|
||||
<p>
|
||||
<textarea rows="10" name="message" class="form-control"></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<button class="btn btn-primary btn-send">Send</button>
|
||||
</p>
|
||||
</div>
|
||||
{% if obj.doc.address %}
|
||||
<div class="col-md-3 col-md-offset-1 alert alert-warning" style="margin-top: 20px;" itemscope itemtype="http://schema.org/PostalAddress">
|
||||
<h4><i class="icon-map-marker"></i> {{ obj.address.address_title }}</h4>
|
||||
{% if obj.address.address_line1 %}
|
||||
<span itemprop="streetAddress">{{ obj.address.address_line1 }}</span><br>
|
||||
{% endif %}
|
||||
{% if obj.address.address_line2 %}
|
||||
<span itemprop="streetAddress">{{ obj.address.address_line2 }}</span><br>
|
||||
{% endif %}
|
||||
{% if obj.address.city %}
|
||||
<span itemprop="addressLocality">{{ obj.address.city }}</span><br>
|
||||
{% endif %}
|
||||
{% if obj.address.state %}
|
||||
<span itemprop="addressRegion">{{ obj.address.state }}</span><br>
|
||||
{% endif %}
|
||||
{% if obj.address.pincode %}
|
||||
<span itemprop="postalCode">{{ obj.address.pincode }}</span><br>
|
||||
{% endif %}
|
||||
{% if obj.address.country %}
|
||||
<span itemprop="addressCountry">{{ obj.address.country }}</span><br>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ obj.doc.introduction }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1 +0,0 @@
|
||||
{% extends "app/website/templates/html/web_page.html" %}
|
||||
@@ -1,88 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% set title=doc.name %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="index">Home</a></li>
|
||||
<li><a href="account">My Account</a></li>
|
||||
<li><a href="invoices">Invoices</a></li>
|
||||
<li class="active"><i class="icon-file-text icon-fixed-width"></i> {{ doc.name }}</li>
|
||||
</ul>
|
||||
<h3><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</h3>
|
||||
<hr>
|
||||
{%- if doc.status -%}
|
||||
<div style="font-size: 13px;">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="label">{{ doc.status }}</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{{ utils.formatdate(doc.transaction_date) }}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Sr</th>
|
||||
<th>Item Name</th>
|
||||
<th>Description</th>
|
||||
<th>Qty</th>
|
||||
<th>UoM</th>
|
||||
<th>Basic Rate</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
{%- for row in doclist.get({"doctype":"Sales Order Item"}) %}
|
||||
<tr>
|
||||
<td style="width: 3%;">{{ row.idx }}</td>
|
||||
<td style="width: 20%;">{{ row.item_name }}</td>
|
||||
<td style="width: 37%;">{{ row.description }}</td>
|
||||
<td style="width: 5%; text-align: right;">{{ row.qty }}</td>
|
||||
<td style="width: 5%;">{{ row.stock_uom }}</td>
|
||||
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_rate, currency=doc.currency) }}</td>
|
||||
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_amount, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
{% endfor -%}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6"></div>
|
||||
<div class="col-md-6">
|
||||
<table cellspacing=0 width=100%>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Net Total</td>
|
||||
<td width=40% style="text-align: right;">{{
|
||||
utils.fmt_money(doc.net_total/doc.conversion_rate, currency=doc.currency)
|
||||
}}</td>
|
||||
</tr>
|
||||
{%- for charge in doclist.get({"doctype":"Sales Taxes and Charges"}) -%}
|
||||
{%- if not charge.included_in_print_rate -%}
|
||||
<tr>
|
||||
<td>{{ charge.description }}</td>
|
||||
<td style="text-align: right;">{{ utils.fmt_money(charge.tax_amount / doc.conversion_rate, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
<tr>
|
||||
<td>Grand Total</td>
|
||||
<td style="text-align: right;">{{ utils.fmt_money(doc.grand_total_export, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
<tr style='font-weight: bold'>
|
||||
<td>Rounded Total</td>
|
||||
<td style="text-align: right;">{{ utils.fmt_money(doc.rounded_total_export, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,61 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% set title="My Profile" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="index">Home</a></li>
|
||||
<li><a href="account">My Account</a></li>
|
||||
<li class="active"><i class="icon-user icon-fixed-width"></i> My Profile</li>
|
||||
</ul>
|
||||
<div class="alert" id="message" style="display: none;"></div>
|
||||
<form>
|
||||
<fieldset>
|
||||
<label>Full Name</label>
|
||||
<input class="form-control" type="text" id="fullname" placeholder="Your Name">
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Password</label>
|
||||
<input class="form-control" type="password" id="password" placeholder="Password">
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Company Name</label>
|
||||
<input class="form-control" type="text" id="company_name" placeholder="Company Name" value="{{ company_name }}">
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Mobile No</label>
|
||||
<input class="form-control" type="text" id="mobile_no" placeholder="Mobile No" value="{{ mobile_no }}">
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Phone</label>
|
||||
<input class="form-control" type="text" id="phone" placeholder="Phone" value="{{ phone }}">
|
||||
</fieldset>
|
||||
<button id="update_profile" type="submit" class="btn btn-default">Update</button>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#fullname").val(getCookie("full_name") || "");
|
||||
$("#update_profile").click(function() {
|
||||
wn.call({
|
||||
method: "startup.webutils.update_profile",
|
||||
type: "POST",
|
||||
args: {
|
||||
fullname: $("#fullname").val(),
|
||||
password: $("#password").val(),
|
||||
company_name: $("#company_name").val(),
|
||||
mobile_no: $("#mobile_no").val(),
|
||||
phone: $("#phone").val()
|
||||
},
|
||||
btn: this,
|
||||
msg: $("#message"),
|
||||
callback: function(r) {
|
||||
if(!r.exc) $("#user-full-name").html($("#fullname").val());
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,90 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% set title=doc.name %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="index">Home</a></li>
|
||||
<li><a href="account">My Account</a></li>
|
||||
<li><a href="{{ parent_link }}">{{ parent_title }}</a></li>
|
||||
<li class="active"><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</li>
|
||||
</ul>
|
||||
<h3><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</h3>
|
||||
{% if doc.name == "Not Allowed" -%}
|
||||
<script>ask_to_login();</script>
|
||||
{% else %}
|
||||
<hr>
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
{% if doc.status -%}<div class="label label-default">{{ doc.status }}</div>{%- endif %}
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<span class="pull-right">{{ utils.formatdate(doc.posting_date or doc.transaction_date) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Sr</th>
|
||||
<th>Item Name</th>
|
||||
<th>Description</th>
|
||||
<th>Qty</th>
|
||||
<th>UoM</th>
|
||||
<th>Basic Rate</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
{%- for row in doclist.get({"doctype": doc.doctype + " Item"}) %}
|
||||
<tr>
|
||||
<td style="width: 3%;">{{ row.idx }}</td>
|
||||
<td style="width: 20%;">{{ row.item_name }}</td>
|
||||
<td style="width: 37%;">{{ row.description }}</td>
|
||||
<td style="width: 5%; text-align: right;">{{ row.qty }}</td>
|
||||
<td style="width: 5%;">{{ row.stock_uom }}</td>
|
||||
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_rate, currency=doc.currency) }}</td>
|
||||
<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_amount, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
{% endfor -%}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6"></div>
|
||||
<div class="col-md-6">
|
||||
<table cellspacing=0 width=100%>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Net Total</td>
|
||||
<td width=40% style="text-align: right;">{{
|
||||
utils.fmt_money(doc.net_total/doc.conversion_rate, currency=doc.currency)
|
||||
}}</td>
|
||||
</tr>
|
||||
{%- for charge in doclist.get({"doctype":"Sales Taxes and Charges"}) -%}
|
||||
{%- if not charge.included_in_print_rate -%}
|
||||
<tr>
|
||||
<td>{{ charge.description }}</td>
|
||||
<td style="text-align: right;">{{ utils.fmt_money(charge.tax_amount / doc.conversion_rate, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
<tr>
|
||||
<td>Grand Total</td>
|
||||
<td style="text-align: right;">{{ utils.fmt_money(doc.grand_total_export, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
<tr style='font-weight: bold'>
|
||||
<td>Rounded Total</td>
|
||||
<td style="text-align: right;">{{ utils.fmt_money(doc.rounded_total_export, currency=doc.currency) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends "app/website/templates/html/transactions.html" %}
|
||||
|
||||
{% block javascript -%}
|
||||
global_number_format = "{{ global_number_format }}";
|
||||
currency = "{{ currency }}";
|
||||
wn.currency_symbols = {{ currency_symbols }};
|
||||
|
||||
{{ super() }}
|
||||
|
||||
var render = function(doc) {
|
||||
doc.grand_total_export = format_currency(doc.grand_total_export, doc.currency);
|
||||
|
||||
$(repl('<a href="{{ page }}?name=%(name)s" class="list-group-item">\
|
||||
<div class="row">\
|
||||
<div class="col-md-6">\
|
||||
<div class="row col-md-12">%(name)s</div>\
|
||||
<div class="row col-md-12 text-muted">%(items)s...</div>\
|
||||
</div>\
|
||||
<div class="col-md-3 text-right">%(grand_total_export)s</div>\
|
||||
<div class="col-md-3 text-right text-muted">%(creation)s</div>\
|
||||
</div>\
|
||||
</a>', doc)).appendTo($list);
|
||||
};
|
||||
|
||||
{%- endblock %}
|
||||
@@ -1,77 +0,0 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="index">Home</a></li>
|
||||
<li><a href="account">My Account</a></li>
|
||||
<li class="active"><i class="{{ icon }} icon-fixed-width"></i> {{ title }}</li>
|
||||
</ul>
|
||||
<div class="list-group transaction-list">
|
||||
<div class="progress progress-striped active">
|
||||
<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button class="btn btn-default btn-show-more" style="display: none;">More</button></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascript %}
|
||||
global_number_format = "{{ global_number_format }}";
|
||||
currency = "{{ currency }}";
|
||||
wn.currency_symbols = {{ currency_symbols }};
|
||||
|
||||
$(document).ready(function() {
|
||||
var start = 0;
|
||||
var $list = $(".transaction-list");
|
||||
|
||||
var $show_more = $(".btn-show-more").on("click", function() {
|
||||
get_transactions(this);
|
||||
});
|
||||
|
||||
var get_transactions = function(btn) {
|
||||
wn.call({
|
||||
method: "{{ method }}",
|
||||
args: { start: start },
|
||||
btn: btn,
|
||||
callback: function(r) {
|
||||
$list.find(".progress").remove();
|
||||
$show_more.toggle(!(r.message && r.message.length===20));
|
||||
|
||||
if(!(r.message && r.message.length)) {
|
||||
console.log("empty");
|
||||
if(!$list.html().trim()) {
|
||||
$list.html("<div class='alert alert-warning'>\
|
||||
{{ empty_list_message }}</div>");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
start += r.message.length;
|
||||
|
||||
$.each(r.message, function(i, doc) {
|
||||
render(doc);
|
||||
});
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
var render = function(doc) {
|
||||
doc.grand_total_export = format_currency(doc.grand_total_export, doc.currency);
|
||||
|
||||
var $row = $(repl('<a href="{{ page }}?name=%(name)s" class="list-group-item">\
|
||||
<div class="row">\
|
||||
<div class="col-md-6">\
|
||||
<div class="row col-md-12">%(name)s</div>\
|
||||
<div class="row col-md-12 text-muted">%(items)s...</div>\
|
||||
</div>\
|
||||
<div class="col-md-3 text-right">%(grand_total_export)s</div>\
|
||||
<div class="col-md-3 text-right text-muted">%(creation)s</div>\
|
||||
</div>\
|
||||
</a>', doc)).appendTo($list);
|
||||
};
|
||||
|
||||
get_transactions();
|
||||
});
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user