annotate gpp/potd/views.py @ 481:9f888dbe61ce
Fixing #230; add a scrollbar to the PM popup dialog if necessary. This wasn't as easy as I thought. Had to wrap the PM text in a div with its styling (max-height and overflow). If I then resized the dialog, I'd get two scrollbars. So for now, made the dialog non-resizable.
author |
Brian Neal <bgneal@gmail.com> |
date |
Fri, 07 Oct 2011 02:11:33 +0000 |
parents |
7b6540b185d9 |
children |
|
rev |
line source |
gremmie@1
|
1 """
|
gremmie@1
|
2 Views for the POTD application.
|
gremmie@1
|
3 """
|
gremmie@1
|
4
|
gremmie@1
|
5 from django.shortcuts import render_to_response
|
bgneal@14
|
6 from django.shortcuts import get_object_or_404
|
gremmie@1
|
7 from django.template import RequestContext
|
gremmie@1
|
8
|
gremmie@1
|
9 from potd.models import Current
|
bgneal@14
|
10 from potd.models import Photo
|
gremmie@1
|
11
|
gremmie@1
|
12
|
gremmie@1
|
13 def view(request):
|
gremmie@1
|
14 potd = Current.objects.get_current_photo()
|
gremmie@1
|
15 return render_to_response('potd/view.html', {
|
gremmie@1
|
16 'potd': potd,
|
bgneal@14
|
17 'is_current': True,
|
gremmie@1
|
18 },
|
gremmie@1
|
19 context_instance = RequestContext(request))
|
bgneal@14
|
20
|
bgneal@14
|
21 def archive(request, id):
|
bgneal@14
|
22 photo = get_object_or_404(Photo, pk=id)
|
bgneal@14
|
23 return render_to_response('potd/view.html', {
|
bgneal@14
|
24 'potd': photo,
|
bgneal@14
|
25 'is_current': False,
|
bgneal@14
|
26 },
|
bgneal@14
|
27 context_instance = RequestContext(request))
|