Changeset 15
- Timestamp:
- 11/05/07 19:38:53 (10 months ago)
- Files:
-
- bitstructures/trunk/css/bitstructures.css (modified) (1 diff)
- bitstructures/trunk/images/feed-icon-14x14.png (added)
- bitstructures/trunk/substructure/templatetags (added)
- bitstructures/trunk/substructure/templatetags/__init__.py (added)
- bitstructures/trunk/substructure/templatetags/substructure_tags.py (added)
- bitstructures/trunk/substructure/urls.py (modified) (1 diff)
- bitstructures/trunk/substructure/views.py (modified) (2 diffs)
- bitstructures/trunk/templates/substructure/atom_entry.xml (added)
- bitstructures/trunk/templates/substructure/atom_feed.xml (added)
- bitstructures/trunk/templates/substructure/base.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bitstructures/trunk/css/bitstructures.css
r14 r15 84 84 } 85 85 86 a.subscribe { 87 color: #da5800; 88 } 89 86 90 a:hover { 87 91 text-decoration: underline; bitstructures/trunk/substructure/urls.py
r7 r15 5 5 (r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[a-z0-9-]+)$', 6 6 'bitstructures.substructure.views.entry_page'), 7 (r'^drafts/(?P<slug>[a-z0-9-]+)$', 'bitstructures.substructure.views.draft_page') 7 (r'^drafts/(?P<slug>[a-z0-9-]+)$', 'bitstructures.substructure.views.draft_page'), 8 (r'^atom.xml$', 'bitstructures.substructure.views.atom_feed') 8 9 ) bitstructures/trunk/substructure/views.py
r7 r15 1 from django.http import Http404 1 from django.http import Http404, HttpResponse 2 2 from django.shortcuts import get_object_or_404, render_to_response 3 from django.template import Context, loader 4 from django.contrib.sites.models import Site 3 5 from bitstructures.substructure.models import Entry 4 6 import bitstructures.settings … … 31 33 return render_to_response('substructure/entry_page.html', data) 32 34 35 def atom_feed(request): 36 t = loader.get_template('substructure/atom_feed.xml') 37 current_site = Site.objects.get_current() 38 entry_list = Entry.objects.filter(date_published__isnull=False).order_by('-date_published') 39 c = Context({ 40 'site_name': current_site.name, 41 'site_domain': current_site.domain, 42 'entry_list': entry_list 43 }) 44 if len(entry_list) > 0: 45 c['most_recent_date_published'] = entry_list[0].date_published 46 return HttpResponse(t.render(c), mimetype='application/atom+xml') 47 33 48 def get_context_data(request): 34 49 data = { 'MEDIA_URL': bitstructures.settings.MEDIA_URL } bitstructures/trunk/templates/substructure/base.html
r14 r15 6 6 <head> 7 7 <title>{% block title %}Bitstructures{% endblock %}</title> 8 <link rel="stylesheet" href="{{ MEDIA_URL }}css/bitstructures.css" type="text/css"> 8 <link rel="alternate" type="application/atom+xml" href="/atom.xml"> 9 <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/bitstructures.css"> 9 10 </head> 10 11 … … 34 35 the <a href="http://dojotoolkit.org/">Dojo</a> JavaScript toolkit.</p> 35 36 <p><a href="http://del.icio.us/simonbates">del.icio.us/simonbates</a></p> 37 <p><a class="subscribe" href="/atom.xml">Subscribe <img src="{{ MEDIA_URL }}images/feed-icon-14x14.png" alt="Subscribe"></a></p> 36 38 </div> 37 39
