diff options
-rw-r--r-- | apps/photos/admin.py | 1 | ||||
-rw-r--r-- | apps/photos/models.py | 4 | ||||
-rw-r--r-- | base_urls.py | 3 | ||||
-rw-r--r-- | media/js/slideshow.js | 69 | ||||
-rw-r--r-- | settings_mobile.py | 2 | ||||
-rw-r--r-- | templates/details/entry.html | 2 | ||||
-rw-r--r-- | templates/details/photo_galleries.html | 13 |
7 files changed, 52 insertions, 42 deletions
diff --git a/apps/photos/admin.py b/apps/photos/admin.py index 15d308e..29f5dbf 100644 --- a/apps/photos/admin.py +++ b/apps/photos/admin.py @@ -10,6 +10,7 @@ GMAP = GoogleMap(key=settings.GOOGLE_MAPS_API_KEY) class PhotoAdmin(OSMGeoAdmin): list_display = ('title','admin_thumbnail', 'flickr_id', 'pub_date',) list_filter = ('pub_date',) + search_fields = ['title', 'description'] fieldsets = ( (None, {'fields': (('title', 'description'),'pub_date', 'tags',('lat','lon'))}), ('Exif Data', {'fields': ('exif_aperture','exif_exposure','exif_iso','exif_focal_length','exif_lens','exif_date','exif_make','exif_model'), 'classes': ('collapse')}), diff --git a/apps/photos/models.py b/apps/photos/models.py index 05b759e..a103938 100644 --- a/apps/photos/models.py +++ b/apps/photos/models.py @@ -188,12 +188,12 @@ class PhotoGallery(models.Model): return "/photos/galleries/%s/" % (self.set_slug) -class PhotoSitemap(Sitemap): +class PhotoGallerySitemap(Sitemap): changefreq = "never" priority = 0.7 def items(self): - return Photo.objects.all() + return PhotoGallery.objects.all() def lastmod(self, obj): return obj.pub_date diff --git a/base_urls.py b/base_urls.py index b0af128..2b9f4e8 100644 --- a/base_urls.py +++ b/base_urls.py @@ -8,6 +8,7 @@ from django.conf import settings from blog.models import BlogSitemap,LatestFull from locations.models import WritingbyLocationSitemap from links.models import LatestLinks +from photos.models import PhotoGallerySitemap admin.autodiscover() @@ -15,7 +16,7 @@ admin.autodiscover() sitemaps = { 'blog': BlogSitemap, 'flatpages': FlatPageSitemap, - #'locations': WritingbyLocationSitemap + 'photos': PhotoGallerySitemap } feeds = { 'writing': LatestFull, diff --git a/media/js/slideshow.js b/media/js/slideshow.js index c889621..05f00a7 100644 --- a/media/js/slideshow.js +++ b/media/js/slideshow.js @@ -1,32 +1,34 @@ //Utility functions for map info window function mapit(latlontitle) { - var map; lat = parseFloat(latlontitle.split(',')[0]); - lon = parseFloat(latlontitle.split(',')[1]); - title= latlontitle.split(',')[2]; - var mapitinit; + lon = parseFloat(latlontitle.split(',')[1]); + title= latlontitle.split(',')[2]; + centerCoord = new google.maps.LatLng(lat, lon); + var mapitinit; if (mapitinit == true) { - panto(); - } else { - mapInit(); - } - - function mapInit() { - var centerCoord = new google.maps.LatLng(lat, lon); - var mapOptions = { - zoom: 6, - center: centerCoord, - mapTypeId: google.maps.MapTypeId.TERRAIN - }; - map = new google.maps.Map(document.getElementById("map-wrapper"), mapOptions); - var marker = new google.maps.Marker({ + mapPanTo(); + } else { + mapInit(); + } + + function mapInit() { + var mapOptions = { + zoom: 6, + center: centerCoord, + disableDefaultUI: true, + navigationControl: true, + mapTypeId: google.maps.MapTypeId.TERRAIN, + navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL} + }; + map = new google.maps.Map(document.getElementById("map-wrapper"), mapOptions); + var marker = new google.maps.Marker({ position: centerCoord, map: map, title: title }); mapitinit = true; } - function panto(){ + function mapPanTo(){ var marker = new google.maps.Marker({ position: centerCoord, map: map, @@ -44,7 +46,7 @@ function create_map(obj) { //deal with the variable height of div.legend $('#map-container').css({ bottom: function(index, value) { - return parseFloat($(obj).parent().parent().css("height"))-2; + return parseFloat($(obj).parent().parent().height())-2; } }); @@ -60,7 +62,7 @@ function get_exif(obj,id) { //deal with the variable height of div.legend $('#exif-container').css({ bottom: function(index, value) { - return parseFloat($(obj).parent().parent().css("height"))-14; + return parseFloat($(obj).parent().parent().height())-14; } }); } @@ -113,17 +115,16 @@ $(document).ready(function(){ $('#slides .bigimg').wrapAll('<div class="bigimgs">').parents('#slides').append('<ul class="menu" id="feature_gallery_pager">').cycle({ fx: 'fade', startingSlide: index, - pause: 1, - prev: '#prev', - next: '#next', - before: onBefore, - after: onAfter, + prev: '#prev', + next: '#next', + before: onBefore, + after: onAfter, slideExpr: '.bigimg', pager: '#feature_gallery_pager', pagerAnchorBuilder: function(idx, slide) { return '<li><a href="#"><img src="'+slide.id+'" class="thumb"><span></span></a></li>'; - } - + }, + pause: 1 }); //callback to delete map and camera info windows if they exist @@ -154,7 +155,7 @@ $(document).ready(function(){ }); }; - //initialize the jcarousel plugin + //initialize the jcarousel plugin $(function() { $('#feature_gallery_pager').jcarousel({ scroll:10, @@ -164,11 +165,11 @@ $(document).ready(function(){ /* hover buttons, currently not used $("#slideshow").hover(function() { - $("ul#nav").fadeIn(); - }, - function() { - $("ul#nav").fadeOut(); - }); + $("ul#nav").fadeIn(); + }, + function() { + $("ul#nav").fadeOut(); + }); */ //enable keyboard shortcuts: diff --git a/settings_mobile.py b/settings_mobile.py index 91bea5d..a617526 100644 --- a/settings_mobile.py +++ b/settings_mobile.py @@ -2,7 +2,7 @@ from settings import * from os.path import dirname, abspath PROJ_ROOT = abspath(dirname(__file__))+'/' -DEBUG = True +DEBUG = False TEMPLATE_DEBUG = DEBUG MIDDLEWARE_CLASSES = ( 'django.middleware.cache.UpdateCacheMiddleware', diff --git a/templates/details/entry.html b/templates/details/entry.html index db378a7..283c6af 100644 --- a/templates/details/entry.html +++ b/templates/details/entry.html @@ -44,7 +44,7 @@ {%if object.template_name == 3 %}<div class="clearfix"></div>{%endif%} <section id="post-metadata"> <h4 class="hide">About {{object.title|smartypants|safe}}</h4> - <p>Posted <time datetime="{{object.pub_date}}">{{object.pub_date|date:"F j, Y"}}</time>, from {{object.location.name|smartypants|safe}}, {%if object.location.state.country.name == 'United States'%}<a href="/maps/#{{object.location.state.slug}}" title="see other entries from {{object.location.state.name}}">{{object.location.state.name|smartypants|safe}}</a>{% else %}{{object.location.state.country.name}}{%endif%}. + <p>Posted <time datetime="{{object.pub_date}}">{{object.pub_date|date:"F j, Y"}}</time>, from {{object.location.name|smartypants|safe}}, {%if object.location.state.country.name == 'United States'%}<a href="/map/#{{object.location.state.country.slug}}" title="see other entries from {{object.location.state.name}}">{{object.location.state.name|smartypants|safe}}</a>{% else %}<a href="/map/#{{object.location.state.country.slug}}" title="view all entries from {{object.location.state.country.name}}">{{object.location.state.country.name}}</a>{%endif%}. Follow along on <a href="http://twitter.com/luxagraf" title="twitter" rel="me">Twitter</a> or by subscribing to the <a href="http://feeds.feedburner.com/luxagraf/blog" title="writing RSS 2.0 feed">RSS Feed</a>. For more about me, see the <a href="/about/" title="about luxagraf">about page</a>. To get in touch please use the <a href="/contact/" title="contact me">contact form</a> or leave a comment below.</p> </section> <section id="page-navigation"> diff --git a/templates/details/photo_galleries.html b/templates/details/photo_galleries.html index 41a5976..a823d20 100644 --- a/templates/details/photo_galleries.html +++ b/templates/details/photo_galleries.html @@ -41,10 +41,9 @@ <script type="text/javascript" src="/media/js/jquery.js"></script> <script type="text/javascript" src="/media/js/jquery.cycle.pack.js"></script> <script type="text/javascript" src="/media/js/jquery.jcarousel.pack.js"></script> - <script type="text/javascript" src="/media/js/slideshow.pack.js" ></script> + <script type="text/javascript" src="/media/js/slideshow.js" ></script> <!-- if you'd like to see a non-packed version of my slideshow script, see this file: http://media.luxagraf.net/js/slideshow.js (requires jquery, jcarousel and cycle) --> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> - </head> <body> <div id="wrapper"> @@ -53,11 +52,19 @@ <li><a href="/photos/" title="luxagraf photos">Photos</a> → </li> <li>{{object.set_title}}</li> </ul> + <div id="slideshow-controls"> + <ul> + <li><a id="prev" href="#"> ← Previous</a></li> + <li><a id="play" href="#">▶</a></li> + <li><a id="next" href="#">Next →</a></li> + </ul> + </div> + <ul id="instructions"> <li>Hover image to pause,</li> <li> ← & → to navigate</li> </ul> - + <ul id="slides"> {%for photo in object.photos.all reversed %} <li class="bigimg" id="{{photo.get_local_slideshow_url}}" style="height: {{photo.slideshowimage_height}}px; width:{{photo.slideshowimage_width}}px; margin-top:{{photo.slideshowimage_margintop}}px; margin-left:{{photo.slideshowimage_marginleft}}px;"> |