[website] [minor] moving to framework

This commit is contained in:
Rushabh Mehta
2013-09-09 12:17:45 +05:30
parent 46089dbc97
commit c59c4e0699
40 changed files with 49 additions and 61 deletions

View File

@@ -1,13 +0,0 @@
<div class="col-md-12">
<hr />
{% if categories %}
<h5>Explore posts by categories</h5>
<ul class="breadcrumb" style="background-color: transparent; padding-left: 20px;">
{% for category in categories %}
<li><a href="blog?category={{ category }}">{{ category }}</a>
{% endfor %}
</ul>
<br><br>
{% endif %}
<p>Show posts by <a href="blog">everyone</a>. Meet the <a href="writers">writers</a> of this blog</p>
</div>

View File

@@ -1,58 +0,0 @@
{% extends "app/website/templates/html/page.html" %}
{% block javascript %}
{% include "app/website/templates/js/blog_page.js" %}
{% endblock %}
{% block css %}
{% include "app/website/templates/css/blog_page.css" %}
{% endblock %}
{% block content %}
<div class="col-md-12" itemscope itemtype="http://schema.org/BlogPost">
<h2 itemprop="name headline">{{ title }}</h2>
<!-- begin blog content -->
<div class="help" style="color: #aaa">
<span itemprop="author">{{ blogger_info and blogger_info.full_name or full_name }}</span> /
<span itemprop="dateCreated">{{ updated }}</span></div>
<br>
<div itemprop="articleBody">
{{ content_html }}
</div>
<!-- end blog content -->
{% if blogger_info %}
<hr />
{% include "app/website/templates/html/blogger.html" %}
{% endif %}
<hr>
<h3>{{ texts.comments }}</h3><br>
<div class="blog-comments">
{% if not comment_list %}
<div class="no-comment">
<p>{{ texts.first_comment }}</p>
</div>
{% endif %}
{% include 'app/website/templates/html/comment.html' %}
</div>
<div><button class="btn btn-default add-comment">{{ texts.add_comment }}</button></div>
<div style="display: none; margin-top: 10px; max-width: 400px;"
id="comment-form">
<div class="alert" style="display:none;"></div>
<form>
<fieldset>
<input class="form-control" name="comment_by_fullname" placeholder="Your Name" type="text"/><br>
<input class="form-control" name="comment_by"
placeholder="Your Email Id" type="text"/><br>
<textarea class="form-control" name="comment" rows=10
placeholder="Comment"/>
</textarea><br>
<button class="btn btn-info" id="submit-comment">{{ texts.submit }}</button>
</fieldset>
</form>
</div>
</div>
{% include 'app/website/templates/html/blog_footer.html' %}
{% endblock %}

View File

@@ -1,9 +0,0 @@
<h4>Subscribe</h4>
<br>
<p>
<button class="btn btn-warning btn-blog-subscribe">Get Updates via Email</button>
</p>
<p>
<img src="app/images/feed.png" style="margin-right: 4px; margin-bottom: -4px">
<a href="rss.xml" target="_blank">RSS Feed</a>
</p>

View File

@@ -1,13 +0,0 @@
<div class="row">
<div class="col-md-2">
<div class="avatar avatar-large">
<img itemprop="thumbnailUrl" src="{{ blogger_info.avatar }}" />
</div>
</div>
<div class="col-md-10">
<h4>{{ blogger_info.full_name }}</h4>
<p style="color: #999">{{ blogger_info.bio }}</p>
<p><a href="blog?by={{ blogger_info.name }}&by_name={{ blogger_info.full_name }}">
{{ texts.all_posts_by }} {{ blogger_info.full_name }}</a></p>
</div>
</div>

View File

