91f05965e207

More changes for the photo blog.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 14 Feb 2009 23:35:49 -0500
parents 444fa384fab8
children 677d5ff5c56e
branches/tags (none)
files photoblog/specs.py photoblog/views.py site-media/style/photoblog.css templates/photoblog/entry.html

Changes

--- a/photoblog/specs.py	Sat Feb 14 12:39:39 2009 -0500
+++ b/photoblog/specs.py	Sat Feb 14 23:35:49 2009 -0500
@@ -6,6 +6,7 @@
 
 class ResizeDisplay(processors.Resize):
     width = 550
+    height = 550
 
 class EnchanceThumb(processors.Adjustment): 
     contrast = 1.2
--- a/photoblog/views.py	Sat Feb 14 12:39:39 2009 -0500
+++ b/photoblog/views.py	Sat Feb 14 23:35:49 2009 -0500
@@ -8,4 +8,15 @@
         entry = get_object_or_404(Entry, slug=slug, pub_date__year=year, 
                                   pub_date__month=month, pub_date__day=day,)
     
-    return render_to_response('photoblog/entry.html', { 'entry': entry })
\ No newline at end of file
+    try:
+        next = entry.get_next_by_pub_date()
+    except Entry.DoesNotExist, e:
+        next = None
+    
+    try:
+        previous = entry.get_previous_by_pub_date()
+    except Entry.DoesNotExist, e:
+        previous = None
+    
+    return render_to_response('photoblog/entry.html', 
+                { 'entry': entry, 'next': next, 'previous': previous })
\ No newline at end of file
--- a/site-media/style/photoblog.css	Sat Feb 14 12:39:39 2009 -0500
+++ b/site-media/style/photoblog.css	Sat Feb 14 23:35:49 2009 -0500
@@ -1,5 +1,8 @@
-img#photoblog-main-image { border: 15px solid #eee; margin: 1em auto 2em; display: block; }
-div#photoblog-entry-date { color: #666; }
+h1#photoblog-entry-title { margin-bottom: 0.1em;}
+div#photoblog-entry-date { color: #666; margin-top: 0em; margin-bottom: 2em; }
+
+img#photoblog-main-image { border: 10px solid #eee; margin: 1em auto 2em; display: block; }
+
 div.photoblog-nav-entry { border-bottom: 1px solid #eee; height: 54px; vertical-align: middle; }
 div.photoblog-nav-entry h2, div.photoblog-nav-entry h3 { line-height: 54px; display: inline; }
 div.photoblog-nav-entry img { float: right; margin: 2px 0px; }
--- a/templates/photoblog/entry.html	Sat Feb 14 12:39:39 2009 -0500
+++ b/templates/photoblog/entry.html	Sat Feb 14 23:35:49 2009 -0500
@@ -15,37 +15,59 @@
             </a>
         </h1>
         
-        <img id="photoblog-main-image" src="{{ entry.display.url }}" />
-        
-        <div id="photoblog-entry-body" class="content">
-            {{ entry.body|markdown|typogrify }}
-        </div>
-        
         <div id="photoblog-entry-date">
             <p>
                 Posted on {{ entry.pub_date|date:"F j, Y" }}
             </p>
         </div>
         
+        <img id="photoblog-main-image" src="{{ entry.display.url }}" />
+        
+        <div id="photoblog-entry-body" class="content">
+            {{ entry.body|markdown|typogrify }}
+        </div>
+        
         <div id="photoblog-nav">
             <div id="photoblog-nav-newer">
-                <div class="photoblog-nav-entry">
-                    <h2>Newer</h2>
-                </div>
-                <div class="photoblog-nav-entry">
-                    <a href=""><img src="{{ entry.thumbnail.url }}" /></a>
-                    <h3><a href="">{{ entry.title }}</a></h3>
-                </div>
+                {% if next %}
+                    <div class="photoblog-nav-entry">
+                        <h2>Newer</h2>
+                    </div>
+                    <div class="photoblog-nav-entry">
+                        <a href="{{ next.get_absolute_url }}">
+                            <img src="{{ next.thumbnail.url }}" />
+                        </a>
+                        <h3>
+                            <a href="{{ next.get_absolute_url }}">
+                                {{ next.title }}
+                            </a>
+                        </h3>
+                    </div>
+                {% else %}
+                    &nbsp;
+                {% endif %}
+                
             </div>
             
             <div id="photoblog-nav-older">
-                <div class="photoblog-nav-entry">
-                    <h2>Older</h2>
-                </div>
-                <div class="photoblog-nav-entry">
-                    <a href=""><img src="{{ entry.thumbnail.url }}" /></a>
-                    <h3><a href="">{{ entry.title }}</a></h3>
-                </div>
+                {% if previous %}
+                    <div class="photoblog-nav-entry">
+                        <h2>Older</h2>
+                    </div>
+                    <div class="photoblog-nav-entry">
+                        <a href="{{ previous.get_absolute_url }}">
+                            <img src="{{ previous.thumbnail.url }}" />
+                        </a>
+                        <h3>
+                            <a href="{{ previous.get_absolute_url }}">
+                                {{ previous.title }}
+                            </a>
+                        </h3>
+                    </div>
+                {% else %}
+                    &nbsp;
+                {% endif %}
+                
             </div>
         </div>
     </div>