[website] [minor] moving to framework
diff --git a/portal/templates/pages/__init__.py b/portal/templates/pages/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/portal/templates/pages/__init__.py
diff --git a/portal/templates/pages/account.html b/portal/templates/pages/account.html
new file mode 100644
index 0000000..da43dd2
--- /dev/null
+++ b/portal/templates/pages/account.html
@@ -0,0 +1,27 @@
+{% extends base_template %}
+
+{% 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 %}
\ No newline at end of file
diff --git a/portal/templates/pages/cart.html b/portal/templates/pages/cart.html
new file mode 100644
index 0000000..372f524
--- /dev/null
+++ b/portal/templates/pages/cart.html
@@ -0,0 +1,57 @@
+{% extends base_template %}
+
+{% 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 %}
\ No newline at end of file
diff --git a/portal/templates/pages/invoice.html b/portal/templates/pages/invoice.html
new file mode 100644
index 0000000..376e5df
--- /dev/null
+++ b/portal/templates/pages/invoice.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sale.html" %}
\ No newline at end of file
diff --git a/portal/templates/pages/invoice.py b/portal/templates/pages/invoice.py
new file mode 100644
index 0000000..ed6e40a
--- /dev/null
+++ b/portal/templates/pages/invoice.py
@@ -0,0 +1,14 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def get_context():
+ from portal.website_transactions import get_transaction_context
+ context = get_transaction_context("Sales Invoice", webnotes.form_dict.name)
+ context.update({
+ "parent_link": "invoices",
+ "parent_title": "Invoices"
+ })
+ return context
\ No newline at end of file
diff --git a/portal/templates/pages/invoices.html b/portal/templates/pages/invoices.html
new file mode 100644
index 0000000..f108683
--- /dev/null
+++ b/portal/templates/pages/invoices.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/portal/templates/pages/invoices.py b/portal/templates/pages/invoices.py
new file mode 100644
index 0000000..2bb6490
--- /dev/null
+++ b/portal/templates/pages/invoices.py
@@ -0,0 +1,22 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def get_context():
+ from portal.website_transactions import get_currency_context
+ context = get_currency_context()
+ context.update({
+ "title": "Invoices",
+ "method": "portal.templates.pages.invoices.get_invoices",
+ "icon": "icon-file-text",
+ "empty_list_message": "No Invoices Found",
+ "page": "invoice"
+ })
+ return context
+
+@webnotes.whitelist()
+def get_invoices(start=0):
+ from portal.website_transactions import get_transaction_list
+ return get_transaction_list("Sales Invoice", start)
\ No newline at end of file
diff --git a/portal/templates/pages/order.html b/portal/templates/pages/order.html
new file mode 100644
index 0000000..376e5df
--- /dev/null
+++ b/portal/templates/pages/order.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sale.html" %}
\ No newline at end of file
diff --git a/portal/templates/pages/order.py b/portal/templates/pages/order.py
new file mode 100644
index 0000000..47e2c68
--- /dev/null
+++ b/portal/templates/pages/order.py
@@ -0,0 +1,14 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def get_context():
+ from portal.website_transactions import get_transaction_context
+ context = get_transaction_context("Sales Order", webnotes.form_dict.name)
+ context.update({
+ "parent_link": "orders",
+ "parent_title": "My Orders"
+ })
+ return context
\ No newline at end of file
diff --git a/portal/templates/pages/orders.html b/portal/templates/pages/orders.html
new file mode 100644
index 0000000..f108683
--- /dev/null
+++ b/portal/templates/pages/orders.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/portal/templates/pages/orders.py b/portal/templates/pages/orders.py
new file mode 100644
index 0000000..3c62d35
--- /dev/null
+++ b/portal/templates/pages/orders.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def get_context():
+ from portal.website_transactions import get_currency_context
+ context = get_currency_context()
+ context.update({
+ "title": "My Orders",
+ "method": "portal.templates.pages.orders.get_orders",
+ "icon": "icon-list",
+ "empty_list_message": "No Orders Yet",
+ "page": "order",
+ })
+ return context
+
+@webnotes.whitelist()
+def get_orders(start=0):
+ from portal.website_transactions import get_transaction_list
+ return get_transaction_list("Sales Order", start)
+
\ No newline at end of file
diff --git a/portal/templates/pages/profile.html b/portal/templates/pages/profile.html
new file mode 100644
index 0000000..2fe03ba
--- /dev/null
+++ b/portal/templates/pages/profile.html
@@ -0,0 +1,61 @@
+{% extends base_template %}
+
+{% 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 %}
\ No newline at end of file
diff --git a/portal/templates/pages/shipment.html b/portal/templates/pages/shipment.html
new file mode 100644
index 0000000..376e5df
--- /dev/null
+++ b/portal/templates/pages/shipment.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sale.html" %}
\ No newline at end of file
diff --git a/portal/templates/pages/shipment.py b/portal/templates/pages/shipment.py
new file mode 100644
index 0000000..5d9d1d1
--- /dev/null
+++ b/portal/templates/pages/shipment.py
@@ -0,0 +1,14 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def get_context():
+ from portal.website_transactions import get_transaction_context
+ context = get_transaction_context("Delivery Note", webnotes.form_dict.name)
+ context.update({
+ "parent_link": "shipments",
+ "parent_title": "Shipments"
+ })
+ return context
\ No newline at end of file
diff --git a/portal/templates/pages/shipments.html b/portal/templates/pages/shipments.html
new file mode 100644
index 0000000..f108683
--- /dev/null
+++ b/portal/templates/pages/shipments.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/portal/templates/pages/shipments.py b/portal/templates/pages/shipments.py
new file mode 100644
index 0000000..4847b9f
--- /dev/null
+++ b/portal/templates/pages/shipments.py
@@ -0,0 +1,22 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def get_context():
+ from portal.website_transactions import get_currency_context
+ context = get_currency_context()
+ context.update({
+ "title": "Shipments",
+ "method": "portal.templates.pages.shipments.get_shipments",
+ "icon": "icon-truck",
+ "empty_list_message": "No Shipments Found",
+ "page": "shipment"
+ })
+ return context
+
+@webnotes.whitelist()
+def get_shipments(start=0):
+ from portal.website_transactions import get_transaction_list
+ return get_transaction_list("Delivery Note", start)