Merge branch 'master' into dev

This commit is contained in:
Anand Doshi 2012-07-13 01:15:08 +05:30
commit aa3ab5ec59
4 changed files with 10 additions and 7 deletions

View File

@ -104,7 +104,7 @@ def add_comment(args=None):
return comment_html return comment_html
def get_content(blog_page_name): def get_blog_content(blog_page_name):
import website.web_cache import website.web_cache
content = website.web_cache.get_html(blog_page_name) content = website.web_cache.get_html(blog_page_name)

View File

@ -20,6 +20,8 @@
<div class="help">By {{ full_name }} on {{ updated }}</div> <div class="help">By {{ full_name }} on {{ updated }}</div>
<br> <br>
{{ content_html }} {{ content_html }}
<!-- end blog content -->
<hr> <hr>
<h3>Comments</h3><br> <h3>Comments</h3><br>
<div class="blog-comments"> <div class="blog-comments">
@ -32,11 +34,10 @@
{% endif %} {% endif %}
{% include 'html/comment.html' %} {% include 'html/comment.html' %}
</div>
<!-- end blog content -->
<button class="btn add-comment">Add Comment</button> <button class="btn add-comment">Add Comment</button>
</div> </div>
</div>
<div class="layout-side-section"> <div class="layout-side-section">
<p><a href="blog.html">All Blogs</a></p> <p><a href="blog.html">All Blogs</a></p>

View File

@ -26,7 +26,7 @@ wn.pages['{{ name }}'].onload = function(wrapper) {
data.content += repl('... <a href="%(name)s.html">(read on)</a>', data); data.content += repl('... <a href="%(name)s.html">(read on)</a>', data);
} }
parent.innerHTML = repl('<h2><a href="%(name)s.html">%(title)s</a></h2>\ parent.innerHTML = repl('<h2><a href="%(name)s.html">%(title)s</a></h2>\
<p>%(content)s</p><br>', data); %(content)s<br /><br />', data);
}, },
page_length: 10 page_length: 10
}); });

View File

@ -219,7 +219,7 @@ def delete_cache(page_name):
import webnotes import webnotes
webnotes.conn.sql("""delete from `tabWeb Cache` where name=%s""", page_name) webnotes.conn.sql("""delete from `tabWeb Cache` where name=%s""", page_name)
def refresh_cache(): def refresh_cache(build=False):
"""delete and re-create web cache entries""" """delete and re-create web cache entries"""
import webnotes import webnotes
@ -239,7 +239,9 @@ def refresh_cache():
for result in webnotes.conn.sql(query_map[dt], as_dict=1): for result in webnotes.conn.sql(query_map[dt], as_dict=1):
create_cache(result['page_name'], dt, result['name']) create_cache(result['page_name'], dt, result['name'])
clear_cache(result['page_name'], dt, result['name']) clear_cache(result['page_name'], dt, result['name'])
if build: load_into_cache(result['page_name'])
for page_name in get_predefined_pages(): for page_name in get_predefined_pages():
create_cache(page_name, None, None) create_cache(page_name, None, None)
clear_cache(page_name, None, None) clear_cache(page_name, None, None)
if build: load_into_cache(page_name)