summaryrefslogtreecommitdiff
path: root/app/media/admin.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2021-08-14 09:39:08 -0400
committerluxagraf <sng@luxagraf.net>2021-08-14 09:39:08 -0400
commit9327e01c60b114286f5a142552aae60843029a48 (patch)
tree7f353f4299d50013c3b90f7b749fc6ab211b32d4 /app/media/admin.py
parent0feb366b10cf422f12d18fa753e5d876120f4195 (diff)
initial commit
Diffstat (limited to 'app/media/admin.py')
-rw-r--r--app/media/admin.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/app/media/admin.py b/app/media/admin.py
new file mode 100644
index 0000000..12d0509
--- /dev/null
+++ b/app/media/admin.py
@@ -0,0 +1,37 @@
+from django.contrib import admin
+from django.contrib.gis.admin import OSMGeoAdmin
+
+from .models import LuxImage, LuxGallery, LuxImageSize, LuxVideo, LuxAudio
+
+
+@admin.register(LuxImageSize)
+class LuxImageSizeAdmin(OSMGeoAdmin):
+ list_display = ('name', 'width', 'height', 'quality')
+
+
+@admin.register(LuxVideo)
+class LuxVideoAdmin(OSMGeoAdmin):
+ pass
+
+
+@admin.register(LuxImage)
+class LuxImageAdmin(OSMGeoAdmin):
+ list_display = ('pk', 'admin_thumbnail', 'pub_date', 'caption')
+ list_filter = ('pub_date',)
+ search_fields = ['title', 'caption']
+ # Options for OSM map Using custom ESRI topo map
+
+ fieldsets = (
+ (None, {
+ 'fields': ('title', ('image'), 'pub_date', 'sizes', 'alt', 'caption', ('is_public'), ('photo_credit_source', 'photo_credit_url'))
+ }),
+ )
+
+ class Media:
+ js = ('image-preview.js', 'next-prev-links.js')
+
+
+@admin.register(LuxAudio)
+class LuxAudioAdmin(OSMGeoAdmin):
+ list_display = ('pk', 'title', 'pub_date')
+ list_filter = ('pub_date',)