summaryrefslogtreecommitdiff
path: root/bak/unused_apps/guide/admin.py
blob: dfdf45eb40815751ed96b60db2705d3dafc7d270 (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 guide.models import Guide
from django.contrib.gis.admin import OSMGeoAdmin


class GuideAdmin(OSMGeoAdmin):
    list_display = (
        'title',
        'pub_date',
        'template_name',
        'status',
        'location',
        'photo_gallery'
    )
    search_fields = ['title', 'body_markdown']
    prepopulated_fields = {"slug": ('title',)}
    list_filter = ('pub_date', 'status', 'location__state__country__lux_region', 'location')
    fieldsets = (
        ('Note', {
            'fields': (
                'title',
                'body_markdown',
                'location',
                'pub_date',
                'status',
                'slug',
                'photo_gallery'
            ),
            'classes': (
                'show',
                'extrapretty',
                'wide'
            )
        }),
        ('Extra', {
            'fields': (
                'dek',
                'meta_description',
                'template_name',
                'image',
                'thumbnail'
            ),
            'classes': (
                'collapse',
                'wide'
            )
        }),
    )

    # 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'

admin.site.register(Guide, GuideAdmin)