Redesigned templates. Now all templates must be inside templates/pages templates/generators

This commit is contained in:
Rushabh Mehta 2013-12-25 15:19:22 +05:30
parent 3c68488873
commit df200f305b
66 changed files with 34 additions and 46 deletions

View File

@ -1 +0,0 @@
{% extends "portal/templates/sales_transactions.html" %}

View File

@ -1,3 +0,0 @@
{% extends "website/templates/base.html" %}
{% block footer %}{% include "portal/templates/includes/footer.html" %}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "portal/templates/sale.html" %}
{% extends "templates/sale.html" %}
{% block status -%}
{% if doc.status %}{{ doc.status }}{% endif %}

View File

@ -8,7 +8,7 @@ from webnotes import _
no_cache = True
def get_context():
from erpnext.portal.utils import get_transaction_context
from erpnext.templates.utils import get_transaction_context
context = get_transaction_context("Sales Order", webnotes.form_dict.name)
modify_status(context.get("doc"))
context.update({

View File

@ -1 +1 @@
{% extends "portal/templates/sales_transactions.html" %}
{% extends "templates/sales_transactions.html" %}

View File

@ -7,7 +7,7 @@ import webnotes
no_cache = True
def get_context():
from erpnext.portal.utils import get_currency_context
from erpnext.templates.utils import get_currency_context
context = get_currency_context()
context.update({
"title": "My Orders",
@ -20,7 +20,7 @@ def get_context():
@webnotes.whitelist()
def get_orders(start=0):
from erpnext.portal.utils import get_transaction_list
from erpnext.templates.utils import get_transaction_list
from erpnext.selling.doctype.sales_order.templates.pages.order import modify_status
orders = get_transaction_list("Sales Order", start, ["per_billed", "per_delivered"])
for d in orders:

View File

@ -107,11 +107,7 @@ def get_group_item_count(item_group):
where item_group in (%s))) """ % (child_groups, child_groups))[0][0]
def get_item_for_list_in_html(context):
from jinja2 import Environment, FileSystemLoader
scrub_item_for_list(context)
jenv = Environment(loader = FileSystemLoader(get_base_path()))
template = jenv.get_template("app/stock/doctype/item/templates/includes/product_in_grid.html")
return template.render(context)
return webnotes.get_template("templates/includes/product_in_grid.html").render(context)
def scrub_item_for_list(r):
if not r.website_description:

View File

@ -1 +0,0 @@
{% extends "portal/templates/sale.html" %}

View File

@ -1 +0,0 @@
{% extends "portal/templates/sales_transactions.html" %}

View File

@ -2,12 +2,12 @@
{% block javascript %}
<script>
{% include "stock/doctype/item/templates/includes/product_page.js" %}
{% include "templates/includes/product_page.js" %}
$(function() {
if(window.logged_in && getCookie("system_user")==="yes") {
wn.has_permission("Item", "{{ name }}", "write", function(r) {
wn.require("js/wn/website/editable.js");
wn.require("assets/webnotes/js/wn/website/editable.js");
wn.make_editable($('[itemprop="description"]'), "Item", "{{ name }}", "web_long_description");
});
}
@ -17,25 +17,25 @@
{% block css %}
<style>
{% include "stock/doctype/item/templates/includes/product_page.css" %}
{% include "templates/includes/product_page.css" %}
</style>
{% endblock %}
{% block content %}
{% include 'stock/doctype/item/templates/includes/product_search_box.html' %}
{% include 'stock/doctype/item/templates/includes/product_breadcrumbs.html' %}
{% include 'templates/includes/product_search_box.html' %}
{% include 'templates/includes/product_breadcrumbs.html' %}
<div class="container content product-page-content" itemscope itemtype="http://schema.org/Product">
<div class="row">
<div class="col-md-6">
{% if slideshow %}
{% include "website/doctype/website_slideshow/templates/includes/slideshow.html" %}
{% include "templates/includes/slideshow.html" %}
{% else %}
{% if website_image %}
<image itemprop="image" class="item-main-image"
src="{{ website_image }}" />
{% else %}
<div class="img-area">
{% include 'stock/doctype/item/templates/includes/product_missing_image.html' %}
{% include 'templates/includes/product_missing_image.html' %}
</div>
{% endif %}
{% endif %}

View File

@ -1,11 +1,11 @@
{% extends base_template %}
{% block content %}
{% include 'stock/doctype/item/templates/includes/product_search_box.html' %}
{% include 'stock/doctype/item/templates/includes/product_breadcrumbs.html' %}
{% include 'templates/includes/product_search_box.html' %}
{% include 'templates/includes/product_breadcrumbs.html' %}
<div class="container content">
{% if slideshow %}<!-- slideshow -->
{% include "website/doctype/website_slideshow/templates/includes/slideshow.html" %}
{% include "templates/includes/slideshow.html" %}
{% endif %}
{% if description %}<!-- description -->
<div itemprop="description">{{ description or ""}}</div>
@ -42,7 +42,7 @@
$(function() {
if(window.logged_in && getCookie("system_user")==="yes") {
wn.has_permission("Item Group", "{{ name }}", "write", function(r) {
wn.require("js/wn/website/editable.js");
wn.require("assets/webnotes/js/wn/website/editable.js");
wn.make_editable($('[itemprop="description"]'), "Item Group", "{{ name }}", "description");
});
}

View File

@ -1,8 +1,3 @@
{% extends "website/templates/includes/footer.html" %}
{% block powered %}<a href="http://erpnext.org" style="color: #aaa;">ERPNext Powered</a>{% endblock %}
{% block extension %}
<div class="container">
<div class="row">
<div class="input-group col-sm-6 col-sm-offset-3" style="margin-top: 7px;">
@ -39,4 +34,3 @@
}
});
</script>
{% endblock %}

View File

@ -0,0 +1 @@
<a href="http://erpnext.org" style="color: #aaa;">ERPNext Powered</a>

View File

@ -1,7 +1,7 @@
{% extends base_template %}
{% block javascript %}
<script>{% include "portal/templates/includes/cart.js" %}</script>
<script>{% include "templates/includes/cart.js" %}</script>
{% endblock %}
{% set title="Shopping Cart" %}

View File

@ -1,4 +1,4 @@
{% extends "portal/templates/sale.html" %}
{% extends "templates/sale.html" %}
{% block status -%}
{% if doc.status %}{{ doc.status }}{% endif %}

View File

@ -9,7 +9,7 @@ from webnotes.utils import flt, fmt_money
no_cache = True
def get_context():
from erpnext.portal.utils import get_transaction_context
from erpnext.templates.utils import get_transaction_context
context = get_transaction_context("Sales Invoice", webnotes.form_dict.name)
modify_status(context.get("doc"))
context.update({

View File

@ -0,0 +1 @@
{% extends "templates/sales_transactions.html" %}

View File

@ -7,7 +7,7 @@ import webnotes
no_cache = True
def get_context():
from erpnext.portal.utils import get_currency_context
from erpnext.templates.utils import get_currency_context
context = get_currency_context()
context.update({
"title": "Invoices",
@ -20,7 +20,7 @@ def get_context():
@webnotes.whitelist()
def get_invoices(start=0):
from erpnext.portal.utils import get_transaction_list
from erpnext.templates.utils import get_transaction_list
from erpnext.accounts.doctype.sales_invoice.templates.pages.invoice import modify_status
invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"])
for d in invoices:

View File

@ -34,7 +34,7 @@ $(document).ready(function() {
$("#fullname").val(getCookie("full_name") || "");
$("#update_profile").click(function() {
wn.call({
method: "portal.templates.pages.profile.update_profile",
method: "erpnext.templates.pages.profile.update_profile",
type: "POST",
args: {
fullname: $("#fullname").val(),

View File

@ -0,0 +1 @@
{% extends "templates/sale.html" %}

View File

@ -7,7 +7,7 @@ import webnotes
no_cache = True
def get_context():
from erpnext.portal.utils import get_transaction_context
from erpnext.templates.utils import get_transaction_context
context = get_transaction_context("Delivery Note", webnotes.form_dict.name)
context.update({
"parent_link": "shipments",

View File

@ -0,0 +1 @@
{% extends "templates/sales_transactions.html" %}

View File

@ -7,11 +7,11 @@ import webnotes
no_cache = True
def get_context():
from erpnext.portal.utils import get_currency_context
from erpnext.templates.utils import get_currency_context
context = get_currency_context()
context.update({
"title": "Shipments",
"method": "portal.templates.pages.shipments.get_shipments",
"method": "erpnext.templates.pages.shipments.get_shipments",
"icon": "icon-truck",
"empty_list_message": "No Shipments Found",
"page": "shipment"
@ -20,5 +20,5 @@ def get_context():
@webnotes.whitelist()
def get_shipments(start=0):
from erpnext.portal.utils import get_transaction_list
from erpnext.templates.utils import get_transaction_list
return get_transaction_list("Delivery Note", start)

View File

@ -1,4 +1,4 @@
{% extends "portal/templates/includes/transactions.html" %}
{% extends "templates/includes/transactions.html" %}
{% block javascript -%}
{{ super() }}

View File

@ -1,4 +1,4 @@
{% extends "portal/templates/includes/transactions.html" %}
{% extends "templates/includes/transactions.html" %}
{% block javascript -%}
<script>

View File

@ -9,7 +9,7 @@ class CustomDocType(DocType):
if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
import requests
response = requests.post(conf.demo_notify_url, data={
"cmd":"portal.utils.send_message",
"cmd":"erpnext.templates.utils.send_message",
"subject":"Logged into Demo",
"sender": webnotes.form_dict.lead_email,
"message": "via demo.erpnext.com"