Merge branch 'master' into edge

This commit is contained in:
Rushabh Mehta
2013-03-08 11:09:48 +05:30
30 changed files with 829 additions and 173 deletions

View File

@@ -0,0 +1,13 @@
<div class="span12">
<hr />
{% if categories %}
<h5>Explore posts by categories</h5>
<ul class="breadcrumb" style="background-color: transparent; padding-left: 0px;">
{% for category in categories %}
<li><a href="blog?category={{ category }}">{{ category }}</a>
{% if not loop.last %}<span class="divider">/</span>{% endif %}</li>
{% endfor %}
<br><br>
{% endif %}
<p>Show posts by <a href="blog">everyone</a>. Meet the <a href="writers">writers</a> of this blog</p>
</div>

View File

@@ -13,41 +13,41 @@
<h2>{{ title }}</h2>
<!-- begin blog content -->
<div class="help">By {{ full_name }} on {{ updated }}</div>
<div class="help" style="color: #aaa">
{{ blogger_info and blogger_info.full_name or full_name }} / {{ updated }}</div>
<br>
{{ content_html }}
<!-- end blog content -->
{% if blogger_info %}
<hr />
{% include "html/blogger.html" %}
{% endif %}
<hr>
<h3>Comments</h3><br>
<h3>{{ texts.comments }}</h3><br>
<div class="blog-comments">
{% if not comment_list %}
<div class="alert no-comment">
<p>Be the first one to comment</p>
<div class="no-comment">
<p>{{ texts.first_comment }}</p>
</div>
{% endif %}
{% include 'html/comment.html' %}
</div>
<div><button class="btn add-comment">Add Comment</button></div>
<div><button class="btn add-comment">{{ texts.add_comment }}</button></div>
<div style="display: none; margin-top: 10px;"
id="comment-form" class="well">
id="comment-form">
<div class="alert" style="display:none;"></div>
<form>
<p>
<input name="comment_by_fullname" placeholder="Your Name" />
</p>
<p>
<input name="comment_by" placeholder="Your Email Id" />
</p>
<p>
<fieldset>
<input name="comment_by_fullname" placeholder="Your Name" type="text"/><br>
<input name="comment_by" placeholder="Your Email Id" type="text"/><br>
<textarea name="comment" placeholder="Comment" style="width: 300px; height: 120px;"/>
</textarea>
</p>
<p>
<button class="btn btn-info" id="submit-comment">Submit</button>
</textarea><br>
<button class="btn btn-info" id="submit-comment">{{ texts.submit }}</button>
</fieldset>
</form>
</div>
</div>
{% include 'html/blog_footer.html' %}
{% endblock %}

View File

@@ -0,0 +1,13 @@
<div class="row">
<div class="span2">
<div class="avatar avatar-large">
<img src="{{ blogger_info.avatar }}" />
</div>
</div>
<div class="span10">
<h4>{{ blogger_info.full_name }}</h4>
<p style="color: #999">{{ blogger_info.bio }}</p>
<p><a href="blog?by={{ blogger_info.name }}&by_name={{ blogger_info.full_name }}">
{{ texts.all_posts_by }} {{ blogger_info.full_name }}</a></p>
</div>
</div>

View File

@@ -6,7 +6,7 @@
<div class="container">
<div class="outer">
<div class="navbar{% if top_bar_background=="Black" %} navbar-inverse{% endif %}"
style="margin-bottom: 0px;">
style="">
<div class="navbar-inner">
<a class="brand" href="index">{{ brand_html }}</a>
<div class="container">

View File

@@ -23,6 +23,15 @@ $(document).ready(function() {
$("#next-page").click(function() {
blog.get_list();
})
if(get_url_arg("by_name")) {
$("#blog-title").html("Posts by " + get_url_arg("by_name"));
}
if(get_url_arg("category")) {
$("#blog-title").html("Posts filed under " + get_url_arg("category"));
}
});
var blog = {
@@ -33,10 +42,13 @@ var blog = {
url: "server.py",
data: {
cmd: "website.helpers.blog.get_blog_list",
start: blog.start
start: blog.start,
by: get_url_arg("by"),
category: get_url_arg("category")
},
dataType: "json",
success: function(data) {
if(data.exc) console.log(data.exc);
blog.render(data.message);
}
});
@@ -53,11 +65,20 @@ var blog = {
b.comment_text = b.comments + ' comments.'
}
$(repl('<h2><a href="%(page_name)s">%(title)s</a></h2>\
<div class="help">%(comment_text)s</div>\
%(content)s<br />\
<p><a href="%(page_name)s">Read with comments...</a></p>\
<hr /><br />', b)).appendTo($wrap);
$(repl('<div class="row">\
<div class="span1">\
<div class="avatar avatar-medium" style="margin-top: 6px;">\
<img src="%(avatar)s" />\
</div>\
</div>\
<div class="span11">\
<h4><a href="%(page_name)s">%(title)s</a></h4>\
<p>%(content)s</p>\
<p style="color: #aaa; font-size: 90%">\
<a href="blog?by=%(blogger)s&by_name=%(full_name)s">\
%(full_name)s</a> wrote this on %(published)s / %(comment_text)s</p>\
</div>\
</div><hr>', b)).appendTo($wrap);
});
blog.start += (data.length || 0);
if(!data.length) {

View File

@@ -12,7 +12,7 @@
{% block content %}
<div class="span12">
<h1>Blog</h1>
<h2 id="blog-title">Blog</h2>
<br>
<div id="blog-list">
<!-- blog list will be generated dynamically -->
@@ -22,4 +22,5 @@
style="display:none;">More...</button>
</div>
</div>
{% include 'html/blog_footer.html' %}
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "html/page.html" %}
{% set title="Blog Writers" %}
{% block content %}
<div class="span12">
<h2 id="blog-title">Blog Writers</h2>
<hr>
{% for blogger_info in bloggers %}
{% include "html/blogger.html" %}
{% endfor %}
</div>
{% include 'html/blog_footer.html' %}
{% endblock %}