Permalink
Browse files

Added some CSS to make the blog look nicer.

  • Loading branch information...
1 parent 5d9d41b commit 88eeaf020ab010bfe1d591b44e8aec19792e0bd9 @matthewbdaly committed Apr 8, 2012
@@ -0,0 +1,28 @@
+body {
+ background-color: #f0f0f0;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+#main {
+ width: 800px;
+ height: 100%;
+ margin: 50px auto;
+}
+
+ul#pageList {
+ margin: 0px;
+ padding: 10px 0px 10px 0px;
+}
+
+ul#pageList li {
+ display: inline;
+ margin-right: 10px;
+ font-size: 18px;
+}
+
+.post, .page {
+ width: 600px;
+ padding: 20px;
+ margin-bottom: 20px;
+ background-color: #ffffff;
+}
View
@@ -4,6 +4,7 @@
from django.template import RequestContext
from blogengine.models import Post, Category
from django.contrib.syndication.views import Feed
+from django.contrib.flatpages.models import FlatPage
def getPosts(request, selected_page=1):
# Get all blog posts
View
@@ -3,10 +3,12 @@
<h1>Posts for {{ category.title }}</h1>
{% if posts %}
{% for post in posts %}
+ <div class="post">
<h1><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h1>
{{ post.text }}
{% get_comment_count for post as comment_count %}
<h3>Comments: {{ comment_count }}</h3>
+ </div>
{% endfor %}
<br />
{% if page.has_previous %}
@@ -1,4 +1,6 @@
{% include 'header.html' %}
+ <div class="page">
<h1>{{ flatpage.title }}</h1>
{{ flatpage.content }}
+ </div>
{% include 'footer.html' %}
View
@@ -1,2 +1,3 @@
+ </div>
</body>
</html>
View
@@ -1,5 +1,16 @@
<html>
<head>
<title>My Django Blog</title>
+ <link rel="stylesheet" type="text/css" href="/static/style.css" />
</head>
<body>
+ <div id="main">
+ <h1>My Django Blog</h1>
+ <ul id="pageList">
+ <li><a href="/">Home</a></li>
+ {% load flatpages %}
+ {% get_flatpages as flatpages %}
+ {% for flatpage in flatpages %}
+ <li><a href="{{ flatpage.url }}">{{ flatpage.title }}</a></li>
+ {% endfor %}
+ </ul>
View
@@ -2,10 +2,12 @@
{% load comments %}
{% if posts %}
{% for post in posts %}
+ <div class="post">
<h1><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h1>
{{ post.text }}
{% get_comment_count for post as comment_count %}
<h3>Comments: {{ comment_count }}</h3>
+ </div>
{% endfor %}
<br />
{% if page.has_previous %}
@@ -15,6 +17,8 @@
<a href="/{{ page.next_page_number }}/">Next Page</a>
{% endif %}
{% else %}
+ <div class="post">
<p>No posts matched</p>
+ </div>
{% endif %}
{% include 'footer.html' %}
View
@@ -1,6 +1,7 @@
{% include 'header.html' %}
{% load comments %}
{% for post in posts %}
+ <div class="post">
<h1><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h1>
<h3>{{ post.pub_date }}</h3>
{{ post.text }}
@@ -16,6 +17,7 @@
{% endfor %}
{% render_comment_form for post %}
{% endfor %}
+ </div>
<br />
{% if page.has_previous %}
<a href="/{{ page.previous_page_number }}/">Previous Page</a>

0 comments on commit 88eeaf0

Please sign in to comment.