<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>doc/unused_css_selectors.csv</filename>
    </added>
    <added>
      <filename>public/files/pdfs/jobs/EOL_Marine_Species_Coordinator.pdf</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -260,7 +260,7 @@ private
   
   # In order for AccountController to work with OpenID, we need to force it to use https when authenticating.  
   def realm
-    return ENV['RAILS_ENV'] =~ /prod/ ? &quot;https://#{request.host_with_port}&quot; : &quot;#{request.protocol + request.host_with_port}&quot;
+    return $PRODUCTION_MODE ? &quot;https://#{request.host_with_port}&quot; : &quot;#{request.protocol + request.host_with_port}&quot;
   end
 
 end</diff>
      <filename>app/controllers/account_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -245,18 +245,7 @@ end
 
   # expire a single non-species page fragment cache
   def expire_cache(page_name)
-
-    pages=ContentPage.find_all_by_page_name(page_name)
-
-    if pages.length &gt; 0
-      Language.find_active.each do |language|
-        pages.each do |page|
-          expire_fragment(:controller=&gt;'/content',:part=&gt;page.id.to_s + '_' + language.iso_639_1)
-          expire_fragment(:controller=&gt;'/content',:part=&gt;page.page_url + '_' + language.iso_639_1)
-        end
-      end
-    end
-
+    expire_pages(ContentPage.find_all_by_page_name(page_name))
   end
 
   # just clear all fragment caches quickly
@@ -272,30 +261,14 @@ end
 
   # expire the header and footer caches
   def expire_menu_caches
-
-    Language.find_active.each do |language|
-      expire_fragment(:controller=&gt;'/content' ,:part =&gt; 'top_nav_'+language.iso_639_1)
-      expire_fragment(:controller=&gt;'/content' ,:part =&gt; 'footer_'+language.iso_639_1)
-      expire_fragment(:controller=&gt;'/content' ,:part =&gt; 'exemplars_'+language.iso_639_1)
-    end
-
+    expire_pages(['top_nav', 'footer', 'exemplars'])
   end
 
   # expire the non-species page fragment caches
   def expire_caches
-
     expire_menu_caches
-    pages=ContentPage.find_all_by_active(true)
-
-    Language.find_active.each do |language|
-      pages.each do |page|
-        expire_fragment(:controller=&gt;'/content',:part=&gt;page.id.to_s + '_' + language.iso_639_1)
-        expire_fragment(:controller=&gt;'/content',:part=&gt;page.page_url + '_' + language.iso_639_1)
-      end
-    end
-
+    expire_pages(ContentPage.find_all_by_active(true))
     $CACHE_CLEARED_LAST=Time.now()
-
   end
 
   # expire a list of taxa_ids specifed as an array</diff>
      <filename>app/controllers/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -119,7 +119,7 @@ class ContentController &lt; ApplicationController
      # bit haywire since there are very few random taxa created by scenarios.
      num_tries = 0
      while(num_tries &lt; 30 and
-           ENV[&quot;RAILS_ENV&quot;].downcase == 'production' and
+           $PRODUCTION_MODE and
            !explore_taxa.blank? and
            current_taxa.include?(explore_taxa.taxon_concept_id.to_s))
        explore_taxa = RandomTaxon.random</diff>
      <filename>app/controllers/content_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,21 @@ require 'uri'
 # TODO - look these over.  I'm not sure all of them are used, and those that are... perhaps not efficiently.
 
 module ApplicationHelper
