summaryrefslogtreecommitdiff
path: root/app/locations/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/locations/admin.py')
-rw-r--r--app/locations/admin.py54
1 files changed, 53 insertions, 1 deletions
diff --git a/app/locations/admin.py b/app/locations/admin.py
index 601ac03..0e78948 100644
--- a/app/locations/admin.py
+++ b/app/locations/admin.py
@@ -1,7 +1,7 @@
from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
-from .models import Region, Country, Location, State, Route, LuxCheckIn, Campsite
+from .models import Region, Country, Location, State, Route, LuxCheckIn, Campsite, GPXFile, GPXTrack, Walk
from utils.widgets import OLAdminBase
from utils.util import get_latlon
@@ -277,3 +277,55 @@ class CampsiteAdmin(OLAdminBase):
class Media:
js = ('image-loader.js', 'next-prev-links.js')
+
+
+@admin.register(GPXFile)
+class GPXFileAdmin(OLAdminBase):
+ pass
+
+
+@admin.register(GPXTrack)
+class GPXTrackAdmin(OLAdminBase):
+ pass
+
+
+@admin.register(Walk)
+class WalkAdmin(OLAdminBase):
+ form = LGEntryForm
+ list_display = ('title', 'date_walked', 'rating', 'location')
+ list_filter = ('rating', 'location', 'date_walked')
+ prepopulated_fields = {'slug': ('title',)}
+ search_fields = ('tite',)
+ fieldsets = (
+ ('Region', {
+ 'fields': (
+ ('title', 'rating'),
+ 'body_markdown',
+ ('date_walked', 'slug'),
+ 'distance',
+ 'gpx_file',
+ 'point',
+ ),
+ 'classes': (
+ 'show',
+ 'extrapretty'
+ )
+ }),
+ )
+
+ # options for OSM map Using custom ESRI topo map
+ default_lon = -9285175
+ default_lat = 4025046
+ default_zoom = 6
+ units = True
+ scrollable = False
+ map_width = 700
+ map_height = 425
+ map_template = 'gis/admin/osm.html'
+ openlayers_url = '/static/admin/js/OpenLayers.js'
+
+ class Media:
+ js = ('image-loader.js', 'next-prev-links.js')
+ css = {
+ "all": ("my_styles.css",)
+ }