diff options
-rw-r--r-- | apps/blog/signals.py | 55 | ||||
-rw-r--r-- | media/js/mainmap.js | 58 | ||||
-rw-r--r-- | templates/archives/homepage.html | 2 | ||||
-rw-r--r-- | templates/archives/writing.html | 2 | ||||
-rw-r--r-- | templates/includes/recent_entries.html | 36 |
5 files changed, 105 insertions, 48 deletions
diff --git a/apps/blog/signals.py b/apps/blog/signals.py index 23e6d3f..7134239 100644 --- a/apps/blog/signals.py +++ b/apps/blog/signals.py @@ -6,30 +6,31 @@ from django.db.models import get_model from locations.models import Region,Country,Route def update_recent(sender, instance, signal, *args, **kwargs): - # Update recent entries static file - model = get_model('blog', 'entry') - qs = {'object_list': model.objects.filter(status__exact=1).order_by('-pub_date')[1:4]} - c = Context(qs) - t = render_to_string('includes/recent_entries_template.html',c) - fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/recent_entries.html') - file = open(fpath, 'w') - file.write(t) - file.close() - # Update map template - import codecs - qs = model.objects.filter(status__exact=1) - cl = Country.objects.filter(visited=True).exclude(name='default') - rl = Region.objects.all() - rtl = Route.objects.all() - c = Context({'object_list':qs, 'country_list':cl,'region_list':rl, 'route_list':rtl}) - t = render_to_string('includes/map_entry_list_template.html',c) - fpath = '%s%s' %(settings.PROJ_ROOT,'media/js/mainmap.js') - file = codecs.open(fpath, 'w','utf8') - file.write(t) - file.close() - c = Context({'country_list':cl,'region_list':rl,'route_list':rtl}) - t = render_to_string('includes/map_sidebar_template.html',c) - fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/map_sidebar.html') - file = codecs.open(fpath, 'w','utf8') - file.write(t) - file.close()
\ No newline at end of file + if not settings.DEVELOPMENT: + # Update recent entries static file + model = get_model('blog', 'entry') + qs = {'object_list': model.objects.filter(status__exact=1).order_by('-pub_date')[1:4]} + c = Context(qs) + t = render_to_string('includes/recent_entries_template.html',c) + fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/recent_entries.html') + file = open(fpath, 'w') + file.write(t) + file.close() + # Update map template + import codecs + qs = model.objects.filter(status__exact=1) + cl = Country.objects.filter(visited=True).exclude(name='default') + rl = Region.objects.all() + rtl = Route.objects.all() + c = Context({'object_list':qs, 'country_list':cl,'region_list':rl, 'route_list':rtl}) + t = render_to_string('includes/map_entry_list_template.html',c) + fpath = '%s%s' %(settings.PROJ_ROOT,'media/js/mainmap.js') + file = codecs.open(fpath, 'w','utf8') + file.write(t) + file.close() + c = Context({'country_list':cl,'region_list':rl,'route_list':rtl}) + t = render_to_string('includes/map_sidebar_template.html',c) + fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/map_sidebar.html') + file = codecs.open(fpath, 'w','utf8') + file.write(t) + file.close()
\ No newline at end of file diff --git a/media/js/mainmap.js b/media/js/mainmap.js index 2c3c6ea..2bed7bd 100644 --- a/media/js/mainmap.js +++ b/media/js/mainmap.js @@ -627,6 +627,62 @@ function initialize() { //loop through and set up markers/info windows + var marker_dinosaur_national = new google.maps.Marker({ + position: new google.maps.LatLng(40.5206340265, -108.993880734), + map: map, + shadow: shadow, + icon: image + }); + + var c_dinosaur_national = '<div class="infowin"><h4>Dinosaur National Monument, Part One: Echo Park<\/h4><span class="date blok">July 28, 2010 (Dinosaur National Monument, Colorado)<\/span><p><img src="http://images.luxagraf.net/post-thumbnail/2010/dinosaurv.jpg" height="100" alt="Dinosaur National Monument, Part One: Echo Park" style="float: left; border: #000 10px solid; margin-right: 8px; margin-bottom: 4px; height: 100px;" \/>Dinosaur National Monument was poorly named. The best parts of it are not the fossils in the quarry (which is closed for 2010 anyway) but the canyon country \u0026mdash\u003B some of the best, most remote canyon country you\u0027ll find in this part of the world. <a href="/2010/jul/28/dinosaur-national-monument-part-one-echo-park/">Read it »<\/a><\/p><\/div>'; + + google.maps.event.addListener(marker_dinosaur_national, 'click', function() { + openWin(c_dinosaur_national,marker_dinosaur_national); + }); + + + var marker_the_endless = new google.maps.Marker({ + position: new google.maps.LatLng(44.4618029245, -110.821969792), + map: map, + shadow: shadow, + icon: image + }); + + var c_the_endless = '<div class="infowin"><h4>The Endless Crowds of Yellowstone<\/h4><span class="date blok">July 25, 2010 (Yellowstone National Park, Wyoming)<\/span><p><img src="http://images.luxagraf.net/post-thumbnail/2010/yellowstonev.jpg" height="100" alt="The Endless Crowds of Yellowstone" style="float: left; border: #000 10px solid; margin-right: 8px; margin-bottom: 4px; height: 100px;" \/>There is wilderness in Yellowstone, even if it\u0027s just inches from the boardwalks that transport thousands around the geothermal pools. It may not be wilderness on a grand scale \u0026mdash\u003B the sweeping mountain peaks or wild rivers of other parks \u0026mdash but in some ways that makes it more enticing. As one Ranger told me, Yellowstone isn\u0027t about the big picture, the grand scenery, it\u0027s about the tiny details within each pool. To really see Yellowstone, he said, you have to take your time, move slowly and look closely. <a href="/2010/jul/25/endless-crowds-yellowstone/">Read it »<\/a><\/p><\/div>'; + + google.maps.event.addListener(marker_the_endless, 'click', function() { + openWin(c_the_endless,marker_the_endless); + }); + + + var marker_backpacking_in = new google.maps.Marker({ + position: new google.maps.LatLng(43.7931543168, -110.79651831), + map: map, + shadow: shadow, + icon: image + }); + + var c_backpacking_in = '<div class="infowin"><h4>Backpacking in the Grand Tetons<\/h4><span class="date blok">July 22, 2010 (Grand Teton National Park, Wyoming)<\/span><p><img src="http://images.luxagraf.net/post-thumbnail/2010/grandtetonsv.jpg" height="100" alt="Backpacking in the Grand Tetons" style="float: left; border: #000 10px solid; margin-right: 8px; margin-bottom: 4px; height: 100px;" \/>Hiking into the wilderness empties your mind. You fall into the silence of the mountains and you can relax in a way that\u0027s very difficult to do in the midst of civilization. The white noise that surrounds us in our everyday lives, that noise we don\u0027t even notice as it adds thin layers of stress that build up over days, weeks, years, does not seem capable of following us into the mountains. <a href="/2010/jul/22/backpacking-grand-tetons/">Read it »<\/a><\/p><\/div>'; + + google.maps.event.addListener(marker_backpacking_in, 'click', function() { + openWin(c_backpacking_in,marker_backpacking_in); + }); + + + var marker_great_sand = new google.maps.Marker({ + position: new google.maps.LatLng(37.7267371803, -105.550975785), + map: map, + shadow: shadow, + icon: image + }); + + var c_great_sand = '<div class="infowin"><h4>Great Sand Dunes National Park<\/h4><span class="date blok">July 17, 2010 (Great Sand Dunes National Park, Colorado)<\/span><p><img src="http://images.luxagraf.net/post-thumbnail/2010/greatsanddunesv_4.jpg" height="100" alt="Great Sand Dunes National Park" style="float: left; border: #000 10px solid; margin-right: 8px; margin-bottom: 4px; height: 100px;" \/>Something about the desert inspires me to get up early and watch the sunrise. The cool mornings seem worth getting up for out here in the high plains of Colorado, especially when there\u0027s the chance to watch the sunrise from the largest sand dunes in North America, here in Great Sand Dune National Park. <a href="/2010/jul/17/great-sand-dunes-national-park/">Read it »<\/a><\/p><\/div>'; + + google.maps.event.addListener(marker_great_sand, 'click', function() { + openWin(c_great_sand,marker_great_sand); + }); + + var marker_comanche_national = new google.maps.Marker({ position: new google.maps.LatLng(37.14748996, -103.009572015), map: map, @@ -634,7 +690,7 @@ function initialize() { icon: image }); - var c_comanche_national = '<div class="infowin"><h4>Comanche National Grasslands<\/h4><span class="date blok">July 16, 2010 (Comanche National Grasslands, Colorado)<\/span><p><img src="http://images.luxagraf.net/post-thumbnail/2010/comanchegrasslands.jpg" height="100" alt="Comanche National Grasslands" style="float: left; border: #000 10px solid; margin-right: 8px; margin-bottom: 4px; height: 100px;" \/>To say the Comanche National Grasslands is off the grid would be an understatement. With the exception of Highway 50 in Nevada, I’ve never driven through such isolation and vast openness anywhere in the world. And it’s easy to get lost. There are no signs, no road names even, just dirt paths crisscrossing a wide, perfectly flat expanses of grass. <a href="/2010/jul/16/comanche-national-grasslands/">Read it »<\/a><\/p><\/div>'; + var c_comanche_national = '<div class="infowin"><h4>Comanche National Grasslands<\/h4><span class="date blok">July 16, 2010 (Comanche National Grasslands, Colorado)<\/span><p><img src="http://images.luxagraf.net/post-thumbnail/2010/comanchegrasslands.jpg" height="100" alt="Comanche National Grasslands" style="float: left; border: #000 10px solid; margin-right: 8px; margin-bottom: 4px; height: 100px;" \/>To say the Comanche National Grasslands is off the grid would be an understatement. With the exception of Highway 50 in Nevada, I\u0027ve never driven through such isolation and vast openness anywhere in the world. And it\u0027s easy to get lost. There are no signs, no road names even, just dirt paths crisscrossing a wide, perfectly flat expanses of grass. <a href="/2010/jul/16/comanche-national-grasslands/">Read it »<\/a><\/p><\/div>'; google.maps.event.addListener(marker_comanche_national, 'click', function() { openWin(c_comanche_national,marker_comanche_national); diff --git a/templates/archives/homepage.html b/templates/archives/homepage.html index 2436795..7cb371e 100644 --- a/templates/archives/homepage.html +++ b/templates/archives/homepage.html @@ -44,4 +44,4 @@ {% endblock %} -{% block js %}<script src="/media/js/hyphenate.js" type="text/javascript"></script>{% endblock%}
\ No newline at end of file +{% block js %}<script src="{{MEDIA_URL}}js/hyphenate.min.js" type="text/javascript"></script>{% endblock%}
\ No newline at end of file diff --git a/templates/archives/writing.html b/templates/archives/writing.html index 7628272..3f8bca3 100644 --- a/templates/archives/writing.html +++ b/templates/archives/writing.html @@ -48,4 +48,4 @@ -{% block js %}<script src="{{MEDIA_URL}}js/hyphenate.js" type="text/javascript"></script>{% endblock%}
\ No newline at end of file +{% block js %}<script src="{{MEDIA_URL}}js/hyphenate.min.js" type="text/javascript"></script>{% endblock%}
\ No newline at end of file diff --git a/templates/includes/recent_entries.html b/templates/includes/recent_entries.html index 91a0ddd..a629a01 100644 --- a/templates/includes/recent_entries.html +++ b/templates/includes/recent_entries.html @@ -1,36 +1,36 @@ <ul> <li class="col1"> - <h3><a href="/2010/jul/15/why-national-parks-are-better-state-parks/" title="Why National Parks Are Better Than State Parks">Why National Parks Are Better Than State Parks</a></h3> + <h3><a href="/2010/jul/25/endless-crowds-yellowstone/" title="The Endless Crowds of Yellowstone">The Endless Crowds of Yellowstone</a></h3> <p> - <span class="location">Amarillo, <a href="/writing/united-states/1/" title="travel writing from the United States">Texas</a></span> + <span class="location">Yellowstone National Park, <a href="/writing/united-states/1/" title="travel writing from the United States">Wyoming</a></span> - <time datetime="2010-07-15 09:00:00">07/15/10</time> - <img src="http://images.luxagraf.net/post-thumbnail/2010/paloduratn.jpg" alt="Why National Parks Are Better Than State Parks" class="post-image" /> + <time datetime="2010-07-25 13:00:00">07/25/10</time> + <img src="http://images.luxagraf.net/post-thumbnail/2010/yellowstonev.jpg" alt="The Endless Crowds of Yellowstone" class="post-image" /> </p> - <p class="intro hyphenate">There are many reasons, but here's the one I currently consider most important: National Parks never close. Take Palo Dura State park outside of Amarillo, Texas. Were it a National Park, I would be there right now. But it's not, it's a state park and so I'm sitting in a hotel room in Amarillo because everyone knows nature closes at 10PM.</p> - <span class="button"><a class="permalink" href="/2010/jul/15/why-national-parks-are-better-state-parks/" title="Why National Parks Are Better Than State Parks">More »</a></span> + <p class="intro hyphenate">There is wilderness in Yellowstone, even if it's just inches from the boardwalks that transport thousands around the geothermal pools. It may not be wilderness on a grand scale — the sweeping mountain peaks or wild rivers of other parks &mdash but in some ways that makes it more enticing. As one Ranger told me, Yellowstone isn't about the big picture, the grand scenery, it's about the tiny details within each pool. To really see Yellowstone, he said, you have to take your time, move slowly and look closely. </p> + <span class="button"><a class="permalink" href="/2010/jul/25/endless-crowds-yellowstone/" title="The Endless Crowds of Yellowstone">More »</a></span> </li> <li class="col2"> - <h3><a href="/2010/jul/11/legend-billy-the-kid/" title="The Legend of Billy the Kid">The Legend of Billy the Kid</a></h3> + <h3><a href="/2010/jul/22/backpacking-grand-tetons/" title="Backpacking in the Grand Tetons">Backpacking in the Grand Tetons</a></h3> <p> - <span class="location">Hico, <a href="/writing/united-states/1/" title="travel writing from the United States">Texas</a></span> + <span class="location">Grand Teton National Park, <a href="/writing/united-states/1/" title="travel writing from the United States">Wyoming</a></span> - <time datetime="2010-07-11 17:00:00">07/11/10</time> - <img src="http://images.luxagraf.net/post-thumbnail/2010/Billykid.jpg" alt="The Legend of Billy the Kid" class="post-image" /> + <time datetime="2010-07-22 16:00:00">07/22/10</time> + <img src="http://images.luxagraf.net/post-thumbnail/2010/grandtetonsv.jpg" alt="Backpacking in the Grand Tetons" class="post-image" /> </p> - <p class="intro hyphenate">History rarely offers neat, tidy stories. But the messier, more confusing and more controversial the story becomes, the more it works its way into our imaginations. The legend of Billy the Kid is like that of Amelia Earhart or D.B. Cooper — the less we know for sure, the more compelling the story becomes.</p> - <span class="button"><a class="permalink" href="/2010/jul/11/legend-billy-the-kid/" title="The Legend of Billy the Kid">More »</a></span> + <p class="intro hyphenate">Hiking into the wilderness empties your mind. You fall into the silence of the mountains and you can relax in a way that's very difficult to do in the midst of civilization. The white noise that surrounds us in our everyday lives, that noise we don't even notice as it adds thin layers of stress that build up over days, weeks, years, does not seem capable of following us into the mountains. </p> + <span class="button"><a class="permalink" href="/2010/jul/22/backpacking-grand-tetons/" title="Backpacking in the Grand Tetons">More »</a></span> </li> <li class="col1"> - <h3><a href="/2010/jul/08/dixie-drug-store/" title="The Dixie Drug Store">The Dixie Drug Store</a></h3> + <h3><a href="/2010/jul/17/great-sand-dunes-national-park/" title="Great Sand Dunes National Park">Great Sand Dunes National Park</a></h3> <p> - <span class="location">New Orleans, <a href="/writing/united-states/1/" title="travel writing from the United States">Louisiana</a></span> + <span class="location">Great Sand Dunes National Park, <a href="/writing/united-states/1/" title="travel writing from the United States">Colorado</a></span> - <time datetime="2010-07-08 16:00:00">07/08/10</time> - <img src="http://images.luxagraf.net/post-thumbnail/2010/nopharmacymuseum.jpg" alt="The Dixie Drug Store" class="post-image" /> + <time datetime="2010-07-17 08:00:00">07/17/10</time> + <img src="http://images.luxagraf.net/post-thumbnail/2010/greatsanddunesv_4.jpg" alt="Great Sand Dunes National Park" class="post-image" /> </p> - <p class="intro hyphenate">New Orleans is it's own world. So much so that's it's impossible to put your finger on what it is that makes it different. New Orleans is a place where the line between consensus reality and private dream seems to have never fully developed. And a wonderful world it is.</p> - <span class="button"><a class="permalink" href="/2010/jul/08/dixie-drug-store/" title="The Dixie Drug Store">More »</a></span> + <p class="intro hyphenate">Something about the desert inspires me to get up early and watch the sunrise. The cool mornings seem worth getting up for out here in the high plains of Colorado, especially when there's the chance to watch the sunrise from the largest sand dunes in North America, here in Great Sand Dune National Park.</p> + <span class="button"><a class="permalink" href="/2010/jul/17/great-sand-dunes-national-park/" title="Great Sand Dunes National Park">More »</a></span> </li> </ul>
\ No newline at end of file |