+  def expire_pages(pages)
+    if pages.length &gt; 0
+      Language.find_active.each do |language|
+        pages.each do |page|
+          if page.class == ContentPage
+            expire_fragment(:controller =&gt; '/content', :part =&gt; &quot;#{page.id.to_s }_#{language.iso_639_1}&quot;)
+            expire_fragment(:controller =&gt; '/content', :part =&gt; &quot;#{page.page_url}_#{language.iso_639_1}&quot;)
+          else
+            expire_fragment(:controller =&gt; '/content', :part =&gt; &quot;#{page}_#{language.iso_639_1}&quot;)
+          end
+        end
+      end
+    end
+  end
+
   #this only applies to text attributions for now
   #author, source, copyright, and data supplier should be shown
   def has_hidden_attributions?(data_object)</diff>
      <filename>app/helpers/application_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,9 +4,9 @@ class AgentContactRole &lt; SpeciesSchemaModel
   has_many :agent_contacts
   
   def self.primary
-    YAML.load(Rails.cache.fetch('agent_contact_roles/primary') do
-      self.find_by_label('Primary Contact').to_yaml
-    end)
+    Rails.cache.fetch('agent_contact_roles/primary') do
+      self.find_by_label('Primary Contact')
+    end
   end
   
 end</diff>
      <filename>app/models/agent_contact_role.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,63 +2,63 @@ class ResourceStatus &lt; SpeciesSchemaModel
   has_many :resources
 
   def self.uploading
-    YAML.load(Rails.cache.fetch('resource_statuses/uploading') do
-      self.find_by_label('Uploading').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/uploading') do
+      self.find_by_label('Uploading')
+    end
   end
   
   def self.uploaded
-    YAML.load(Rails.cache.fetch('resource_statuses/uploaded') do
-      self.find_by_label('Uploaded').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/uploaded') do
+      self.find_by_label('Uploaded')
+    end
   end
   
   def self.upload_failed
-    YAML.load(Rails.cache.fetch('resource_statuses/upload_failed') do
-      self.find_by_label('Upload Failed').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/upload_failed') do
+      self.find_by_label('Upload Failed')
+    end
   end
   
   def self.moved_to_content_server
-    YAML.load(Rails.cache.fetch('resource_statuses/moved_to_content_server') do
-      self.find_by_label('Moved to Content Server').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/moved_to_content_server') do
+      self.find_by_label('Moved to Content Server')
+    end
   end
   
   def self.validated
-    YAML.load(Rails.cache.fetch('resource_statuses/validated') do
-      self.find_by_label('Validated').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/validated') do
+      self.find_by_label('Validated')
+    end
   end
   
   def self.validation_failed
-    YAML.load(Rails.cache.fetch('resource_statuses/validation_failed') do
-      self.find_by_label('Validation Failed').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/validation_failed') do
+      self.find_by_label('Validation Failed')
+    end
   end
   
   def self.being_processed
-    YAML.load(Rails.cache.fetch('resource_statuses/being_processed') do
-      self.find_by_label('Being Processed').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/being_processed') do
+      self.find_by_label('Being Processed')
+    end
   end
   
   def self.processed
-    YAML.load(Rails.cache.fetch('resource_statuses/processed') do
-      self.find_by_label('Processed').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/processed') do
+      self.find_by_label('Processed')
+    end
   end
   
   def self.processing_failed
-    YAML.load(Rails.cache.fetch('resource_statuses/processing_failed') do
-      self.find_by_label('Processing Failed').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/processing_failed') do
+      self.find_by_label('Processing Failed')
+    end
   end
 
   def self.published
-    YAML.load(Rails.cache.fetch('resource_statuses/published') do
-      self.find_by_label('Published').to_yaml
-    end)
+    Rails.cache.fetch('resource_statuses/published') do
+      self.find_by_label('Published')
+    end
   end
 end
 # == Schema Info</diff>
      <filename>app/models/resource_status.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,11 +13,7 @@
     &lt;div id=&quot;page-content&quot; class=&quot;clearfix&quot;&gt;
         &lt;!-- center page content --&gt;
         &lt;div id=&quot;full-page-content&quot;&gt;
-        &lt;div id=&quot;open_id_instructions&quot;&gt;
-            Attention Flickr, Yahoo, SmugMug, Blogger, AOL users (and others) -  &lt;%= link_to 'you already have OpenID accounts', 'http://openid.net/get/',:target=&gt;'_blank' %&gt; and can now use
-            them to log into EOL directly!
-        &lt;/div&gt;
-        
+    
             &lt;div style=&quot;float: left; width: 550px;&quot;&gt;
  
               
@@ -33,9 +29,31 @@
 				&lt;%=&quot;or&quot;[]%&gt;
         &lt;br /&gt;
         &lt;div id=&quot;openid&quot;&gt;
+          &lt;a href=&quot;#&quot; onclick=&quot;Element.toggle('open_id_instructions');return false;&quot;&gt;You may already have an OpenID account&lt;/a&gt; and, if so, can log into EOL immediately.          &lt;div id=&quot;open_id_instructions&quot; style=&quot;display:none;&quot;&gt;
+            The following websites where you may already have an account act as OpenID providers.  To use your existing account, find the website in the list below and then enter in the 
+            sample OpenID login in the OpenID box below, replacing the &lt;strong&gt;bold&lt;/strong&gt; text in the sample login with your specific username for that website.
+          	&lt;table class=&quot;results_table&quot;&gt;
+          	  &lt;tr&gt;&lt;th width=&quot;40%&quot;&gt;Website&lt;/th&gt;&lt;th&gt;Sample OpenID login&lt;/th&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;odd&quot;&gt;&lt;a href=&quot;http://www.aol.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://openid.net/wp-content/uploads/aol.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; AOL &lt;/td&gt;&lt;td class=&quot;odd&quot;&gt; openid.aol.com/&lt;strong&gt;screenname&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;even&quot;&gt;&lt;a href=&quot;http://www.livejournal.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://www.myspace.com/favicon.ico&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; MySpace &lt;/td&gt;&lt;td class=&quot;even&quot;&gt; myspace.com/&lt;strong&gt;username&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;odd&quot;&gt;&lt;a href=&quot;http://www.yahoo.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://www.yahoo.com/favicon.ico&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; Yahoo! &lt;/td&gt;&lt;td class=&quot;odd&quot;&gt; me.yahoo.com/&lt;strong&gt;username&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;even&quot;&gt;&lt;a href=&quot;http://www.blogger.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://www.blogger.com/favicon.ico&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; Blogger &lt;/td&gt;&lt;td class=&quot;even&quot;&gt; &lt;strong&gt;blogname&lt;/strong&gt;.blogspot.com&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;odd&quot;&gt;&lt;a href=&quot;http://www.flickr.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://www.flickr.com/favicon.ico&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; Flickr &lt;/td&gt;&lt;td class=&quot;odd&quot;&gt;  www.flickr.com/photos/&lt;strong&gt;username&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;even&quot;&gt;&lt;a href=&quot;http://www.livedoor.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://www.livedoor.com/favicon.ico&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; LiveDoor &lt;/td&gt;&lt;td class=&quot;even&quot;&gt;  profile.livedoor.com/&lt;strong&gt;username&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;odd&quot;&gt;&lt;a href=&quot;http://www.livejournal.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://www.livejournal.com/favicon.ico&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; LiveJournal &lt;/td&gt;&lt;td class=&quot;odd&quot;&gt; &lt;strong&gt;username&lt;/strong&gt;.livejournal.com&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;even&quot;&gt;&lt;a class=&quot;favicon&quot; href=&quot;http://www.smugmug.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://openid.net/wp-content/uploads/smugmug.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; SmugMug &lt;/td&gt;&lt;td class=&quot;even&quot;&gt; &lt;strong&gt;username&lt;/strong&gt;.smugmug.com&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;odd&quot;&gt;&lt;a href=&quot;http://www.technorati.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://www.technorati.com/favicon.ico&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; Technorati &lt;/td&gt;&lt;td class=&quot;odd&quot;&gt; technorati.com/people/technorati/&lt;strong&gt;username&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;even&quot;&gt;&lt;img src=&quot;http://openid.net/wp-content/uploads/vox.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; Vox &lt;/td&gt;&lt;td class=&quot;even&quot;&gt; &lt;strong&gt;member&lt;/strong&gt;.vox.com&lt;/td&gt;&lt;/tr&gt;
+              &lt;tr&gt;&lt;td class=&quot;odd&quot;&gt;&lt;a href=&quot;http://www.wordpress.com&quot;&gt;&lt;img class=&quot;favicon&quot; src=&quot;http://openid.net/wp-content/uploads/wordpress.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; WordPress.com &lt;/td&gt;&lt;td class=&quot;odd&quot;&gt; &lt;strong&gt;username&lt;/strong&gt;.wordpress.com&lt;/td&gt;&lt;/tr&gt;
+        	  &lt;/table&gt;
+        	  &lt;br /&gt;
+          	&lt;%= link_to 'Learn more about OpenID providers', 'http://openid.net/get/',:target=&gt;'_blank' %&gt; 
+        	  &lt;br /&gt;        	  &lt;br /&gt;
+        	&lt;/div&gt;
+          
    				  &lt;label for=&quot;openid_url&quot;&gt;&lt;%= &quot;OpenID&quot;[] %&gt;&lt;/label&gt;
             &lt;%= text_field_tag 'openid_url', {},{:size=&gt;100,:maxlength=&gt;250,:class=&gt;'openid'} %&gt; 
-  					&lt;%= link_to 'What is OpenID?', 'http://openid.net/',:target=&gt;'_blank' %&gt; | &lt;%= link_to 'Do I already have an OpenID?', 'http://openid.net/get/',:target=&gt;'_blank' %&gt; 
+  					&lt;%= link_to 'What is OpenID?', 'http://openid.net/',:target=&gt;'_blank' %&gt; | &lt;a href=&quot;#&quot; onclick=&quot;Element.toggle('open_id_instructions');return false;&quot;&gt;How do I log in with OpenID?&lt;/a&gt; 
           &lt;/div&gt;
           &lt;br /&gt;
             	&lt;table border=&quot;0&quot; width=&quot;500&quot; cellpadding=&quot;20&quot;&gt;</diff>
      <filename>app/views/account/login.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -75,6 +75,11 @@ Rails::Initializer.run do |config|
   # in the &quot;environments&quot; folder for the various environments (e.g. &quot;production.rb&quot;) to see.
   # the following only generates assests1.eol.org or assets2.eol.org on up to any number specified below
   #config.action_controller.asset_host = &quot;http://content0.eol.org&quot; 
+
+  # We have a lot of production-like environments.  To quickly test if we're in one, rather than parsing the ENV,
+  # you may check $PRODUCTION_MODE.
+  $PRODUCTION_MODE = true if ENV['RAILS_ENV'] and
+    ['production', 'staging', 'siproduction', 'failover', 'preview'].include?(ENV['RAILS_ENV'].downcase)
     
   # THIS IS WHERE ALL THE IMAGES/VIDEOS LIVE:
   $CONTENT_SERVERS = ['http://content1.eol.org/', 'http://content2.eol.org/', 'http://content3.eol.org/', 'http://content4.eol.org/', 'http://content5.eol.org/', 
@@ -207,5 +212,9 @@ begin
 rescue LoadError
 end
 
+if ENV['BLEAK']
+  require 'bleak_house'
+end
+
 # load the system configuration
 require File.dirname(__FILE__) + '/system' if File.file?(File.dirname(__FILE__) + '/system.rb')</diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,8 +32,8 @@ end
 class ActiveRecord::Migration
   def self.not_okay_in_production
     # Perhaps not the right error class to throw, but I'm not aware of good alternatives:
-    raise ActiveRecord::IrreversibleMigration.new(&quot;It is not okay to run this migration on a production database.&quot;) if
-      ENV['RAILS_ENV'] =~ /prod/i
+    raise ActiveRecord::IrreversibleMigration.new(&quot;It is not okay to run this migration on a production database.&quot;) unless
+      $PRODUCTION_MODE
   end
 end
 </diff>
      <filename>lib/core_extensions.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2dccdd75155433e1bebb0c6849e6b88fb0d71b87</id>
    </parent>
  </parents>
  <author>
    <name>jrice</name>
    <email>jrice@78829999-583a-0410-bd01-8a9b849fd409</email>
  </author>
  <url>http://github.com/eol/eol/commit/46cdbb7dd57c464adf5629783a02436006b0ef65</url>
  <id>46cdbb7dd57c464adf5629783a02436006b0ef65</id>
  <committed-date>2009-06-29T09:01:48-07:00</committed-date>
  <authored-date>2009-06-29T09:01:48-07:00</authored-date>
  <message>Merge with 2.10 (.2), adding a pdf (I think), fixing a bug with RAILS_ENV checks, and refactoring some of the caching code (duplicated code).

git-svn-id: file:///data/subversion/eol/trunk@791 78829999-583a-0410-bd01-8a9b849fd409</message>
  <tree>c5b561eaced32f2e3381f736cf577909878c5a9a</tree>
  <committer>
    <name>jrice</name>
    <email>jrice@78829999-583a-0410-bd01-8a9b849fd409</email>
  </committer>
</commit>
