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 [4/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/db/migrate/001_create_conferences.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/001_create_conferences.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/001_create_conferences.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/001_create_conferences.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,18 @@
+class CreateConferences < ActiveRecord::Migration
+  def self.up
+    create_table :conferences do |t|
+      t.string :name
+      t.datetime :start_date
+      t.datetime :end_date
+      t.integer :venue_id
+      t.text :description
+      t.string :host
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :conferences
+  end
+end

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

Added: labs/consite/trunk/conferences/db/migrate/002_create_locations.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/002_create_locations.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/002_create_locations.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/002_create_locations.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,15 @@
+class CreateLocations < ActiveRecord::Migration
+  def self.up
+    create_table :locations do |t|
+      t.string :name
+      t.integer :venue_id
+      t.text :description
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :locations
+  end
+end

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

Added: labs/consite/trunk/conferences/db/migrate/003_create_venues.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/003_create_venues.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/003_create_venues.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/003_create_venues.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,15 @@
+class CreateVenues < ActiveRecord::Migration
+  def self.up
+    create_table :venues do |t|
+      t.string :name
+      t.text :address
+      t.text :description
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :venues
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/003_create_venues.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/004_create_people.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/004_create_people.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/004_create_people.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/004_create_people.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,19 @@
+class CreatePeople < ActiveRecord::Migration
+  def self.up
+    create_table :people do |t|
+      t.string :url
+      t.string :photo
+      t.text :bio
+      t.integer :user_id
+
+      t.timestamps
+    end
+
+    add_column :users, :person_id, :integer
+
+  end
+
+  def self.down
+    drop_table :people
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/004_create_people.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/005_update_people.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/005_update_people.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/005_update_people.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/005_update_people.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,12 @@
+class UpdatePeople < ActiveRecord::Migration
+  def self.up
+
+    add_column :people, :name, :string
+    add_column :people, :email, :string
+
+  end
+
+  def self.down
+
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/005_update_people.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/006_create_capacities.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/006_create_capacities.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/006_create_capacities.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/006_create_capacities.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,13 @@
+class CreateCapacities < ActiveRecord::Migration
+  def self.up
+    create_table :capacities do |t|
+      t.string :name
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :capacities
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/006_create_capacities.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/007_create_roles.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/007_create_roles.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/007_create_roles.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/007_create_roles.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,15 @@
+class CreateRoles < ActiveRecord::Migration
+  def self.up
+    create_table :roles do |t|
+      t.integer :conference_id
+      t.integer :person_id
+      t.integer :capacity_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :roles
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/007_create_roles.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/008_update_conferences.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/008_update_conferences.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/008_update_conferences.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/008_update_conferences.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,10 @@
+class UpdateConferences < ActiveRecord::Migration
+  def self.up
+    remove_column :conferences, :host
+    add_column :conferences, :short_name, :string
+  end
+
+  def self.down
+
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/008_update_conferences.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/009_create_sponsor_classes.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/009_create_sponsor_classes.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/009_create_sponsor_classes.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/009_create_sponsor_classes.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,15 @@
+class CreateSponsorClasses < ActiveRecord::Migration
+  def self.up
+    create_table :sponsor_classes do |t|
+      t.string :name
+      t.integer :sponsor_type_id
+      t.integer :rank
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :sponsor_classes
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/009_create_sponsor_classes.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/010_create_sponsor_types.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/010_create_sponsor_types.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/010_create_sponsor_types.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/010_create_sponsor_types.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,14 @@
+class CreateSponsorTypes < ActiveRecord::Migration
+  def self.up
+    create_table :sponsor_types do |t|
+      t.string :name
+      t.integer :rank
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :sponsor_types
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/010_create_sponsor_types.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/011_create_sponsors.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/011_create_sponsors.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/011_create_sponsors.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/011_create_sponsors.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,16 @@
+class CreateSponsors < ActiveRecord::Migration
+  def self.up
+    create_table :sponsors do |t|
+      t.integer :conference_id
+      t.integer :person_id
+      t.integer :sponsor_type_id
+      t.integer :sponsor_class_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :sponsors
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/011_create_sponsors.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/012_create_organizations.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/012_create_organizations.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/012_create_organizations.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/012_create_organizations.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,22 @@
+class CreateOrganizations < ActiveRecord::Migration
+  def self.up
+    create_table :organizations do |t|
+      t.string :name
+      t.string :url
+      t.text   :description
+      t.string :logo
+
+      t.timestamps
+    end
+
+    remove_column :sponsors, :person_id
+    add_column :sponsors, :organization_id, :integer
+
+  end
+
+  def self.down
+    drop_table :organizations
+    add_column :sponsors, :person_id, :integer
+    remove_column :sponsors, :organization_id
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/012_create_organizations.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/013_create_presentation_types.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/013_create_presentation_types.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/013_create_presentation_types.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/013_create_presentation_types.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,13 @@
+class CreatePresentationTypes < ActiveRecord::Migration
+  def self.up
+    create_table :presentation_types do |t|
+      t.string :name
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :presentation_types
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/013_create_presentation_types.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/014_create_presentations.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/014_create_presentations.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/014_create_presentations.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/014_create_presentations.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,15 @@
+class CreatePresentations < ActiveRecord::Migration
+  def self.up
+    create_table :presentations do |t|
+      t.string   :name
+      t.text     :description
+      t.integer  :type_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :presentations
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/014_create_presentations.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/015_create_presenters.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/015_create_presenters.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/015_create_presenters.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/015_create_presenters.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,14 @@
+class CreatePresenters < ActiveRecord::Migration
+  def self.up
+    create_table :presenters do |t|
+      t.integer :person_id
+      t.integer :presentation_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :presenters
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/015_create_presenters.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/016_create_scheduled_sessions.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/016_create_scheduled_sessions.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/016_create_scheduled_sessions.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/016_create_scheduled_sessions.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,16 @@
+class CreateScheduledSessions < ActiveRecord::Migration
+  def self.up
+    create_table :scheduled_sessions do |t|
+      t.integer :presentation_id
+      t.datetime :start_time
+      t.datetime :end_time
+      t.integer :track_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :scheduled_sessions
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/016_create_scheduled_sessions.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/017_create_tags_presentations.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/017_create_tags_presentations.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/017_create_tags_presentations.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/017_create_tags_presentations.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,14 @@
+class CreateTagsPresentations < ActiveRecord::Migration
+  def self.up
+    create_table :tags_presentations do |t|
+      t.integer :tag_id
+      t.integer :presentation_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :tags_presentations
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/017_create_tags_presentations.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/018_create_tags.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/018_create_tags.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/018_create_tags.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/018_create_tags.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,13 @@
+class CreateTags < ActiveRecord::Migration
+  def self.up
+    create_table :tags do |t|
+      t.string :name
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :tags
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/018_create_tags.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/019_create_tracks.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/019_create_tracks.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/019_create_tracks.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/019_create_tracks.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,16 @@
+class CreateTracks < ActiveRecord::Migration
+  def self.up
+    create_table :tracks do |t|
+      t.string  :name
+      t.date    :date
+      t.integer :conference_id
+      t.integer :location_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :tracks
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/019_create_tracks.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/020_create_presentation_capacities.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/020_create_presentation_capacities.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/020_create_presentation_capacities.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/020_create_presentation_capacities.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,14 @@
+class CreatePresentationCapacities < ActiveRecord::Migration
+  def self.up
+    create_table :presentation_capacities do |t|
+      t.integer :capacity_id
+      t.integer :presentation_type_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :presentation_capacities
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/020_create_presentation_capacities.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/021_create_submissions.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/021_create_submissions.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/021_create_submissions.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/021_create_submissions.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,18 @@
+class CreateSubmissions < ActiveRecord::Migration
+  def self.up
+    create_table :submissions do |t|
+      t.integer :presentation_id
+      t.integer :conference_id
+      t.boolean :reviewed
+      t.boolean :accepted
+      t.integer :score
+      t.integer :votes
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :submissions
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/021_create_submissions.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/022_create_presentations_tags.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/022_create_presentations_tags.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/022_create_presentations_tags.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/022_create_presentations_tags.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,15 @@
+class CreatePresentationsTags < ActiveRecord::Migration
+  def self.up
+    create_table :presentations_tags do |t|
+      t.integer :presentation_id
+      t.integer :tag_id
+
+      t.timestamps
+    end
+    drop_table :tags_presentations
+  end
+
+  def self.down
+    drop_table :presentations_tags
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/022_create_presentations_tags.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/023_refactor_tables.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/023_refactor_tables.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/023_refactor_tables.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/023_refactor_tables.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,23 @@
+class RefactorTables < ActiveRecord::Migration
+  def self.up
+    add_column :presentations, :duration, :integer
+    add_column :presentations, :materials, :string
+    add_column :submissions, :comments, :text
+
+    remove_column :sponsor_types, :rank
+    remove_column :sponsor_classes, :sponsor_type_id
+    rename_column :sponsors, :sponsor_class_id, :sponsor_level_id
+    rename_table :sponsor_classes, :sponsor_levels
+
+    change_column :conferences, :start_date, :date
+    change_column :conferences, :end_date, :date
+
+    change_column :scheduled_sessions, :start_time, :time
+    change_column :scheduled_sessions, :end_time, :time
+
+  end
+
+  def self.down
+
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/023_refactor_tables.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/024_initialize_global_configuration.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/024_initialize_global_configuration.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/024_initialize_global_configuration.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/024_initialize_global_configuration.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,30 @@
+class InitializeGlobalConfiguration < ActiveRecord::Migration
+  def self.up
+
+    presentation = PresentationType.new(:name => "Presentation")
+    half_day = PresentationType.new(:name => "Training, Half-Day")
+    full_day = PresentationType.new(:name => "Training, Full-Day")
+    two_day  = PresentationType.new(:name => "Training, Two-Day")
+    panel = PresentationType.new(:name => "Panel")
+    keynote = PresentationType.new(:name => "Keynote")
+    pbreak = PresentationType.new(:name => "Break")
+    presentation.save; half_day.save; full_day.save; two_day.save;
+    panel.save; keynote.save; pbreak.save;
+
+    SponsorType.new(:name => "Sponsor").save
+    SponsorType.new(:name => "Media Partner").save
+    SponsorType.new(:name => "Community Partner").save
+    SponsorType.new(:name => "Exhibitor").save
+
+    SponsorLevel.new(:name => "Gold", :rank => 0).save
+    SponsorLevel.new(:name => "Silver", :rank => 1).save
+    SponsorLevel.new(:name => "Bronze", :rank => 2).save
+    SponsorLevel.new(:name => "Special", :rank => 3).save
+    SponsorLevel.new(:name => "Additional", :rank => 4).save
+
+  end
+
+  def self.down
+
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/024_initialize_global_configuration.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/025_acts_as_taggable_migration.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/025_acts_as_taggable_migration.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/025_acts_as_taggable_migration.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/025_acts_as_taggable_migration.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,31 @@
+class ActsAsTaggableMigration < ActiveRecord::Migration
+  def self.up
+
+    # already have this table
+
+#    create_table :tags do |t|
+#      t.column :name, :string
+#    end
+
+    drop_table :presentations_tags
+
+    create_table :taggings do |t|
+      t.column :tag_id, :integer
+      t.column :taggable_id, :integer
+
+      # You should make sure that the column created is
+      # long enough to store the required class names.
+      t.column :taggable_type, :string
+
+      t.column :created_at, :datetime
+    end
+
+    add_index :taggings, :tag_id
+    add_index :taggings, [:taggable_id, :taggable_type]
+  end
+
+  def self.down
+    drop_table :taggings
+    drop_table :tags
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/025_acts_as_taggable_migration.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/026_refactor_conferences.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/026_refactor_conferences.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/026_refactor_conferences.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/026_refactor_conferences.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,20 @@
+class RefactorConferences < ActiveRecord::Migration
+  def self.up
+
+    add_column :conferences, :logo, :string
+    add_column :conferences, :tagline, :string
+    add_column :conferences, :registration_link, :string
+    add_column :conferences, :community_link, :string
+    add_column :conferences, :wiki_link, :string
+    add_column :conferences, :mailing_list, :string
+    add_column :conferences, :mailing_list_link, :string
+
+    add_column :conferences, :registration_open, :boolean
+    add_column :conferences, :cfp_open, :boolean
+
+  end
+
+  def self.down
+
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/026_refactor_conferences.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/027_create_panel_members.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/027_create_panel_members.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/027_create_panel_members.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/027_create_panel_members.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,14 @@
+class CreatePanelMembers < ActiveRecord::Migration
+  def self.up
+    create_table :panel_members do |t|
+      t.integer :person_id
+      t.integer :presentation_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :panel_members
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/027_create_panel_members.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/028_refactor_schedule.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/028_refactor_schedule.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/028_refactor_schedule.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/028_refactor_schedule.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,24 @@
+class RefactorSchedule < ActiveRecord::Migration
+  def self.up
+
+    add_column :presentations, :presenter_id, :integer
+
+#     presenters = Presenter.find(:all)
+#     presenters.each do |presenter|
+#       presenter.presentation.presenter = presenter.person
+#       presenter.presentation.save
+#       presenter.save
+#    end
+
+    remove_column :scheduled_sessions, :presentation_id
+    add_column :scheduled_sessions, :submission_id, :integer
+
+    remove_column :submissions, :reviewed
+    drop_table :presenters
+
+  end
+
+  def self.down
+
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/028_refactor_schedule.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/029_create_activities.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/029_create_activities.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/029_create_activities.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/029_create_activities.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,21 @@
+class CreateActivities < ActiveRecord::Migration
+  def self.up
+    create_table :activities do |t|
+      t.string :name
+      t.datetime :start_time
+      t.datetime :end_time
+      t.text :description
+      t.integer :presentation_type_id
+      t.integer :location_id
+      t.integer :track_id
+      t.integer :conference_id
+      t.integer :person_id
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :activities
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/029_create_activities.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/030_refactor_panel.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/030_refactor_panel.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/030_refactor_panel.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/030_refactor_panel.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,9 @@
+class RefactorPanel < ActiveRecord::Migration
+  def self.up
+    rename_column :panel_members, :presentation_id, :submission_id
+  end
+
+  def self.down
+
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/030_refactor_panel.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/031_refactor_roles.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/031_refactor_roles.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/031_refactor_roles.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/031_refactor_roles.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,69 @@
+class RefactorRoles < ActiveRecord::Migration
+  def self.up
+    drop_table :roles
+    drop_table :presentation_capacities
+    drop_table :capacities
+
+    sqlite_version = <<SQL
+CREATE VIEW 'conference_roles' AS
+ select "2" || tracks.conference_id || presentations.presenter_id || scheduled_sessions.id as id,
+        tracks.conference_id as conference_id, presentations.presenter_id as person_id,
+        scheduled_sessions.id as event_id , "scheduled_session" as event_type
+ from tracks, scheduled_sessions, submissions, presentations
+ where
+   tracks.id = scheduled_sessions.track_id
+   and scheduled_sessions.submission_id  = submissions.id
+   and submissions.presentation_id = presentations.id
+ UNION
+ select "3" || activities.conference_id || activities.person_id || activities.id as id,
+        activities.conference_id as conference_id, activities.person_id as person_id,
+        activities.id as event_id, "activity" as event_type
+   from activities
+ UNION
+ select "4" || tracks.conference_id || panel_members.person_id || scheduled_sessions.id as id,
+        tracks.conference_id as conference_id, panel_members.person_id as person_id,
+        scheduled_sessions.id as event_id, "panel_member" as event_type
+ from tracks, scheduled_sessions, submissions, panel_members, people
+ where
+   tracks.id = scheduled_sessions.track_id
+   and scheduled_sessions.submission_id  = submissions.id
+   and panel_members.submission_id = submissions.id
+SQL
+
+    mysql_version = <<SQL
+CREATE VIEW conference_roles AS
+ select CONCAT('2',tracks.conference_id,presentations.presenter_id,scheduled_sessions.id) as id,
+        tracks.conference_id as conference_id, presentations.presenter_id as person_id,
+        scheduled_sessions.id as event_id , "scheduled_session" as event_type
+ from tracks, scheduled_sessions, submissions, presentations
+ where
+   tracks.id = scheduled_sessions.track_id
+   and scheduled_sessions.submission_id  = submissions.id
+   and submissions.presentation_id = presentations.id
+ UNION
+ select CONCAT('3', activities.conference_id, activities.person_id, activities.id) as id,
+        activities.conference_id as conference_id, activities.person_id as person_id,
+        activities.id as event_id, "activity" as event_type
+   from activities
+ UNION
+A select CONCAT("4",tracks.conference_id,panel_members.person_id,scheduled_sessions.id) as id,
+        tracks.conference_id as conference_id, panel_members.person_id as person_id,
+        scheduled_sessions.id as event_id, "panel_member" as event_type
+ from tracks, scheduled_sessions, submissions, panel_members, people
+ where
+   tracks.id = scheduled_sessions.track_id
+   and scheduled_sessions.submission_id  = submissions.id
+   and panel_members.submission_id = submissions.id
+SQL
+
+    #!! TODO really shouldn't hardcode this...
+
+
+    execute mysql_version
+
+  end
+
+  def self.down
+
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/031_refactor_roles.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/032_refactor_times.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/032_refactor_times.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/032_refactor_times.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/032_refactor_times.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,18 @@
+class RefactorTimes < ActiveRecord::Migration
+
+  def self.up
+   change_column :scheduled_sessions, :start_time, :datetime
+   change_column :scheduled_sessions, :end_time, :datetime
+
+   add_column :conferences, :time_zone, :string
+
+  end
+
+  def self.down
+    change_column :scheduled_sessions, :end_time, :time
+    change_column :scheduled_sessions, :start_time, :time
+
+    remove_column :conferences, :time_zone
+  end
+
+end

Propchange: labs/consite/trunk/conferences/db/migrate/032_refactor_times.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/033_migrate_people.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/033_migrate_people.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/033_migrate_people.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/033_migrate_people.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,46 @@
+class MigratePeople < ActiveRecord::Migration
+  
+  def self.up
+    people = Person.find(:all)
+    people.each do | person |
+      if person.user
+        user = person.user
+        user.name = person.name
+        user.email = person.email ? person.email : 'info@apachecon.com'
+        user.notes = person.bio
+        user.url = person.url
+        user.login = person.name.downcase.gsub(/ /,'')        
+        user.password = 'conference_speaker'
+        user.person = person
+        user.save!
+        person.user = user
+        person.save!
+        puts "#{user.name};#{user.email};#{user.login}"         
+      else
+        user = User.new
+        user.name = person.name
+        user.email = person.email ? person.email : 'info@apachecon.com'
+        user.notes = person.bio
+        user.login = person.name.downcase.gsub(/ /,'')
+        user.password = 'conference_speaker'
+        user.password_confirmation = 'conference_speaker'
+        user.person = person
+        user.save!
+        person.user = user
+        person.save!        
+        puts "#{user.name};#{user.email};#{user.login}"                      
+      end
+    end
+
+    add_column   :activities, :presenter_id, :integer
+    add_column   :panel_members, :presenter_id, :integer
+    rename_column :presentations, :presenter_id, :person_id
+    add_column   :presentations, :presenter_id, :integer
+  end    
+
+  
+  def self.down
+
+  end
+  
+end

Propchange: labs/consite/trunk/conferences/db/migrate/033_migrate_people.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/034_remove_people.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/034_remove_people.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/034_remove_people.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/034_remove_people.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,49 @@
+class RemovePeople < ActiveRecord::Migration
+  
+  def self.up
+    populate_users(Presentation)
+    populate_users(Activity)
+    populate_users(PanelMember)
+    
+    remove_column :users, :person_id
+    remove_column :activities, :person_id
+    remove_column :panel_members, :person_id
+    remove_column :presentation, :person_id
+        
+    drop_table :people    
+
+    puts "recreating conference_roles view..."
+
+    execute "DROP VIEW conference_roles"
+    
+    mysql_version = <<SQL
+
+CREATE VIEW `conference_roles` AS select concat(_latin1'2',`apachecon_production`.`tracks`.`conference_id`,`apachecon_production`.`presentations`.`presenter_id`,`apachecon_production`.`scheduled_sessions`.`id`) AS `id`,`apachecon_production`.`tracks`.`conference_id` AS `conference_id`,`apachecon_production`.`presentations`.`presenter_id` AS `presenter_id`,`apachecon_production`.`scheduled_sessions`.`id` AS `event_id`,_latin1'scheduled_session' AS `event_type` from (((`tracks` join `scheduled_sessions`) join `submissions`) join `presentations`) where ((`apachecon_production`.`tracks`.`id` = `apachecon_production`.`scheduled_sessions`.`track_id`) and (`apachecon_production`.`scheduled_sessions`.`submission_id` = `apachecon_production`.`submissions`.`id`) and (`apachecon_production`.`submissions`.`presentation_id` = `apachecon_production`.`presentations`.`id`)) 
+union select concat(_latin1'3',`apachecon_production`.`activities`.`conference_id`,`apachecon_production`.`activities`.`presenter_id`,`apachecon_production`.`activities`.`id`) AS `id`,`apachecon_production`.`activities`.`conference_id` AS `conference_id`,`apachecon_production`.`activities`.`presenter_id` AS `presenter_id`,`apachecon_production`.`activities`.`id` AS `event_id`,_latin1'activity' AS `event_type` from `activities` 
+union select concat(_latin1'4',`apachecon_production`.`tracks`.`conference_id`,`apachecon_production`.`panel_members`.`presenter_id`,`apachecon_production`.`scheduled_sessions`.`id`) AS `id`,`apachecon_production`.`tracks`.`conference_id` AS `conference_id`,`apachecon_production`.`panel_members`.`presenter_id` AS `presenter_id`,`apachecon_production`.`scheduled_sessions`.`id` AS `event_id`,_latin1'panel_member' AS `event_type` from ((((`tracks` join `scheduled_sessions`) join `submissions`) join `panel_members`) join `users`) where ((`apachecon_production`.`tracks`.`id` = `apachecon_production`.`scheduled_sessions`.`track_id`) and (`apachecon_production`.`scheduled_sessions`.`submission_id` = `apachecon_production`.`submissions`.`id`) and (`apachecon_production`.`panel_members`.`submission_id` = `apachecon_production`.`submissions`.`id`))
+
+SQL
+
+     execute mysql_version
+    
+  end
+  
+
+  def self.populate_users(model)
+    models = model.find(:all)
+    models.each do | m |
+      person_id = m.person_id
+      if person_id
+        user_id = Person.find(person_id).user_id
+        puts "#{m.id} ; #{m.person_id} ; #{user_id}" 
+        m.presenter_id = user_id
+        m.person_id = nil
+        m.save!        
+      else
+        puts "no person_id for #{m.to_s} : #{m.id}" unless person_id
+      end
+    end
+  end    
+
+  
+end

Propchange: labs/consite/trunk/conferences/db/migrate/034_remove_people.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/035_add_submission_notification_to_conference.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/035_add_submission_notification_to_conference.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/035_add_submission_notification_to_conference.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/035_add_submission_notification_to_conference.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,9 @@
+class AddSubmissionNotificationToConference < ActiveRecord::Migration
+  def self.up
+    add_column :conferences, :submission_notification_email, :string
+  end
+  
+  def self.down
+    remove_column :conferences, :submission_notification_email
+  end
+end
\ No newline at end of file

Propchange: labs/consite/trunk/conferences/db/migrate/035_add_submission_notification_to_conference.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/036_add_agreement_form_received_to_submissions.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/036_add_agreement_form_received_to_submissions.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/036_add_agreement_form_received_to_submissions.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/036_add_agreement_form_received_to_submissions.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,9 @@
+class AddAgreementFormReceivedToSubmissions < ActiveRecord::Migration
+  def self.up
+    add_column :submissions, :agreement_form_received, :boolean, :default => false
+  end
+  
+  def self.down
+    remove_column :submissions, :agreement_form_received
+  end
+end
\ No newline at end of file

Propchange: labs/consite/trunk/conferences/db/migrate/036_add_agreement_form_received_to_submissions.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/db/migrate/037_create_emails.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/db/migrate/037_create_emails.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/db/migrate/037_create_emails.rb (added)
+++ labs/consite/trunk/conferences/db/migrate/037_create_emails.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,16 @@
+class CreateEmails < ActiveRecord::Migration
+  def self.up
+    create_table :emails do |t|
+      t.integer :conference_id      
+      t.string :recipient
+      t.string :subject
+      t.text :body
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :emails
+  end
+end

Propchange: labs/consite/trunk/conferences/db/migrate/037_create_emails.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/lib/acts_as_cache_clearing.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/lib/acts_as_cache_clearing.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/lib/acts_as_cache_clearing.rb (added)
+++ labs/consite/trunk/conferences/lib/acts_as_cache_clearing.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,18 @@
+module Con
+  module CacheClearing
+
+    def self.included(base)
+      base.extend AddActsAsCacheClearing
+    end
+
+    module AddActsAsCacheClearing
+      def acts_as_cache_clearing
+        class_eval do
+          after_save do
+            ResponseCache.instance.clear
+          end
+        end
+      end
+    end
+  end
+end

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

Added: labs/consite/trunk/conferences/lib/conference_generator.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/lib/conference_generator.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/lib/conference_generator.rb (added)
+++ labs/consite/trunk/conferences/lib/conference_generator.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,405 @@
+class ConferenceGenerator
+  attr_reader :con
+  def initialize(conference)
+    @con = conference
+    @confs_root = @current_page = Page.find_by_url('/c/')
+  end
+
+  def generate
+    page(con.name, :slug => con.short_name) do
+      page("About") do
+        part(:body, about)
+        page("Venue") do
+          part(:body, venue)
+        end
+      end
+      page("Articles", :class_name => "ArchivePage") do
+        part(:body, %Q{<ul><r:children:each><li><r:link/> <span class="article-date"><r:date/></span></li></r:children:each></ul>})
+        page("%b %Y Archives", :class_name => "ArchiveMonthIndexPage") do
+          part(:body, %Q{<ul><r:archive:children:each><li><r:link/> <span class="article-date"><r:date/></span></li></r:archive:children:each></ul>})
+        end
+      end
+      page("Export") do
+        part(:body, export_root, :filter_id => "Markdown")
+        page("Article Newsfeed", :slug => "atom.xml",              :layout => layout("Atom"))       { part(:body, article_newsfeed) }
+        page("iCalendar",        :slug => "#{con.short_name}.ics", :layout => layout("iCalendar"))  { part(:body, icalendar) }
+        page("Sponsors",         :slug => "sponsors.xml",          :layout => layout("Atom"))       { part(:body, sponsors_feed) }
+        page("Sponsors JSON",    :slug => "sponsors.json",         :layout => layout("JavaScript")) { part(:body, sponsors_json) }
+      end
+      page("Speakers", :class_name => "SpeakersPage") do
+        part(:body, speakers)
+        page("Speaker", :class_name => "SpeakerPage") { part(:body, speaker) }
+      end
+      page("Schedule", :class_name => "SchedulePage") do
+        part(:body, schedule)
+        page("Schedule Day", :class_name => "ScheduleDayPage") { part(:body, schedule_day) }
+      end
+      page("Sessions", :class_name => "SessionsPage") do
+        part(:body, sessions)
+        page("Session", :class_name => "SessionPage") { part(:body, session) }
+      end
+      page("Sponsors", :class_name => "SponsorsPage") do
+        part(:body, sponsors)
+        page("Conference Sponsors", :class_name => "SponsorTypePage") { part(:body, sponsor) }
+      end
+    end
+  end
+
+  private
+
+  def page(title, options={})
+    defaults = {
+      :title => title,
+      :slug => title.underscore.gsub(/[_\s\W]+/, '-').sub(/-+$/, '').sub(/^-+/, ''),
+      :breadcrumb => title,
+      :status_id => 100
+    }
+    options = defaults.merge(options)
+    page = @current_page.children.create!(options)
+    if block_given?
+      old_page = @current_page
+      @current_page = page
+      yield
+      @current_page = old_page
+    end
+  rescue Exception => e
+    @current_page.logger.warn("PAGE CREATE FAILED: #{e.message}")
+    raise e
+  end
+
+  def part(name, content, options={})
+    defaults = {
+      :name => name.to_s,
+      :content => content
+    }
+    options = defaults.merge(options)
+    @current_page.parts.create!(options)
+  rescue Exception => e
+    @current_page.logger.warn("PART CREATE FAILED: #{e.message}")
+    raise e
+  end
+
+  def layout(name)
+    Layout.find_by_name(name)
+  end
+
+  def about
+    <<-ABOUT
+    <h1>#{con.name}</h1>
+    #{con.description}
+    ABOUT
+  end
+
+  def venue
+    <<-VENUE
+    <h1>Venue</h1>
+    <h2>#{con.venue.name}</h2>
+    #{con.venue.description}
+    #{con.venue.address}
+    VENUE
+  end
+
+  def export_root
+    <<-EXPORT
+    Site Export Services
+    ====================
+
+    We publish much of the conference information in various export formats:
+
+     - [ATOM News Feed](/c/#{con.short_name}/export/atom.xml)
+     - [iCalendar Schedule](/c/#{con.short_name}/export/acus2008.ics)
+     - [Sponsor XML Feed](/c/#{con.short_name}/export/sponsors.xml)
+    EXPORT
+  end
+
+  def article_newsfeed
+    <<-FEED
+    <feed xmlns="http://www.w3.org/2005/Atom">
+
+     <title>#{con.name}</title>
+     <subtitle>Official User Conference of the Apache Software Foundation</subtitle>
+     <link href="http://us.apachecon.com/c/#{con.short_name}/export/atom.xml" rel="self"/>
+     <link href="http://us.apachecon.com/c/#{con.short_name}"/>
+     <updated><r:date for="updated_at" format="%Y-%m-%dT%H:%M:%SZ"/></updated>
+     <author>
+       <name>ApacheCon Team</name>
+       <email>info@apachecon.com</email>
+     </author>
+     <id>http://us.apachecon.com/c/#{con.short_name}/export/atom.xml</id>
+
+     <r:find url="/c/#{con.short_name}/articles">
+      <r:children:each order="asc">
+      <entry>
+        <title><r:title/></title>
+        <link href="http://us.apachecon.com<r:url/>" />
+        <id>http://us.apachecon.com<r:url/></id>
+        <updated><r:date for="updated_at" format="%Y-%m-%dT%H:%M:%SZ"/></updated>
+        <content type="html">
+         <r:content/>
+        </content>
+      </entry>
+      </r:children:each>
+     </r:find>
+
+    </feed>
+    FEED
+  end
+
+  def icalendar
+    <<-ICAL
+    <r:conference shortname="#{con.short_name}">
+    <r:schedule:each_day>
+    <r:tracks>
+    <r:session>
+    BEGIN:VEVENT
+    SUMMARY:<r:title/>
+    DTSTART;TZID=US-Central:<r:start_time datefmt="%Y%m%dT%H%M%S"/>
+    DTEND;TZID=US-Central:<r:end_time datefmt="%Y%m%dT%H%M%S"/>
+    LOCATION:<r:venue:name/>, <r:location/>
+    URL:http://us.apachecon.com/c/#{con.short_name}/sessions/<r:id/>
+    END:VEVENT
+    </r:session>
+    </r:tracks>
+    </r:schedule:each_day>
+    </r:conference>
+    ICAL
+  end
+
+  def sponsors_feed
+    <<-SPONSORS
+    <feed xmlns="http://www.w3.org/2005/Atom">
+
+     <title>#{con.name} Sponsors</title>
+     <subtitle>Official sponsor list for #{con.name}</subtitle>
+     <link href="http://us.apachecon.com/c/#{con.short_name}/export/sponsors.xml" rel="self"/>
+     <link href="http://us.apachecon.com/c/#{con.short_name}"/>
+     <updated><r:date for="updated_at" format="%Y-%m-%dT%H:%M:%SZ"/></updated>
+     <author>
+       <name>ApacheCon Team</name>
+       <email>info@apachecon.com</email>
+     </author>
+     <id>http://us.apachecon.com/c/#{con.short_name}/export/sponsors.xml</id>
+
+     <r:conference shortname="#{con.short_name}">
+     <r:sponsors:each>
+      <entry>
+        <title><r:name/></title>
+        <id>uri:#{con.short_name.upcase}SPONSOR<r:id/></id>
+        <updated><r:date for="updated_at" format="%Y-%m-%dT%H:%M:%SZ"/></updated>
+        <link rel="alternate" href="<r:url/>" />
+        <link rel="logo" href="http://us.apachecon.com:3000<r:logo type="url"/>"/>
+        <category term="<r:level/>" scheme="http://us.apachecon.com/c/#{con.short_name}/export/sponsor_levels.xml"/>
+        <category term="<r:type/>"  scheme="http://us.apachecon.com/c/#{con.short_name}/export/sponsor_types.xml" />
+        <summary type="xhtml" xml:lang="en" xml:base="http://us.apachecon.com/c/#{con.short_name}/">
+         <div xmlns="http://www.w3.org/1999/xhtml">
+          <h2><img src="http://us.apachecon.com:3000<r:logo type="url"/>" alt="<r:name/>"/></h2>
+          <h3>#{con.name} <r:level/> <r:type/></h3>
+          <div class="description">
+           <r:description/>
+          </div>
+         </div>
+        </summary>
+      </entry>
+     </r:sponsors:each>
+     </r:conference>
+
+    </feed>
+    SPONSORS
+  end
+
+  def sponsors_json
+    <<-SPJSON
+    {"sponsors" : [
+     <r:conference shortname="#{con.short_name}">
+     <r:sponsors:each>
+    {
+     "title": "<r:name/>",
+     "url"  : "<r:url/>",
+     "logo" : "http://us.apachecon.com:3000<r:logo type="url"/>",
+     "level": "<r:level/>",
+     "type" : "<r:type/>"
+    },
+     </r:sponsors:each>
+     </r:conference>
+    ]}
+    SPJSON
+  end
+
+  def speakers
+    <<-SPEAKERS
+    <h1>Speakers</h1>
+
+    <r:conference shortname="#{con.short_name}">
+     <ul>
+      <r:speakers:each>
+       <li><strong><a href="/c/#{con.short_name}/speakers/<r:id/>"><r:name/></a></strong><br/> <r:sessions/> <r:activities/></li>
+      </r:speakers:each>
+     </ul>
+    </r:conference>
+    SPEAKERS
+  end
+
+  def speaker
+    <<-SPEAKER
+    <r:conference shortname="#{con.short_name}">
+     <r:speaker>
+     <h4>#{con.name}</h4>
+     <h1><r:name/></h1>
+
+     <div class="span-4" style="text-align:center;">
+       <r:photo/><br/>
+       <a href="<r:url/>">Website</a>
+     </div>
+
+     <div class="span-14 last">
+      <h4>Sessions</h4>
+      <ul>
+        <li>
+          <r:sessions delim="</li><li>" prefix="c/#{con.short_name}/sessions" />
+        </li>
+      </ul>
+     </div>
+     <hr class="space"/>
+     <div class="span-18 last">
+      <r:bio/>
+     </div>
+
+     </r:speaker>
+    </r:conference>
+    SPEAKER
+  end
+
+  def schedule
+    <<-SCHEDULE
+    <h1>Schedule at a Glance</h1>
+    <r:conference shortname="#{con.short_name}">
+    <table>
+      <tr>
+        <r:schedule:each_day>
+          <th><r:schedule_date_link /></th>
+        </r:schedule:each_day>
+      </tr>
+      <tr>
+        <td colspan="5">Insert schedule overview grid here</td>
+      </tr>
+    </table>
+    </r:conference>
+    SCHEDULE
+  end
+
+  def schedule_day
+    <<-SDAY
+    <r:conference shortname="#{con.short_name}">
+
+      <div class="schedule-grid span-24 last">
+       <h2><r:schedule_date_link prefix="c/#{con.short_name}/schedule" /> <a href="/c/#{con.short_name}/export/acus2008.ics"><img src="/images/ical.gif" border="0"></a></h2>
+
+       <table style="border:1px solid black;">
+         <tr>
+          <th>&nbsp;</th>
+          <r:tracks>
+           <th><r:name/><br/><r:location/></th>
+          </r:tracks>
+         </tr>
+         <r:time_slots interval="30">
+          <tr>
+            <td><r:time_slot/></td>
+            <r:tracks>
+              <r:if_session_in_slot>
+                <td class="session track-<r:count/> <r:type/>" rowspan="<r:interval_span/>">
+                 <span class="session-name"><r:link session_prefix="c/#{con.short_name}/sessions" activity_prefix="c/#{con.short_name}/activities" /></span>
+                 <br/><br/>
+                 <span class="session-presenter"><r:presenter:link prefix="c/#{con.short_name}/speakers" /></span>
+                </td>
+              </r:if_session_in_slot>
+              <r:if_empty_slot>
+               <td class="freetime track-<r:count/>">&nbsp;</td>
+              </r:if_empty_slot>
+            </r:tracks>
+          </tr>
+         </r:time_slots>
+       </table>
+
+      </div>
+
+    </r:conference>
+    SDAY
+  end
+
+  def sessions
+    <<-SESSIONS
+    <h1>Sessions</h1>
+
+    <h3>
+    See the <a href="/c/#{con.short_name}/schedule/">Schedule Grid</a> for the complete conference program.
+    </h3>
+
+    <table>
+    <r:conference shortname="#{con.short_name}" >
+    <r:sessions>
+    <tr><td><r:start_time datefmt="%a %m %b %H:%M"/> </td><td> <div class="session-name"><r:link prefix="c/#{con.short_name}/sessions" /></div> by <r:presenter prefix="c/#{con.short_name}/speakers" /> </td></tr>
+    </r:sessions>
+    </r:conference>
+    </table>
+    SESSIONS
+  end
+
+  def session
+    <<-SESSION
+    <r:conference shortname="#{con.short_name}">
+    <r:session>
+    <h4>#{con.name} Session</h4>
+    <h1><r:name/></h1>
+
+    <ul>
+    <li><r:presenter prefix="c/#{con.short_name}/speakers"/></li>
+    <li><r:start_time datefmt="<a href='/c/#{con.short_name}/schedule/%Y/%m/%d'>%a, %d %B %Y %H:%M</a>"/></li>
+    <li><r:tags/></li>
+    </ul>
+
+    <p>
+    <r:description/>
+    </p>
+
+    </r:session>
+    </r:conference>
+    SESSION
+  end
+  
+  def sponsors
+    <<-SPONSORS
+    <h1>Sponsors</h1>
+    <h4>For information on becoming a Sponsor or Exhibitor, please contact INSERT EMAIL LINK HERE</h4>
+    <r:conference shortname='#{con.short_name}'>
+    <ul>
+    <r:sponsor_types:each>
+    <li> 
+    <r:link/>
+    </li>
+    </r:sponsor_types:each> 
+    </ul>
+    </r:conference>
+    SPONSORS
+  end
+
+  def sponsor
+    <<-SPONSOR
+    <r:conference shortname="#{con.short_name}">
+
+    <h1><r:sponsor_type_name/></h1>
+    <h3>For information on becoming a Sponsor or Exhibitor INSERT EMAIL LINK HERE/h3>
+    <r:sponsors:each>
+     <div class="sponsor-section">
+       <a href="<r:url/>"><r:logo/></a>
+       <h3><r:name/></h3>
+       <h4 class="alt"><r:level/> <r:type/></h4>
+      <p>
+        <r:description/>
+      </p>
+      <hr/>
+     </div>
+    </r:sponsors:each>
+    </r:conference>
+    SPONSOR
+  end
+end
\ No newline at end of file

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

Added: labs/consite/trunk/conferences/lib/conference_tags.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/lib/conference_tags.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/lib/conference_tags.rb (added)
+++ labs/consite/trunk/conferences/lib/conference_tags.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,195 @@
+module ConferenceTags
+
+  include Radiant::Taggable
+  include FileColumnHelper
+
+  # CONFERENCE
+  desc %{ Access to conference data }
+  tag "conference" do |tag|
+    shortname = tag.attr['shortname']? tag.attr['shortname'] : get_conference_from_url
+    conference = Conference.find_by_short_name(shortname)
+    tag.locals.conference = conference
+    tag.expand
+  end
+
+  #!! TODO format for start and end dates
+  [:name, :start_date, :end_date, :tagline, :description, :registration_link,
+   :community_link, :wiki_link, :mailing_list, :mailing_list_link].each do |column|
+    desc %{ Renders the #{column} for the given conference.  Use the 'datefmt' attribute
+            to format dates. }
+    tag "conference:#{column}" do |tag|
+      if tag.attr['datefmt']
+        time = tag.locals.conference[column].to_time
+        time.strftime(tag.attr['datefmt'])
+      else
+        tag.locals.conference[column]
+      end
+    end
+  end
+
+  desc %{ Conference logo }
+  tag "conference:logo" do |tag|
+    @conference = tag.locals.conference
+    "<img src='#{url_for_file_column("conference", "logo")}' alt='#{@conference.name}'/>"
+  end
+
+  # VENUE
+  desc %{ Access to the current venue }
+  tag "conference:venue" do |tag|
+    tag.locals.venue = tag.locals.conference.venue
+    tag.expand
+  end
+
+  [:name, :address, :description].each do |column|
+    desc %{ Renders the #{column} for the given venue }
+    tag "conference:venue:#{column}" do |tag|
+      tag.locals.venue[column]
+    end
+  end
+
+  desc %{ Locations for this venue }
+  tag "conference:venue:locations" do |tag|
+    output = ""
+    tag.locals.venue.locations.each do |location|
+      tag.locals.location = location
+      output << tag.expand
+    end
+    output
+  end
+
+  [:name,:description].each do | column|
+    desc %{ Renders location #{column} }
+    tag "conference:venue:locations:#{column}" do |tag|
+      tag.locals.location[column]
+    end
+  end
+
+
+  # SPONSORS
+
+  desc %{ Sponsors for this conference.  Filter sponsor types by use of the
+          <code>type</code> attribute. }
+  tag "sponsors" do |tag|
+
+    unless tag.locals.conference
+      shortname = get_conference_from_url
+      tag.locals.conference = Conference.find_by_short_name(shortname)
+    end
+
+    if tag.attr['type']
+      type = tag.attr['type']
+    elsif tag.globals.sponsor_type
+      type = tag.globals.sponsor_type.name
+    end
+
+
+    find_by_type = type ? " and sponsor_types.name = ?" : " "
+    conditions = ["conference_id = ? #{find_by_type}", tag.locals.conference.id]
+    conditions << type if type
+
+    order = "sponsor_types.name desc, sponsor_levels.rank, organizations.name"
+
+    tag.locals.sponsors = Sponsor.find(:all, :conditions => conditions,
+                                       :order => order, :include => [:sponsor_type, :sponsor_level, :organization] )
+    tag.expand
+  end
+
+  desc %{ Sponsors for this conference }
+  tag "sponsors:each" do |tag|
+    output = ""
+    tag.locals.sponsors.each do | sponsor |
+      tag.locals.sponsor = sponsor
+      output << tag.expand
+    end
+    output
+  end
+
+
+  desc %{ Sponsor type }
+  tag "sponsors:each:type" do |tag|
+    if tag.locals.sponsor.sponsor_type
+      tag.locals.sponsor.sponsor_type.name
+    end
+  end
+
+  desc %{ Sponsor level }
+  tag "sponsors:each:level" do |tag|
+    if tag.locals.sponsor.sponsor_level
+      tag.locals.sponsor.sponsor_level.name
+    end
+  end
+
+
+  [:name, :url, :description, :id].each do |column|
+    desc %{ Sponsor #{column} }
+    tag "sponsors:each:#{column}" do |tag|
+      tag.locals.sponsor.organization[column]
+    end
+  end
+
+  desc %{ Sponsor logo }
+  tag "sponsors:each:logo" do |tag|
+    @organization = tag.locals.sponsor.organization
+    type = 'html'
+    type = tag.attr['type'] if tag.attr['type']
+    case type
+      when "html"
+        output = "<img src='#{url_for_file_column("organization", "logo")}' alt='#{@organization.name}'/>"      
+      when "url"
+        output = url_for_file_column("organization", "logo")      
+    end
+    output
+  end
+
+  desc %{ Sponsor types }
+  tag "sponsor_types" do |tag|
+    #!! TODO should filter for sponsor types in this conference
+    tag.locals.sponsor_types = SponsorType.find(:all)
+    tag.expand
+  end
+
+  desc %{ For each sponsor type }
+  tag "sponsor_types:each" do |tag|
+    output = ""
+    tag.locals.sponsor_types.each do | type |
+      tag.locals.sponsor_type = type
+      output << tag.expand
+    end
+    output
+  end
+
+  desc %{ Sponsor type name }
+  tag "sponsor_types:each:name" do |tag|
+    tag.locals.sponsor_type.name
+  end
+
+  desc %{ Sponsor type url }
+  tag "sponsor_types:each:link" do |tag|
+    if tag.attr['prefix']
+      prefix = tag.attr['prefix']
+    else
+      prefix = "#{tag.locals.conference.short_name}/sponsors"
+    end
+    output = "<a href='/#{prefix}/#{tag.locals.sponsor_type.name.tableize.gsub(/ /,'_')}'>"
+    output << tag.locals.sponsor_type.name
+    output << "</a>"
+  end
+
+
+  private
+    def request_uri
+      request.request_uri unless request.nil?
+    end
+
+   #!! TODO add an optional prefix
+   def get_conference_from_url
+     m = request_uri.match /^\/([^\/]*)\/.*$/
+     m[1] if m
+   end
+
+   def get_date_from_url
+     year, month, day = $1, $2, $3 if request_uri =~  %r{#{parent.url}(\d{4})/(\d{2})/(\d{2})$}
+     Date.new(year,month,day)
+   end
+
+end

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

Added: labs/consite/trunk/conferences/lib/patches/active_scaffold.patch
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/lib/patches/active_scaffold.patch?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/lib/patches/active_scaffold.patch (added)
+++ labs/consite/trunk/conferences/lib/patches/active_scaffold.patch Fri Mar 27 10:32:54 2009
@@ -0,0 +1,114 @@
+Index: frontends/default/javascripts/active_scaffold.js
+===================================================================
+--- frontends/default/javascripts/active_scaffold.js	(revision 739)
++++ frontends/default/javascripts/active_scaffold.js	(working copy)
+@@ -194,7 +194,7 @@
+     this.loading_indicator = loading_indicator;
+     this.hide_target = false;
+     this.position = this.tag.getAttribute('position');
+-		this.page_link = this.tag.getAttribute('page_link');
++                this.page_link = this.tag.getAttribute('page_link');
+ 
+     this.onclick = this.tag.onclick;
+     this.tag.onclick = null;
+@@ -218,37 +218,38 @@
+     }
+   },
+ 
+-	open_action: function() {
+-		if (this.position) this.disable();
++        open_action: function() {
++                if (this.position) this.disable();
+ 
+-		if (this.page_link) {
+-			window.location = this.url;
+-		} else {
+-			if (this.loading_indicator) this.loading_indicator.style.visibility = 'visible';
+-	    new Ajax.Request(this.url, {
+-	      asynchronous: true,
+-	      evalScripts: true,
++                if (this.page_link) {
++                        window.location = this.url;
++                } else {
++                        if (this.loading_indicator) this.loading_indicator.style.visibility = 'visible';
++            new Ajax.Request(this.url, {
++              asynchronous: true,
++              evalScripts: true,
+ 
+-	      onSuccess: function(request) {
+-	        if (this.position) {
+-	          this.insert(request.responseText);
+-	          if (this.hide_target) this.target.hide();
+-	        } else {
+-	          request.evalResponse();
+-	        }
+-	      }.bind(this),
++              onSuccess: function(request) {
++                if (this.position) {
++                  this.insert(request.responseText);
++                  if (this.hide_target) this.target.hide();
++                } else {
++                  request.evalResponse();
++                }
++              }.bind(this),
+ 
+-	      onFailure: function(request) {
+-	        ActiveScaffold.report_500_response(this.scaffold_id());
+-	        if (this.position) this.enable()
+-	      }.bind(this),
++              onFailure: function(request) {
++                ActiveScaffold.report_500_response(this.scaffold_id());
++                if (this.position) this.enable()
++              }.bind(this),
+ 
+-	      onComplete: function(request) {
+-	        if (this.loading_indicator) this.loading_indicator.style.visibility = 'hidden';
+-	      }.bind(this)
+-			});
+-		}
+-	},
++              onComplete: function(request) {
++                if (this.loading_indicator) this.loading_indicator.style.visibility = 'hidden';
++                init_tinyMCE();
++              }.bind(this)
++                        });
++                }
++        },
+ 
+   insert: function(content) {
+     throw 'unimplemented'
+Index: frontends/default/views/_update_form.rhtml
+===================================================================
+--- frontends/default/views/_update_form.rhtml	(revision 739)
++++ frontends/default/views/_update_form.rhtml	(working copy)
+@@ -3,11 +3,13 @@
+ if request.xhr?
+   if active_scaffold_config.update.multipart?  # file_uploads
+     form_remote_upload_tag url_options.merge({:iframe => true}),
++                           :before => "update_from_tinyMCE(this);",
+                            :id => element_form_id(:action => :update),
+                            :class => 'update',
+                            :method => :put
+   else
+     form_remote_tag :url => url_options,
++                    :before => "update_from_tinyMCE(this);",
+                     :after => "$('#{loading_indicator_id(:action => :update, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{element_form_id(:action => :update)}');",
+                     :complete => "$('#{loading_indicator_id(:action => :update, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{element_form_id(:action => :update)}');",
+                     :failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",
+Index: frontends/default/views/_create_form.rhtml
+===================================================================
+--- frontends/default/views/_create_form.rhtml	(revision 739)
++++ frontends/default/views/_create_form.rhtml	(working copy)
+@@ -3,10 +3,12 @@
+ if request.xhr?
+   if active_scaffold_config.create.multipart? # file_uploads
+     form_remote_upload_tag url_options.merge({:iframe => true}),
++                           :before => "update_from_tinyMCE(this);",
+                            :id => element_form_id(:action => :create),
+                            :class => 'create'
+   else
+     form_remote_tag :url => url_options,
++                    :before => "update_from_tinyMCE(this);",
+                     :after => "$('#{loading_indicator_id(:action => :create, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{element_form_id(:action => :create)}');",
+                     :complete => "$('#{loading_indicator_id(:action => :create, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{element_form_id(:action => :create)}');",
+                     :failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",

Propchange: labs/consite/trunk/conferences/lib/patches/active_scaffold.patch
------------------------------------------------------------------------------
    svn:eol-style = native

Added: labs/consite/trunk/conferences/lib/schedule_tags.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/lib/schedule_tags.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/lib/schedule_tags.rb (added)
+++ labs/consite/trunk/conferences/lib/schedule_tags.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,307 @@
+module ScheduleTags
+
+  include Radiant::Taggable
+
+  desc %{ Renders the schedule for the conference }
+  tag "schedule" do |tag|
+    unless tag.locals.conference
+      shortname = get_conference_from_url
+      tag.locals.conference = Conference.find_by_short_name(shortname)
+    end
+    tag.expand
+  end
+
+  tag "schedule:each_day" do |tag|
+    output = ""
+    dates = Range.new(tag.locals.conference.start_date, tag.locals.conference.end_date)
+    dates.each do | date |
+      tag.locals.schedule_date = date
+      output << tag.expand
+    end
+    output
+  end
+
+  tag "schedule_date" do |tag|
+    unless tag.locals.schedule_date
+      if tag.globals.schedule_date
+        tag.locals.schedule_date = tag.globals.schedule_date
+      elsif
+        tag.locals.schedule_date = get_date_from_url
+      end
+    end
+    if tag.attr['datefmt']
+      time = tag.locals.schedule_date.to_time
+      time.strftime(tag.attr['datefmt'])
+    else
+      tag.locals.schedule_date
+    end
+  end
+
+  tag "time_slots" do |tag|
+    output = ""
+    begining = tag.locals.conference.start_time_for_date(tag.locals.schedule_date)
+    ending = tag.locals.conference.end_time_for_date(tag.locals.schedule_date)
+    if begining and ending
+      slots = Range.new(0, ending - begining)
+      interval = tag.attr['interval'] ? tag.attr['interval'].to_i : 30
+      tag.locals.time_slot_interval = interval * 60
+      slots.step(tag.locals.time_slot_interval) do | step |
+        tag.locals.current_time_slot = begining + step
+        output << tag.expand
+      end
+    end
+    output
+  end
+
+  tag "time_slot" do |tag|
+    fmt = tag.attr['datefmt'] ? tag.attr['datefmt'] : "%H:%M"
+    tz = TimeZone[tag.locals.conference.time_zone]
+    time = tz.utc_to_local tag.locals.current_time_slot
+    time.strftime(fmt)
+  end
+
+  tag "schedule_date_link" do |tag|
+    prefix = tag.attr['prefix'] ? tag.attr['prefix'] : "#{get_conference_from_url}/schedule"
+    unless tag.locals.schedule_date
+      if tag.globals.schedule_date
+        tag.locals.schedule_date = tag.globals.schedule_date
+      elsif
+        tag.locals.schedule_date = get_date_from_url
+      end
+    end
+    time = tag.locals.schedule_date.to_time
+    fmt = tag.attr['datefmt'] ? tag.attr['datefmt'] : "%A, %d %b %Y"
+    time.strftime("<a href='/#{prefix}/%Y/%m/%d'>#{fmt}</a>")
+  end
+
+  tag "tracks" do |tag|
+    unless tag.locals.conference
+      shortname = get_conference_from_url
+      tag.locals.conference = Conference.find_by_short_name(shortname)
+    end
+    unless tag.locals.schedule_date
+      tag.locals.schedule_date = get_date_from_url
+    end
+
+    tracks = Track.find(:all, :order => ["locations.name"], :include => [:location],
+                        :conditions => ["tracks.conference_id = ? and tracks.date = ?",
+                                         tag.locals.conference.id,
+                                         tag.locals.schedule_date])
+
+    output = ""
+    tag.locals.tracks_size = tracks.size
+    tracks.each do | track |
+      tag.locals.track = track
+      output << tag.expand
+    end
+    output
+  end
+
+  tag "tracks:count" do |tag|
+    tag.locals.tracks_size
+  end
+
+  tag "tracks:name" do |tag|
+    tag.locals.track.name
+  end
+
+
+  tag "tracks:location" do |tag|
+    tag.locals.track.location.name
+  end
+
+  tag "tracks:session" do |tag|
+    output = ""
+    sessions = tag.locals.track.all_events
+    tag.locals.sessions = sessions
+    sessions.each_with_index do | session, index |
+      tag.locals.session = session
+      tag.locals.session_index = index
+      output << tag.expand
+    end
+    output
+  end
+
+  tag "tracks:session:preceding_free_minutes" do |tag|
+    minutes = 0
+    prev_index = tag.locals.session_index - 1
+    if prev_index >= 0
+      prev_session = tag.locals.sessions[ prev_index ]
+      seconds = tag.locals.session.start_time - prev_session.end_time
+      # to closest 10 minute interval
+      minutes = (seconds / 600.0).round * 10
+    else
+      seconds = tag.locals.session.start_time - tag.locals.conference.start_time_for_date(tag.locals.schedule_date)
+      minutes = (seconds / 600.0).round * 10
+    end
+    minutes
+  end
+
+  tag "tracks:session:following_free_minutes" do |tag|
+    minutes = 0
+    next_index = tag.locals.session_index + 1
+    if next_index < tag.locals.sessions.size
+      next_session = tag.locals.sessions[ next_index ]
+      seconds = next_session.start_time - tag.locals.session.end_time
+      # to closest 10 minute interval
+      # minutes = (seconds / 600.0).round * 10
+      minutes = 0
+    else
+      seconds =  tag.locals.conference.end_time_for_date(tag.locals.schedule_date) - tag.locals.session.end_time
+      minutes = (seconds / 600.0).round * 10
+    end
+    minutes
+  end
+
+  tag "tracks:session:duration" do |tag|
+    tag.locals.session.duration
+  end
+
+  tag "tracks:session:title" do |tag|
+    tag.locals.session.name
+  end
+
+  tag "tracks:session:id" do |tag|
+    tag.locals.session.id
+  end
+
+  tag "tracks:session:type" do |tag|
+    tag.locals.session.type.name if tag.locals.sessions.type
+  end
+  tag "tracks:session:type_class" do |tag|
+    tag.locals.session.type.name.tableize if tag.locals.sessions.type
+  end
+
+  tag "tracks:session:url" do |tag|
+    s_prefix = tag.attr['session_prefix'] ? tag.attr['session_prefix'] : "#{tag.locals.conference.short_name}/sessions"
+    a_prefix = tag.attr['activity_prefix'] ? tag.attr['activity_prefix'] : "#{tag.locals.conference.short_name}/activities"
+    prefix = (tag.locals.session.is_a? ScheduledSession) ?  s_prefix : a_prefix
+    output = "#{prefix}/#{tag.locals.session.id}"
+  end
+
+  tag "tracks:session:link" do |tag|
+    s_prefix = tag.attr['session_prefix'] ? tag.attr['session_prefix'] : "#{tag.locals.conference.short_name}/sessions"
+    a_prefix = tag.attr['activity_prefix'] ? tag.attr['activity_prefix'] : "#{tag.locals.conference.short_name}/activities"
+    prefix = (tag.locals.session.is_a? ScheduledSession) ?  s_prefix : a_prefix
+    output = "<a href='/#{prefix}/#{tag.locals.session.id}'>"
+    output << "#{tag.locals.session.name}</a>"
+  end
+
+  tag "tracks:session:presenter" do |tag|
+    if tag.locals.session.is_a? ScheduledSession
+      tag.locals.presenter = tag.locals.session.presenter
+    else
+      tag.locals.presenter = tag.locals.session.presenter
+    end
+    tag.expand
+  end
+
+
+  tag "tracks:session:presenter:name" do |tag|
+    tag.locals.presenter.name if tag.locals.presenter
+  end
+
+  tag "tracks:session:presenter:link" do |tag|
+    output = ""
+    if tag.locals.presenter
+      prefix = tag.attr['prefix'] ? tag.attr['prefix'] : "#{tag.locals.conference.short_name}/speakers"
+      output << "<a href='/#{prefix}/#{tag.locals.presenter.id}'>"
+      output << tag.locals.presenter.name
+      output << "</a>"
+    end
+    output
+  end
+
+
+  [:start_time, :end_time].each do | column |
+    tag "tracks:session:#{column}" do |tag|
+      if tag.attr['datefmt']
+        tz = TimeZone[tag.locals.conference.time_zone]
+        time = tz.utc_to_local tag.locals.session[column]
+        time.strftime(tag.attr['datefmt'])
+      else
+        tag.locals.session[column]
+      end
+    end
+  end
+
+
+  tag "tracks:if_session_in_slot" do |tag|
+    output = ""
+    slot_start = tag.locals.current_time_slot
+    slot_end   = slot_start + tag.locals.time_slot_interval
+    slot_events = tag.locals.track.events_starting_in_slot slot_start, slot_end
+    slot_events.each do |slot_event|
+      tag.locals.session = slot_event
+      output << tag.expand
+    end
+    output
+  end
+
+  tag "tracks:if_session_in_slot:interval_span" do |tag|
+    span = 0
+    if tag.locals.session and tag.locals.time_slot_interval
+      span = (tag.locals.session.end_time - tag.locals.session.start_time) / tag.locals.time_slot_interval
+    end
+    span
+  end
+
+  tag "tracks:if_session_in_slot:link" do |tag|
+    s_prefix = tag.attr['session_prefix'] ? tag.attr['session_prefix'] : "#{tag.locals.conference.short_name}/sessions"
+    a_prefix = tag.attr['activity_prefix'] ? tag.attr['activity_prefix'] : "#{tag.locals.conference.short_name}/activities"
+    prefix = (tag.locals.session.is_a? ScheduledSession) ?  s_prefix : a_prefix
+    output = "<a href='/#{prefix}/#{tag.locals.session.id}'>"
+    output << "#{tag.locals.session.name}</a>"
+  end
+
+  tag "tracks:if_session_in_slot:type" do |tag|
+    tag.locals.session.type.name.tableize if tag.locals.sessions.type
+  end
+
+  tag "tracks:if_session_in_slot:presenter" do |tag|
+    if tag.locals.session.is_a? ScheduledSession
+      tag.locals.presenter = tag.locals.session.presenter
+    else
+      tag.locals.presenter = tag.locals.session.presenter
+    end
+    tag.expand
+  end
+
+  tag "tracks:if_session_in_slot:presenter:link" do |tag|
+    output = ""
+    if tag.locals.presenter
+      prefix = tag.attr['prefix'] ? tag.attr['prefix'] : "#{tag.locals.conference.short_name}/speakers"
+      output << "<a href='/#{prefix}/#{tag.locals.presenter.id}'>"
+      output << tag.locals.presenter.name
+      output << "</a>"
+    end
+    output
+  end
+
+  tag "tracks:if_empty_slot" do |tag|
+    output = ""
+    slot_start = tag.locals.current_time_slot
+    slot_end   = slot_start + tag.locals.time_slot_interval
+    unless tag.locals.track.events_in_slot? slot_start, slot_end
+      slot_events = tag.locals.track.events_starting_in_slot slot_start, slot_end
+      output << tag.expand if slot_events.size == 0
+    end
+    output
+  end
+
+ private
+    def request_uri
+      request.request_uri unless request.nil?
+    end
+
+   def get_conference_from_url
+     m = request_uri.match /^\/([^\/]*)\/.*$/
+     m[1] if m
+   end
+
+   def get_date_from_url
+     year, month, day = $1, $2, $3 if request_uri =~  %r{#{parent.url}(\d{4})/(\d{2})/(\d{2})$}
+     Date.new(year,month,day)
+   end
+
+end

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

Added: labs/consite/trunk/conferences/lib/session_tags.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/lib/session_tags.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/lib/session_tags.rb (added)
+++ labs/consite/trunk/conferences/lib/session_tags.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,147 @@
+module SessionTags
+
+  include Radiant::Taggable
+  include FileColumnHelper
+
+
+  tag "conference:sessions" do |tag|
+    output = ""
+    type = tag.attr["type"] ? tag.attr["type"] : "scheduled_sessions"
+    if type == "activities"
+      tag.locals.sessions = tag.locals.conference.activities
+    else
+      tag.locals.sessions = tag.locals.conference.scheduled_sessions
+    end
+
+    tag.locals.sessions.each do | session |
+      tag.locals.session = session
+      output << tag.expand
+    end
+    output
+  end
+
+  [:start_time, :end_time].each do | column |
+    tag "conference:sessions:#{column}" do |tag|
+      if tag.attr['datefmt']
+        tz = TimeZone[tag.locals.conference.time_zone]
+        time = tz.utc_to_local tag.locals.session[column]
+        time.strftime(tag.attr['datefmt'])
+      else
+        tag.locals.session[column]
+      end   
+    end
+  end
+
+  [:name, :description, :duration, :presentation_type].each do |column|
+    tag "conference:sessions:#{column}" do |tag|
+      tag.locals.session[column]
+    end
+  end
+
+  tag "conference:sessions:tags" do |tag|
+    delim = tag.attr['delim'] ? tag.attr['delim'] : ","
+    tag.locals.session.tag_list.join(delim)
+  end
+
+
+    
+  tag "conference:sessions:link" do |tag|
+    prefix = tag.attr['prefix'] ? tag.attr['prefix'] : "#{tag.locals.conference.short_name}/sessions"
+    "<a href='/#{prefix}/#{tag.locals.session.id}'>#{tag.locals.session.name}</a>"
+  end
+
+  tag "conference:sessions:presenter" do |tag|
+    prefix = tag.attr['prefix'] ? tag.attr['prefix'] : "#{tag.locals.conference.short_name}/speakers"
+    if tag.locals.session.is_a? ScheduledSession
+      output = "<a href='/#{prefix}/#{tag.locals.session.presenter.id}'>"
+      output << "#{tag.locals.session.presenter.name}</a>"
+    else
+      output = "<a href='/#{prefix}/#{tag.locals.session.presenter.id}'>"
+      output << "#{tag.locals.session.presenter.name}</a>"
+    end
+  end  
+  
+
+ tag "conference:session" do |tag|
+    type = tag.attr["type"] ? tag.attr["type"] : "scheduled_session"
+
+    unless tag.locals.scheduled_session
+      if tag.globals.scheduled_session
+        tag.locals.scheduled_session = tag.globals.scheduled_session
+      else
+        if type == "activity"
+          tag.locals.scheduled_session = Activity.find(get_session_from_url.to_i)
+        else
+          tag.locals.scheduled_session = ScheduledSession.find(get_session_from_url.to_i)
+        end
+      end
+    end
+    tag.expand
+  end
+
+
+  [:start_time, :end_time].each do | column |
+    tag "conference:session:#{column}" do |tag|
+      time = tag.locals.scheduled_session[column]
+      tz = TimeZone[tag.locals.conference.time_zone]
+      time = tz.utc_to_local time
+      if tag.attr['datefmt']
+        time.strftime(tag.attr['datefmt'])
+      end
+    end
+  end
+
+  [:name, :description, :duration, :presentation_type].each do |column|
+    tag "conference:session:#{column}" do |tag|
+      tag.locals.scheduled_session.send column
+    end
+  end
+
+  tag "conference:session:tags" do |tag|
+    delim = tag.attr['delim'] ? tag.attr['delim'] : ","
+    tag.locals.scheduled_session.tag_list.join(delim)
+  end
+
+  tag "conference:session:materials_link" do |tag|
+    text = tag.attr['text'] ? tag.attr['text'] : "Download Materials"
+    output = 'No Materials Available'
+    if tag.locals.scheduled_session.submission.presentation.materials
+     output = "<a href='#{url_for_file_column tag.locals.scheduled_session.submission.presentation, 'materials', :absolute => true}'>#{text}</a>"      
+    end
+    output
+  end  
+  
+  tag "conference:session:link" do |tag|
+    prefix = tag.attr['prefix'] ? tag.attr['prefix'] : "#{tag.locals.conference.short_name}/sessions"
+    "<a href='/#{prefix}/#{tag.locals.scheduled_session.id}'>#{tag.locals.scheduled_session.submission.presentation.name}</a>"
+  end
+
+  tag "conference:session:presenter" do |tag|
+    prefix = tag.attr['prefix'] ? tag.attr['prefix'] : "#{tag.locals.conference.short_name}/speakers"
+    output = "<a href='/#{prefix}/"
+    output << "#{tag.locals.scheduled_session.presenter.id}'>"
+    output << "#{tag.locals.scheduled_session.presenter.name}</a>"
+  end
+
+
+
+  private
+    def request_uri
+      request.request_uri unless request.nil?
+    end
+
+   def get_conference_from_url
+     m = request_uri.match /^\/([^\/]*)\/.*$/
+     m[1] if m
+   end
+
+   def get_session_from_url
+      $1 if request_uri =~ %r{#{parent.url}/?(\w+)/?$}
+   end
+
+   def get_date_from_url
+     year, month, day = $1, $2, $3 if request_uri =~  %r{#{parent.url}(\d{4})/(\d{2})/(\d{2})$}
+     Date.new(year,month,day)
+   end
+
+end

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

Added: labs/consite/trunk/conferences/lib/speaker_tags.rb
URL: http://svn.apache.org/viewvc/labs/consite/trunk/conferences/lib/speaker_tags.rb?rev=759091&view=auto
==============================================================================
--- labs/consite/trunk/conferences/lib/speaker_tags.rb (added)
+++ labs/consite/trunk/conferences/lib/speaker_tags.rb Fri Mar 27 10:32:54 2009
@@ -0,0 +1,89 @@
+module SpeakerTags
+
+  include Radiant::Taggable
+  include FileColumnHelper
+
+  # SPEAKERS
+
+  desc %{ Speakers for this conference }
+  tag "speakers" do |tag|
+    unless tag.locals.conference
+      shortname = get_conference_from_url
+      tag.locals.conference = Conference.find_by_short_name(shortname)
+    end
+    tag.locals.speakers = tag.locals.conference.presenters.uniq
+    tag.expand
+  end
+
+  desc %{ Speakers for this conference }
+  tag "speakers:each" do |tag|
+    output = ""
+    tag.locals.speakers.each do | speaker |
+      tag.locals.speaker = speaker
+      output << tag.expand
+    end
+    output
+  end
+
+  tag 'speakers:each:insanity' do |tag|
+    'sane'
+  end
+
+  tag 'speakers:each:bio' do |tag| 
+   tag.locals.speaker.notes 
+  end 
+  
+  [:name, :url, :notes, :id].each do |column|
+    desc %{  Renders the '#{column}' attribute of the current speaker.}
+    tag "speakers:each:#{column}" do |tag|
+      tag.locals.speaker[column]
+    end
+  end
+
+  desc %{ Image for speakers }
+  tag "speakers:each:photo" do |tag|
+    @speaker = tag.locals.speaker
+    "<img src='#{url_for_file_column("speaker", "photo")}' alt='#{@speaker.name}'/>"
+  end
+
+  desc %{ Scheduled session names for this speaker }
+  tag "speakers:each:sessions" do |tag|
+    delimiter = tag.attr['delim']? tag.attr['delim'] : ","
+    sessions = tag.locals.speaker.scheduled_sessions(tag.locals.conference)
+    presentation_names = [ ]
+    sessions.each do |session|
+      presentation_names << session.submission.presentation.name
+    end
+    presentation_names.join(delimiter)
+  end
+
+  desc %{ Associated activities for this presenter }
+  tag "speakers:each:activities" do |tag|
+    delimiter = tag.attr['delim']? tag.attr['delim'] : ","
+    activities = Activity.find(:all, :conditions => ['conference_id = ? and presenter_id = ?',
+                                                     tag.locals.conference.id,
+                                                     tag.locals.speaker.id])
+    names = [ ]
+    activities.each { |a| names << a.name }
+    names.join(delimiter)
+  end
+
+
+
+  private
+    def request_uri
+      request.request_uri unless request.nil?
+    end
+
+   def get_conference_from_url
+     m = request_uri.match /^\/([^\/]*)\/.*$/
+     m[1] if m
+   end
+
+   def get_date_from_url
+     year, month, day = $1, $2, $3 if request_uri =~  %r{#{parent.url}(\d{4})/(\d{2})/(\d{2})$}
+     Date.new(year,month,day)
+   end
+
+
+end

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



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