[website] [minor] moving to framework

This commit is contained in:
Rushabh Mehta
2013-09-09 17:31:19 +05:30
parent bb4c6eb630
commit bdb846f665
9 changed files with 42 additions and 65 deletions

View File

@@ -44,7 +44,7 @@ class DocType(DocTypeNestedSet):
webnotes.msgprint("An item exists with same name (%s), please change the \
item group name or rename the item" % self.doc.name, raise_exception=1)
def prepare_template_args(self):
def get_context(self):
from selling.utils.product import get_product_list_for_group, \
get_parent_item_groups, get_group_item_count

View File

@@ -0,0 +1,42 @@
{% extends "app/website/templates/html/page.html" %}
{% block content %}
{% include 'app/website/templates/html/product_search_box.html' %}
{% include 'app/website/templates/html/product_breadcrumbs.html' %}
<div class="col-md-12">
{% if slideshow %}<!-- slideshow -->
{% include "app/website/templates/html/slideshow.html" %}
{% endif %}
{% if description %}<!-- description -->
<div>{{ description or ""}}</div>
{% else %}
<h3>{{ name }}</h3>
{% endif %}
</div>
<div class="col-md-12">
{% if sub_groups %}
<hr />
<div class="row">
{% for d in sub_groups %}
<div class="col-md-4">
<a href="{{ d.page_name }}">{{ d.name }} ({{ d.count }})</a>
</div>
{% endfor %}
</div>
<hr />
{% endif %}
{% if items %}
<div id="search-list" class="row">
{% for item in items %}
{{ item }}
{% endfor %}
</div>
{% if len(items)==100 %}
<div class="alert info">Showing top 100 items.</div>
{% endif %}
{% else %}
<div class="alert">No items listed.</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -29,7 +29,7 @@ class DocType:
else:
return ''
def prepare_template_args(self):
def get_context(self):
address = webnotes.conn.get_value("Address",
{"sales_partner": self.doc.name, "is_primary_address": 1},
"*", as_dict=True)