# HG changeset patch # User Steve Losh # Date 1232345701 18000 # Node ID 24ce70aa993424419e2e4555f17d459c415d802d # Parent ed09fa884762b91d6b2d400c2d623ebae73049e3 Added support for photos to the projects app. diff -r ed09fa884762 -r 24ce70aa9934 site-media/scripts/stevelosh-gallery.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/site-media/scripts/stevelosh-gallery.js Mon Jan 19 01:15:01 2009 -0500 @@ -0,0 +1,29 @@ +$(function() { + $('div.gallery').each(function () { + $(this).contents().filter(function() { + return this.nodeType == Node.TEXT_NODE; + }).remove(); + + var cols = 4; + var padding = 10; + var total_width = $(this).width(); + var width = (total_width / cols) - 2 * padding; + $(this).find('img').css({width: width, margin: padding}); + + $(this).before(''); + $(this).find('img:first').clone() + .addClass('gallery-display') + .css({width: '', margin: ''}) + .appendTo('div.gallery-pane'); + }); + + $('div.gallery img').click(function() { + var new_image = $(this).clone() + .addClass('gallery-display') + .css({width: '', margin: '', display: 'none'}); + $('img.gallery-display').fadeOut('fast', function() { + $(this).remove(); + new_image.appendTo('div.gallery-pane').fadeIn('slow'); + }); + }); +}); \ No newline at end of file diff -r ed09fa884762 -r 24ce70aa9934 site-media/style/gallery.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/site-media/style/gallery.css Mon Jan 19 01:15:01 2009 -0500 @@ -0,0 +1,1 @@ +div.gallery-pane { text-align: center; margin-bottom: 10px; } \ No newline at end of file diff -r ed09fa884762 -r 24ce70aa9934 templates/feeds/comments_title.html --- a/templates/feeds/comments_title.html Fri Jan 16 18:11:37 2009 -0500 +++ b/templates/feeds/comments_title.html Mon Jan 19 01:15:01 2009 -0500 @@ -1,1 +1,1 @@ -Comment on {% if obj.entry.title %}{{ obj.entry.title }}{% else %}{{ obj.project.name }}{% endif %} by {{ obj.name }}. \ No newline at end of file +Comment on {% if obj.entry.title %}{{ obj.entry.title }}{% else %}{{ obj.project.name }}{% endif %} by {{ obj.name }} \ No newline at end of file diff -r ed09fa884762 -r 24ce70aa9934 templates/projects/base.html --- a/templates/projects/base.html Fri Jan 16 18:11:37 2009 -0500 +++ b/templates/projects/base.html Mon Jan 19 01:15:01 2009 -0500 @@ -5,6 +5,8 @@ {% block style %} + {% endblock %} diff -r ed09fa884762 -r 24ce70aa9934 templates/projects/project.html --- a/templates/projects/project.html Fri Jan 16 18:11:37 2009 -0500 +++ b/templates/projects/project.html Mon Jan 19 01:15:01 2009 -0500 @@ -10,6 +10,9 @@ + {% endblock %} {% block content %}