Commits

Anonymous committed 4111958

fixed feed's title url

Comments (0)

Files changed (2)

pages/models/__init__.py

 from limited import markup
 from settings import BLOG_URL
 
-## We want to generate absolute URLs here
-set_script_prefix(BLOG_URL)
-
 def apply_filter_method(**kwargs):
     model = kwargs.pop('sender')
     def filter(*args, **kwargs):
 
     @property
     def absolute_url(self):
+        ## We want to generate absolute URLs here
+        ## this need to be done in this funktion to work in templates
+        set_script_prefix(BLOG_URL)
+
         return urlresolve('single_post' if self.isblog else 'single_page',
                           kwargs={'single' : self.url})
 

templates/widgets/archive_widget.html

+{% load i18n %}
+{% load filters %}
+
+<h3>{% trans "Blog archive" %}</h3>
+{% for year in years %}
+    <ul class="archive">
+        <li>
+            <a href="{% url archive_yearly year %}" title="{% trans 'Archive for' %} {{ year }}">{{ year }}</a>
+            <ul>
+                {% for month, postcount in year.months %}
+                    <li>
+                        <a href="{% url archive_monthly year.year month|fill_n:2 %}"
+                            title="{% trans 'Archive for' %} {{ month|monthname }}/{{ year }}">
+                            {{ month|monthname }} ({{ postcount }})</a>
+                    </li>
+                {% endfor %}
+            </ul>
+        </li>
+    </ul>
+{% endfor %}