You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by fa...@apache.org on 2009/03/27 11:33:07 UTC

svn commit: r759091 [8/8] - in /labs/consite: ./ trunk/ trunk/conferences/ trunk/conferences/app/ trunk/conferences/app/controllers/ trunk/conferences/app/controllers/admin/ trunk/conferences/app/controllers/admin/con/ trunk/conferences/app/helpers/ tr...

Added: labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_test.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_test.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_test.rb (added)
+++ labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_test.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,380 @@
+require File.dirname(__FILE__) + '/abstract_unit'
+require 'RMagick'
+require File.dirname(__FILE__) + '/fixtures/entry'
+
+
+class AbstractRMagickTest < Test::Unit::TestCase
+  def teardown
+    FileUtils.rm_rf File.dirname(__FILE__)+"/public/entry/"
+  end
+
+  def test_truth
+    assert true
+  end
+
+  private
+
+  def read_image(path)
+    Magick::Image::read(path).first
+  end
+
+  def assert_max_image_size(img, s)
+    assert img.columns <= s, "img has #{img.columns} columns, expected: #{s}"
+    assert img.rows <= s, "img has #{img.rows} rows, expected: #{s}"
+    assert_equal s, [img.columns, img.rows].max
+  end
+end
+
+class RMagickSimpleTest < AbstractRMagickTest
+  def setup
+    Entry.file_column :image, :magick => { :geometry => "100x100" }
+  end
+
+  def test_simple_resize_without_save
+    e = Entry.new
+    e.image = upload(f("kerb.jpg"))
+    
+    img = read_image(e.image)
+    assert_max_image_size img, 100
+  end
+
+  def test_simple_resize_with_save
+    e = Entry.new
+    e.image = upload(f("kerb.jpg"))
+    assert e.save
+    e.reload
+    
+    img = read_image(e.image)
+    assert_max_image_size img, 100
+  end
+
+  def test_resize_on_saved_image
+    Entry.file_column :image, :magick => { :geometry => "100x100" }
+    
+    e = Entry.new
+    e.image = upload(f("skanthak.png"))
+    assert e.save
+    e.reload
+    old_path = e.image
+    
+    e.image = upload(f("kerb.jpg"))
+    assert e.save
+    assert "kerb.jpg", File.basename(e.image)
+    assert !File.exists?(old_path), "old image '#{old_path}' still exists"
+
+    img = read_image(e.image)
+    assert_max_image_size img, 100
+  end
+
+  def test_invalid_image
+    e = Entry.new
+    assert_nothing_raised { e.image = upload(f("invalid-image.jpg")) }
+    assert !e.valid?
+  end
+
+  def test_serializable
+    e = Entry.new
+    e.image = upload(f("skanthak.png"))
+    assert_nothing_raised {
+      flash = Marshal.dump(e)
+      e = Marshal.load(flash)
+    }
+    assert File.exists?(e.image)
+  end
+
+  def test_imagemagick_still_usable
+    e = Entry.new
+    assert_nothing_raised {
+      img = e.load_image_with_rmagick(file_path("skanthak.png"))
+      assert img.kind_of?(Magick::Image)
+    }
+  end
+end
+
+class RMagickRequiresImageTest < AbstractRMagickTest
+  def setup
+    Entry.file_column :image, :magick => { 
+      :size => "100x100>",
+      :image_required => false,
+      :versions => {
+        :thumb => "80x80>",
+        :large => {:size => "200x200>", :lazy => true}
+      }
+    }
+  end
+
+  def test_image_required_with_image
+    e = Entry.new(:image => upload(f("skanthak.png")))
+    assert_max_image_size read_image(e.image), 100
+    assert e.valid?
+  end
+
+  def test_image_required_with_invalid_image
+    e = Entry.new(:image => upload(f("invalid-image.jpg")))
+    assert e.valid?, "did not ignore invalid image"
+    assert FileUtils.identical?(e.image, f("invalid-image.jpg")), "uploaded file has not been left alone"
+  end
+
+  def test_versions_with_invalid_image
+    e = Entry.new(:image => upload(f("invalid-image.jpg")))
+    assert e.valid?
+
+    image_state = e.send(:image_state)
+    assert_nil image_state.create_magick_version_if_needed(:thumb)
+    assert_nil image_state.create_magick_version_if_needed(:large)
+    assert_nil image_state.create_magick_version_if_needed("300x300>")
+  end
+end
+
+class RMagickCustomAttributesTest < AbstractRMagickTest
+  def assert_image_property(img, property, value, text = nil)
+    assert File.exists?(img), "the image does not exist"
+    assert_equal value, read_image(img).send(property), text
+  end
+
+  def test_simple_attributes
+    Entry.file_column :image, :magick => { :attributes => { :quality => 20 } }
+    e = Entry.new("image" => upload(f("kerb.jpg")))
+    assert_image_property e.image, :quality, 20, "the quality was not set"
+  end
+
+  def test_version_attributes
+    Entry.file_column :image, :magick => {
+      :versions => {
+        :thumb => { :attributes => { :quality => 20 } }
+      }
+    }
+    e = Entry.new("image" => upload(f("kerb.jpg")))
+    assert_image_property e.image("thumb"), :quality, 20, "the quality was not set"
+  end
+  
+  def test_lazy_attributes
+    Entry.file_column :image, :magick => {
+      :versions => {
+        :thumb => { :attributes => { :quality => 20 }, :lazy => true }
+      }
+    }
+    e = Entry.new("image" => upload(f("kerb.jpg")))
+    e.send(:image_state).create_magick_version_if_needed(:thumb)
+    assert_image_property e.image("thumb"), :quality, 20, "the quality was not set"
+  end
+end
+
+class RMagickVersionsTest < AbstractRMagickTest
+  def setup
+    Entry.file_column :image, :magick => {:geometry => "200x200",
+      :versions => {
+        :thumb => "50x50",
+        :medium => {:geometry => "100x100", :name => "100_100"},
+        :large => {:geometry => "150x150", :lazy => true}
+      }
+    }
+  end
+
+
+  def test_should_create_thumb
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    
+    assert File.exists?(e.image("thumb")), "thumb-nail not created"
+    
+    assert_max_image_size read_image(e.image("thumb")), 50
+  end
+
+  def test_version_name_can_be_different_from_key
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    
+    assert File.exists?(e.image("100_100"))
+    assert !File.exists?(e.image("medium"))
+  end
+
+  def test_should_not_create_lazy_versions
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    assert !File.exists?(e.image("large")), "lazy versions should not be created unless needed"
+  end
+
+  def test_should_create_lazy_version_on_demand
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    
+    e.send(:image_state).create_magick_version_if_needed(:large)
+    
+    assert File.exists?(e.image("large")), "lazy version should be created on demand"
+    
+    assert_max_image_size read_image(e.image("large")), 150
+  end
+
+  def test_generated_name_should_not_change
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    
+    name1 = e.send(:image_state).create_magick_version_if_needed("50x50")
+    name2 = e.send(:image_state).create_magick_version_if_needed("50x50")
+    name3 = e.send(:image_state).create_magick_version_if_needed(:geometry => "50x50")
+    assert_equal name1, name2, "hash value has changed"
+    assert_equal name1, name3, "hash value has changed"
+  end
+
+  def test_should_create_version_with_string
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    
+    name = e.send(:image_state).create_magick_version_if_needed("32x32")
+    
+    assert File.exists?(e.image(name))
+
+    assert_max_image_size read_image(e.image(name)), 32
+  end
+
+  def test_should_create_safe_auto_id
+    e = Entry.new("image" => upload(f("skanthak.png")))
+
+    name = e.send(:image_state).create_magick_version_if_needed("32x32")
+
+    assert_match /^[a-zA-Z0-9]+$/, name
+  end
+end
+
+class RMagickCroppingTest < AbstractRMagickTest
+  def setup
+    Entry.file_column :image, :magick => {:geometry => "200x200",
+      :versions => {
+        :thumb => {:crop => "1:1", :geometry => "50x50"}
+      }
+    }
+  end
+  
+  def test_should_crop_image_on_upload
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    
+    img = read_image(e.image("thumb"))
+    
+    assert_equal 50, img.rows 
+    assert_equal 50, img.columns
+  end
+    
+end
+
+class UrlForImageColumnTest < AbstractRMagickTest
+  include FileColumnHelper
+
+  def setup
+    Entry.file_column :image, :magick => {
+      :versions => {:thumb => "50x50"} 
+    }
+    @request = RequestMock.new
+  end
+    
+  def test_should_use_version_on_symbol_option
+    e = Entry.new(:image => upload(f("skanthak.png")))
+    
+    url = url_for_image_column(e, "image", :thumb)
+    assert_match %r{^/entry/image/tmp/.+/thumb/skanthak.png$}, url
+  end
+
+  def test_should_use_string_as_size
+    e = Entry.new(:image => upload(f("skanthak.png")))
+
+    url = url_for_image_column(e, "image", "50x50")
+    
+    assert_match %r{^/entry/image/tmp/.+/.+/skanthak.png$}, url
+    
+    url =~ /\/([^\/]+)\/skanthak.png$/
+    dirname = $1
+    
+    assert_max_image_size read_image(e.image(dirname)), 50
+  end
+
+  def test_should_accept_version_hash
+    e = Entry.new(:image => upload(f("skanthak.png")))
+
+    url = url_for_image_column(e, "image", :size => "50x50", :crop => "1:1", :name => "small")
+
+    assert_match %r{^/entry/image/tmp/.+/small/skanthak.png$}, url
+
+    img = read_image(e.image("small"))
+    assert_equal 50, img.rows
+    assert_equal 50, img.columns
+  end
+end
+
+class RMagickPermissionsTest < AbstractRMagickTest
+  def setup
+    Entry.file_column :image, :magick => {:geometry => "200x200",
+      :versions => {
+        :thumb => {:crop => "1:1", :geometry => "50x50"}
+      }
+    }, :permissions => 0616
+  end
+  
+  def check_permissions(e)
+    assert_equal 0616, (File.stat(e.image).mode & 0777)
+    assert_equal 0616, (File.stat(e.image("thumb")).mode & 0777)
+  end
+
+  def test_permissions_with_rmagick
+    e = Entry.new(:image => upload(f("skanthak.png")))
+    
+    check_permissions e
+
+    assert e.save
+
+    check_permissions e
+  end
+end
+
+class Entry 
+  def transform_grey(img)
+    img.quantize(256, Magick::GRAYColorspace)
+  end
+end
+
+class RMagickTransformationTest < AbstractRMagickTest
+  def assert_transformed(image)
+    assert File.exists?(image), "the image does not exist"
+    assert 256 > read_image(image).number_colors, "the number of colors was not changed"
+  end
+  
+  def test_simple_transformation
+    Entry.file_column :image, :magick => { :transformation => Proc.new { |image| image.quantize(256, Magick::GRAYColorspace) } }
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    assert_transformed(e.image)
+  end
+  
+  def test_simple_version_transformation
+    Entry.file_column :image, :magick => {
+      :versions => { :thumb => Proc.new { |image| image.quantize(256, Magick::GRAYColorspace) } }
+    }
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    assert_transformed(e.image("thumb"))
+  end
+  
+  def test_complex_version_transformation
+    Entry.file_column :image, :magick => {
+      :versions => {
+        :thumb => { :transformation => Proc.new { |image| image.quantize(256, Magick::GRAYColorspace) } }
+      }
+    }
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    assert_transformed(e.image("thumb"))
+  end
+  
+  def test_lazy_transformation
+    Entry.file_column :image, :magick => {
+      :versions => {
+        :thumb => { :transformation => Proc.new { |image| image.quantize(256, Magick::GRAYColorspace) }, :lazy => true }
+      }
+    }
+    e = Entry.new("image" => upload(f("skanthak.png")))
+    e.send(:image_state).create_magick_version_if_needed(:thumb)
+    assert_transformed(e.image("thumb"))
+  end
+
+  def test_simple_callback_transformation
+    Entry.file_column :image, :magick => :transform_grey
+    e = Entry.new(:image => upload(f("skanthak.png")))
+    assert_transformed(e.image)
+  end
+
+  def test_complex_callback_transformation
+    Entry.file_column :image, :magick => { :transformation => :transform_grey }
+    e = Entry.new(:image => upload(f("skanthak.png")))
+    assert_transformed(e.image)
+  end
+end

