Favicon for website
Started work on comments to be embedded in blog page
diff --git a/erpnext/website/templates/base.html b/erpnext/website/templates/base.html
index cd64139..8639a8f 100644
--- a/erpnext/website/templates/base.html
+++ b/erpnext/website/templates/base.html
@@ -3,14 +3,21 @@
<meta charset="utf-8">
<title>{% block title %}{% endblock %}</title>
<meta name="generator" content="wnframework">
- <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
- <link rel="icon" href="images/favicon.ico" type="image/x-icon">
<script type="text/javascript" src="js/lib/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/all-web.js"></script>
<script type="text/javascript" src="js/wn-web.js"></script>
<link type="text/css" rel="stylesheet" href="css/all-web.css">
<link type="text/css" rel="stylesheet" href="css/wn-web.css">
+ {% if favicon %}
+ <link rel="shortcut icon" href="files/{{ favicon }}" type="image/x-icon">
+ <link rel="icon" href="files/{{ favicon }}" type="image/x-icon">
+ {% else %}
+ <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
+ <link rel="icon" href="images/favicon.ico" type="image/x-icon">
+ {% endif %}
+
+
{% block header %}
{% endblock %}
</head>
diff --git a/erpnext/website/templates/blog/blog.html b/erpnext/website/templates/blog/blog.html
index 03a2ed7..9132e52 100644
--- a/erpnext/website/templates/blog/blog.html
+++ b/erpnext/website/templates/blog/blog.html
@@ -11,21 +11,51 @@
{{ content_html }}
<hr><h3>Comments</h3>
<br>
- <div class="blog-comments"></div>
+ <div class="blog-comments">
+ {% for comment in comment_list %}
+ <div class="comment-row">
+ <div class="comment-title">
+ {{ comment.comment_by_fullname }} - {{ comment.comment_date }}:
+ {{ comment.comment_date_type }}
+ </div>
+ <p class="comment-content">{{ comment.comment }}</p>
+ <hr>
+ </div>
+ {% endfor %}
+ </div>
</div>
<div class="layout-side-section">
<p><a href="blog.html">All Blogs</a></p>
- <h4>Recent Posts</h4>
- <div class="recent-posts" style="min-height: 100px;"></div>
+ <br />
<h4>Subscribe</h4>
<p>
<img src="images/feed.png" style="margin-right: 4px; margin-bottom: -4px">
<a href="rss.xml" target="_blank">RSS Feed</a>
</p>
+ <br />
+ <h4>Recent Posts</h4>
+ <div class="recent-posts" style="min-height: 100px;"></div>
</div>
<div style="clear: both"></div>
</div>
</div>
+{% endblock %}
+
+{% block css %}
+ <style>
+ .comment-title {
+ color:#777;
+ }
+
+ .comment-content {
+ margin-left: 20px;
+ }
+
+/* .comment-row {
+ padding: 5px 0px;
+ }
+*/ </style>
+
{% endblock %}
\ No newline at end of file
diff --git a/erpnext/website/templates/blog/blog.js b/erpnext/website/templates/blog/blog.js
index 80cb813..3ad1575 100644
--- a/erpnext/website/templates/blog/blog.js
+++ b/erpnext/website/templates/blog/blog.js
@@ -18,7 +18,10 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// js inside blog page
+wn.provide('erpnext.blog');
wn.pages['{{ name }}'].onload = function(wrapper) {
+ erpnext.blog.wrapper = wrapper;
+
// sidebar
wrapper.recent_list = new wn.ui.Listing({
parent: $(wrapper).find('.recent-posts'),
@@ -31,57 +34,72 @@
if(data.content && data.content.length==100) data.content += '...';
parent.innerHTML = repl('<a href="%(name)s.html">%(title)s</a>\
<div class="comment">%(content)s</div><br>', data);
+
+ // adjust page height depending on sidebar height
+ erpnext.blog.adjust_page_height(wrapper);
},
page_length: 5,
});
wrapper.recent_list.run();
-
- wrapper.comment_list = new wn.ui.Listing({
- parent: $(wrapper).find('.blog-comments').get(0),
- no_toolbar: true,
- query: 'select comment, comment_by_fullname, creation\
- from `tabComment` where comment_doctype="Page"\
- and comment_docname="{{ name }}" order by creation desc',
- no_result_message: 'Be the first one to comment',
- render_row: function(parent, data) {
- data.comment_date = prettyDate(data.creation);
- $(parent).html(repl("<div style='color:#777'>\
- %(comment_by_fullname)s | %(comment_date)s:\
- </div>\
- <p style='margin-left: 20px;'>%(comment)s</p><br>", data))
- },
- hide_refresh: true,
- });
- wrapper.comment_list.run();
-
- // add comment
- $(wrapper).find('.layout-main-section').append('<br><button class="btn add-comment">\
- Add Comment</button>');
- $(wrapper).find('button.add-comment').click(function(){
- d = new wn.widgets.Dialog({
- title: 'Add Comment',
- fields: [
- {fieldname:'comment_by_fullname', label:'Your Name', reqd:1, fieldtype:'Data'},
- {fieldname:'comment_by', label:'Email Id', reqd:1, fieldtype:'Data'},
- {fieldname:'comment', label:'Comment', reqd:1, fieldtype:'Text'},
- {fieldname:'post', label:'Post', fieldtype:'Button'}
- ]
- });
- d.fields_dict.post.input.onclick = function() {
- var btn = this;
- var args = d.get_values();
- if(!args) return;
- args.comment_doctype = 'Page';
- args.comment_docname = '{{ name }}';
- $(btn).set_working();
- $c('webnotes.widgets.form.comments.add_comment', args, function(r) {
- $(btn).done_working();
- d.hide();
- wrapper.comment_list.refresh();
- })
- }
- d.show();
- })
}
+erpnext.blog.adjust_page_height = function(wrapper) {
+ if (!wrapper) { wrapper = erpnext.blog.wrapper; }
+ if (!wrapper) { return; }
+
+ // adjust page height based on sidebar height
+ var $main_page = $(wrapper).find('.layout-main-section');
+ var $sidebar = $(wrapper).find('.layout-side-section');
+ if ($sidebar.height() > $main_page.height()) {
+ $main_page.height($sidebar.height());
+ }
+}
+ // wrapper.comment_list = new wn.ui.Listing({
+ // parent: $(wrapper).find('.blog-comments').get(0),
+ // no_toolbar: true,
+ // query: 'select comment, comment_by_fullname, creation\
+ // from `tabComment` where comment_doctype="Page"\
+ // and comment_docname="{{ name }}" order by creation desc',
+ // no_result_message: 'Be the first one to comment',
+ // render_row: function(parent, data) {
+ // data.comment_date = prettyDate(data.creation);
+ // $(parent).html(repl("<div style='color:#777'>\
+ // %(comment_by_fullname)s | %(comment_date)s:\
+ // </div>\
+ // <p style='margin-left: 20px;'>%(comment)s</p><br>", data))
+ // },
+ // hide_refresh: true,
+ // });
+ // wrapper.comment_list.run();
+ //
+ // // add comment
+ // $(wrapper).find('.layout-main-section').append('<br><button class="btn add-comment">\
+ // Add Comment</button>');
+ // $(wrapper).find('button.add-comment').click(function(){
+ // d = new wn.widgets.Dialog({
+ // title: 'Add Comment',
+ // fields: [
+ // {fieldname:'comment_by_fullname', label:'Your Name', reqd:1, fieldtype:'Data'},
+ // {fieldname:'comment_by', label:'Email Id', reqd:1, fieldtype:'Data'},
+ // {fieldname:'comment', label:'Comment', reqd:1, fieldtype:'Text'},
+ // {fieldname:'post', label:'Post', fieldtype:'Button'}
+ // ]
+ // });
+ // d.fields_dict.post.input.onclick = function() {
+ // var btn = this;
+ // var args = d.get_values();
+ // if(!args) return;
+ // args.comment_doctype = 'Page';
+ // args.comment_docname = '{{ name }}';
+ // $(btn).set_working();
+ // $c('webnotes.widgets.form.comments.add_comment', args, function(r) {
+ // $(btn).done_working();
+ // d.hide();
+ // wrapper.comment_list.refresh();
+ // })
+ // }
+ // d.show();
+ // })
+
+
{% endblock %}
diff --git a/erpnext/website/templates/login/login.html b/erpnext/website/templates/login/login.html
index 834fc27..62d252f 100644
--- a/erpnext/website/templates/login/login.html
+++ b/erpnext/website/templates/login/login.html
@@ -1,16 +1,7 @@
{% extends "login/login.js" %}
-{% block css %}
- <style>
- #login_wrapper {
- width: 300px !important;
- margin: 20px auto;
- }
-
- .login-banner {
- margin-bottom: 20px;
- }
- </style>
+{% block title %}
+ Login Page
{% endblock %}
{% block content %}
@@ -50,4 +41,17 @@
</div>
</div>
+{% endblock %}
+
+{% block css %}
+ <style>
+ #login_wrapper {
+ width: 300px !important;
+ margin: 20px auto;
+ }
+
+ .login-banner {
+ margin-bottom: 20px;
+ }
+ </style>
{% endblock %}
\ No newline at end of file
diff --git a/erpnext/website/templates/product/product.js b/erpnext/website/templates/product/product.js
index 9e51334..f7745d7 100644
--- a/erpnext/website/templates/product/product.js
+++ b/erpnext/website/templates/product/product.js
@@ -25,18 +25,25 @@
erpnext.products.make_similar_products(wrapper);
// if website image missing, autogenerate one
- var $img = $('.product-page-content').find('.img-area');
+ var $img = $(wrapper).find('.product-page-content .img-area');
if ($img && $img.length > 0) {
$img.append(wn.dom.placeholder(160, "{{ item_name }}"));
}
+ erpnext.products.adjust_page_height(wrapper);
+
+}
+
+erpnext.products.adjust_page_height = function(wrapper) {
+ if (!wrapper) { wrapper = erpnext.products.wrapper; }
+ if (!wrapper) { return; }
+
// adjust page height based on sidebar height
- var $main_page = $('.layout-main-section');
- var $sidebar = $('.layout-side-section');
+ var $main_page = $(wrapper).find('.layout-main-section');
+ var $sidebar = $(wrapper).find('.layout-side-section');
if ($sidebar.height() > $main_page.height()) {
$main_page.height($sidebar.height());
}
-
}
erpnext.products.make_similar_products = function(wrapper) {
@@ -78,6 +85,9 @@
$(parent).find('.img-area').append(wn.dom.placeholder(55,
data.item_name));
}
+
+ // adjust page height, if sidebar height keeps increasing
+ erpnext.products.adjust_page_height(wrapper);
}
});
wrapper.similar.run();
diff --git a/erpnext/website/templates/product/product_list.html b/erpnext/website/templates/product/product_list.html
index 24d5590..c8dfd24 100644
--- a/erpnext/website/templates/product/product_list.html
+++ b/erpnext/website/templates/product/product_list.html
@@ -1,6 +1,8 @@
{% extends "product/product_list.js" %}
-{% block title %}Products{% endblock %}
+{% block title %}
+ Products
+{% endblock %}
{% block content %}
<div class="layout-wrapper layout-wrapper-background">