@@ -1,17 +0,0 @@
{#
this template generates comment rows for a blog
it is to be included in the blog/blog.html template
#}
<div itemscope itemtype="http://schema.org/UserComments">
{% for comment in comment_list %}
<div class="comment-row">
<div class="comment-title">
<span itemprop="name" class="author">{{ comment.comment_by_fullname }}</span> /
<span itemprop="commentTime">{{ comment.comment_date }}</span>:
</div>
<p class="comment-content" itemprop="commentText">{{ comment.comment }}</p>
<hr>
</div>
{% endfor %}
</div>

View File

@@ -1,26 +0,0 @@
{% extends "app/website/templates/html/page.html" %}
{% block content %}
<div class="col-md-12" itemscope itemtype="http://schema.org/Organization">
<div class="row">
<div class="col-md-4">
{% if logo -%}
<img itemprop="brand" src="{{ logo }}" class="partner-logo"
alt="{{ partner_name }}" title="{{ partner_name }}" />
<br><br>
{%- endif %}
<address>
{% if partner_website -%}<p><a href="{{ partner_website }}"
target="_blank">{{ partner_website }}</a></p>{%- endif %}
{% if partner_address -%}<p itemprop="address">{{ partner_address }}</p>{%- endif %}
{% if phone -%}<p itemprop="telephone">{{ phone }}</p>{%- endif %}
{% if email -%}<p itemprop="email"><span class="icon-envelope"></span> {{ email }}</p>{%- endif %}
</address>
</div>
<div class="col-md-8">
<h3 itemprop="name" style="margin-top: 0px;">{{ partner_name }}</h3>
<p>{{ description }}</p>
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,12 +0,0 @@
{% if obj.parent_groups and len(obj.parent_groups) > 1 %}
<div class="col-md-12">
<div class="clearfix">
<ul class="breadcrumb">
{% for ig in obj.parent_groups[:-1] %}
<li><a href="{{ ig.page_name }}.html">{{ ig.name }}</a></li>
{% endfor %}
<li class="active">{{ obj.parent_groups[-1].name }}</li>
</ul>
</div>
</div>
{% endif %}

View File

@@ -1,42 +0,0 @@
{% 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

@@ -1,14 +0,0 @@
<div class="col-md-3">
<div style="height: 120px; overflow: hidden;">
<a href="{{ page_name }}">
{%- if website_image -%}
<img class="product-image" style="width: 80%; margin: auto;" src="{{ website_image }}">
{%- else -%}
{% include 'app/website/templates/html/product_missing_image.html' %}
{%- endif -%}
</a>
</div>
<div style="height: 100px; overflow: hidden; font-size: 80%;">
<h4 style="margin-bottom: 2px;"><a href="{{ page_name }}">{{ item_name }}</a></h4>
</div>
</div>

View File

@@ -1,15 +0,0 @@
<!-- TODO product listing -->
<div class="col-md-12">
<div style="height: 120px; overflow: hidden;">
<a href="{{ page_name }}">
{%- if website_image -%}
<img class="product-image" style="width: 80%; margin: auto;" src="{{ website_image }}">
{%- else -%}
{% include 'app/website/templates/html/product_missing_image.html' %}
{%- endif -%}
</a>
</div>
<div style="height: 100px; overflow: hidden; font-size: 80%;">
<h4 style="margin-bottom: 2px;"><a href="{{ page_name }}">{{ item_name }}</a></h4>
</div>
</div>

View File

@@ -1 +0,0 @@
<div class="missing-image"><i class="icon-camera"></i></div>

View File

@@ -1,74 +0,0 @@
{% extends "app/website/templates/html/page.html" %}
{% block javascript %}
{% include "app/website/templates/js/product_page.js" %}
{% endblock %}
{% block css %}
{% include "app/website/templates/css/product_page.css" %}
{% endblock %}
{% block content %}
{% include 'app/website/templates/html/product_search_box.html' %}
{% include 'app/website/templates/html/product_breadcrumbs.html' %}
<div class="col-md-12 product-page-content" itemscope itemtype="http://schema.org/Product">
<div class="row">
<div class="col-md-6">
{% if slideshow %}
{% include "app/website/templates/html/slideshow.html" %}
{% else %}
{% if website_image %}
<image itemprop="image" class="item-main-image"
src="{{ website_image }}" />
{% else %}
<div class="img-area">
{% include 'app/website/templates/html/product_missing_image.html' %}
</div>
{% endif %}
{% endif %}
</div>
<div class="col-md-6">
<h3 itemprop="name" style="margin-top: 0px;">{{ item_name }}</h3>
<p class="help">Item Code: <span itemprop="productID">{{ name }}</span></p>
<h4>Product Description</h4>
<div itemprop="description">
{{ web_long_description or description or "[No description given]" }}
</div>
<div style="min-height: 100px; margin: 10px 0;">
<div class="item-price-info" style="display: none;">
<h4 class="item-price" itemprop="price"></h4>
<div class="item-stock" itemprop="availablity"></div>
<div id="item-add-to-cart">
<button class="btn btn-primary">
<i class="icon-shopping-cart"></i> Add to Cart</button>
</div>
<div id="item-update-cart" class="input-group col-md-4" style="display: none;
padding-left: 0px; padding-right: 0px;">
<input class="form-control" type="text">
<div class="input-group-btn">
<button class="btn btn-primary">
<i class="icon-ok"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
{% if obj.doclist.get({"doctype":"Item Website Specification"}) -%}
<div class="row" style="margin-top: 20px">
<div class="col-md-12">
<h4>Specifications</h4>
<table class="table table-bordered" style="width: 100%">
{% for d in obj.doclist.get(
{"doctype":"Item Website Specification"}) -%}
<tr>
<td style="width: 30%;">{{ d.label }}</td>
<td>{{ d.description }}</td>
</tr>
{%- endfor %}
</table>
</div>
</div>
{%- endif %}
</div>
{% endblock %}

View File

@@ -1,29 +0,0 @@
<div class="col-md-12 clearfix">
<div class="pull-right" style="margin-top: 15px; margin-bottom: 15px;">
<form class="form-search">
<div class="input-group col-md-4 col-md-offset-8">
<input class="form-control" type="text" id="product-search" placeholder="Product Search...">
<span class="input-group-btn">
<button class="btn btn-default" type="button" id="btn-product-search">
<i class="icon-search"></i></button>
</span>
</div>
</form>
</div>
<script>
// redirect to product search page
$(document).ready(function() {
$('.dropdown-toggle').dropdown()
$("#btn-product-search").click(function() {
var txt = $("#product-search").val();
if(txt) {
window.location.href="product_search.html?q=" + txt;
}
return false;
});
$("#product-search").keypress(function(e) {
if(e.which==13) $("#product-search-btn").click();
})
})
</script>
</div>

View File

@@ -14,6 +14,7 @@ $(document).ready(function() {
.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("");
})

View File

@@ -7,7 +7,7 @@ $(document).ready(function() {
wn.cart.bind_events();
return wn.call({
type: "POST",
method: "website.helpers.cart.get_cart_quotation",
method: "selling.utils.cart.get_cart_quotation",
callback: function(r) {
console.log(r);
$("#cart-container").removeClass("hide");
@@ -194,7 +194,7 @@ $.extend(wn.cart, {
return wn.call({
btn: btn,
type: "POST",
method: "website.helpers.cart.apply_shipping_rule",
method: "selling.utils.cart.apply_shipping_rule",
args: { shipping_rule: rule },
callback: function(r) {
if(!r.exc) {
@@ -242,7 +242,7 @@ $.extend(wn.cart, {
return wn.call({
type: "POST",
method: "website.helpers.cart.update_cart_address",
method: "selling.utils.cart.update_cart_address",
args: {
address_fieldname: $address_wrapper.attr("data-fieldname"),
address_name: $(this).attr("data-address-name")
@@ -273,7 +273,7 @@ $.extend(wn.cart, {
place_order: function() {
return wn.call({
type: "POST",
method: "website.helpers.cart.place_order",
method: "selling.utils.cart.place_order",
callback: function(r) {
if(r.exc) {
var msg = "";

View File

@@ -15,7 +15,7 @@ window.get_product_list = function() {
url: "server.py",
dataType: "json",
data: {
cmd: "website.helpers.product.get_product_list",
cmd: "selling.utils.product.get_product_list",
start: window.start,
search: window.search,
product_group: window.product_group

View File

@@ -7,7 +7,7 @@ $(document).ready(function() {
wn.call({
type: "POST",
method: "website.helpers.product.get_product_info",
method: "selling.utils.product.get_product_info",
args: {
item_code: "{{ name }}"
},

View File

@@ -89,7 +89,7 @@
wn.call({
btn: $(this),
type: "POST",
method: "website.helpers.cart.save_address",
method: "selling.utils.cart.save_address",
args: { fields: fields, address_fieldname: get_url_arg("address_fieldname") },
callback: function(r) {
if(r.exc) {

View File

@@ -26,7 +26,7 @@
var fetch_addresses = function() {
wn.call({
method: "website.helpers.cart.get_addresses",
method: "selling.utils.cart.get_addresses",
callback: function(r) {
$("#address-list .progress").remove();
var $list = $("#address-list");

View File

@@ -1,33 +0,0 @@
{% extends "app/website/templates/html/page.html" %}
{% block javascript %}
{% include "app/website/templates/js/blog.js" %}
{% endblock %}
{% block css %}
{% include "app/website/templates/css/blog.css" %}
{% endblock %}
{% set title="Blog" %}
{% block content %}
<div class="col-md-12">
<h2 id="blog-title">{{ blog_title }}</h2>
{% if blog_introduction %}
<p>{{ blog_introduction }}</p>
{% endif %}
<h3 id="blot-subtitle" style="display:none;"></h3>
<br>
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
</div>
<div id="blog-list">
<!-- blog list will be generated dynamically -->
</div>
<div style="text-align: center;">
<button id="next-page" class="btn btn-default"
style="display:none;">More...</button>
</div>
</div>
{% include 'app/website/templates/html/blog_footer.html' %}
{% endblock %}

View File

@@ -1,31 +0,0 @@
{% extends "app/website/templates/html/transactions.html" %}
{% block javascript -%}
{{ super() }}
var render = function(doc) {
doc.sender = doc.sender ? doc.sender : "To ";
doc.recipients = doc.recipients ? (" to " + doc.recipients) : "";
doc.content = remove_script_and_style(doc.content);
if(!is_html(doc.content)) {
doc.content = doc.content.replace("\n", "<br>");
}
$(repl('<a class="list-group-item">\
<div class="row col-md-12">%(subject)s</div>\
<div class="row text-muted">\
<div class="col-md-6">%(sender)s%(recipients)s</div>\
<div class="col-md-6 text-right">%(creation)s</div>\
</div>\
<div class="row col-md-12 msg-content" style="display: none;"><hr>%(content)s</div>\
</a>', doc))
.appendTo($list)
.on("click", function() {
$(this).find(".msg-content").toggle();
});
}
{%- endblock %}

View File

@@ -1,30 +0,0 @@
{% extends "app/website/templates/html/page.html" %}
{% set title="Partners" %}
{% block content %}
<div class="col-md-12">
<h2 id="blog-title">{{ title }}</h2>
<hr>
{% for partner_info in partners %}
<div class="row">
<div class="col-md-3">
{% if partner_info.logo -%}
<a href="{{ partner_info.page_name }}">
<img itemprop="brand" src="{{ partner_info.logo }}" class="partner-logo"
alt="{{ partner_info.partner_name }}" title="{{ partner_info.partner_name }}" />
</a>
{%- endif %}
</div>
<div class="col-md-9">
<a href="{{ partner_info.page_name }}">
<h4>{{ partner_info.partner_name }}</h4>
</a>
<p style="color: #999">{{ partner_info.territory }} - {{ partner_info.partner_type }}</p>
<p>{{ partner_info.introduction }}</p>
</div>
</div>
<hr>
{% endfor %}
</div>
{% endblock %}

View File

@@ -1,33 +0,0 @@
{% extends "app/website/templates/html/page.html" %}
{% set title="Product Search" %}
{% block javascript %}
{% include "app/website/templates/js/product_list.js" %}
{% endblock %}
{% block content %}
<script>
$(document).ready(function() {
var txt = get_url_arg("q");
$(".search-results").html("Search results for: " + txt);
window.search = txt;
window.start = 0;
window.get_product_list();
});
</script>
{% include 'app/website/templates/html/product_search_box.html' %}
<div class="col-md-12">
<h3 class="search-results">Search Results</h3>
<div id="search-list" class="row">
</div>
<div style="text-align: center;">
<div class="more-btn"
style="display: none; text-align: center;">
<button class="btn">More...</button>
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,67 +0,0 @@
{% extends "app/website/templates/html/page.html" %}
{% set title=doc.name %}
{% set status_label = {
"Open": "label-success",
"To Reply": "label-danger",
"Closed": "label-default"
} %}
{% 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="tickets">My Tickets</a></li>
<li class="active"><i class="icon-ticket icon-fixed-width"></i> {{ doc.name }}</li>
</ul>
<h3><i class="icon-ticket icon-fixed-width"></i> {{ doc.name }}</h3>
{% if doc.name == "Not Allowed" -%}
<script>ask_to_login();</script>
{% else %}
<hr>
{%- if doc.status -%}
{% if doc.status == "Waiting for Customer" -%}
{% set status = "To Reply" %}
{% else %}
{% set status = doc.status %}
{%- endif -%}
<div class="row">
<div class="col-md-2" style="margin-bottom: 7px;">
<span class="label {{ status_label.get(status) or 'label-default' }}">{{ status }}</span>
</div>
<div class="col-md-8">
<div class="row col-md-12">{{ doc.subject }}</div>
</div>
<div class="col-md-2 pull-right">
<span class="text-muted">{{ utils.formatdate(doc.creation) }}</span>
</div>
</div>
<br>
<h4>Messages</h4>
{%- if doclist.get({"doctype":"Communication"}) -%}
<div>
<table class="table table-bordered table-striped">
<tbody>
{%- for comm in doclist.get({"doctype":"Communication"}) %}
<tr>
<td>
<h5 style="text-transform: none">
{{ comm.sender }} on {{ utils.formatdate(doc.modified) }}</h5>
<hr>
<p>{{ webnotes.utils.is_html(comm.content) and comm.content or
comm.content.replace("\n", "<br>")}}</p>
</td>
</tr>
{% endfor -%}
</tbody>
</table>
</div>
{%- else -%}
<div class="alert">No messages</div>
{%- endif -%}
{%- endif -%}
{% endif -%}
</div>
{% endblock %}

View File

@@ -1,31 +0,0 @@
{% extends "app/website/templates/html/transactions.html" %}
{% block javascript -%}
{{ super() }}
var status_label = {
"Open": "label-success",
"Waiting for Customer": "label-danger",
"Closed": "label-default"
}
var render = function(doc) {
doc.status = doc.status.trim();
doc.label_class = status_label[doc.status] || "label-default";
if(doc.status==="Waiting for Customer") doc.status = "To Reply";
$(repl('<a href="{{ page }}?name=%(name)s" class="list-group-item">\
<div class="row">\
<div class="col-md-2" style="margin-bottom: 7px;"><span class="label %(label_class)s">\
%(status)s</span></div>\
<div class="col-md-8">\
<div class="row col-md-12">%(name)s</div>\
<div class="row col-md-12 text-muted">%(subject)s</div>\
</div>\
<div class="col-md-2 pull-right">\
<span class="text-muted">%(creation)s</span>\
</div>\
</div>\
</a>', doc)).appendTo($list);
};
{%- endblock %}

View File

@@ -1,17 +0,0 @@
{% extends "app/website/templates/html/page.html" %}
{% set title="Blog Writers" %}
{% block content %}
<div class="col-md-12">
<h2 id="blog-title">Blog Writers</h2>
{% if writers_introduction %}
<p>{{ writers_introduction }}</p>
{% endif %}
<hr>
{% for blogger_info in bloggers %}
{% include "app/website/templates/html/blogger.html" %}
{% endfor %}
</div>
{% include 'app/website/templates/html/blog_footer.html' %}
{% endblock %}