summaryrefslogtreecommitdiff
path: root/app/planner/admin.py
blob: 09048a6323bac0f88007b41626f76e9af897abae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from django.contrib import admin
from django import forms
from django.contrib.contenttypes.admin import GenericStackedInline

from utils.widgets import AdminImageWidget, LGEntryForm
from .models import Camp, Trip, CampIdea

from media.models import LuxImage
from utils.util import get_latlon

@admin.register(CampIdea)
class PlannerAdmin(admin.ModelAdmin):
    list_display = ('name', )
    #list_filter = ('has_water', )
    # options for OSM map Using custom ESRI topo map
    lat, lon = get_latlon()
    default_lon = lon
    default_lat = lat
    default_zoom = 10
    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')
        #'product-loader.js', 
        css = {
            "all": ("my_styles.css",)
        }


@admin.register(Camp)
class PlannerAdmin(admin.ModelAdmin):
    list_display = ('name', 'date_arrive', 'date_depart', 'distance_from_previous', 'price', 'site_number',)
    list_filter = ('date_arrive', 'has_water' )
    # options for OSM map Using custom ESRI topo map
    lat, lon = get_latlon()
    default_lon = lon
    default_lat = lat
    default_zoom = 10
    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')
        #'product-loader.js', 
        css = {
            "all": ("my_styles.css",)
        }


@admin.register(Trip)
class TripAdmin(admin.ModelAdmin):
    pass