1. Mario Fuest
  2. limited

Commits

keba  committed 4111958

fixed feed's title url

  • Participants
  • Parent commits a5968e6
  • Branches default

Comments (0)

Files changed (2)

File pages/models/__init__.py

View file
  • Ignore whitespace
 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})
 

File templates/widgets/archive_widget.html

View file
  • Ignore whitespace
+{% 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 %}