fixes in blog list

This commit is contained in:
Anand Doshi 2012-07-13 01:14:52 +05:30
parent f01059fd3e
commit 200c443b72
4 changed files with 10 additions and 7 deletions

View File

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

View File

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

View File

@ -26,7 +26,7 @@ wn.pages['{{ name }}'].onload = function(wrapper) {
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>\
<p>%(content)s</p><br>', data);
%(content)s<br /><br />', data);
},
page_length: 10
});

View File

@ -219,7 +219,7 @@ def delete_cache(page_name):
import webnotes
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"""
import webnotes
@ -239,7 +239,9 @@ def refresh_cache():
for result in webnotes.conn.sql(query_map[dt], as_dict=1):
create_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():
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)