some admin changes as per schuyler email
This commit is contained in:
parent
5bda2ad896
commit
584afc94e7
|
@ -3,7 +3,7 @@ from models import *
|
|||
|
||||
class FeatureNamesInline(admin.StackedInline):
|
||||
model = Name
|
||||
extra = 3
|
||||
extra = 0
|
||||
|
||||
class FeatureRelationInline(admin.TabularInline):
|
||||
model = Feature.relationships.through
|
||||
|
@ -12,10 +12,10 @@ class FeatureRelationInline(admin.TabularInline):
|
|||
|
||||
class FeatureAdmin(admin.OSMGeoAdmin):
|
||||
search_fields = ['preferred_name']
|
||||
list_filter = ('feature_type',)
|
||||
# list_filter = ('feature_type',)
|
||||
inlines = [FeatureNamesInline]
|
||||
list_display = ('__unicode__', 'feature_type_name', 'time_start', 'time_end',)
|
||||
list_per_page = 300
|
||||
list_per_page = 12
|
||||
openlayers_url = 'http://openlayers.org/dev/OpenLayers.js'
|
||||
openlayers_img_path = None
|
||||
# map_template = 'gis/admin/osm.html'
|
||||
|
@ -31,3 +31,4 @@ admin.site.register(Feature, FeatureAdmin)
|
|||
admin.site.register(TimeFrame)
|
||||
admin.site.register(FeatureType, FeatureTypeAdmin)
|
||||
admin.site.register(Relationship)
|
||||
admin.site.register(AuthorityRecord)
|
||||
|
|
|
@ -11,6 +11,8 @@ ADMINS = (
|
|||
INTERNAL_IPS = ('127.0.0.1',)
|
||||
MANAGERS = ADMINS
|
||||
|
||||
PROJECT_ROOT = os.path.dirname(__file__)
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.contrib.gis.db.backends.postgis', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
|
||||
|
@ -47,12 +49,12 @@ USE_L10N = True
|
|||
|
||||
# Absolute filesystem path to the directory that will hold user-uploaded files.
|
||||
# Example: "/home/media/media.lawrence.com/"
|
||||
MEDIA_ROOT = ''
|
||||
MEDIA_ROOT = join(PROJECT_ROOT, 'static')
|
||||
|
||||
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
||||
# trailing slash if there is a path component (optional in other cases).
|
||||
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
||||
MEDIA_URL = ''
|
||||
MEDIA_URL = '/static/'
|
||||
|
||||
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
||||
# trailing slash.
|
||||
|
@ -81,6 +83,7 @@ MIDDLEWARE_CLASSES = (
|
|||
ROOT_URLCONF = 'gazetteer.urls'
|
||||
|
||||
TEMPLATE_DIRS = (
|
||||
join(PROJECT_ROOT, 'templates'),
|
||||
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
||||
# Always use forward slashes, even on Windows.
|
||||
# Don't forget to use absolute paths, not relative paths.
|
||||
|
|
10
gazetteer/templates/admin/base_site.html
Normal file
10
gazetteer/templates/admin/base_site.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{{ title }} | {% trans 'Library of Congress Digital Gazetteer' %}{% endblock %}
|
||||
|
||||
{% block branding %}
|
||||
<h1 id="site-name">{% trans 'Library of Congress Digital Gazetteer' %}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block nav-global %}{% endblock %}
|
4
gazetteer/templates/gis/admin/google.html
Normal file
4
gazetteer/templates/gis/admin/google.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "gis/admin/openlayers.html" %}
|
||||
{% block openlayers %}
|
||||
{% include "gis/admin/google.js" %}
|
||||
{% endblock %}
|
11
gazetteer/templates/gis/admin/google.js
Normal file
11
gazetteer/templates/gis/admin/google.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% extends "gis/admin/openlayers.js" %}
|
||||
{% block base_layer %}
|
||||
new OpenLayers.Layer.Google("Google Terrain", {type: G_PHYSICAL_MAP, 'sphericalMercator': true});
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_layers %}
|
||||
{{ module }}.layers.overlay = new OpenLayers.Layer.OSM.Mapnik("OpenStreetMap (Mapnik)");
|
||||
{{ module }}.map.addLayer({{ module }}.layers.overlay);
|
||||
{% endblock %}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user