Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Snapshot for end of dash.

  • Loading branch information...
commit c475354b765e418348b609fd0af6a23c648cd54c 1 parent db3eca7
@coderanger authored
View
2  glitchtools/core/templates/glitchtools/core/layout.html
@@ -18,6 +18,7 @@
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css">
<script src="{{ STATIC_URL }}js/libs/modernizr-1.7.min.js"></script>
+ {% block extrahead %}{% endblock %}
</head>
<body>
<div id="container">
@@ -49,5 +50,6 @@
<script src="{{ STATIC_URL }}js/libs/dd_belatedpng.js"></script>
<script> DD_belatedPNG.fix('img, .png_bg');</script>
<![endif]-->
+ {% block javascript %}{% endblock %}
</body>
</html>
View
73 glitchtools/map/migrations/0006_auto__add_streetfeaturesnapshot__add_streetfeaturesnaphotitem__add_uni.py
@@ -0,0 +1,73 @@
+# 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 model 'StreetFeatureSnapshot'
+ db.create_table('map_streetfeaturesnapshot', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('street', self.gf('django.db.models.fields.related.ForeignKey')(related_name='feature_snapshots', to=orm['map.Street'])),
+ ('ts', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.utcnow)),
+ ))
+ db.send_create_signal('map', ['StreetFeatureSnapshot'])
+
+ # Adding model 'StreetFeatureSnaphotItem'
+ db.create_table('map_streetfeaturesnaphotitem', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('snapshot', self.gf('django.db.models.fields.related.ForeignKey')(related_name='items', to=orm['map.StreetFeatureSnapshot'])),
+ ('feature', self.gf('django.db.models.fields.CharField')(max_length=100)),
+ ))
+ db.send_create_signal('map', ['StreetFeatureSnaphotItem'])
+
+ # Adding unique constraint on 'Street', fields ['tsid']
+ db.create_unique('map_street', ['tsid'])
+
+
+ def backwards(self, orm):
+
+ # Removing unique constraint on 'Street', fields ['tsid']
+ db.delete_unique('map_street', ['tsid'])
+
+ # Deleting model 'StreetFeatureSnapshot'
+ db.delete_table('map_streetfeaturesnapshot')
+
+ # Deleting model 'StreetFeatureSnaphotItem'
+ db.delete_table('map_streetfeaturesnaphotitem')
+
+
+ models = {
+ 'map.hub': {
+ 'Meta': {'object_name': 'Hub'},
+ 'id': ('django.db.models.fields.PositiveSmallIntegerField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'map.street': {
+ 'Meta': {'object_name': 'Street'},
+ 'connections': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'connections_rel_+'", 'to': "orm['map.Street']"}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'hub': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'streets'", 'to': "orm['map.Hub']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'last_update': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1970, 1, 1, 0, 0)'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'tsid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '15'})
+ },
+ 'map.streetfeaturesnaphotitem': {
+ 'Meta': {'object_name': 'StreetFeatureSnaphotItem'},
+ 'feature': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'snapshot': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['map.StreetFeatureSnapshot']"})
+ },
+ 'map.streetfeaturesnapshot': {
+ 'Meta': {'object_name': 'StreetFeatureSnapshot'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'street': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'feature_snapshots'", 'to': "orm['map.Street']"}),
+ 'ts': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'})
+ }
+ }
+
+ complete_apps = ['map']
View
67 glitchtools/map/migrations/0007_auto__del_streetfeaturesnaphotitem__add_streetfeaturesnapshotitem.py
@@ -0,0 +1,67 @@
+# 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):
+
+ # Deleting model 'StreetFeatureSnaphotItem'
+ db.delete_table('map_streetfeaturesnaphotitem')
+
+ # Adding model 'StreetFeatureSnapshotItem'
+ db.create_table('map_streetfeaturesnapshotitem', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('snapshot', self.gf('django.db.models.fields.related.ForeignKey')(related_name='items', to=orm['map.StreetFeatureSnapshot'])),
+ ('feature', self.gf('django.db.models.fields.CharField')(max_length=100)),
+ ))
+ db.send_create_signal('map', ['StreetFeatureSnapshotItem'])
+
+
+ def backwards(self, orm):
+
+ # Adding model 'StreetFeatureSnaphotItem'
+ db.create_table('map_streetfeaturesnaphotitem', (
+ ('snapshot', self.gf('django.db.models.fields.related.ForeignKey')(related_name='items', to=orm['map.StreetFeatureSnapshot'])),
+ ('feature', self.gf('django.db.models.fields.CharField')(max_length=100)),
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ))
+ db.send_create_signal('map', ['StreetFeatureSnaphotItem'])
+
+ # Deleting model 'StreetFeatureSnapshotItem'
+ db.delete_table('map_streetfeaturesnapshotitem')
+
+
+ models = {
+ 'map.hub': {
+ 'Meta': {'object_name': 'Hub'},
+ 'id': ('django.db.models.fields.PositiveSmallIntegerField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'map.street': {
+ 'Meta': {'object_name': 'Street'},
+ 'connections': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'connections_rel_+'", 'to': "orm['map.Street']"}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'hub': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'streets'", 'to': "orm['map.Hub']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'last_update': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1970, 1, 1, 0, 0)'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'tsid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '15'})
+ },
+ 'map.streetfeaturesnapshot': {
+ 'Meta': {'object_name': 'StreetFeatureSnapshot'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'street': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'feature_snapshots'", 'to': "orm['map.Street']"}),
+ 'ts': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'})
+ },
+ 'map.streetfeaturesnapshotitem': {
+ 'Meta': {'object_name': 'StreetFeatureSnapshotItem'},
+ 'feature': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'snapshot': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['map.StreetFeatureSnapshot']"})
+ }
+ }
+
+ complete_apps = ['map']
View
52 glitchtools/map/migrations/0008_auto__add_field_streetfeaturesnapshotitem_count.py
@@ -0,0 +1,52 @@
+# 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 'StreetFeatureSnapshotItem.count'
+ db.add_column('map_streetfeaturesnapshotitem', 'count', self.gf('django.db.models.fields.IntegerField')(default=1), keep_default=False)
+
+
+ def backwards(self, orm):
+
+ # Deleting field 'StreetFeatureSnapshotItem.count'
+ db.delete_column('map_streetfeaturesnapshotitem', 'count')
+
+
+ models = {
+ 'map.hub': {
+ 'Meta': {'object_name': 'Hub'},
+ 'id': ('django.db.models.fields.PositiveSmallIntegerField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'map.street': {
+ 'Meta': {'object_name': 'Street'},
+ 'connections': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'connections_rel_+'", 'to': "orm['map.Street']"}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'hub': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'streets'", 'to': "orm['map.Hub']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'last_update': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1970, 1, 1, 0, 0)'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'tsid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '15'})
+ },
+ 'map.streetfeaturesnapshot': {
+ 'Meta': {'object_name': 'StreetFeatureSnapshot'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'street': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'feature_snapshots'", 'to': "orm['map.Street']"}),
+ 'ts': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'})
+ },
+ 'map.streetfeaturesnapshotitem': {
+ 'Meta': {'object_name': 'StreetFeatureSnapshotItem'},
+ 'count': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
+ 'feature': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'snapshot': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['map.StreetFeatureSnapshot']"})
+ }
+ }
+
+ complete_apps = ['map']
View
53 glitchtools/map/migrations/0009_auto__add_field_street_current_features.py
@@ -0,0 +1,53 @@
+# 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 'Street.current_features'
+ db.add_column('map_street', 'current_features', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', null=True, to=orm['map.StreetFeatureSnapshot']), keep_default=False)
+
+
+ def backwards(self, orm):
+
+ # Deleting field 'Street.current_features'
+ db.delete_column('map_street', 'current_features_id')
+
+
+ models = {
+ 'map.hub': {
+ 'Meta': {'object_name': 'Hub'},
+ 'id': ('django.db.models.fields.PositiveSmallIntegerField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'map.street': {
+ 'Meta': {'object_name': 'Street'},
+ 'connections': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'connections_rel_+'", 'to': "orm['map.Street']"}),
+ 'current_features': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['map.StreetFeatureSnapshot']"}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'hub': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'streets'", 'to': "orm['map.Hub']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'last_update': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1970, 1, 1, 0, 0)'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'tsid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '15'})
+ },
+ 'map.streetfeaturesnapshot': {
+ 'Meta': {'object_name': 'StreetFeatureSnapshot'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'street': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'feature_snapshots'", 'to': "orm['map.Street']"}),
+ 'ts': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'})
+ },
+ 'map.streetfeaturesnapshotitem': {
+ 'Meta': {'object_name': 'StreetFeatureSnapshotItem'},
+ 'count': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
+ 'feature': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'snapshot': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['map.StreetFeatureSnapshot']"})
+ }
+ }
+
+ complete_apps = ['map']
View
112 glitchtools/map/models.py
@@ -1,12 +1,84 @@
import collections
import datetime
+import re
from django.db import models
from django.utils.translation import ugettext_lazy as _
-from glitchtools.utils.db import TSIDField
+from glitchtools.utils.db import TSIDField, update
+
+FEATURES_RE = re.compile(r'<b>(?:(\d*) )?([^<]+)</b>')
+
+FEATURES = (
+ 'A Firefly Swarm',
+ 'Alchemical Goods Vendor',
+ 'Alph',
+ 'Animal Goods Vendor',
+ 'Bean Tree',
+ 'Beryl Rock for mining',
+ 'Bubble Tree',
+ 'Butterfly',
+ 'Chicken',
+ 'Cosma',
+ 'Crop Garden plots',
+ 'Dullite Rock for mining',
+ 'Egg Plant',
+ 'Friendly',
+ 'Fruit Tree',
+ 'Gardening Goods Vendor',
+ 'Gardening Tools Vendor',
+ 'Gas Plant',
+ 'Grendaline',
+ 'Groceries Vendor',
+ 'Hardware Vendor',
+ 'Humbaba',
+ 'Jellisac Growth',
+ 'Kitchen Tools Vendor',
+ 'Lem',
+ 'Mab',
+ 'Meal Vendor',
+ 'Metal Rock for mining',
+ 'Mining Vendor',
+ 'Mortar Barnacle',
+ 'Paper Tree',
+ 'Patch',
+ 'Peat Bog',
+ 'Piggy',
+ 'Pot',
+ 'Produce Vendor',
+ 'Sparkly Rock for mining',
+ 'Spice Plant',
+ 'Spriggan',
+ 'Ti',
+ 'Tool Vendor',
+ 'Wood Tree',
+ 'Zille',
+)
+
+FEATURES_PLURALS = {
+ 'Bean Trees': 'Bean Tree',
+ 'Beryl Rocks for mining': 'Beryl Rock for mining',
+ 'Bubble Trees': 'Bubble Tree',
+ 'Butterflies': 'Butterfly',
+ 'Chickens': 'Chicken',
+ 'Dullite Rocks for mining': 'Dullite Rock for mining',
+ 'Egg Plants': 'Egg Plant',
+ 'Fruit Trees': 'Fruit Tree',
+ 'Gas Plants': 'Gas Plant',
+ 'Jellisac Growths': 'Jellisac Growth',
+ 'Metal Rocks for mining': 'Metal Rock for mining',
+ 'Mortar Barnacles': 'Mortar Barnacle',
+ 'Paper Trees': 'Paper Tree',
+ 'Patches': 'Patch',
+ 'Peat Bogs': 'Peat Bog',
+ 'Piggies': 'Piggy',
+ 'Sparkly Rocks for mining': 'Sparkly Rock for mining',
+ 'Spice Plants': 'Spice Plant',
+ 'Wood Trees': 'Wood Tree',
+}
class Hub(models.Model):
+ """Data model for a single Glitch hub (called a region in-game)."""
id = models.PositiveSmallIntegerField(_('id'), primary_key=True)
name = models.CharField(_('name'), max_length=100)
@@ -15,12 +87,14 @@ def __unicode__(self):
class Street(models.Model):
+ """Data model for a single Glitch street."""
hub = models.ForeignKey(Hub, verbose_name=_('hub'), related_name='streets')
tsid = TSIDField(_('tsid'), unique=True)
name = models.CharField(_('name'), max_length=100)
deleted = models.BooleanField(_('deleted'), default=False)
last_update = models.DateTimeField(_('last update'), default=datetime.datetime.utcfromtimestamp(0))
connections = models.ManyToManyField('self', verbose_name=_('connections'))
+ current_features = models.ForeignKey('StreetFeatureSnapshot', null=True, verbose_name=_('current features'), related_name='+')
def __unicode__(self):
return self.name
@@ -32,9 +106,43 @@ def search(self, search_fn):
unexplored = collections.deque((id, (self.id,)) for id in self.connections.values_list('id', flat=True))
while unexplored:
cur_id, cur_path = unexplored.popleft()
- cur = Street.objects.get(id=cur_id)
+ cur = Street.objects.select_related('current_features').get(id=cur_id)
new_path = cur_path + (cur_id,)
if search_fn(cur):
return new_path
explored.add(cur.id)
unexplored.extend((id, new_path) for id in cur.connections.values_list('id', flat=True) if id not in explored)
+
+ def set_features(self, raw_features):
+ # Clean up the raw features strings, normalize to lowercase, and de-pluralize
+ features = {}
+ for count, feature in FEATURES_RE.findall(''.join(raw_features)):
+ features[FEATURES_PLURALS.get(feature, feature).lower()] = int(count or 0)
+ if not self.current_features or not self.current_features.features_equal(features):
+ snapshot = StreetFeatureSnapshot.objects.create(street=self)
+ for feature, count in features.iteritems():
+ StreetFeatureSnapshotItem.objects.create(snapshot=snapshot, feature=feature, count=count)
+ update(self, current_features=snapshot)
+
+
+class StreetFeatureSnapshot(models.Model):
+ """Data model for a snapshot in time of the features on a street."""
+ street = models.ForeignKey(Street, verbose_name=_('street'), related_name='feature_snapshots')
+ ts = models.DateTimeField(_('timestamp'), default=datetime.datetime.utcnow)
+
+ def features_equal(self, features):
+ """Is the given dict of {'feature': count} the same as this snapshot."""
+ items = self.items.all()
+ if len(items) != len(features):
+ return False
+ for it in items:
+ if features.get(it.feature) != it.count:
+ return False
+ return True
+
+
+class StreetFeatureSnapshotItem(models.Model):
+ """Data model for a single feature on a street."""
+ snapshot = models.ForeignKey(StreetFeatureSnapshot, verbose_name=_('snapshot'), related_name='items')
+ feature = models.CharField(_('feature'), max_length=100, choices=((s.lower(),s) for s in FEATURES))
+ count = models.IntegerField(_('count'), default=1)
View
17 glitchtools/map/static/css/map.scss
@@ -0,0 +1,17 @@
+@import "base";
+
+#map {
+ .loc-select {
+ @include columns(3, 12);
+ }
+
+ .search {
+ @include columns(9, 12);
+ @include omega(12);
+ }
+
+ .street-select {
+ display: none;
+ .street { display: none; }
+ }
+}
View
8 glitchtools/map/tasks.py
@@ -46,6 +46,7 @@ def update_streets_info(force=False):
def update_street_info(tsid):
info = api.locations.streetInfo(street_tsid=tsid)
street = Street.objects.get(tsid=tsid)
+ street.set_features(info['features'])
street.connections.exclude(tsid__in=info['connections']).delete()
for connection_tsid in info['connections'].iterkeys():
try:
@@ -67,4 +68,9 @@ def fn(street):
@task
def find_feature(tsid, feature):
- pass
+ # Normalize to lowercase
+ feature = feature.lower()
+ start_street = Street.object.get(tsid=tsid)
+ def fn(street):
+ return street.current_features.filter(feature=feature)
+ return start_street.search(fn)
View
52 glitchtools/map/templates/glitchtools/map/index.html
@@ -0,0 +1,52 @@
+{% extends 'glitchtools/map/layout.html' %}
+
+{% block content %}
+<div id="map" class="index">
+ <div class="loc-select">
+ {% if current_location %}
+ <div class="current">
+ <a class="street" data-tsid="{{ current_location.tsid }}">{{ current_location.name }}</a>
+ </div>
+ {% endif %}
+ <div class="region-select">
+ <ul>
+ {% for hub in hubs %}
+ <li><a href="#" data-hub="{{ hub.id }}">{{ hub.name }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ <div class="street-select">
+ <ul>
+ {% for street in streets %}
+ <li><a class="street" href="#" data-hub="{{ street.hub_id }}" data-tsid="{{ street.tsid }}">{{ street.name }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+ <div class="search">
+ What do you want to look for?
+ </div>
+</div>
+{% endblock %}
+
+{% block javascript %}{{ block.super }}
+<script type="text/javascript">
+ $(function() {
+ $('.region-select a').click(function() {
+ var elm = $(this);
+ $('.region-select').hide();
+ $('.street-select').show().find('a').each(function() {
+ var streetElm = $(this);
+ if(streetElm.data('hub') == elm.data('hub')) {
+ streetElm.show();
+ }
+ });
+ return false;
+ });
+
+ $('.street').click(function() {
+
+ });
+ });
+</script>
+{% endblock %}
View
5 glitchtools/map/templates/glitchtools/map/layout.html
@@ -0,0 +1,5 @@
+{% extends 'glitchtools/core/layout.html' %}
+
+{% block extrahead %}{{ block.super }}
+<link rel="stylesheet" href="{{ STATIC_URL }}css/map.css">
+{% endblock %}
View
7 glitchtools/map/urls.py
@@ -0,0 +1,7 @@
+from django.conf.urls.defaults import patterns, url
+
+from glitchtools.map import views
+
+urlpatterns = patterns('',
+ url(r'^$', views.index, name='glitchtools-map-index'),
+)
View
14 glitchtools/map/views.py
@@ -0,0 +1,14 @@
+from django.template.response import TemplateResponse
+
+from glitchtools.map.models import Hub, Street
+
+def index(request):
+ data = {
+ 'hubs': Hub.objects.all().order_by('name'),
+ 'streets': Street.objects.all().order_by('name'),
+ 'current_location': '',
+ }
+ if request.glitch_user and request.glitch_user.location:
+ data['current_location'] = Street.objects.filter(tsid=request.glitch_user.location).values('tsid', 'name')
+ return TemplateResponse(request, 'glitchtools/map/index.html', data)
+
View
3  glitchtools/urls.py
@@ -6,5 +6,6 @@
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^login/', include('glitchtools.users.urls')),
- url(r'', 'glitchtools.core.views.comingsoon'),
+ url(r'^map/', include('glitchtools.map.urls')),
+ url(r'^$', 'glitchtools.core.views.comingsoon'),
)
Please sign in to comment.
Something went wrong with that request. Please try again.