Propchange: labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_test.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_view_only_test.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_view_only_test.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_view_only_test.rb (added)
+++ labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_view_only_test.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,21 @@
+require File.dirname(__FILE__) + '/abstract_unit'
+require File.dirname(__FILE__) + '/fixtures/entry'
+
+class RMagickViewOnlyTest < Test::Unit::TestCase
+  include FileColumnHelper
+
+  def setup
+    Entry.file_column :image
+    @request = RequestMock.new
+  end
+
+  def teardown
+    FileUtils.rm_rf File.dirname(__FILE__)+"/public/entry/"
+  end
+
+  def test_url_for_image_column_without_model_versions
+    e = Entry.new(:image => upload(f("skanthak.png")))
+    
+    assert_nothing_raised { url_for_image_column e, "image", "50x50" }
+  end
+end

Propchange: labs/consite/trunk/conferences/vendor/plugins/file_column/test/magick_view_only_test.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/README
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/README?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/README (added)
+++ labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/README Fri Mar 27 10:32:54 2009
@@ -0,0 +1,20 @@
+TZInfo Timezone
+===============
+
+This plugin installs a replacement for the TimeZone class. The replacement
+uses the TZInfo library (http://tzinfo.rubyforge.org) to do the time zone
+conversions, and thus takes into account daylight saving, for free.
+
+It is not a 100%-compatible replacement, however. If you use TimeZone#unadjust
+anywhere, you'll need to replace those calls, possibly with #local_to_utc.
+Also, the #adjust method is deprecated--it is better (and easier to read) if
+you use the #utc_to_local method instead.
+
+Note that you will need to have the tzinfo library installed separately--it is
+not bundled with this plugin. You can easily install tzinfo as a gem:
+
+  gem install tzinfo
+
+---------------
+Copyright (c) 2006 Jamis Buck (jamis@37signals.com)
+released under the MIT license
\ No newline at end of file

Propchange: labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/README
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/Rakefile
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/Rakefile?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/Rakefile (added)
+++ labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/Rakefile Fri Mar 27 10:32:54 2009
@@ -0,0 +1,22 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
+desc 'Test the tzinfo_timezone plugin.'
+Rake::TestTask.new(:test) do |t|
+  t.libs << 'lib'
+  t.pattern = 'test/**/*_test.rb'
+  t.verbose = true
+end
+
+desc 'Generate documentation for the tzinfo_timezone plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+  rdoc.rdoc_dir = 'rdoc'
+  rdoc.title    = 'TzinfoTimezone'
+  rdoc.options << '--line-numbers' << '--inline-source'
+  rdoc.rdoc_files.include('README')
+  rdoc.rdoc_files.include('lib/**/*.rb')
+end

Added: labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/init.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/init.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/init.rb (added)
+++ labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/init.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,7 @@
+require 'tzinfo_timezone'
+
+# remove the existing TimeZone constant
+Object.send(:remove_const, :TimeZone)
+
+# Use TzinfoTimezone as the TimeZone class
+Object::TimeZone = TzinfoTimezone
\ No newline at end of file

Propchange: labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/init.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/lib/tzinfo_timezone.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/lib/tzinfo_timezone.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/lib/tzinfo_timezone.rb (added)
+++ labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/lib/tzinfo_timezone.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,337 @@
+require 'tzinfo'
+
+class TzinfoTimezone
+  MAPPING = {
+    "International Date Line West" => "Pacific/Midway",
+    "Midway Island"                => "Pacific/Midway",
+    "Samoa"                        => "Pacific/Pago_Pago",
+    "Hawaii"                       => "Pacific/Honolulu",
+    "Alaska"                       => "America/Juneau",
+    "Pacific Time (US & Canada)"   => "America/Los_Angeles",
+    "Tijuana"                      => "America/Tijuana",
+    "Mountain Time (US & Canada)"  => "America/Denver",
+    "Arizona"                      => "America/Phoenix",
+    "Chihuahua"                    => "America/Chihuahua",
+    "Mazatlan"                     => "America/Mazatlan",
+    "Central Time (US & Canada)"   => "America/Chicago",
+    "Saskatchewan"                 => "America/Regina",
+    "Guadalajara"                  => "America/Mexico_City",
+    "Mexico City"                  => "America/Mexico_City",
+    "Monterrey"                    => "America/Monterrey",
+    "Central America"              => "America/Guatemala",
+    "Eastern Time (US & Canada)"   => "America/New_York",
+    "Indiana (East)"               => "America/Indiana/Indianapolis",
+    "Bogota"                       => "America/Bogota",
+    "Lima"                         => "America/Lima",
+    "Quito"                        => "America/Lima",
+    "Atlantic Time (Canada)"       => "America/Halifax",
+    "Caracas"                      => "America/Caracas",
+    "La Paz"                       => "America/La_Paz",
+    "Santiago"                     => "America/Santiago",
+    "Newfoundland"                 => "America/St_Johns",
+    "Brasilia"                     => "America/Argentina/Buenos_Aires",
+    "Buenos Aires"                 => "America/Argentina/Buenos_Aires",
+    "Georgetown"                   => "America/Argentina/San_Juan",
+    "Greenland"                    => "America/Godthab",
+    "Mid-Atlantic"                 => "Atlantic/South_Georgia",
+    "Azores"                       => "Atlantic/Azores",
+    "Cape Verde Is."               => "Atlantic/Cape_Verde",
+    "Dublin"                       => "Europe/Dublin",
+    "Edinburgh"                    => "Europe/Dublin",
+    "Lisbon"                       => "Europe/Lisbon",
+    "London"                       => "Europe/London",
+    "Casablanca"                   => "Africa/Casablanca",
+    "Monrovia"                     => "Africa/Monrovia",
+    "Belgrade"                     => "Europe/Belgrade",
+    "Bratislava"                   => "Europe/Bratislava",
+    "Budapest"                     => "Europe/Budapest",
+    "Ljubljana"                    => "Europe/Ljubljana",
+    "Prague"                       => "Europe/Prague",
+    "Sarajevo"                     => "Europe/Sarajevo",
+    "Skopje"                       => "Europe/Skopje",
+    "Warsaw"                       => "Europe/Warsaw",
+    "Zagreb"                       => "Europe/Zagreb",
+    "Brussels"                     => "Europe/Brussels",
+    "Copenhagen"                   => "Europe/Copenhagen",
+    "Madrid"                       => "Europe/Madrid",
+    "Paris"                        => "Europe/Paris",
+    "Amsterdam"                    => "Europe/Amsterdam",
+    "Berlin"                       => "Europe/Berlin",
+    "Bern"                         => "Europe/Berlin",
+    "Rome"                         => "Europe/Rome",
+    "Stockholm"                    => "Europe/Stockholm",
+    "Vienna"                       => "Europe/Vienna",
+    "West Central Africa"          => "Africa/Algiers",
+    "Bucharest"                    => "Europe/Bucharest",
+    "Cairo"                        => "Africa/Cairo",
+    "Helsinki"                     => "Europe/Helsinki",
+    "Kyev"                         => "Europe/Kiev",
+    "Riga"                         => "Europe/Riga",
+    "Sofia"                        => "Europe/Sofia",
+    "Tallinn"                      => "Europe/Tallinn",
+    "Vilnius"                      => "Europe/Vilnius",
+    "Athens"                       => "Europe/Athens",
+    "Istanbul"                     => "Europe/Istanbul",
+    "Minsk"                        => "Europe/Minsk",
+    "Jerusalem"                    => "Asia/Jerusalem",
+    "Harare"                       => "Africa/Harare",
+    "Pretoria"                     => "Africa/Johannesburg",
+    "Moscow"                       => "Europe/Moscow",
+    "St. Petersburg"               => "Europe/Moscow",
+    "Volgograd"                    => "Europe/Moscow",
+    "Kuwait"                       => "Asia/Kuwait",
+    "Riyadh"                       => "Asia/Riyadh",
+    "Nairobi"                      => "Africa/Nairobi",
+    "Baghdad"                      => "Asia/Baghdad",
+    "Tehran"                       => "Asia/Tehran",
+    "Abu Dhabi"                    => "Asia/Muscat",
+    "Muscat"                       => "Asia/Muscat",
+    "Baku"                         => "Asia/Baku",
+    "Tbilisi"                      => "Asia/Tbilisi",
+    "Yerevan"                      => "Asia/Yerevan",
+    "Kabul"                        => "Asia/Kabul",
+    "Ekaterinburg"                 => "Asia/Yekaterinburg",
+    "Islamabad"                    => "Asia/Karachi",
+    "Karachi"                      => "Asia/Karachi",
+    "Tashkent"                     => "Asia/Tashkent",
+    "Chennai"                      => "Asia/Calcutta",
+    "Kolkata"                      => "Asia/Calcutta",
+    "Mumbai"                       => "Asia/Calcutta",
+    "New Delhi"                    => "Asia/Calcutta",
+    "Kathmandu"                    => "Asia/Katmandu",
+    "Astana"                       => "Asia/Dhaka",
+    "Dhaka"                        => "Asia/Dhaka",
+    "Sri Jayawardenepura"          => "Asia/Colombo",
+    "Almaty"                       => "Asia/Almaty",
+    "Novosibirsk"                  => "Asia/Novosibirsk",
+    "Rangoon"                      => "Asia/Rangoon",
+    "Bangkok"                      => "Asia/Bangkok",
+    "Hanoi"                        => "Asia/Bangkok",
+    "Jakarta"                      => "Asia/Jakarta",
+    "Krasnoyarsk"                  => "Asia/Krasnoyarsk",
+    "Beijing"                      => "Asia/Shanghai",
+    "Chongqing"                    => "Asia/Chongqing",
+    "Hong Kong"                    => "Asia/Hong_Kong",
+    "Urumqi"                       => "Asia/Urumqi",
+    "Kuala Lumpur"                 => "Asia/Kuala_Lumpur",
+    "Singapore"                    => "Asia/Singapore",
+    "Taipei"                       => "Asia/Taipei",
+    "Perth"                        => "Australia/Perth",
+    "Irkutsk"                      => "Asia/Irkutsk",
+    "Ulaan Bataar"                 => "Asia/Ulaanbaatar",
+    "Seoul"                        => "Asia/Seoul",
+    "Osaka"                        => "Asia/Tokyo",
+    "Sapporo"                      => "Asia/Tokyo",
+    "Tokyo"                        => "Asia/Tokyo",
+    "Yakutsk"                      => "Asia/Yakutsk",
+    "Darwin"                       => "Australia/Darwin",
+    "Adelaide"                     => "Australia/Adelaide",
+    "Canberra"                     => "Australia/Melbourne",
+    "Melbourne"                    => "Australia/Melbourne",
+    "Sydney"                       => "Australia/Sydney",
+    "Brisbane"                     => "Australia/Brisbane",
+    "Hobart"                       => "Australia/Hobart",
+    "Vladivostok"                  => "Asia/Vladivostok",
+    "Guam"                         => "Pacific/Guam",
+    "Port Moresby"                 => "Pacific/Port_Moresby",
+    "Magadan"                      => "Asia/Magadan",
+    "Solomon Is."                  => "Asia/Magadan",
+    "New Caledonia"                => "Pacific/Noumea",
+    "Fiji"                         => "Pacific/Fiji",
+    "Kamchatka"                    => "Asia/Kamchatka",
+    "Marshall Is."                 => "Pacific/Majuro",
+    "Auckland"                     => "Pacific/Auckland",
+    "Wellington"                   => "Pacific/Auckland",
+    "Nuku'alofa"                   => "Pacific/Tongatapu"
+  }
+
+  attr_reader :name, :utc_offset
+
+  # Create a new TzinfoTimezone object with the given name and offset. The
+  # offset is the number of seconds that this time zone is offset from UTC
+  # (GMT). Seconds were chosen as the offset unit because that is the unit that
+  # Ruby uses to represent time zone offsets (see Time#utc_offset).
+  def initialize(name, utc_offset)
+    @name = name
+    @utc_offset = utc_offset
+  end
+
+  # Returns the offset of this time zone as a formatted string, of the
+  # format "+HH:MM". If the offset is zero, this returns the empty
+  # string. If +colon+ is false, a colon will not be inserted into the
+  # result.
+  def formatted_offset(colon=true)
+    utc_offset == 0 ? '' : offset(colon)
+  end
+  
+  # Returns the offset of this time zone as a formatted string, of the
+  # format "+HH:MM".
+  def offset(colon=true)
+    sign = (utc_offset < 0 ? -1 : 1)
+    hours = utc_offset.abs / 3600
+    minutes = (utc_offset.abs % 3600) / 60
+    "%+03d%s%02d" % [ hours * sign, colon ? ":" : "", minutes ]
+  end
+  
+  # Compute and return the current time, in the time zone represented by
+  # +self+.
+  def now
+    tzinfo.now
+  end
+  
+  # Returns the UTC offset of this time zone adjusted for DST at the
+  # current time, or optionally at the time specified by +relative_to+.
+  def dst_utc_offset(relative_to = now)
+    dst_offset = tzinfo.period_for_local(relative_to, true).dst? ? 3600 : 0
+    utc_offset + dst_offset
+  end
+
+  # Return the current date in this time zone.
+  def today
+    now.to_date
+  end
+
+  # Adjust the given time to the time zone represented by +self+.
+  def utc_to_local(time)
+    tzinfo.utc_to_local(time)
+  end
+
+  def local_to_utc(time, dst=true)
+    tzinfo.local_to_utc(time, dst)
+  end
+
+  # Adjust the given time to the time zone represented by +self+.
+  # (Deprecated--use utc_to_local, instead.)
+  alias :adjust :utc_to_local
+
+  # Compare this time zone to the parameter. The two are comapred first on
+  # their offsets, and then by name.
+  def <=>(zone)
+    result = (utc_offset <=> zone.utc_offset)
+    result = (name <=> zone.name) if result == 0
+    result
+  end
+
+  # Returns a textual representation of this time zone.
+  def to_s
+    "(GMT#{formatted_offset}) #{name}"
+  end
+
+  def tzinfo
+    return @tzinfo if @tzinfo
+    @tzinfo = MAPPING[name]
+    if String === @tzinfo
+      @tzinfo = TZInfo::Timezone.get(@tzinfo)
+      MAPPING[name] = @tzinfo
+    end
+    @tzinfo
+  end
+
+  @@zones = nil
+
+  class << self
+    alias_method :create, :new
+
+    # Return a TzinfoTimezone instance with the given name, or +nil+ if no
+    # such TzinfoTimezone instance exists. (This exists to support the use of
+    # this class with the #composed_of macro.)
+    def new(name)
+      self[name]
+    end
+
+    # Return an array of all TzinfoTimezone objects. There are multiple
+    # TzinfoTimezone objects per time zone, in many cases, to make it easier
+    # for users to find their own time zone.
+    def all
+      unless @@zones
+        @@zones = []
+        @@zones_map = {}
+        [[-39_600, "International Date Line West", "Midway Island", "Samoa" ],
+         [-36_000, "Hawaii" ],
+         [-32_400, "Alaska" ],
+         [-28_800, "Pacific Time (US & Canada)", "Tijuana" ],
+         [-25_200, "Mountain Time (US & Canada)", "Chihuahua", "Mazatlan",
+                   "Arizona" ],
+         [-21_600, "Central Time (US & Canada)", "Saskatchewan", "Guadalajara",
+                   "Mexico City", "Monterrey", "Central America" ],
+         [-18_000, "Eastern Time (US & Canada)", "Indiana (East)", "Bogota",
+                   "Lima", "Quito" ],
+         [-14_400, "Atlantic Time (Canada)", "Caracas", "La Paz", "Santiago" ],
+         [-12_600, "Newfoundland" ],
+         [-10_800, "Brasilia", "Buenos Aires", "Georgetown", "Greenland" ],
+         [ -7_200, "Mid-Atlantic" ],
+         [ -3_600, "Azores", "Cape Verde Is." ],
+         [      0, "Dublin", "Edinburgh", "Lisbon", "London", "Casablanca",
+                   "Monrovia" ],
+         [  3_600, "Belgrade", "Bratislava", "Budapest", "Ljubljana", "Prague",
+                   "Sarajevo", "Skopje", "Warsaw", "Zagreb", "Brussels",
+                   "Copenhagen", "Madrid", "Paris", "Amsterdam", "Berlin",
+                   "Bern", "Rome", "Stockholm", "Vienna",
+                   "West Central Africa" ],
+         [  7_200, "Bucharest", "Cairo", "Helsinki", "Kyev", "Riga", "Sofia",
+                   "Tallinn", "Vilnius", "Athens", "Istanbul", "Minsk",
+                   "Jerusalem", "Harare", "Pretoria" ],
+         [ 10_800, "Moscow", "St. Petersburg", "Volgograd", "Kuwait", "Riyadh",
+                   "Nairobi", "Baghdad" ],
+         [ 12_600, "Tehran" ],
+         [ 14_400, "Abu Dhabi", "Muscat", "Baku", "Tbilisi", "Yerevan" ],
+         [ 16_200, "Kabul" ],
+         [ 18_000, "Ekaterinburg", "Islamabad", "Karachi", "Tashkent" ],
+         [ 19_800, "Chennai", "Kolkata", "Mumbai", "New Delhi" ],
+         [ 20_700, "Kathmandu" ],
+         [ 21_600, "Astana", "Dhaka", "Sri Jayawardenepura", "Almaty",
+                   "Novosibirsk" ],
+         [ 23_400, "Rangoon" ],
+         [ 25_200, "Bangkok", "Hanoi", "Jakarta", "Krasnoyarsk" ],
+         [ 28_800, "Beijing", "Chongqing", "Hong Kong", "Urumqi",
+                   "Kuala Lumpur", "Singapore", "Taipei", "Perth", "Irkutsk",
+                   "Ulaan Bataar" ],
+         [ 32_400, "Seoul", "Osaka", "Sapporo", "Tokyo", "Yakutsk" ],
+         [ 34_200, "Darwin", "Adelaide" ],
+         [ 36_000, "Canberra", "Melbourne", "Sydney", "Brisbane", "Hobart",
+                   "Vladivostok", "Guam", "Port Moresby" ],
+         [ 39_600, "Magadan", "Solomon Is.", "New Caledonia" ],
+         [ 43_200, "Fiji", "Kamchatka", "Marshall Is.", "Auckland",
+                   "Wellington" ],
+         [ 46_800, "Nuku'alofa" ]].
+        each do |offset, *places|
+          places.each do |place|
+            zone = create(place, offset)
+            @@zones << zone
+            @@zones_map[place] = zone
+          end
+        end
+        @@zones.sort!
+      end
+      @@zones
+    end
+
+    # Locate a specific time zone object. If the argument is a string, it
+    # is interpreted to mean the name of the timezone to locate. If it is a
+    # numeric value it is either the hour offset, or the second offset, of the
+    # timezone to find. (The first one with that offset will be returned.)
+    # Returns +nil+ if no such time zone is known to the system.
+    def [](arg)
+      case arg
+        when String
+          all # force the zones to be loaded
+          @@zones_map[arg]
+        when Numeric
+          arg *= 3600 if arg.abs <= 13
+          all.find { |z| z.utc_offset == arg.to_i }
+        else
+          raise ArgumentError, "invalid argument to TzinfoTimezone[]: #{arg.inspect}"
+      end
+    end
+
+    # A regular expression that matches the names of all time zones in
+    # the USA.
+    US_ZONES = /US|Arizona|Indiana|Hawaii|Alaska/
+
+    # A convenience method for returning a collection of TzinfoTimezone objects
+    # for time zones in the USA.
+    def us_zones
+      all.find_all { |z| z.name =~ US_ZONES }
+    end
+  end
+end

Propchange: labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/lib/tzinfo_timezone.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/test/tzinfo_timezone_test.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/test/tzinfo_timezone_test.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/test/tzinfo_timezone_test.rb (added)
+++ labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/test/tzinfo_timezone_test.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,35 @@
+require 'test/unit'
+require 'tzinfo_timezone'
+
+class TzinfoTimezoneTest < Test::Unit::TestCase
+  TzinfoTimezone::MAPPING.keys.each do |name|
+    define_method("test_map_#{name.downcase.gsub(/[^a-z]/, '_')}_to_tzinfo") do
+      zone = TzinfoTimezone[name]
+      assert_not_nil zone.tzinfo
+    end
+  end
+
+  TzinfoTimezone.all.each do |zone|
+    name = zone.name.downcase.gsub(/[^a-z]/, '_')
+    define_method("test_from_#{name}_to_map") do
+      assert_not_nil TzinfoTimezone[zone.name]
+    end
+
+    define_method("test_utc_offset_for_#{name}") do
+      period = zone.tzinfo.period_for_utc(Time.utc(2006,1,1,0,0,0))
+      assert_equal period.utc_offset, zone.utc_offset
+    end
+  end
+  
+  def test_dst_utc_offset_in_standard_time
+    zone = TzinfoTimezone["Central Time (US & Canada)"]
+    time = Time.utc(2008, 3, 9)
+    assert_equal zone.utc_offset, zone.dst_utc_offset(time)
+  end
+  
+  def test_dst_utc_offset_in_daylight_time
+    zone = TzinfoTimezone["Central Time (US & Canada)"]
+    time = Time.utc(2008, 3, 9, 12)
+    assert_equal zone.utc_offset + 3600, zone.dst_utc_offset(time)
+  end
+end

Propchange: labs/consite/trunk/conferences/vendor/plugins/tzinfo_timezone/test/tzinfo_timezone_test.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/README
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/README?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/README (added)
+++ labs/consite/trunk/members/README Fri Mar 27 10:32:54 2009
@@ -0,0 +1,40 @@
+= Members
+
+Enhances the Radiant users model for use as a site-wide members
+feature.  It makes the following changes:
+
+The User model now has a:
+
+- photo  (file_column)
+- url
+
+A new `Profile` tab is added.  This becomes the default tab on login.
+A new Snippet named `profile_sidebar` is created which can be used to
+modify the profile page.
+
+All tabs except for Profile now default to require :developer or
+:admin role access.  This includes the Page and Snippets tabs.
+
+A new registration form will be created at:
+
+  /admin/members/register
+
+To install:
+
+- rake db:migrate:extensions
+- merge the contents of members/public/images into your public/images directory
+
+
+The extension includes a copy of the file_column plugin.
+
+
+There's *lots* still to be done, including:
+
+- Using email confirmation for registration
+- Allowing for user registration approval
+- Linking to the registration page on the login page
+- RSpec tests
+
+For questions and suggestions contact Aaron Farr at 
+  farra [at] apache [dot] org
+

Propchange: labs/consite/trunk/members/README
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/Rakefile
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/Rakefile?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/Rakefile (added)
+++ labs/consite/trunk/members/Rakefile Fri Mar 27 10:32:54 2009
@@ -0,0 +1,120 @@
+# I think this is the one that should be moved to the extension Rakefile template
+
+# In rails 1.2, plugins aren't available in the path until they're loaded.
+# Check to see if the rspec plugin is installed first and require
+# it if it is.  If not, use the gem version.
+
+# Determine where the RSpec plugin is by loading the boot
+unless defined? RADIANT_ROOT
+  ENV["RAILS_ENV"] = "test"
+  case
+  when ENV["RADIANT_ENV_FILE"]
+    require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
+  when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
+    require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
+  else
+    require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
+  end
+end
+
+require 'rake'
+require 'rake/rdoctask'
+require 'rake/testtask'
+
+rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib')
+$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
+require 'spec/rake/spectask'
+# require 'spec/translator'
+
+# Cleanup the RADIANT_ROOT constant so specs will load the environment
+Object.send(:remove_const, :RADIANT_ROOT)
+
+extension_root = File.expand_path(File.dirname(__FILE__))
+
+task :default => :spec
+task :stats => "spec:statsetup"
+
+desc "Run all specs in spec directory"
+Spec::Rake::SpecTask.new(:spec) do |t|
+  t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
+  t.spec_files = FileList['spec/**/*_spec.rb']
+end
+
+namespace :spec do
+  desc "Run all specs in spec directory with RCov"
+  Spec::Rake::SpecTask.new(:rcov) do |t|
+    t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
+    t.spec_files = FileList['spec/**/*_spec.rb']
+    t.rcov = true
+    t.rcov_opts = ['--exclude', 'spec', '--rails']
+  end
+  
+  desc "Print Specdoc for all specs"
+  Spec::Rake::SpecTask.new(:doc) do |t|
+    t.spec_opts = ["--format", "specdoc", "--dry-run"]
+    t.spec_files = FileList['spec/**/*_spec.rb']
+  end
+
+  [:models, :controllers, :views, :helpers].each do |sub|
+    desc "Run the specs under spec/#{sub}"
+    Spec::Rake::SpecTask.new(sub) do |t|
+      t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
+      t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
+    end
+  end
+  
+  # Hopefully no one has written their extensions in pre-0.9 style
+  # desc "Translate specs from pre-0.9 to 0.9 style"
+  # task :translate do
+  #   translator = ::Spec::Translator.new
+  #   dir = RAILS_ROOT + '/spec'
+  #   translator.translate(dir, dir)
+  # end
+
+  # Setup specs for stats
+  task :statsetup do
+    require 'code_statistics'
+    ::STATS_DIRECTORIES << %w(Model\ specs spec/models)
+    ::STATS_DIRECTORIES << %w(View\ specs spec/views)
+    ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
+    ::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
+    ::CodeStatistics::TEST_TYPES << "Model specs"
+    ::CodeStatistics::TEST_TYPES << "View specs"
+    ::CodeStatistics::TEST_TYPES << "Controller specs"
+    ::CodeStatistics::TEST_TYPES << "Helper specs"
+    ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
+  end
+
+  namespace :db do
+    namespace :fixtures do
+      desc "Load fixtures (from spec/fixtures) into the current environment's database.  Load specific fixtures using FIXTURES=x,y"
+      task :load => :environment do
+        require 'active_record/fixtures'
+        ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
+        (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
+          Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
+        end
+      end
+    end
+  end
+end
+
+desc 'Generate documentation for the members extension.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+  rdoc.rdoc_dir = 'rdoc'
+  rdoc.title    = 'MembersExtension'
+  rdoc.options << '--line-numbers' << '--inline-source'
+  rdoc.rdoc_files.include('README')
+  rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+# For extensions that are in transition
+desc 'Test the members extension.'
+Rake::TestTask.new(:test) do |t|
+  t.libs << 'lib'
+  t.pattern = 'test/**/*_test.rb'
+  t.verbose = true
+end
+
+# Load any custom rakefiles for extension
+Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
\ No newline at end of file

Added: labs/consite/trunk/members/app/controllers/admin/members/profile_controller.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/app/controllers/admin/members/profile_controller.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/app/controllers/admin/members/profile_controller.rb (added)
+++ labs/consite/trunk/members/app/controllers/admin/members/profile_controller.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,31 @@
+class Admin::Members::ProfileController <  Admin::ResourceController
+  model_class User
+
+  login_required
+ 
+      
+  def index
+    @sidebar_text = ''
+    @user = current_user
+    snippet = Snippet.find_by_name 'profile_sidebar'
+    if snippet
+      #TODO a bit a hack here to render the snippet in the context
+      #     of the first page.  Is there a better way to render a snippet like this?
+      p = Page.find(:all).first
+      @sidebar_text = p.render_snippet snippet if p
+    end
+  end
+  
+  def edit
+  # let's only allow editing the current user...
+  # self.model = model_class.find_by_id(params[:user][:id])
+    self.model = current_user
+    handle_new_or_edit_post
+  end  
+  
+  def continue_url(options)
+    return { :controller => 'admin/members/profile', :action => 'index' }
+  end
+
+  
+end

Propchange: labs/consite/trunk/members/app/controllers/admin/members/profile_controller.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/app/controllers/admin/members/register_controller.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/app/controllers/admin/members/register_controller.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/app/controllers/admin/members/register_controller.rb (added)
+++ labs/consite/trunk/members/app/controllers/admin/members/register_controller.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,23 @@
+class Admin::Members::RegisterController  <  Admin::ResourceController
+  model_class User
+  
+  no_login_required
+  skip_before_filter :verify_authenticity_token 
+  
+  
+  def index
+    self.model = model_class.new
+    render :action => 'index', :layout => nil
+  end
+  
+  def new
+    self.model = model_class.new
+    handle_new_or_edit_post    
+  end
+  
+  def continue_url(options)
+    return { :controller => 'admin/members/profile', :action => 'index' }
+  end  
+   
+  
+end

Propchange: labs/consite/trunk/members/app/controllers/admin/members/register_controller.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/app/helpers/admin/members/profile_helper.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/app/helpers/admin/members/profile_helper.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/app/helpers/admin/members/profile_helper.rb (added)
+++ labs/consite/trunk/members/app/helpers/admin/members/profile_helper.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,2 @@
+module Admin::Members::ProfileHelper
+end

Propchange: labs/consite/trunk/members/app/helpers/admin/members/profile_helper.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/app/helpers/admin/members/register_helper.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/app/helpers/admin/members/register_helper.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/app/helpers/admin/members/register_helper.rb (added)
+++ labs/consite/trunk/members/app/helpers/admin/members/register_helper.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,2 @@
+module Admin::Members::RegisterHelper
+end

Propchange: labs/consite/trunk/members/app/helpers/admin/members/register_helper.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/app/views/admin/members/profile/edit.html.erb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/app/views/admin/members/profile/edit.html.erb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/app/views/admin/members/profile/edit.html.erb (added)
+++ labs/consite/trunk/members/app/views/admin/members/profile/edit.html.erb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,10 @@
+<% unless @user.errors.empty? %>
+  <ul>
+  <% @user.errors.each_full do |message| %>
+    <li><%= message %></li>
+  <% end %>
+  </ul>
+<% end %>
+
+
+<a href="javascript:window.back();">Go Back</a>

Added: labs/consite/trunk/members/app/views/admin/members/profile/index.html.erb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/app/views/admin/members/profile/index.html.erb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/app/views/admin/members/profile/index.html.erb (added)
+++ labs/consite/trunk/members/app/views/admin/members/profile/index.html.erb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,69 @@
+
+<h2>Hello, <%= @user.name %></h2>
+
+<table width='100%'>
+
+<tr>
+<td style="padding-left: 10px; vertical-align: top; width:300px;">
+  <% if @user.photo %>
+   <%= image_tag url_for_file_column("user", "photo") %>
+  <% else %>
+   <img src="/images/admin/profile.png" alt="<%= @user.name%>" height="80" width="80"/>
+  <% end %>
+  <br/>
+  <%= @sidebar_text %>
+
+</td>
+
+<td>
+<% form_tag '/admin/members/edit', :multipart => true do %>
+ <table class='fieldset'>
+
+   <tr><th class='label'><label for="user_name">Name<label></th>
+       <td class='field'><%= text_field :user, :name %></td>
+       <td class='help'>Full name as you prefer it to appear on the website.</td>
+       </tr>
+
+   <tr><th class='label'><label for="user_email">Email</label></th>
+       <td class='field'><%= text_field :user, :email %></td>
+       <td class='help'>Current email address.</td>
+       </tr>
+
+   <tr><th class='label'><label class="optional" for="user_password">Password</label></th>
+       <td class='field'><%= password_field :user, :password,  :value => ''%></td>
+       <td class='help'>You may optionally update your password.</td>
+       </tr>
+
+   <tr><th class='label'><label class="optional" for="user_password_confirmation">Confirm Password</label></th>
+       <td class='field'><%= password_field :user,  :password_confirmation %></td>
+       <td class='help'>Repeat your password.</td>
+       </tr>
+
+   <tr><th class='label'><label class="optional" for="user_url">Website</label></th>
+       <td class='field' class='optional'><%= text_field :user, :url %></td>
+       <td class='help'>Your personal or company website.  Requires <code>http://</code> prefix</td>
+       </tr>
+
+   <tr><th class='label'><label class="optional" for="user_photo">Photo</label></th>
+       <td class='field'><%= file_column_field "user", "photo" %></td>
+       <td class='help'>A current photo.</td>
+       </tr>
+
+   <tr><th class='label'><label class='optional' for="user_notes">Notes</a></th>
+       <td class='field'><%= text_area :user, :notes %></td>
+       <td class='help'><em>Text only</em> background and profile information.</td>
+       </tr>
+
+   <tr><td colspan='3'>
+       <%= hidden_field :user, :id %>
+       <%= submit_tag 'Update' %>
+       </td></tr>
+ </table>  
+<% end %>
+
+</td>
+
+
+</tr>
+
+</table>

Added: labs/consite/trunk/members/app/views/admin/members/register/index.html.haml
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/app/views/admin/members/register/index.html.haml?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/app/views/admin/members/register/index.html.haml (added)
+++ labs/consite/trunk/members/app/views/admin/members/register/index.html.haml Fri Mar 27 10:32:54 2009
@@ -0,0 +1,78 @@
+
+
+- content_for 'page_css' do
+  :sass
+    #content
+      text-align: center
+      #login
+        background-color: #f5f1e2
+        border: 5px solid #efead3
+        text-align: left
+        margin: 2em
+        margin-left: auto
+        margin-right: auto
+        padding: 5px 20px
+        padding-right: 22px
+        position: relative
+        width: 23.5em
+        h1
+          font-size: 140%    
+          margin: 0
+          margin-top: 13px
+        table
+          width: 100%
+          margin: 15px 0 10px 0
+          td
+            text-align: left
+            padding: 6px 0
+            &.label
+              width: 6em
+            &.field
+              input.textbox
+                font-size: 100%
+                width: 98%
+            &.checkbox
+              font-size: 85%
+            &.buttons
+              text-align: right
+              input
+                font-size: 140%
+
+#login
+  %h1 Register
+
+  - form_tag '/admin/members/register/new' do
+    %table
+      %tr
+        %td.label
+          %label{:for=>"user_name"} Full Name
+        %td.field{:colspan=>2}
+          = text_field "user", "name", :class => 'textbox activate', :value => '', :maxlength => 40, :size => 40
+      %tr
+        %td.label
+          %label{:for=>"user_login"} Username
+        %td.field{:colspan=>2}
+          = text_field "user", "login", :class => 'textbox activate', :value => '', :maxlength => 40, :size => 40
+      %tr
+        %td.label
+          %label{:for=>"user_email"} Email
+        %td.field{:colspan=>2}
+          = text_field "user", "email", :class => 'textbox activate', :value => '', :maxlength => 40, :size => 40
+      %tr
+        %td.label
+          %label{:for=>"user_password"} Password
+        %td.field{:colspan=>2}
+          = password_field "user", "password", :class => 'textbox', :value => '', :maxlength => 40, :size => 40
+      %tr
+        %td.label
+          %label{:for=>"user_password_confirmation"} Confirm Password
+        %td.field{:colspan=>2}
+          = password_field "user", "password_confirmation", :class => 'textbox', :value => '', :maxlength => 40, :size => 40
+      %tr
+        %td
+        %td
+          All fields required.
+        %td.buttons
+          %input.button{:type=>"submit", :value=>"Register"}/
+
+= javascript_tag "$('user_login').activate();"
\ No newline at end of file

Added: labs/consite/trunk/members/app/views/admin/members/register/new.html.erb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/app/views/admin/members/register/new.html.erb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/app/views/admin/members/register/new.html.erb (added)
+++ labs/consite/trunk/members/app/views/admin/members/register/new.html.erb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,10 @@
+<% unless @user.errors.empty? %>
+  <ul>
+  <% @user.errors.each_full do |message| %>
+    <li><%= message %></li>
+  <% end %>
+  </ul>
+<% end %>
+
+
+<a href="javascript:window.back();">Go Back</a>

Added: labs/consite/trunk/members/db/migrate/001_modify_users.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/db/migrate/001_modify_users.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/db/migrate/001_modify_users.rb (added)
+++ labs/consite/trunk/members/db/migrate/001_modify_users.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,13 @@
+class ModifyUsers < ActiveRecord::Migration
+  
+  def self.up
+    add_column :users, :photo, :string
+    add_column :users, :url, :string    
+  end
+
+  def self.down
+    remove_column :users, :photo
+    remove_column :users, :url
+  end
+  
+end

Propchange: labs/consite/trunk/members/db/migrate/001_modify_users.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/db/migrate/002_create_profile_snippet.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/db/migrate/002_create_profile_snippet.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/db/migrate/002_create_profile_snippet.rb (added)
+++ labs/consite/trunk/members/db/migrate/002_create_profile_snippet.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,15 @@
+class CreateProfileSnippet < ActiveRecord::Migration
+  
+  def self.up
+    snippet = Snippet.new
+    snippet.name = "profile_sidebar"
+    snippet.content = " "
+    snippet.save!
+  end
+
+  def self.down
+    snippet = Snippet.find_by_name 'profile_sidebar'
+    snippet.delete
+  end
+  
+end

Propchange: labs/consite/trunk/members/db/migrate/002_create_profile_snippet.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/lib/tasks/members_extension_tasks.rake
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/lib/tasks/members_extension_tasks.rake?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/lib/tasks/members_extension_tasks.rake (added)
+++ labs/consite/trunk/members/lib/tasks/members_extension_tasks.rake Fri Mar 27 10:32:54 2009
@@ -0,0 +1,28 @@
+namespace :radiant do
+  namespace :extensions do
+    namespace :members do
+      
+      desc "Runs the migration of the Members extension"
+      task :migrate => :environment do
+        require 'radiant/extension_migrator'
+        if ENV["VERSION"]
+          MembersExtension.migrator.migrate(ENV["VERSION"].to_i)
+        else
+          MembersExtension.migrator.migrate
+        end
+      end
+      
+      desc "Copies public assets of the Members to the instance public/ directory."
+      task :update => :environment do
+        is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) }
+        Dir[MembersExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file|
+          path = file.sub(MembersExtension.root, '')
+          directory = File.dirname(path)
+          puts "Copying #{path}..."
+          mkdir_p RAILS_ROOT + directory
+          cp file, RAILS_ROOT + path
+        end
+      end  
+    end
+  end
+end

Added: labs/consite/trunk/members/members_extension.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/members_extension.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/members_extension.rb (added)
+++ labs/consite/trunk/members/members_extension.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,67 @@
+# Uncomment this if you reference any of your controllers in activate
+require_dependency 'application'
+
+class MembersExtension < Radiant::Extension
+  version "1.0"
+  description "Extends Radiant user model for site members"
+  url "http://cubiclemuses.com/cm"
+  
+  define_routes do |map|
+     map.connect 'admin/members/register/:action', :controller => 'admin/members/register'        
+     map.connect 'admin/members/:action', :controller => 'admin/members/profile'
+  end
+  
+  def activate
+    admin.tabs.add "Profile", "/admin/members/", :after => "Layouts", :visibility => [:all]
+    
+    User.class_eval do
+      file_column :photo, :magick => { :geometry => "80x80>" }   
+      validates_presence_of :email, :message => 'required'      
+    end
+
+    Radiant::AdminUI::Tab.class_eval do
+
+      alias_method :initialize_less_securely, :initialize unless method_defined?(:initialize_more_securely)
+      
+      def initialize_more_securely(name, url, options = {})
+        @name, @url = name, url
+        @visibility = [options[:for], options[:visibility]].flatten.compact
+        @visibility = [:developer,:admin] if @visibility.empty?
+      end      
+      
+      alias_method :initialize, :initialize_more_securely      
+      
+    end
+    
+    Admin::PagesController.class_eval do 
+      only_allow_access_to :index, :new, :edit, :remove,
+        :when => [:developer, :admin],
+        :denied_url => { :controller => 'welcome', :action => 'index' },
+        :denied_message => 'You must have developer privileges to perform this action.'        
+    end
+    
+    Admin::SnippetsController.class_eval do 
+      only_allow_access_to :index, :new, :edit, :remove,
+        :when => [:developer, :admin],
+        :denied_url => { :controller => 'welcome', :action => 'index' },
+        :denied_message => 'You must have developer privileges to perform this action.'        
+    end    
+    
+    Admin::WelcomeController.class_eval do 
+      alias_method :index_to_page, :index unless method_defined?(:index_to_profile)
+      
+      def index_to_profile
+        redirect_to :controller => 'admin/members/profile', :action => 'index'
+      end
+      
+      alias_method :index, :index_to_profile      
+    end    
+    
+    
+  end
+  
+  def deactivate
+    admin.tabs.remove "Profile"
+  end
+  
+end

Propchange: labs/consite/trunk/members/members_extension.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/public/images/profile.png
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/public/images/profile.png?rev=759091&view=auto
==============================================================================
Binary file - no diff available.

Propchange: labs/consite/trunk/members/public/images/profile.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: labs/consite/trunk/members/spec/controllers/admin/members/profile_controller_spec.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/spec/controllers/admin/members/profile_controller_spec.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/spec/controllers/admin/members/profile_controller_spec.rb (added)
+++ labs/consite/trunk/members/spec/controllers/admin/members/profile_controller_spec.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe Admin::Members::ProfileController do
+
+  #Delete this example and add some real ones
+  it "should use Admin::Members::ProfileController" do
+    controller.should be_an_instance_of(Admin::Members::ProfileController)
+  end
+
+end

Propchange: labs/consite/trunk/members/spec/controllers/admin/members/profile_controller_spec.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/spec/controllers/admin/members/register_controller_spec.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/spec/controllers/admin/members/register_controller_spec.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/spec/controllers/admin/members/register_controller_spec.rb (added)
+++ labs/consite/trunk/members/spec/controllers/admin/members/register_controller_spec.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe Admin::Members::RegisterController do
+
+  #Delete this example and add some real ones
+  it "should use Admin::Members::RegisterController" do
+    controller.should be_an_instance_of(Admin::Members::RegisterController)
+  end
+
+end

Propchange: labs/consite/trunk/members/spec/controllers/admin/members/register_controller_spec.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/spec/helpers/admin/members/profile_helper_spec.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/spec/helpers/admin/members/profile_helper_spec.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/spec/helpers/admin/members/profile_helper_spec.rb (added)
+++ labs/consite/trunk/members/spec/helpers/admin/members/profile_helper_spec.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe Admin::Members::ProfileHelper do
+  
+  #Delete this example and add some real ones or delete this file
+  it "should include the Admin::Members::ProfileHelper" do
+    included_modules = self.metaclass.send :included_modules
+    included_modules.should include(Admin::Members::ProfileHelper)
+  end
+  
+end

Propchange: labs/consite/trunk/members/spec/helpers/admin/members/profile_helper_spec.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/spec/helpers/admin/members/register_helper_spec.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/spec/helpers/admin/members/register_helper_spec.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/spec/helpers/admin/members/register_helper_spec.rb (added)
+++ labs/consite/trunk/members/spec/helpers/admin/members/register_helper_spec.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+describe Admin::Members::RegisterHelper do
+  
+  #Delete this example and add some real ones or delete this file
+  it "should include the Admin::Members::RegisterHelper" do
+    included_modules = self.metaclass.send :included_modules
+    included_modules.should include(Admin::Members::RegisterHelper)
+  end
+  
+end

Propchange: labs/consite/trunk/members/spec/helpers/admin/members/register_helper_spec.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/members/spec/spec.opts
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/spec/spec.opts?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/spec/spec.opts (added)
+++ labs/consite/trunk/members/spec/spec.opts Fri Mar 27 10:32:54 2009
@@ -0,0 +1,6 @@
+--colour
+--format
+progress
+--loadby
+mtime
+--reverse

Added: labs/consite/trunk/members/spec/spec_helper.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/members/spec/spec_helper.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/members/spec/spec_helper.rb (added)
+++ labs/consite/trunk/members/spec/spec_helper.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,37 @@
+unless defined? RADIANT_ROOT
+  ENV["RAILS_ENV"] = "test"
+  case
+  when ENV["RADIANT_ENV_FILE"]
+    require ENV["RADIANT_ENV_FILE"]
+  when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
+    require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
+  else
+    require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
+  end
+end
+require "#{RADIANT_ROOT}/spec/spec_helper"
+
+if File.directory?(File.dirname(__FILE__) + "/scenarios")
+  Scenario.load_paths.unshift File.dirname(__FILE__) + "/scenarios"
+end
+if File.directory?(File.dirname(__FILE__) + "/matchers")
+  Dir[File.dirname(__FILE__) + "/matchers/*.rb"].each {|file| require file }
+end
+
+Spec::Runner.configure do |config|
+  # config.use_transactional_fixtures = true
+  # config.use_instantiated_fixtures  = false
+  # config.fixture_path = RAILS_ROOT + '/spec/fixtures'
+
+  # You can declare fixtures for each behaviour like this:
+  #   describe "...." do
+  #     fixtures :table_a, :table_b
+  #
+  # Alternatively, if you prefer to declare them only once, you can
+  # do so here, like so ...
+  #
+  #   config.global_fixtures = :table_a, :table_b
+  #
+  # If you declare global fixtures, be aware that they will be declared
+  # for all of your examples, even those that don't use them.
+end
\ No newline at end of file

Propchange: labs/consite/trunk/members/spec/spec_helper.rb
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org