summaryrefslogtreecommitdiff
path: root/app/photos
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2016-03-21 19:29:19 -0400
committerluxagraf <sng@luxagraf.net>2016-03-21 19:29:19 -0400
commit19c0006134b5cb53fb7ed51d8f63490f8f7d1761 (patch)
tree753f1b39d1efa6fb0ceb542b6976c8ee97070faa /app/photos
parent4585b582a69be734676de102213ff4a69e1c57aa (diff)
added inline image preview to birdsightings changeform and fixed private
gallery pages
Diffstat (limited to 'app/photos')
-rw-r--r--app/photos/admin.py6
-rw-r--r--app/photos/forms.py5
-rw-r--r--app/photos/models.py1
3 files changed, 5 insertions, 7 deletions
diff --git a/app/photos/admin.py b/app/photos/admin.py
index 9453734..83fbae8 100644
--- a/app/photos/admin.py
+++ b/app/photos/admin.py
@@ -38,7 +38,7 @@ class LuxImageAdmin(OSMGeoAdmin):
fieldsets = (
(None, {
- 'fields': (('image', 'pub_date'), 'sizes', ('title', 'alt'), 'caption', 'point', ('is_public', 'is_video'), ('photo_credit_source','photo_credit_url'))
+ 'fields': (('image', 'pub_date'), 'sizes', ('title', 'alt'), 'caption', 'point', ('is_public', 'is_video'), ('photo_credit_source', 'photo_credit_url'))
}),
('Exif Data', {
'classes': ('collapse',),
@@ -47,10 +47,6 @@ class LuxImageAdmin(OSMGeoAdmin):
)
-
-
-
-
admin.site.register(LuxImage, LuxImageAdmin)
diff --git a/app/photos/forms.py b/app/photos/forms.py
index 8ad89f2..03c6f09 100644
--- a/app/photos/forms.py
+++ b/app/photos/forms.py
@@ -39,8 +39,11 @@ class GalleryForm(forms.ModelForm):
items = []
for image in images:
items.append(
- (image.pk, mark_safe('%sqq%s' % (image.title, image.get_image_name())))
+ (image.pk, mark_safe('%sqq%sqq%s' % (image.title, image.get_image_by_size('tn'), image.pk)))
)
+
+
+
self.fields['images'].choices = items
self.fields['images'].allow_tags = True
diff --git a/app/photos/models.py b/app/photos/models.py
index 048dd65..6907a25 100644
--- a/app/photos/models.py
+++ b/app/photos/models.py
@@ -74,7 +74,6 @@ class LuxImage(models.Model):
if size.width <= 800:
return self.get_image_by_size(size)
-
def get_image_name(self):
return self.image.url.split("original/")[1][5:-4]