mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 05:09:11 +00:00
[website] [minor] moving to framework
This commit is contained in:
6
portal/templates/pages/account.py
Normal file
6
portal/templates/pages/account.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
no_cache = True
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends base_template %}
|
||||
|
||||
{% block javascript %}
|
||||
{% include "app/website/templates/js/cart.js" %}
|
||||
<script>{% include "app/portal/templates/includes/cart.js" %}</script>
|
||||
{% endblock %}
|
||||
|
||||
{% set title="Shopping Cart" %}
|
||||
|
||||
6
portal/templates/pages/cart.py
Normal file
6
portal/templates/pages/cart.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
no_cache = True
|
||||
@@ -1 +0,0 @@
|
||||
{% extends "app/portal/templates/sale.html" %}
|
||||
@@ -1,14 +0,0 @@
|
||||
# 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
|
||||
@@ -1 +0,0 @@
|
||||
{% extends "app/portal/templates/sales_transactions.html" %}
|
||||
@@ -1,22 +0,0 @@
|
||||
# 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)
|
||||
@@ -1 +0,0 @@
|
||||
{% extends "app/portal/templates/sale.html" %}
|
||||
@@ -1,14 +0,0 @@
|
||||
# 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
|
||||
@@ -1 +0,0 @@
|
||||
{% extends "app/portal/templates/sales_transactions.html" %}
|
||||
@@ -1,23 +0,0 @@
|
||||
# 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)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<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>
|
||||
<div class="alert alert-warning" id="message" style="display: none;"></div>
|
||||
<form>
|
||||
<fieldset>
|
||||
<label>Full Name</label>
|
||||
@@ -39,7 +39,7 @@ $(document).ready(function() {
|
||||
$("#fullname").val(getCookie("full_name") || "");
|
||||
$("#update_profile").click(function() {
|
||||
wn.call({
|
||||
method: "startup.webutils.update_profile",
|
||||
method: "portal.templates.pages.profile.update_profile",
|
||||
type: "POST",
|
||||
args: {
|
||||
fullname: $("#fullname").val(),
|
||||
|
||||
32
portal/templates/pages/profile.py
Normal file
32
portal/templates/pages/profile.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes.utils import cstr
|
||||
|
||||
no_cache = True
|
||||
|
||||
def get_context():
|
||||
from selling.utils.cart import get_lead_or_customer
|
||||
party = get_lead_or_customer()
|
||||
if party.doctype == "Lead":
|
||||
mobile_no = party.mobile_no
|
||||
phone = party.phone
|
||||
else:
|
||||
mobile_no, phone = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user,
|
||||
"customer": party.name}, ["mobile_no", "phone"])
|
||||
|
||||
return {
|
||||
"company_name": cstr(party.customer_name if party.doctype == "Customer" else party.company_name),
|
||||
"mobile_no": cstr(mobile_no),
|
||||
"phone": cstr(phone)
|
||||
}
|
||||
|
||||
@webnotes.whitelist()
|
||||
def update_profile(fullname, password=None, company_name=None, mobile_no=None, phone=None):
|
||||
from selling.utils.cart import update_party
|
||||
update_party(fullname, company_name, mobile_no, phone)
|
||||
|
||||
from core.doctype.profile import profile
|
||||
return profile.update_profile(fullname, password)
|
||||
@@ -1 +0,0 @@
|
||||
{% extends "app/portal/templates/sale.html" %}
|
||||
@@ -1,14 +0,0 @@
|
||||
# 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
|
||||
@@ -1 +0,0 @@
|
||||
{% extends "app/portal/templates/sales_transactions.html" %}
|
||||
@@ -1,22 +0,0 @@
|
||||
# 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)
|
||||
Reference in New Issue
Block a user