Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mark Ransom
committed
Apr 25, 2012
1 parent
5bebb36
commit e14e91c
Showing
6 changed files
with
139 additions
and
4 deletions.
There are no files selected for viewing
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
"""Applications hooks for cmsplugin_zinnia""" | |||
from django.utils.translation import ugettext_lazy as _ | |||
|
|||
from cms.app_base import CMSApp | |||
from cms.apphook_pool import apphook_pool | |||
|
|||
class StoreLocatorApphook(CMSApp): | |||
"""Store Locator Apphook""" | |||
name = _('Store Locator') | |||
urls = ['store_locator.urls'] | |||
|
|||
apphook_pool.register(StoreLocatorApphook) |
68 changes: 68 additions & 0 deletions
68
store_locator/migrations/0009_auto__add_field_storelocator_show_distance.py
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,68 @@ | |||
# encoding: utf-8 | |||
import datetime | |||
from south.db import db | |||
from south.v2 import SchemaMigration | |||
from django.db import models | |||
|
|||
class Migration(SchemaMigration): | |||
|
|||
def forwards(self, orm): | |||
|
|||
# Adding field 'StoreLocator.show_distance' | |||
db.add_column('cmsplugin_storelocator', 'show_distance', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False) | |||
|
|||
|
|||
def backwards(self, orm): | |||
|
|||
# Deleting field 'StoreLocator.show_distance' | |||
db.delete_column('cmsplugin_storelocator', 'show_distance') | |||
|
|||
|
|||
models = { | |||
'cms.cmsplugin': { | |||
'Meta': {'object_name': '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': '15', 'db_index': 'True'}), | |||
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), | |||
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), | |||
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}), | |||
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), | |||
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), | |||
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), | |||
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), | |||
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) | |||
}, | |||
'cms.placeholder': { | |||
'Meta': {'object_name': 'Placeholder'}, | |||
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}), | |||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |||
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}) | |||
}, | |||
'store_locator.location': { | |||
'Meta': {'object_name': 'Location'}, | |||
'address': ('django.db.models.fields.TextField', [], {'max_length': '255'}), | |||
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), | |||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |||
'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True'}), | |||
'location_types': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['store_locator.LocationType']", 'null': 'True', 'blank': 'True'}), | |||
'longitude': ('django.db.models.fields.FloatField', [], {'null': 'True'}), | |||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | |||
'phone': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), | |||
'url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}) | |||
}, | |||
'store_locator.locationtype': { | |||
'Meta': {'object_name': 'LocationType'}, | |||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}) | |||
}, | |||
'store_locator.storelocator': { | |||
'Meta': {'object_name': 'StoreLocator', 'db_table': "'cmsplugin_storelocator'", '_ormbases': ['cms.CMSPlugin']}, | |||
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), | |||
'default_distance': ('django.db.models.fields.CharField', [], {'default': "'10'", 'max_length': '50'}), | |||
'show_distance': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | |||
'starting_location': ('django.db.models.fields.CharField', [], {'max_length': '255'}) | |||
} | |||
} | |||
|
|||
complete_apps = ['store_locator'] |
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
41 changes: 41 additions & 0 deletions
41
store_locator/templates/store_locator/store_locator_map_view.html
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,41 @@ | |||
{% extends "base.html" %} | |||
{% block content %} | |||
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script> | |||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" type="text/javascript"></script> | |||
|
|||
<div class="locations_search_fields"> | |||
<form> | |||
<input type="text" id="locations_search_field" /> | |||
<select id="distance_field"> | |||
{% for distance in distance_choices %} | |||
<option value="{{ distance.0 }}" {% if instance.default_distance == distance.0 %}selected="selected"{% endif %}>{{ distance.1 }}</option> | |||
{% endfor %} | |||
</select> | |||
<input type="submit" onClick="location_search(); return false;" value="Search" /> | |||
<ul class="location_types_list"> | |||
{% for type in location_types %} | |||
<li> | |||
<input name="location_type_{{ instance.id }}" type="radio" class="location_type" id="type_{{ type.id }}" value="{{ type.id }}"> | |||
<label for="type_{{ type.id }}">{{ type.name }}</label> | |||
</li> | |||
{% endfor %} | |||
<li> | |||
<input name="location_type_{{ instance.id }}" checked="checked" type="radio" class="location_type" id="type_all" value=""> | |||
<label for="type_all">All</label> | |||
</li> | |||
</ul> | |||
</form> | |||
</div> | |||
<div id="map_canvas" lass="locations_map" style="width:600px; height:400px"></div> | |||
<ul class="location_list"> | |||
|
|||
</ul> | |||
<script type="text/javascript"> | |||
var get_lat_long_url = "{{ get_lat_long_url }}"; | |||
var get_locations_url = "{{ get_locations_url }}"; | |||
var starting_location = "wichita, ks"; | |||
var starting_zoom = 2000; | |||
</script> | |||
|
|||
<script type="text/javascript" src="{{ STATIC_URL }}store_locator/js/store_locator_map.js"></script> | |||
{% endblock%} |
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