Added a better slugify function, monthly archives work, notes are optional now.
[~kgodey/maayanwich.git] / templates / base.html
index 7b0eb1f..a910bb1 100644 (file)
@@ -9,21 +9,31 @@
                                <h1 class="header">Ma'ayanwich Tracker</h1>
                        </div>
                        <div id="sidebar">
-                               <h3 class="navtitle">NAVIGATION</h3>
+                               <h3 class="navtitle">Account</h3>
                                <ul class="nav">
-                                       <li><a href="http://127.0.0.1:8000/sandwich/all/" class="navlink">All sandwiches</a></li>
-                                       <li><a href="http://127.0.0.1:8000/sandwich/add/" class="navlink">Add sandwich</a></li>
-                                       <li><a href="http://127.0.0.1:8000/login/" class="navlink">Login</a></li>
-                                       <li><a href="http://127.0.0.1:8000/signup/" class="navlink">Signup</a></li>
-                                       <li>Monthly Links (TODO)</li>
-                                       <li>Logout (TODO)</li>
+                                       {% if user.is_authenticated %}
+                                               <li><a href="http://127.0.0.1:8000/sandwich/add/" class="navlink">Add sandwich</a></li>
+                                               <li><a href="http://127.0.0.1:8000/logout/" class="navlink">Logout</a></li>
+                                       {% else %}
+                                               <li><a href="http://127.0.0.1:8000/login/" class="navlink">Login</a></li>
+                                               <li><a href="http://127.0.0.1:8000/signup/" class="navlink">Signup</a></li>
+                                       {% endif %}
                                </ul>
-                               <h3 class="navtitle">NEWEST</h3>
+                               <h3 class="navtitle">Newest</h3>
                                <ul class="newest">
                                        {% for s in sandwiches %}
-                                               <li>{{ s.adjective }}</li>
+                                               <li><a href="{{ s.get_absolute_url }}">{{ s.adjective }}</a></li>
+                                       {% endfor %}
+                               </ul>
+                               <h3 class="navtitle">Sandwiches</h3>
+                               <ul class="newest">
+                                       {% for m in monthly %}
+                                       <li><a href="http://127.0.0.1:8000/sandwich/{{ m.year }}/{{ m.month }}/"> {{ m|date:"F" }} {{m.year}} </a></li>
                                        {% endfor %}
                                </ul>
+                               <ul class="newest">
+                                       <li><a href="http://127.0.0.1:8000/sandwich/all/" class="navlink">All sandwiches</a></li>
+                               </ul>
                        </div>
                        <div id="content">
                                {% block content %}