[snowy] Pimp my pins



commit e75c02f50af0718d99e66a54420bd43a05ad66d3
Author: Brad Taylor <brad getcoded net>
Date:   Tue May 19 16:32:44 2009 -0400

    Pimp my pins
---
 notes/templates/notes/note_detail.html |    2 +-
 notes/views.py                         |    3 +--
 site_media/css/screen.css              |    4 ++++
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/notes/templates/notes/note_detail.html b/notes/templates/notes/note_detail.html
index 6aade11..cfab791 100644
--- a/notes/templates/notes/note_detail.html
+++ b/notes/templates/notes/note_detail.html
@@ -15,7 +15,7 @@
 <div id="sidebar-note-list">
     <ul>
 {% for n in all_notes %}
-        <li class="note-item"><a href="{{ n.get_absolute_url }}">{{ n.title }}</a></li>
+        <li class="note-item{% if n.pinned %} pinned{% endif %}"><a href="{{ n.get_absolute_url }}">{{ n.title }}</a></li>
 {% endfor %}
         <li class="more-item"><a href="#">{% trans "More Notes..." %}</a></li>
     </ul>
diff --git a/notes/views.py b/notes/views.py
index 190005a..b665486 100644
--- a/notes/views.py
+++ b/notes/views.py
@@ -68,9 +68,8 @@ def note_detail(request, username, note_id, slug='',
         if doc != None: doc.freeDoc()
         if result != None: result.freeDoc()
 
-    # TODO: pinned notes
     all_notes = Note.objects.filter(author=user) \
-                            .order_by('-user_modified')
+                            .order_by('-pinned', '-user_modified')
     if request.user != user:
         all_notes = all_notes.filter(permissions=1) # Public
 
diff --git a/site_media/css/screen.css b/site_media/css/screen.css
index e8a1bc3..e92d4e9 100644
--- a/site_media/css/screen.css
+++ b/site_media/css/screen.css
@@ -150,6 +150,10 @@ td#sidebar-container {
     list-style-image: url('/site_media/img/note_16.png'); 
 }
 
+#sidebar-note-list .pinned {
+    list-style-image: url('/site_media/img/pin-down_16.png'); 
+}
+
 #sidebar-note-list #new-note {
     list-style-image: url('/site_media/img/note-new_16.png'); 
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]