summaryrefslogtreecommitdiff
path: root/templates/archives
diff options
context:
space:
mode:
Diffstat (limited to 'templates/archives')
-rw-r--r--templates/archives/homepage.html20
-rw-r--r--templates/archives/map.html111
-rw-r--r--templates/archives/photos.html14
-rw-r--r--templates/archives/writing.html12
4 files changed, 8 insertions, 149 deletions
diff --git a/templates/archives/homepage.html b/templates/archives/homepage.html
index 2d72d0b..c6ad42d 100644
--- a/templates/archives/homepage.html
+++ b/templates/archives/homepage.html
@@ -16,23 +16,7 @@
{% block extrabody %}
<div class="archives">
<h4 id="archive-header">Recently</h4>
- <ul>
- {% for object in object_list %}
- <li>
- <dl>
- <dt>
- <span class="post-image"><img src="{{object.get_thumbnail_url}}" alt="{{ object.title }}"/></span>
- <h3><a href="{{object.get_absolute_url}}" title="{%if object.title_keywords%}{{object.title_keywords}}{%else%}{{object.title}}{%endif%}">{{object.title|smartypants|widont|safe}}</a></h3>
- </dt>
- <dd>
- <span class="date">{{object.pub_date|date:"F j, Y"}} {% ifequal object.location.state.country.name "United States" %}({{object.location.name|smartypants|safe}}, {{object.location.state.name}}){%else%}({{object.location.name|smartypants|safe}}, {{object.location.state.country.name}}){%endifequal%}</span>
- {{object.dek|safe}}
- <span class="more"><a href="{{object.get_absolute_url}}" title="{{object.title}}">Read&nbsp;it&nbsp;&raquo;</a></span>
- </dd>
- </dl>
- </li>
- {% endfor %}
- </ul>
+ {% include 'includes/recent_entries.html' %}
</div>
{% endblock %}
@@ -43,7 +27,7 @@
<div id="nav" class="first"><a href="{{featured.get_previous_published.get_absolute_url}}" title="">&laquo;Previous</a></div>
<div class="blok">
<h4>Topography</h4>
- {% chunk "regions_sidebar" %}
+ {% include 'includes/regions_sidebar.html' %}
</div>
<div class="blok">
<h4>About Luxagraf</h4>
diff --git a/templates/archives/map.html b/templates/archives/map.html
index 2714861..5deef0f 100644
--- a/templates/archives/map.html
+++ b/templates/archives/map.html
@@ -34,117 +34,10 @@ Google Maps code
{% block sidebar %}
<div id="sidebar">
- <div class="blok">
- <h4 class="first">Trips</h4>
- <ul>
- <li><a onclick="addRoute('yi_iAp}mmOlzd@egy@njcCcpOq{hDxyqAai_@kvhSio[b|zVjhNbmZ','BBBBBBB','#FF0000',12.0554, -85.1880, 8);" href="#">Nicaragua (2008)</a></li>
- </ul>
- <h4>Regions</h4>
- <ul>
- {%for region in region_list %}
- <li><a href="#{{region.slug}}" onclick="focusCountry({{region.lat}}, {{region.lon}}, {{region.zoom_level}});" title="See all writing from {{region.name|title}}">{{region.name}}</a></li>
- {% endfor %}
- </ul>
-
- <h4>Countries</h4>
- <ul>
- <li><a onclick="focusCountry(19.311143,2.460938,2);" href="#">All</a></li>
- {%for country in country_list %}
- <li><a href="#{{country.slug}}" onclick="focusCountry({{country.lat}}, {{country.lon}}, {{country.zoom_level}});" title="See all writing from {{country.name|title}}">{{country.name}}</a></li>
- {% endfor %}
- </ul>
-
- </div>
+{% include 'includes/map_sidebar.html' %}
</div><!-- sidebar -->
{% endblock %}
{% block js %}
-
-<script type="text/javascript">
- var map = null;
- function JLngLat(a,b) {
- return new GLatLng(b,a)
- }
- function initialize() {
- if (GBrowserIsCompatible()) {
- var tinyIcon = new GIcon();
- tinyIcon.image = "http://media.luxagraf.net/img/marker-entry.png";
- tinyIcon.shadow = "http://media.luxagraf.net/img/shadow.png";
- tinyIcon.iconSize = new GSize(12, 20);
- tinyIcon.shadowSize = new GSize(22, 20);
- tinyIcon.iconAnchor = new GPoint(6, 20);
- tinyIcon.infoWindowAnchor = new GPoint(5, 5);
-
- //var iconOptions = {};
- //iconOptions.primaryColor = "#a53503";
- //iconOptions.strokeColor = "#201a11";
- //var icon = MapIconMaker.createLabeledMarkerIcon(iconOptions);
-
- var location = window.location.hash;
- var pts = new Array();
- {%for c in country_list%}pts[{{forloop.counter0}}] = ["#{{c.slug}}", {{c.lat}},{{c.lon}},{{c.zoom_level}}];{% endfor %}
- {%for c in region_list%}pts[pts.length] = ["#{{c.slug}}", {{c.lat}},{{c.lon}},{{c.zoom_level}}];{% endfor %}
- if (location.length>1) {
- for (i=0;i<pts.length;i++) {
- if (location == pts[i][0]) {
- point = new GLatLng(pts[i][1],pts[i][2]);
- zoom = pts[i][3];
- break;
- } else {
- point = new GLatLng(19.311143,2.460938);
- zoom = 2;
- }
- }
- } else {
- point = new GLatLng(19.311143,2.460938);
- zoom = 2;
- }
-
- // create a new map.
- map = new GMap2(document.getElementById("map-canvas"));
- map.enableContinuousZoom()
- map.setCenter(point, zoom, G_PHYSICAL_MAP);
-
- // basic control and overview (closed by default)
- map.addControl(new GSmallZoomControl());
- var ov = new GOverviewMapControl(new GSize(100,100));
- map.addControl(ov);
- ov.hide(true);
-
- // Add a marker for each project
-
- {% for entry in object_list %}
- point_{{entry.title|truncatewords:2|slugify_under}} = JLngLat{{entry.point.coords}};
- markerOptions = { clickable:true, draggable:false, icon:tinyIcon};
- marker_{{entry.title|truncatewords:2|slugify_under}} = new GMarker(point_{{entry.title|truncatewords:2|slugify_under}}, markerOptions);
- map.addOverlay(marker_{{entry.title|truncatewords:2|slugify_under}});
- marker_{{entry.title|truncatewords:2|slugify_under}}.info_window_content = '<div class="mcanvas"><h4>{{entry.title}}<\/h4><span>{{entry.pub_date|date:"F j, Y"}} ({% ifequal entry.location.state.country.name "United States" %}{{entry.location.name|smartypants|safe}}, {{entry.location.state.name}}){%else%}{{entry.location.name|smartypants|safe}}, {{entry.location.state.country.name}}){%endifequal%}<\/span><p><img src="{{entry.get_thumbnail_url}}" height="100" alt="{{ entry.title }}" \/>{{entry.dek|escapejs}} <a href="{{entry.get_absolute_url}}">Read it &raquo;<\/a><\/p><\/div>'
- marker_{{entry|truncatewords:2|slugify_under}}.bindInfoWindowHtml(marker_{{entry|truncatewords:2|slugify_under}}.info_window_content, {maxWidth:400});
- GEvent.addListener(marker_{{entry.title|truncatewords:2|slugify_under}}, "click", function() {
- map.panTo(point_{{entry.title|truncatewords:2|slugify_under}}, 2);
- });
-
- {% endfor %}
- }
- }
-
- // center on a country
- function focusCountry(latitude, longitude, zoom) {
- map.setZoom(zoom);
- map.panTo(new GLatLng(latitude, longitude))
- }
- function addRoute(line,levels,color,lat,lon,zoom){
- var encodedPolyline = new GPolyline.fromEncoded({
- color: color,
- weight: 5,
- points: line,
- levels: levels,
- zoomFactor: 32,
- numLevels: 4
- });
- focusCountry(lat,lon,zoom);
- map.addOverlay(encodedPolyline);
- }
- </script>
-
+{% include 'includes/map_entry_list.html' %}
{%endblock%} \ No newline at end of file
diff --git a/templates/archives/photos.html b/templates/archives/photos.html
index 425e375..d1db79c 100644
--- a/templates/archives/photos.html
+++ b/templates/archives/photos.html
@@ -44,21 +44,11 @@
<div id="sidebar">
<div class="blok">
<h4 class="first">Regions</h4>
- <ul>
- {%for region in region_list %}
- <li><a href="/photos/{{region.slug}}/1/" title="See all photos from {{region.name|title}}">{{region.name}}</a></li>
- </li>
- {% endfor %}
- </ul>
+ {% include 'includes/regions_sidebar.html' %}
</div>
<div class="blok">
<h4>Countries</h4>
- <ul>
- {%for country in country_list %}
- <li><a href="/photos/{{country.slug}}/1/" title="See all photos from {{country.name|title}}">{{country.name}}</a></li>
- </li>
- {% endfor %}
- </ul>
+ {% include 'includes/country_sidebar.html' %}
</div>
diff --git a/templates/archives/writing.html b/templates/archives/writing.html
index a3d1a3b..7071a4e 100644
--- a/templates/archives/writing.html
+++ b/templates/archives/writing.html
@@ -47,20 +47,12 @@
<div class="blok">
<h4 class="first">Regions</h4>
<ul>
- {%for region in region_list %}
- <li><a href="/writing/{{region.slug}}/1/" title="See all writing from {{region.name|title}}">{{region.name}}</a></li>
- </li>
- {% endfor %}
+ {% include 'includes/regions_sidebar.html' %}
</ul>
</div>
<div class="blok">
<h4>Countries</h4>
- <ul>
- {%for country in country_list %}
- <li><a href="/writing/{{country.slug}}/1/" title="See all writing from {{country.name|title}}">{{country.name}}</a></li>
- </li>
- {% endfor %}
- </ul>
+ {% include 'includes/country_sidebar.html' %}
</div>