website added banner

This commit is contained in:
Rushabh Mehta 2013-03-12 11:22:30 +05:30
parent f47d53adbc
commit 1aff4c384d
4 changed files with 25 additions and 20 deletions

View File

@ -1,8 +1,8 @@
[
{
"creation": "2013-01-25 11:35:10",
"creation": "2013-03-07 11:55:11",
"docstatus": 0,
"modified": "2013-02-21 10:05:09",
"modified": "2013-03-12 11:17:11",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -72,24 +72,31 @@
"label": "Home Page is Products"
},
{
"description": "Add a banner to the site. (small banners are usually good)",
"doctype": "DocField",
"fieldname": "banner",
"fieldtype": "Section Break",
"label": "Banner"
},
{
"description": "Banner is above the Top Menu Bar.",
"doctype": "DocField",
"fieldname": "banner_html",
"fieldtype": "Small Text",
"label": "Banner HTML"
},
{
"description": "Menu items in the Top Bar. For setting the color of the Top Bar, go to <a href=\"#Form/Style Settings\">Style Settings</a>",
"doctype": "DocField",
"fieldname": "top_bar",
"fieldtype": "Section Break",
"label": "Top Bar"
},
{
"description": "Background shade of the top menu bar",
"doctype": "DocField",
"fieldname": "top_bar_background",
"fieldtype": "Select",
"label": "Top Bar Background",
"options": "Black\nWhite"
},
{
"description": "Brand is what appears on the top-right of the toolbar. If it is an image, make sure it\nhas a transparent background and use the &lt;img /&gt; tag. Keep size as 200px x 30px",
"doctype": "DocField",
"fieldname": "brand_html",
"fieldtype": "Text",
"fieldtype": "Small Text",
"label": "Brand HTML"
},
{

View File

@ -1,7 +1,7 @@
<div class="navbar{% if top_bar_background=="Black" %} navbar-inverse{% endif %}"
<div class="navbar navbar-inverse"
style="">
<div class="navbar-inner">
<a class="brand" href="index">{{ brand_html }}</a>
{% if brand_html %}<a class="brand" href="index">{{ brand_html }}</a>{% endif %}
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>

View File

@ -4,6 +4,9 @@
<header>
</header>
<div class="container">
{% if banner_html %}<div class="row" style="margin-top: 30px;">
<div class="span12">{{ banner_html }}</div>
</div>{% endif %}
<div class="outer">
{% include "html/navbar.html" %}
<div class="content row" id="page-{{ name }}" style="display: block;">

View File

@ -255,18 +255,13 @@ def get_outer_env(page_name, args):
args.update(ret)
settings = webnotes.doc("Website Settings", "Website Settings")
for k in ["brand_html", "copyright", "address", "top_bar_background", "favicon",
"facebook_share", "google_plus_one", "twitter_share", "linked_in_share", "twitter_share_via"]:
for k in ["banner_html", "brand_html", "copyright", "address", "twitter_share_via"
"favicon", "facebook_share", "google_plus_one", "twitter_share", "linked_in_share"]:
if k in settings.fields:
args[k] = settings.fields.get(k)
for k in ["facebook_share", "google_plus_one", "twitter_share", "linked_in_share"]:
args[k] = int(args.get(k) or 0)
if not args.brand_html:
args.brand_html = "ERPNext"
if not args.top_bar_background:
args.top_bar_background = "Black"
args.url = quote(str(get_request_site_address(full_address=True)), str(""))
args.encoded_title = quote(str(args.title or ""), str(""))