forked from django-cms/django-cms
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/digi604/django-cms-2.0
Conflicts: cms/models/pagemodel.py
- Loading branch information
Showing
14 changed files
with
229 additions
and
18 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
|
||
from south.db import db | ||
from django.db import models | ||
from cms.plugins.googlemap.models import * | ||
|
||
class Migration: | ||
|
||
def forwards(self, orm): | ||
|
||
# Adding field 'GoogleMap.lng' | ||
db.add_column('cmsplugin_googlemap', 'lng', orm['googlemap.googlemap:lng']) | ||
|
||
# Adding field 'GoogleMap.lat' | ||
db.add_column('cmsplugin_googlemap', 'lat', orm['googlemap.googlemap:lat']) | ||
|
||
|
||
|
||
def backwards(self, orm): | ||
|
||
# Deleting field 'GoogleMap.lng' | ||
db.delete_column('cmsplugin_googlemap', 'lng') | ||
|
||
# Deleting field 'GoogleMap.lat' | ||
db.delete_column('cmsplugin_googlemap', 'lat') | ||
|
||
|
||
models = { | ||
'cms.cmsplugin': { | ||
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'language': ('django.db.models.fields.CharField', [], {'max_length': '5', 'db_index': 'True'}), | ||
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Page']"}), | ||
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}), | ||
'placeholder': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), | ||
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), | ||
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), | ||
'publisher_is_draft': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}), | ||
'publisher_public': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'publisher_draft'", 'unique': 'True', 'null': 'True', 'to': "orm['cms.CMSPlugin']"}), | ||
'publisher_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '0', 'db_index': 'True'}), | ||
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) | ||
}, | ||
'cms.cmspluginpublic': { | ||
'creation_date': ('models.DateTimeField', [], {'default': 'datetime.datetime(2009, 7, 14, 7, 37, 26, 118649)'}), | ||
'id': ('models.AutoField', [], {'primary_key': 'True'}), | ||
'language': ('models.CharField', [], {'max_length': '5', 'db_index': 'True'}), | ||
'level': ('models.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'lft': ('models.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'mark_delete': ('models.BooleanField', [], {'default': 'False', 'blank': 'True'}), | ||
'page': ('models.ForeignKey', [], {'to': "orm['cms.PagePublic']"}), | ||
'parent': ('models.ForeignKey', [], {'to': "orm['cms.CMSPluginPublic']", 'null': 'True', 'blank': 'True'}), | ||
'placeholder': ('models.CharField', [], {'max_length': '50', 'db_index': 'True'}), | ||
'plugin_type': ('models.CharField', [], {'max_length': '50', 'db_index': 'True'}), | ||
'position': ('models.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), | ||
'rght': ('models.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'tree_id': ('models.PositiveIntegerField', [], {'db_index': 'True'}) | ||
}, | ||
'cms.page': { | ||
'changed_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}), | ||
'created_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}), | ||
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'in_navigation': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}), | ||
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'login_required': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), | ||
'menu_login_required': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), | ||
'moderator_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '1', 'blank': 'True'}), | ||
'navigation_extenders': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '80', 'null': 'True', 'blank': 'True'}), | ||
'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['cms.Page']"}), | ||
'publication_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), | ||
'publication_end_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), | ||
'published': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), | ||
'publisher_is_draft': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}), | ||
'publisher_public': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'publisher_draft'", 'unique': 'True', 'null': 'True', 'to': "orm['cms.Page']"}), | ||
'publisher_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '0', 'db_index': 'True'}), | ||
'reverse_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '40', 'null': 'True', 'blank': 'True'}), | ||
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}), | ||
'soft_root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}), | ||
'template': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) | ||
}, | ||
'cms.pagepublic': { | ||
'changed_by': ('models.CharField', [], {'max_length': '70'}), | ||
'created_by': ('models.CharField', [], {'max_length': '70'}), | ||
'creation_date': ('models.DateTimeField', [], {'default': 'datetime.datetime(2009, 7, 14, 7, 37, 26, 379713)'}), | ||
'id': ('models.AutoField', [], {'primary_key': 'True'}), | ||
'in_navigation': ('models.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}), | ||
'level': ('models.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'lft': ('models.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'login_required': ('models.BooleanField', [], {'default': 'False', 'blank': 'True'}), | ||
'mark_delete': ('models.BooleanField', [], {'default': 'False', 'blank': 'True'}), | ||
'moderator_state': ('models.SmallIntegerField', [], {'default': '1', 'blank': 'True'}), | ||
'navigation_extenders': ('models.CharField', [], {'db_index': 'True', 'max_length': '80', 'null': 'True', 'blank': 'True'}), | ||
'parent': ('models.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['cms.PagePublic']"}), | ||
'publication_date': ('models.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), | ||
'publication_end_date': ('models.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), | ||
'published': ('models.BooleanField', [], {'default': 'False', 'blank': 'True'}), | ||
'reverse_id': ('models.CharField', [], {'db_index': 'True', 'max_length': '40', 'null': 'True', 'blank': 'True'}), | ||
'rght': ('models.PositiveIntegerField', [], {'db_index': 'True'}), | ||
'site': ('models.ForeignKey', [], {'to': "orm['sites.Site']"}), | ||
'soft_root': ('models.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}), | ||
'template': ('models.CharField', [], {'max_length': '100'}), | ||
'tree_id': ('models.PositiveIntegerField', [], {'db_index': 'True'}) | ||
}, | ||
'googlemap.googlemap': { | ||
'Meta': {'db_table': "'cmsplugin_googlemap'"}, | ||
'address': ('django.db.models.fields.CharField', [], {'max_length': '150'}), | ||
'city': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), | ||
'content': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
'lat': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '10', 'decimal_places': '6', 'blank': 'True'}), | ||
'lng': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '10', 'decimal_places': '6', 'blank': 'True'}), | ||
'title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), | ||
'zipcode': ('django.db.models.fields.CharField', [], {'max_length': '30'}), | ||
'zoom': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) | ||
}, | ||
'sites.site': { | ||
'Meta': {'db_table': "'django_site'"}, | ||
'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | ||
} | ||
} | ||
|
||
complete_apps = ['googlemap'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
cms/plugins/googlemap/templates/cms/plugins/.tmp_googlemap.html.27330~
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{% load i18n %} | ||
|
||
<div id="map"> | ||
<div id="google-map" style="height:385px; width:auto; display: block;"></div> | ||
</div> | ||
|
||
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key={{ GOOGLE_MAPS_API_KEY }}&hl={{ lang }}"></script> | ||
<script type="text/javascript"> | ||
//<![CDATA[ | ||
var geocoder; | ||
var map; | ||
|
||
var title = "{{ object.get_title }}"; | ||
var address = "{{ object.address }}, {{ object.zipcode }} {{ object.city }}"; | ||
var zoom = {{ object.get_zoom_level }}; | ||
|
||
function load() | ||
{ | ||
// Create new map object | ||
map = new GMap2(document.getElementById("google-map")); | ||
map.addControl(new GSmallZoomControl()); | ||
map.addControl(new GMapTypeControl()); | ||
|
||
// Create new geocoding object | ||
geocoder = new GClientGeocoder(); | ||
|
||
// Retrieve location information, pass it to addToMap() | ||
geocoder.getLocations(address, addToMap); | ||
} | ||
|
||
// This function adds the point to the map | ||
|
||
function addToMap(response) | ||
{ | ||
// Retrieve the object | ||
place = response.Placemark[0]; | ||
|
||
// Retrieve the latitude and longitude | ||
point1 = new GLatLng(place.Point.coordinates[1], | ||
place.Point.coordinates[0]); | ||
|
||
// Retrieve the latitude and longitude | ||
point2 = new GLatLng(place.Point.coordinates[1] + 0.01, | ||
place.Point.coordinates[0]); | ||
|
||
// Center the map on this point | ||
map.setCenter(point2, zoom); | ||
|
||
// Create a marker | ||
marker = new GMarker(point1); | ||
|
||
// Add the marker to map | ||
map.addOverlay(marker); | ||
|
||
// Add address information to marker | ||
marker.openInfoWindowHtml("<strong>" + title + "</strong><br />" + place.address {% ifnotequal map.get_content "" %} + "<br/><br/><i>{{ object.get_content }}</i>"{% endifnotequal %}); | ||
} | ||
|
||
load(); | ||
//]]> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters