Permalink
Browse files

Added a SHOW_VIEWS_ON_HOMEPAGE setting which does what it says on the…

… tin.
  • Loading branch information...
1 parent cff0b45 commit d3c7705c6a39102b4eefadb824744551864819af @orf committed Oct 3, 2012
Showing with 4 additions and 1 deletion.
  1. +2 −0 create_config.py
  2. +2 −1 templates/index.html
View
@@ -12,6 +12,7 @@ def input_with_default(prompt, default):
SETTINGS = (
input_with_default("Posts per page", 5),
input_with_default("Show the post content on the homepage","y").lower()[0] == "y",
+ input_with_default("Show post view count on the homepage?","n").lower()[0] == "y",
input_with_default("Admin username","admin"),
generate_password_hash(input_with_default("Admin password","password")),
input_with_default("Google analytics ID",""),
@@ -28,6 +29,7 @@ def input_with_default(prompt, default):
fd.write("""# -*- coding: utf-8 -*-\n
POSTS_PER_PAGE = %s
POST_CONTENT_ON_HOMEPAGE = %s
+SHOW_VIEWS_ON_HOMEPAGE = %s
ADMIN_USERNAME = '%s'
ADMIN_PASSWORD = '%s'
ANALYTICS_ID = '%s'
View
@@ -16,7 +16,8 @@
<br/>
{{ post.render_content()|safe }}
{% else %}
- <p style="color: #999;">Posted: {{ post.created_at.strftime('%B %d, %Y') }}, viewed {{ post.views }} times</p>
+ <p style="color: #999;">Posted: {{ post.created_at.strftime('%B %d, %Y') }}
+ {% if config.get('SHOW_VIEWS_ON_HOMEPAGE',False) %}, viewed {{ post.views }} times{% endif %}</p>
{% endif %}
</section>
</div>

0 comments on commit d3c7705

Please sign in to comment.