From cc70aa809252899dfd062feb241aaecede66bd02 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Tue, 24 Jun 2014 12:05:46 -0400 Subject: Rewrote all sass and reconfigured HTML to use more microformats and clearer class names --- app/blog/models.py | 2 +- app/blog/urls.py | 13 ++++++++++++- app/blog/views.py | 2 +- app/lib/pagination/templates/pagination/pagination.html | 9 ++++----- app/notes/models.py | 2 +- 5 files changed, 19 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/blog/models.py b/app/blog/models.py index f01eeae..12b5b28 100644 --- a/app/blog/models.py +++ b/app/blog/models.py @@ -79,7 +79,7 @@ class Entry(models.Model): return self.title def get_absolute_url(self): - return "/%s/%s/" % (self.pub_date.strftime("%Y/%b/%d").lower(), self.slug) + return "/%s/%s" % (self.pub_date.strftime("%Y/%m").lower(), self.slug) def comment_period_open(self): return self.enable_comments and datetime.datetime.today() - datetime.timedelta(30) <= self.pub_date diff --git a/app/blog/urls.py b/app/blog/urls.py index d0a5224..0ac8870 100644 --- a/app/blog/urls.py +++ b/app/blog/urls.py @@ -1,10 +1,21 @@ from django.conf.urls import * from django.views.generic.base import RedirectView - +""" urlpatterns = patterns('', (r'(?P[-\w]+)/(?P\d+)/$', 'blog.views.entry_list_by_area'), (r'(?P\d+)/$', 'blog.views.entry_list'), (r'(?P[-\w]+)/$', RedirectView.as_view(url="/writing/%(slug)s/1/")), (r'', RedirectView.as_view(url="/writing/1/")), ) +""" + +urlpatterns = patterns('', + url(r'(?P\d{4})/(?P\d{2})/(?P[-\w]+)$', 'blog.views.entry_detail'), + #url(r'(?P\d{4})/(?P\d{2})/$', 'blog.views.date_list', name="blog_by_month"), + #url(r'(?P\d{4})/$', 'blog.views.date_list', name="blog_by_year"), + (r'(?P[-\w]+)/(?P\d+)/$', 'blog.views.entry_list_by_area'), + (r'(?P\d+)/$', 'blog.views.entry_list'), + url(r'(?P[-\w]+)/$', RedirectView.as_view(url="/writing/%(slug)s/1/")), + #url(r'', RedirectView.as_view(url="/writing/1/")), +) diff --git a/app/blog/views.py b/app/blog/views.py index 1d552eb..b82a2ab 100644 --- a/app/blog/views.py +++ b/app/blog/views.py @@ -16,7 +16,7 @@ def home(request): return render_to_response('archives/homepage.html', context, context_instance=RequestContext(request)) -def entry_detail(request, year, month, day, slug): +def entry_detail(request, year, month, slug): obj = get_object_or_404(Entry, slug__exact=slug) photos = {} # if obj.photo_gallery: diff --git a/app/lib/pagination/templates/pagination/pagination.html b/app/lib/pagination/templates/pagination/pagination.html index 1afb3d7..0b99346 100644 --- a/app/lib/pagination/templates/pagination/pagination.html +++ b/app/lib/pagination/templates/pagination/pagination.html @@ -1,10 +1,9 @@ {% load pagination_tags %}{% if is_paginated %}
    {% if page_obj.has_previous %} -
  • {% else %} - {% endif %}{% for page in pages %}{% if page %}{% if page == page_obj.number %} +
  • {% endif %}{% for page in pages %}{% if page %}{% if page == page_obj.number %}
  • {{ page }}
  • {% else %}
  • {{ page }}
  • {% endif %}{% else %}
  • ...
  • {% endif %}{% endfor %}{% if page_obj.has_next %} -
  • {% else %} - {% endif %} -
{% endif %} \ No newline at end of file +
  • + {% endif %} + {% endif %} diff --git a/app/notes/models.py b/app/notes/models.py index dc158d2..6d139f0 100644 --- a/app/notes/models.py +++ b/app/notes/models.py @@ -42,7 +42,7 @@ class Note(models.Model): twitter_id = models.CharField('twitter_id', max_length=450) twitter_send = models.BooleanField("send to twitter?", default=False) twitter_sent = models.BooleanField(default=False, blank=True) - in_reply_to = models.CharField('in reply to url', max_length=450) + #in_reply_to = models.CharField('in reply to url', max_length=450) def __str__(self): return self.slug -- cgit v1.2.3-70-g09d2