Merge branch 'master' into edge

This commit is contained in:
Rushabh Mehta
2013-03-15 11:31:47 +05:30
8 changed files with 55 additions and 52 deletions

View File

@@ -238,8 +238,7 @@ class DocType(DocListController):
from website.helpers.product import get_parent_item_groups, url_for_website from website.helpers.product import get_parent_item_groups, url_for_website
self.parent_groups = get_parent_item_groups(self.doc.item_group) + [{"name":self.doc.name}] self.parent_groups = get_parent_item_groups(self.doc.item_group) + [{"name":self.doc.name}]
self.doc.website_image = url_for_website(self.doc.website_image) self.doc.website_image = url_for_website(self.doc.website_image)
self.doc.title = self.doc.item_name == self.doc.name and self.doc.item_name or \ self.doc.title = self.doc.item_name
(self.doc.item_name + " [" + self.doc.name + "]")
if self.doc.slideshow: if self.doc.slideshow:
from website.helpers.slideshow import get_slideshow from website.helpers.slideshow import get_slideshow

View File

@@ -47,10 +47,9 @@ div.outer {
{% if doc.page_border %} {% if doc.page_border %}
/* Page Border*/ /* Page Border*/
div.outer { div.outer {
-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.9); box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.9); -moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
box-shadow: 0px 0px 3px rgba(0,0,0,0.9); -webkibox-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
border-radius: 5px;
} }
{% else %} {% else %}
{% if doc.background_color == doc.page_background %} {% if doc.background_color == doc.page_background %}
@@ -61,6 +60,11 @@ div.web-footer {
{% endif %} {% endif %}
{% endif %} {% endif %}
div.web-footer, div.web-footer a {
font-size: 90%;
color: #{{ get_hex_shade(doc.background_color or "ffffff", 70) }};
}
/* Bootstrap Navbar */ /* Bootstrap Navbar */
.navbar-inverse .navbar-inner { .navbar-inverse .navbar-inner {
background-color: #{{ doc.top_bar_background or "444444"}}; background-color: #{{ doc.top_bar_background or "444444"}};

View File

@@ -2,7 +2,7 @@
{ {
"creation": "2013-03-08 11:36:53", "creation": "2013-03-08 11:36:53",
"docstatus": 0, "docstatus": 0,
"modified": "2013-03-12 13:35:14", "modified": "2013-03-14 11:57:20",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@@ -150,14 +150,14 @@
"fieldtype": "Column Break" "fieldtype": "Column Break"
}, },
{ {
"description": "Add the name of Google Web Font e.g. \"Open Sans\"", "description": "Add the name of <a href=\"http://google.com/webfonts\" target=\"_blank\">Google Web Font</a> e.g. \"Open Sans\"",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "google_web_font_for_heading", "fieldname": "google_web_font_for_heading",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Google Web Font (Heading)" "label": "Google Web Font (Heading)"
}, },
{ {
"description": "Add the name of Google Web Font e.g. \"Open Sans\"", "description": "Add the name of <a href=\"http://google.com/webfonts\" target=\"_blank\">Google Web Font</a> e.g. \"Open Sans\"",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "google_web_font_for_text", "fieldname": "google_web_font_for_text",
"fieldtype": "Data", "fieldtype": "Data",

View File

@@ -50,5 +50,5 @@ cur_frm.cscript.set_banner_from_image = function(doc) {
var src = doc.banner_image; var src = doc.banner_image;
if(src.indexOf("/")==-1) src = "files/" + src; if(src.indexOf("/")==-1) src = "files/" + src;
cur_frm.set_value("banner_html", "<a href='/'><img src='"+ src cur_frm.set_value("banner_html", "<a href='/'><img src='"+ src
+"'></a>"); +"' style='max-width: 200px;'></a>");
} }

View File

@@ -57,13 +57,12 @@ def generate():
items = '' items = ''
blog_list = webnotes.conn.sql("""\ blog_list = webnotes.conn.sql("""\
select page_name as name, modified, creation, title from `tabBlog Post` select page_name as name, modified, creation, title, content from `tabBlog Post`
where ifnull(published,0)=1 where ifnull(published,0)=1
order by creation desc, modified desc, name asc limit 20""", as_dict=1) order by creation desc, modified desc, name asc limit 20""", as_dict=1)
for blog in blog_list: for blog in blog_list:
blog.link = host + '/' + blog.name + '.html' blog.link = host + '/' + blog.name + '.html'
blog.content = get_blog_content(blog.name)
items += rss_item % blog items += rss_item % blog

View File

@@ -6,6 +6,7 @@
.layout-wrapper { .layout-wrapper {
background-color: #fff; background-color: #fff;
color: #333;
padding: 10px; padding: 10px;
box-shadow: 1px 1px 3px 3px #ccc; box-shadow: 1px 1px 3px 3px #ccc;
font-size: 12px; font-size: 12px;

View File

@@ -11,46 +11,41 @@
{% block content %} {% block content %}
{% include 'html/product_search_box.html' %} {% include 'html/product_search_box.html' %}
{% include 'html/product_breadcrumbs.html' %} {% include 'html/product_breadcrumbs.html' %}
<div class="span12">
<h3 itemprop="name">{{ item_name }}</h3>
<p class="help">Item Code: {{ name }}</p>
</div>
<div class="span12 product-page-content" itemscope itemtype="http://schema.org/Product"> <div class="span12 product-page-content" itemscope itemtype="http://schema.org/Product">
{% if slideshow %}
{% include "html/slideshow.html" %}
{% else %}
{% if website_image %}
<image itemprop="image" class="item-main-image"
src="{{ website_image }}" />
{% else %}
<div class="img-area">
{% include 'html/product_missing_image.html' %}
</div>
{% endif %}
{% endif %}
<br><br>
<div class="row"> <div class="row">
<div class="span9"> <div class="span6">
<h3>Product Description</h3> {% if slideshow %}
{% include "html/slideshow.html" %}
{% else %}
{% if website_image %}
<image itemprop="image" class="item-main-image" src="{{ website_image }}" />
{% else %}
<div class="img-area">
{% include 'html/product_missing_image.html' %}
</div>
{% endif %}
{% endif %}
</div>
<div class="span6">
<h3 itemprop="name" style="margin-top: 0px;">{{ item_name }}</h3>
<p class="help">Item Code: {{ name }}</p>
<h4>Product Description</h4>
<div itemprop="description"> <div itemprop="description">
{{ web_long_description or web_short_description or {{ web_long_description or web_short_description or
"[No description given]" }} "[No description given]" }}
</div> </div>
<hr>
{% if obj.doclist.get({"doctype":"Item Website Specification"}) %} {% if obj.doclist.get({"doctype":"Item Website Specification"}) %}
<h3>Specifications</h3> <h4>Specifications</h4>
<table class="table table-bordered" style="width: 100%"> <table class="table table-bordered" style="width: 100%">
{% for d in obj.doclist.get( {% for d in obj.doclist.get(
{"doctype":"Item Website Specification"}) %} {"doctype":"Item Website Specification"}) %}
<tr> <tr>
<td style="width: 30%;">{{ d.label }}</td> <td style="width: 30%;">{{ d.label }}</td>
<td>{{ d.description }}</td> <td>{{ d.description }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
{% endif %} {% endif %}
</div>
<div class="span3">
<div class="item-price hide"> <div class="item-price hide">
<p>Price:</p> <p>Price:</p>
</div> </div>

View File

@@ -309,13 +309,6 @@ def url_for_website(url):
return url return url
def get_hex_shade(color, percent): def get_hex_shade(color, percent):
# switch dark and light shades
if int(color, 16) > int("808080", 16):
percent = -percent
# stronger diff for darker shades
if int(color, 16) < int("333333", 16):
percent = percent * 2
def p(c): def p(c):
v = int(c, 16) + int(int('ff', 16) * (float(percent)/100)) v = int(c, 16) + int(int('ff', 16) * (float(percent)/100))
@@ -329,4 +322,16 @@ def get_hex_shade(color, percent):
return h return h
r, g, b = color[0:2], color[2:4], color[4:6] r, g, b = color[0:2], color[2:4], color[4:6]
return p(r) + p(g) + p(b)
avg = (float(int(r, 16) + int(g, 16) + int(b, 16)) / 3)
# switch dark and light shades
if avg > 128:
percent = -percent
# stronger diff for darker shades
if percent < 25 and avg < 64:
percent = percent * 2
return p(r) + p(g) + p(b)