Commits

Artem Egorkine committed ea23686

Post.get_url_values() returns the proper endpoint address now.
* zine/models.py:
A slug is not enough, return the full endpoint address.
* zine/templates/widgets/pages_navigation.html:
`request.path` check is correct now.

  • Participants
  • Parent commits 1ee61f5
  • Branches page-reordering

Comments (0)

Files changed (2)

File zine/models.py

                self.pub_date > datetime.utcnow()
 
     def get_url_values(self):
-        return self.slug
+        #return self.slug
+        return 'blog/post', { 'slug': self.slug }
 
     def __repr__(self):
         return '<%s %r>' % (

File zine/templates/widgets/pages_navigation.html

   {%- if widget.pages %}
   <ul class="pages-navigation">
   {%- for item in widget.pages %}
-    <li {%- if request.path == '/'+url_for(item) %} class="current"{% endif %}>
+    <li {%- if request.path == url_for(item) %} class="current"{% endif %}>
       <a href="{{ url_for(item)|e }}">{{ item.title|e }}</a>
     </li>
   {%- endfor %}