Merge branch 'master' into edge

This commit is contained in:
Rushabh Mehta 2013-03-15 11:31:47 +05:30
commit d5d9d5032a
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
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.title = self.doc.item_name == self.doc.name and self.doc.item_name or \
(self.doc.item_name + " [" + self.doc.name + "]")
self.doc.title = self.doc.item_name
if self.doc.slideshow:
from website.helpers.slideshow import get_slideshow

View File

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

View File

@ -2,7 +2,7 @@
{
"creation": "2013-03-08 11:36:53",
"docstatus": 0,
"modified": "2013-03-12 13:35:14",
"modified": "2013-03-14 11:57:20",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -150,14 +150,14 @@
"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",
"fieldname": "google_web_font_for_heading",
"fieldtype": "Data",
"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",
"fieldname": "google_web_font_for_text",
"fieldtype": "Data",

View File

@ -50,5 +50,5 @@ cur_frm.cscript.set_banner_from_image = function(doc) {
var src = doc.banner_image;
if(src.indexOf("/")==-1) src = "files/" + 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 = ''
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
order by creation desc, modified desc, name asc limit 20""", as_dict=1)
for blog in blog_list:
blog.link = host + '/' + blog.name + '.html'
blog.content = get_blog_content(blog.name)
items += rss_item % blog

View File

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

View File

@ -11,46 +11,41 @@
{% block content %}
{% include 'html/product_search_box.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">
{% 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="span9">
<h3>Product Description</h3>
<div class="span6">
{% 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">
{{ web_long_description or web_short_description or
"[No description given]" }}
</div>
<hr>
{% if obj.doclist.get({"doctype":"Item Website Specification"}) %}
<h3>Specifications</h3>
<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>
<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>
{% endif %}
</div>
<div class="span3">
<div class="item-price hide">
<p>Price:</p>
</div>

View File

@ -309,13 +309,6 @@ def url_for_website(url):
return url
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):
v = int(c, 16) + int(int('ff', 16) * (float(percent)/100))
@ -329,4 +322,16 @@ def get_hex_shade(color, percent):
return h
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)