Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix some bugs left over from the tabs -> spaces migration. Also, fix …

…the permalinks and turn off the Flickr backend until that is stable.
  • Loading branch information...
commit 0bf68cfcd1e8588381f9568f6b7661004f2728c4 1 parent f889aeb
@streeter streeter authored
View
6 base.html
@@ -56,7 +56,7 @@
</div>
<!-- end container -->
-<!-- lightbox javascript -->
+<!-- javascript -->
<script type="text/javascript">
$(document).ready(function() {
$('a.lightbox').lightBox({
@@ -68,7 +68,7 @@
});
if (document.location.hash) {
- $(''+document.location.hash).click();
+ $(''+document.location.hash+'-id').click();
}
window.setTimeout(function() {
@@ -78,7 +78,7 @@
}, 2000);
});
</script>
-<!-- end lightbox javascript -->
+<!-- end javascript -->
{% if user.merchant_id %}
<!-- google checkout -->
View
2  flickr.py
@@ -844,7 +844,7 @@ def _doget(method, auth=False, **params):
from google.appengine.api import memcache
result = memcache.get(url)
if result:
- return result
+ return result
result = urlopen(url).read()
memcache.set(url, result)
View
3  index.html
@@ -4,11 +4,12 @@
<!-- thumb-container -->
<div id="thumb-container">
{% if homepage_photo %}
- <a href="/{{ homepage_photo.album }}/#{{ homepage_photo.id}}"><img border="0" src="{{ homepage_photo.src }}" /></a>
+ <a href="/{{ homepage_photo.album }}/#{{ homepage_photo.id }}"><img border="0" src="{{ homepage_photo.src }}" /></a>
{% endif %}
{% for photo in photos %}
<a photoid="{{ photo.id }}"
+ id="{{ photo.id }}-id"
class="thumb lightbox"
style="width:{{ user.thumb_size }}; height:{{ user.thumb_size }};"
title="{{ photo.name }}"
View
5 models.py
@@ -30,6 +30,9 @@ def GetFeaturedAlbums(self, featured=[]):
featured_albums.append(album)
+ # Sort by name
+ featured_albums.sort(key=lambda a: a['title'])
+
if 'all' in featured:
featured_albums.append({'id': 'all', 'title': 'all'})
@@ -86,6 +89,8 @@ def GetAllAlbums(self):
'title': album.title.text,
})
+ albums.sort(key=lambda a: a['title'])
+
# set memcache
self.CacheSet(key, albums)
View
2  settings.py
@@ -24,4 +24,4 @@
PHOTO_BACKEND_PICASA = 1
PHOTO_BACKEND_FLICKR = 2
-PHOTO_BACKENDS = [PHOTO_BACKEND_PICASA, PHOTO_BACKEND_FLICKR, ]
+PHOTO_BACKENDS = [PHOTO_BACKEND_PICASA, ]
View
6 views.py
@@ -228,9 +228,9 @@ def get(self, album_name=None):
# Reset template values with every new request.
self.template_values = {
'user': self.userprefs,
- 'title': self.userprefs.site_title+" gallery",
- 'albums': backend.GetFeaturedAlbums(self.userprefs.featured_albums),
- 'debug': settings.DEBUG,
+ 'title': self.userprefs.site_title+" gallery",
+ 'albums': backend.GetFeaturedAlbums(self.userprefs.featured_albums),
+ 'debug': settings.DEBUG,
}
if users.is_current_user_admin():
self.template_values['logout_url'] = users.create_logout_url('/')
Please sign in to comment.
Something went wrong with that request. Please try again.