From 03a26f2ed24a0fda5b73178de8451b1526a8b297 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Sat, 19 May 2012 10:53:15 +0530
Subject: [PATCH] list blogs based on creation date
---
erpnext/website/doctype/blog/blog_page.js | 8 ++++----
erpnext/website/page/blog/blog.js | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/erpnext/website/doctype/blog/blog_page.js b/erpnext/website/doctype/blog/blog_page.js
index 1b8523bd91..4b283920fa 100644
--- a/erpnext/website/doctype/blog/blog_page.js
+++ b/erpnext/website/doctype/blog/blog_page.js
@@ -22,7 +22,7 @@ pscript['onload_{{ doc.name }}'] = function(wrapper) {
parent: $(wrapper).find('.recent-posts'),
no_toolbar: true,
query: 'select name, title, left(content, 100) as content from tabBlog\
- where ifnull(published,0)=1 and name!="{{ doc.name }}" order by modified desc',
+ where ifnull(published,0)=1 and name!="{{ doc.name }}" order by creation desc',
hide_refresh: true,
render_row: function(parent, data) {
//console.log(data);
@@ -37,12 +37,12 @@ pscript['onload_{{ doc.name }}'] = function(wrapper) {
wrapper.comment_list = new wn.ui.Listing({
parent: $(wrapper).find('.blog-comments').get(0),
no_toolbar: true,
- query: 'select comment, comment_by_fullname, modified\
+ query: 'select comment, comment_by_fullname, creation\
from `tabComment` where comment_doctype="Page"\
- and comment_docname="{{ doc.name }}" order by modified desc',
+ and comment_docname="{{ doc.name }}" order by creation desc',
no_result_message: 'Be the first one to comment',
render_row: function(parent, data) {
- data.comment_date = prettyDate(data.modified);
+ data.comment_date = prettyDate(data.creation);
$(parent).html(repl("\
%(comment_by_fullname)s | %(comment_date)s:\
\
diff --git a/erpnext/website/page/blog/blog.js b/erpnext/website/page/blog/blog.js
index 356529f096..5a10998c6f 100644
--- a/erpnext/website/page/blog/blog.js
+++ b/erpnext/website/page/blog/blog.js
@@ -18,18 +18,18 @@
pscript.onload_blog = function(wrapper) {
wrapper.blog_list = new wn.ui.Listing({
parent: $(wrapper).find('#blog-list').get(0),
- query: 'select tabBlog.name, title, left(content, 1000) as content, tabBlog.modified, \
+ query: 'select tabBlog.name, title, left(content, 1000) as content, tabBlog.creation, \
ifnull(first_name, "") as first_name, ifnull(last_name, "") as last_name \
from tabProfile, tabBlog\
where ifnull(published,0)=1 and tabBlog.owner = tabProfile.name \
- order by tabBlog.modified desc',
+ order by tabBlog.creation desc',
hide_refresh: true,
no_toolbar: true,
render_row: function(parent, data) {
if(data.content && data.content.length==1000) data.content += '... (read on)';
data.content = wn.markdown(data.content);
if(data.last_name) data.last_name = ' ' + data.last_name;
- data.date = prettyDate(data.modified);
+ data.date = prettyDate(data.creation);
parent.innerHTML = repl('%(title)s
\
By %(first_name)s%(last_name)s, %(date)s
\
%(content)s
\