Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
5cd6b88119
@ -26,6 +26,10 @@
|
||||
<td><a href="http://httpd.apache.org">Apache HTTPD web server</a></td>
|
||||
<td>The Number One HTTP Server On The Internet.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="http://memcached.org/">Memcached</a></td>
|
||||
<td>Free & open source, high-performance, distributed memory object caching system.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="http://python.org/">Python Programming Language</a></td>
|
||||
<td>The "batteries included" language that lets you write elegant code, quickly.<br><br>Python Libraries:
|
||||
|
@ -74,13 +74,15 @@ class DocType:
|
||||
# temp fields
|
||||
from webnotes.utils import global_date_format, get_fullname
|
||||
self.doc.full_name = get_fullname(self.doc.owner)
|
||||
self.doc.updated = global_date_format(self.doc.creation)
|
||||
self.doc.updated = global_date_format(self.doc.published_on)
|
||||
self.doc.content_html = self.doc.content
|
||||
if self.doc.blogger:
|
||||
self.doc.blogger_info = webnotes.doc("Blogger", self.doc.blogger).fields
|
||||
if self.doc.blogger_info.avatar and not "/" in self.doc.blogger_info.avatar:
|
||||
self.doc.blogger_info.avatar = "files/" + self.doc.blogger_info.avatar
|
||||
|
||||
self.doc.description = self.doc.blog_intro or self.doc.content[:140]
|
||||
|
||||
self.doc.categories = webnotes.conn.sql_list("select name from `tabBlog Category` order by name")
|
||||
|
||||
self.doc.texts = {
|
||||
|
0
website/doctype/blog_settings/__init__.py
Normal file
0
website/doctype/blog_settings/__init__.py
Normal file
8
website/doctype/blog_settings/blog_settings.py
Normal file
8
website/doctype/blog_settings/blog_settings.py
Normal file
@ -0,0 +1,8 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
61
website/doctype/blog_settings/blog_settings.txt
Normal file
61
website/doctype/blog_settings/blog_settings.txt
Normal file
@ -0,0 +1,61 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-03-11 17:48:16",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-03-11 17:48:16",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"description": "Blog Settings",
|
||||
"doctype": "DocType",
|
||||
"issingle": 1,
|
||||
"module": "Website",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Blog Settings",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"name": "__common__",
|
||||
"parent": "Blog Settings",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"read": 1,
|
||||
"role": "Website Manager",
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Blog Settings"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "blog_title",
|
||||
"fieldtype": "Data",
|
||||
"label": "Blog Title"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "blog_introduction",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Blog Introduction"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "writers_introduction",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Writers Introduction"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
@ -12,13 +12,16 @@ body {
|
||||
background-color: #edede7;
|
||||
{% endif %}
|
||||
{% if doc.font or doc.google_web_font_for_text %}
|
||||
font-family: '{{ doc.google_web_font_for_text or doc.font }}', Verdana, Sans !important;
|
||||
{% endif %}
|
||||
{% if doc.font_size %}
|
||||
font-size: {{ doc.font_size }} !important;
|
||||
font-family: '{{ doc.google_web_font_for_text or doc.font }}', 'Helvetica Neue', Arial, Sans !important;
|
||||
{% endif %}
|
||||
{% if doc.font_size %}font-size: {{ doc.font_size }} !important;{% endif %}
|
||||
{% if doc.page_text %}color: #{{ doc.page_text }};{% endif %}
|
||||
}
|
||||
|
||||
{% if doc.page_links %}a, a:hover {
|
||||
color: #{{ doc.page_links }};
|
||||
}{% endif %}
|
||||
|
||||
{% if doc.font_size %}
|
||||
.small {
|
||||
font-size: {{ doc.small_font_size }} !important;
|
||||
@ -29,16 +32,17 @@ div.outer {
|
||||
background-color: #{{ doc.page_background or "fff" }};
|
||||
}
|
||||
|
||||
{% if doc.google_web_font_for_heading or doc.heading_font %}
|
||||
h1, h2, h3, h4, h5 {
|
||||
font-family: '{{ doc.google_web_font_for_heading or doc.heading_font }}', Arial, 'Helvetica Neue' !important;
|
||||
}
|
||||
{% endif %}
|
||||
{% if doc.heading_text_style %}
|
||||
h1, h2, h3, h4, h5 {
|
||||
{% if doc.google_web_font_for_heading or doc.heading_font %}h1, h2, h3, h4, h5 {
|
||||
font-family: '{{ doc.google_web_font_for_heading or doc.heading_font }}', 'Helvetica Neue', Arial !important;
|
||||
}{% endif %}
|
||||
|
||||
{% if doc.heading_text_style %}h1, h2, h3, h4, h5 {
|
||||
text-transform: {{ doc.heading_text_style }};
|
||||
}
|
||||
{% endif %}
|
||||
}{% endif %}
|
||||
|
||||
{% if doc.page_headings %}h1, h2, h3, h4, h5 {
|
||||
color: #{{ doc.page_headings }};
|
||||
}{% endif %}
|
||||
|
||||
{% if doc.page_border %}
|
||||
/* Page Border*/
|
||||
@ -64,20 +68,16 @@ div.web-footer {
|
||||
}
|
||||
|
||||
.navbar-inverse .brand,
|
||||
.navbar-inverse .brand:hover,
|
||||
.navbar-inverse .brand:focus,
|
||||
.navbar-inverse .nav > li > a {
|
||||
color: #{{ doc.top_bar_foreground or "fff"}};
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.navbar-inverse .brand:hover,
|
||||
.navbar-inverse .nav > li > a:hover,
|
||||
.navbar-inverse .brand:focus,
|
||||
.navbar-inverse .nav > li > a:focus {
|
||||
color: #{{ doc.top_bar_background or "aaa"}};
|
||||
}
|
||||
|
||||
.navbar-inverse .brand {
|
||||
color: #{{ doc.top_bar_foreground or "fff"}};
|
||||
color: #{{ doc.top_bar_background or "000"}};
|
||||
}
|
||||
|
||||
.navbar-inverse .navbar-text {
|
||||
|
@ -17,8 +17,9 @@
|
||||
|
||||
cur_frm.cscript.onload_post_render = function() {
|
||||
wn.require('lib/public/js/lib/jscolor/jscolor.js');
|
||||
cur_frm.fields_dict.background_color.input.className = 'color';
|
||||
cur_frm.fields_dict.page_background.input.className = 'color';
|
||||
cur_frm.fields_dict.top_bar_background.input.className = 'color';
|
||||
$.each(["background_color", "page_background", "page_text", "page_links",
|
||||
"top_bar_background", "top_bar_foreground", "page_headings"], function(i, v) {
|
||||
cur_frm.fields_dict[v].input.className = 'color';
|
||||
})
|
||||
jscolor.bind();
|
||||
}
|
@ -15,7 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import cint, cstr
|
||||
from webnotes import _
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
@ -26,6 +29,8 @@ class DocType:
|
||||
from jinja2 import Template
|
||||
import os
|
||||
|
||||
self.validate_colors()
|
||||
|
||||
with open(os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
'custom_template.css'), 'r') as f:
|
||||
@ -39,11 +44,24 @@ class DocType:
|
||||
|
||||
from webnotes.sessions import clear_cache
|
||||
clear_cache('Guest')
|
||||
|
||||
from website.utils import clear_cache
|
||||
clear_cache()
|
||||
|
||||
for f in ["small_font_size", "at_import", "heading_text_style"]:
|
||||
if f in self.doc.fields:
|
||||
del self.doc.fields[f]
|
||||
|
||||
def validate_colors(self):
|
||||
if self.doc.page_background==self.doc.page_text:
|
||||
webnotes.msgprint(_("Page text and background is same color. Please change."),
|
||||
raise_exception=1)
|
||||
|
||||
if self.doc.top_bar_background==self.doc.top_bar_foreground:
|
||||
webnotes.msgprint(_("Top Bar text and background is same color. Please change."),
|
||||
raise_exception=1)
|
||||
|
||||
|
||||
def prepare(self):
|
||||
if not self.doc.font_size:
|
||||
self.doc.font_size = '13px'
|
||||
|
@ -1,8 +1,8 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-25 11:35:10",
|
||||
"creation": "2013-03-08 11:36:53",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-03-08 09:58:49",
|
||||
"modified": "2013-03-12 11:34:32",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@ -65,6 +65,24 @@
|
||||
"fieldtype": "Data",
|
||||
"label": "Page Background"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "page_headings",
|
||||
"fieldtype": "Data",
|
||||
"label": "Page Headings"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "page_text",
|
||||
"fieldtype": "Data",
|
||||
"label": "Page Text"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "page_links",
|
||||
"fieldtype": "Data",
|
||||
"label": "Page Links"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "page_border",
|
||||
@ -88,9 +106,8 @@
|
||||
"description": "000 is black, fff is white",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "top_bar_foreground",
|
||||
"fieldtype": "Select",
|
||||
"label": "Top Bar Foreground",
|
||||
"options": "000\nFFF"
|
||||
"fieldtype": "Data",
|
||||
"label": "Top Bar Text"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
|
@ -1,8 +1,8 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-01-27 16:31:21",
|
||||
"creation": "2013-02-12 13:19:11",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-02-12 09:33:47",
|
||||
"modified": "2013-03-11 17:41:11",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@ -24,18 +24,16 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"amend": 0,
|
||||
"doctype": "DocPerm",
|
||||
"name": "__common__",
|
||||
"parent": "Web Page",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Website Manager",
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
"submit": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
@ -85,6 +83,13 @@
|
||||
"label": "Slideshow",
|
||||
"options": "Website Slideshow"
|
||||
},
|
||||
{
|
||||
"description": "Description for page header.",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description"
|
||||
},
|
||||
{
|
||||
"description": "Content in markdown format that appears on the main side of your page",
|
||||
"doctype": "DocField",
|
||||
@ -143,6 +148,17 @@
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"permlevel": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"cancel": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"permlevel": 1,
|
||||
"write": 0
|
||||
}
|
||||
]
|
@ -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 <img /> tag. Keep size as 200px x 30px",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "brand_html",
|
||||
"fieldtype": "Text",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Brand HTML"
|
||||
},
|
||||
{
|
||||
|
@ -99,10 +99,8 @@ def add_comment(args=None):
|
||||
return comment_html
|
||||
|
||||
@webnotes.whitelist(allow_guest=True)
|
||||
def add_subscriber():
|
||||
def add_subscriber(name, email_id):
|
||||
"""add blog subscriber to lead"""
|
||||
full_name = webnotes.form_dict.get('your_name')
|
||||
email = webnotes.form_dict.get('your_email_address')
|
||||
name = webnotes.conn.sql("""select name from tabLead where email_id=%s""", email)
|
||||
|
||||
from webnotes.model.doc import Document
|
||||
@ -114,22 +112,23 @@ def add_subscriber():
|
||||
if not lead.source: lead.source = 'Blog'
|
||||
lead.unsubscribed = 0
|
||||
lead.blog_subscriber = 1
|
||||
lead.lead_name = full_name
|
||||
lead.lead_name = name
|
||||
lead.email_id = email
|
||||
lead.save()
|
||||
|
||||
|
||||
def get_blog_content(blog_page_name):
|
||||
import website.utils
|
||||
content = website.utils.get_html(blog_page_name)
|
||||
content = split_blog_content(content)
|
||||
import webnotes.utils
|
||||
content = webnotes.utils.escape_html(content)
|
||||
return content
|
||||
|
||||
def get_blog_template_args():
|
||||
return {
|
||||
args = {
|
||||
"categories": webnotes.conn.sql_list("select name from `tabBlog Category` order by name")
|
||||
}
|
||||
args.update(webnotes.doc("Blog Settings", "Blog Settings").fields)
|
||||
return args
|
||||
|
||||
def get_writers_args():
|
||||
bloggers = webnotes.conn.sql("""select * from `tabBlogger`
|
||||
@ -138,10 +137,13 @@ def get_writers_args():
|
||||
if blogger.avatar and not "/" in blogger.avatar:
|
||||
blogger.avatar = "files/" + blogger.avatar
|
||||
|
||||
return {
|
||||
args = {
|
||||
"bloggers": bloggers,
|
||||
"texts": {
|
||||
"all_posts_by": _("All posts by")
|
||||
},
|
||||
"categories": webnotes.conn.sql_list("select name from `tabBlog Category` order by name")
|
||||
}
|
||||
}
|
||||
|
||||
args.update(webnotes.doc("Blog Settings", "Blog Settings").fields)
|
||||
return args
|
@ -59,7 +59,7 @@ def generate():
|
||||
blog_list = webnotes.conn.sql("""\
|
||||
select page_name as name, modified, creation, title from `tabBlog Post`
|
||||
where ifnull(published,0)=1
|
||||
order by creation desc, modified desc, name asc limit 100""", as_dict=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'
|
||||
|
@ -37,6 +37,12 @@ wn.module_page["Website"] = [
|
||||
description: wn._("Categorize blog posts."),
|
||||
doctype:"Blog Category"
|
||||
},
|
||||
{
|
||||
label: wn._("Blog Settings"),
|
||||
description: wn._("Write titles and introductions to your blog."),
|
||||
doctype:"Blog Settings",
|
||||
route: "Form/Blog Settings"
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
|
@ -19,6 +19,9 @@
|
||||
<link rel="icon" href="app/images/favicon.ico" type="image/x-icon">
|
||||
{% endif %}
|
||||
|
||||
{% if description %}
|
||||
<meta name="description" content="{{ description }}">
|
||||
{% endif %}
|
||||
|
||||
{% block header %}
|
||||
{% endblock %}
|
||||
|
@ -9,14 +9,17 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="span12">
|
||||
<h2>{{ title }}</h2>
|
||||
<div class="span12" itemscope itemtype="http://schema.org/BlogPost">
|
||||
<h2 itemprop="name headline">{{ title }}</h2>
|
||||
|
||||
<!-- begin blog content -->
|
||||
<div class="help" style="color: #aaa">
|
||||
{{ blogger_info and blogger_info.full_name or full_name }} / {{ updated }}</div>
|
||||
<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 />
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class="row">
|
||||
<div class="span2">
|
||||
<div class="avatar avatar-large">
|
||||
<img src="{{ blogger_info.avatar }}" />
|
||||
<img itemprop="thumbnailUrl" src="{{ blogger_info.avatar }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="span10">
|
||||
|
@ -3,12 +3,15 @@
|
||||
it is to be included in the blog/blog.html template
|
||||
#}
|
||||
|
||||
{% for comment in comment_list %}
|
||||
<div class="comment-row">
|
||||
<div class="comment-title">
|
||||
{{ comment.comment_by_fullname }} - {{ comment.comment_date }}:
|
||||
<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>
|
||||
<p class="comment-content">{{ comment.comment }}</p>
|
||||
<hr>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
66
website/templates/html/footer.html
Normal file
66
website/templates/html/footer.html
Normal file
@ -0,0 +1,66 @@
|
||||
<footer class="container"><div class="web-footer">
|
||||
{% if facebook_share or google_plus_one or twitter_share or linked_in_share %}
|
||||
<div class="social-icons" style="">
|
||||
<span style="font-size: 11px;">{{ share_text or "Share this page on: "}}</span>
|
||||
{% if google_plus_one %}
|
||||
<a href="https://plus.google.com/share?url={{ url }}"
|
||||
target="_blank"><i class="icon-google-plus"></i></a>
|
||||
{% endif %}
|
||||
{% if twitter_share %}
|
||||
<a href="https://twitter.com/intent/tweet?url={{ url }}&text={{ encoded_title }}"
|
||||
target="_blank" ><i class="icon-twitter"></i></a>
|
||||
{% endif %}
|
||||
{% if facebook_share %}
|
||||
<a href="https://www.facebook.com/sharer.php?u={{ url }}&t={{ encoded_title }}&via={{ twitter_share_via }}"
|
||||
target="_blank"><i class="icon-facebook"></i></a>
|
||||
{% endif %}
|
||||
{% if linked_in_share %}
|
||||
<a href="http://www.linkedin.com/shareArticle?mini=true&url={{ url }}&title={{ encoded_title }}"
|
||||
target="_blank"><i class="icon-linkedin"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<p style="float: right; clear: right;">
|
||||
<a style="font-size: 90%; color: #888;" href="attributions">ERPNext Powered</a>
|
||||
</p>
|
||||
<div class="web-footer-menu">
|
||||
<ul>
|
||||
{% for item in footer_items %}
|
||||
<li><a href="{{ item.url }}" {{ item.target }}
|
||||
data-label="{{ item.label }}">{{ item.label }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% if copyright %}
|
||||
<div class="web-footer-copyright">© {{ copyright }}</div>
|
||||
{% endif %}
|
||||
{% if address %}
|
||||
{{ address }}
|
||||
{% endif %}
|
||||
<p><div class="input-append" style="text-align: center; margin:30px 0px;">
|
||||
<input class="span3" id="footer-subscribe-email" type="text" placeholder="Your email address...">
|
||||
<button class="btn" type="button" id="footer-subscribe-button">Stay Updated</button>
|
||||
</div></p>
|
||||
<script>
|
||||
$("#footer-subscribe-button").click(function() {
|
||||
if($("#footer-subscribe-email").val()) {
|
||||
erpnext.send_message({
|
||||
subject:"Subscribe me",
|
||||
sender: $("#footer-subscribe-email").val(),
|
||||
message: "Subscribe to newsletter (via website footer).",
|
||||
callback: function(r) {
|
||||
console.log(r)
|
||||
if(!r.exc) {
|
||||
$("#footer-subscribe-email").val("").attr('disabled', true);
|
||||
$("#footer-subscribe-button").html("Thank You :)")
|
||||
.addClass("btn-success").attr("disabled", true);
|
||||
} else {
|
||||
$("#footer-subscribe-button").html("Error :( Not a valid id?").addClass("btn-danger");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</footer>
|
57
website/templates/html/navbar.html
Normal file
57
website/templates/html/navbar.html
Normal file
@ -0,0 +1,57 @@
|
||||
<div class="navbar navbar-inverse"
|
||||
style="">
|
||||
<div class="navbar-inner">
|
||||
{% 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>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<div class="nav-collapse collapse">
|
||||
<ul class="nav">
|
||||
{% for page in top_bar_items %}
|
||||
{% if not page.parent_label %}
|
||||
<li data-label="{{ page.label }}"
|
||||
{% if page.child_items %}
|
||||
class="dropdown"
|
||||
{% endif %}>
|
||||
<a href="{{ page.url or '#' }}"
|
||||
{% if page.child_items %}
|
||||
class="dropdown-toggle"
|
||||
onclick="return false;"
|
||||
data-toggle="dropdown"
|
||||
{% endif %}
|
||||
{{ page.target or ''}}>
|
||||
{{ page.label }}
|
||||
{% if page.child_items %}
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for child in page.child_items %}
|
||||
<li data-label="{{ child.label }}">
|
||||
<a {% if child.indent %}
|
||||
style="padding-left:
|
||||
{{(int(child.indent)+1)*15 }}px"
|
||||
{% endif %}
|
||||
href="{{ child.url }}" {{ child.target or '' }}>
|
||||
{{ child.label }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<ul class="nav pull-right">
|
||||
<li id="login-topbar-item"><a href="login">Login</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('.dropdown-toggle').dropdown()</script>
|
@ -4,107 +4,17 @@
|
||||
<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">
|
||||
<div class="navbar{% if top_bar_background=="Black" %} navbar-inverse{% endif %}"
|
||||
style="">
|
||||
<div class="navbar-inner">
|
||||
<a class="brand" href="index">{{ brand_html }}</a>
|
||||
<div class="container">
|
||||
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<div class="nav-collapse collapse">
|
||||
<ul class="nav">
|
||||
{% for page in top_bar_items %}
|
||||
{% if not page.parent_label %}
|
||||
<li data-label="{{ page.label }}"
|
||||
{% if page.child_items %}
|
||||
class="dropdown"
|
||||
{% endif %}>
|
||||
<a href="{{ page.url or '#' }}"
|
||||
{% if page.child_items %}
|
||||
class="dropdown-toggle"
|
||||
onclick="return false;"
|
||||
data-toggle="dropdown"
|
||||
{% endif %}
|
||||
{{ page.target or ''}}>
|
||||
{{ page.label }}
|
||||
{% if page.child_items %}
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for child in page.child_items %}
|
||||
<li data-label="{{ child.label }}">
|
||||
<a {% if child.indent %}
|
||||
style="padding-left:
|
||||
{{(int(child.indent)+1)*15 }}px"
|
||||
{% endif %}
|
||||
href="{{ child.url }}" {{ child.target or '' }}>
|
||||
{{ child.label }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<ul class="nav pull-right">
|
||||
<li id="login-topbar-item"><a href="login">Login</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('.dropdown-toggle').dropdown()</script>
|
||||
{% include "html/navbar.html" %}
|
||||
<div class="content row" id="page-{{ name }}" style="display: block;">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="container"><div class="web-footer">
|
||||
{% if facebook_share or google_plus_one or twitter_share or linked_in_share %}
|
||||
<div class="social-icons" style="">
|
||||
<span style="font-size: 11px;">{{ share_text or "Share this page on: "}}</span>
|
||||
{% if google_plus_one %}
|
||||
<a href="https://plus.google.com/share?url={{ url }}"
|
||||
target="_blank"><i class="icon-google-plus"></i></a>
|
||||
{% endif %}
|
||||
{% if twitter_share %}
|
||||
<a href="https://twitter.com/intent/tweet?url={{ url }}&text={{ encoded_title }}"
|
||||
target="_blank" ><i class="icon-twitter"></i></a>
|
||||
{% endif %}
|
||||
{% if facebook_share %}
|
||||
<a href="https://www.facebook.com/sharer.php?u={{ url }}&t={{ encoded_title }}&via={{ twitter_share_via }}"
|
||||
target="_blank"><i class="icon-facebook"></i></a>
|
||||
{% endif %}
|
||||
{% if linked_in_share %}
|
||||
<a href="http://www.linkedin.com/shareArticle?mini=true&url={{ url }}&title={{ encoded_title }}"
|
||||
target="_blank"><i class="icon-linkedin"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<p style="float: right; clear: right;">
|
||||
<a style="font-size: 90%; color: #888;" href="attributions">ERPNext Powered</a></p>
|
||||
<div class="web-footer-menu"><ul>
|
||||
{% for item in footer_items %}
|
||||
<li><a href="{{ item.url }}" {{ item.target }}
|
||||
data-label="{{ item.label }}">{{ item.label }}</a></li>
|
||||
{% endfor %}
|
||||
</ul></div>
|
||||
{% if copyright %}
|
||||
<div class="web-footer-copyright">© {{ copyright }}</div>
|
||||
{% endif %}
|
||||
{% if address %}
|
||||
{{ address }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</footer>
|
||||
{% include "html/footer.html" %}
|
||||
|
||||
{% endblock %}
|
@ -5,10 +5,12 @@
|
||||
{% for slide in obj.slides %}
|
||||
<div class="{% if slide.idx==1 %}active {% endif %}item">
|
||||
<img src="{{ slide.image }}" />
|
||||
{% if slide.heading or slide.description %}
|
||||
<div class="carousel-caption">
|
||||
<h4>{{ slide.heading }}</h4>
|
||||
<p>{{ slide.description }}</p>
|
||||
{% if slide.heading %}<h4>{{ slide.heading }}</h4>{% endif %}
|
||||
{% if slide.heading %}<p>{{ slide.description }}</p>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
@ -25,11 +25,11 @@ $(document).ready(function() {
|
||||
})
|
||||
|
||||
if(get_url_arg("by_name")) {
|
||||
$("#blog-title").html("Posts by " + get_url_arg("by_name"));
|
||||
$("#blot-subtitle").html("Posts by " + get_url_arg("by_name")).toggle(true);
|
||||
}
|
||||
|
||||
if(get_url_arg("category")) {
|
||||
$("#blog-title").html("Posts filed under " + get_url_arg("category"));
|
||||
$("#blot-subtitle").html("Posts filed under " + get_url_arg("category")).toggle(true);
|
||||
}
|
||||
|
||||
});
|
||||
@ -48,6 +48,7 @@ var blog = {
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$(".progress").toggle(false);
|
||||
if(data.exc) console.log(data.exc);
|
||||
blog.render(data.message);
|
||||
}
|
||||
@ -81,10 +82,10 @@ var blog = {
|
||||
</div><hr>', b)).appendTo($wrap);
|
||||
});
|
||||
blog.start += (data.length || 0);
|
||||
if(!data.length) {
|
||||
if(!data.length || data.length < 20) {
|
||||
if(blog.start) {
|
||||
$("#next-page").toggle(false)
|
||||
.parent().append("<div class='alert'>Nothing more to show.</div>");
|
||||
.parent().append("<div class='alert alert-info'>Nothing more to show.</div>");
|
||||
} else {
|
||||
$("#next-page").toggle(false)
|
||||
.parent().append("<div class='alert'>No blogs written yet.</div>");
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="layout-attributions span12">
|
||||
<h3>This website is made using these Awesome Open Source Projects <i class="icon-heart" style="color: red"></i></h3>
|
||||
<h3>This website is made using these awesome Open Source projects <i class="icon-heart" style="color: red"></i></h3>
|
||||
<hr>
|
||||
<table class="table table-bordered table-striped">
|
||||
<tbody>
|
||||
@ -37,6 +37,10 @@
|
||||
<td><a href="http://httpd.apache.org">Apache HTTPD web server</a></td>
|
||||
<td>The Number One HTTP Server On The Internet.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="http://memcached.org/">Memcached</a></td>
|
||||
<td>Free & open source, high-performance, distributed memory object caching system.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="http://python.org/">Python Programming Language</a></td>
|
||||
<td>The "batteries included" language that lets you write elegant code, quickly.<br><br>Python Libraries:
|
||||
@ -80,6 +84,10 @@
|
||||
<td><a href="https://github.com/mleibman/SlickGrid">SlickGrid</a></td>
|
||||
<td>A lightning fast JavaScript grid/spreadsheet.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="http://arshaw.com/fullcalendar/">FullCalendar</a></td>
|
||||
<td>FullCalendar is a jQuery plugin that provides a full-sized, drag and drop calendar.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="http://www.flotcharts.org/">Flot Charting Library</a></td>
|
||||
<td>Attractive JavaScript plotting for jQuery.</td>
|
||||
@ -96,13 +104,37 @@
|
||||
<td><a href="http://jscolor.com/">JSColor - Color Picker</a></td>
|
||||
<td>HTML/Javascript Color Picker.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="http://qunitjs.com/">QUnit</a></td>
|
||||
<td>A JavaScript Unit Testing framework.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/dcneiner/Downloadify">Downloadify - Flash Download Widget</a></td>
|
||||
<td>A tiny javascript + Flash library that enables the creation and download of text files without server interaction.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
<h3>ERPNext License: GNU/General Public License</h3>
|
||||
<div class="well">
|
||||
<p><b>ERPNext - Open Source, web based ERP</b></p>
|
||||
<p>Copyright © 2012, Web Notes Technologies Pvt Ltd, India</p>
|
||||
|
||||
<p class="alert">Note: A link to this page must be easily accessible.</p>
|
||||
<p>This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the <b>GNU General Public License</b> as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.</p>
|
||||
|
||||
<p>This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.</p>
|
||||
|
||||
<p>For complete license see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a></p>
|
||||
</div>
|
||||
<p class="alert">Note: A link to this page must be easily accessible and all other ERPNext branding must remain as it is.</p>
|
||||
<hr>
|
||||
<p>For more information please write to us at support@erpnext.com</p>
|
||||
</div>
|
||||
{% endblock %}
|
@ -12,8 +12,15 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="span12">
|
||||
<h2 id="blog-title">Blog</h2>
|
||||
<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="bar" style="width: 100%;"></div>
|
||||
</div>
|
||||
<div id="blog-list">
|
||||
<!-- blog list will be generated dynamically -->
|
||||
</div>
|
||||
|
@ -5,6 +5,9 @@
|
||||
{% block content %}
|
||||
<div class="span12">
|
||||
<h2 id="blog-title">Blog Writers</h2>
|
||||
{% if writers_introduction %}
|
||||
<p>{{ writers_introduction }}</p>
|
||||
{% endif %}
|
||||
<hr>
|
||||
{% for blogger_info in bloggers %}
|
||||
{% include "html/blogger.html" %}
|
||||
|
@ -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(""))
|
||||
|
Loading…
Reference in New Issue
Block a user