Changeset 9
- Timestamp:
- 06/15/08 10:56:14 (6 months ago)
- Files:
-
- trunk/rails (modified) (1 prop)
- trunk/rails/app/controllers/application.rb (modified) (2 diffs)
- trunk/rails/app/controllers/welcome_controller.rb (added)
- trunk/rails/app/views/home/index.html.erb (modified) (2 diffs)
- trunk/rails/app/views/layouts/welcome.html.erb (added)
- trunk/rails/app/views/welcome (added)
- trunk/rails/app/views/welcome/index.html.erb (added)
- trunk/rails/config/environments/development.rb (modified) (1 diff)
- trunk/rails/config/initializers/railtrackr.rb (modified) (1 diff)
- trunk/rails/config/railtrackr_development.yml (added)
- trunk/rails/config/railtrackr_production.yml (added)
- trunk/rails/config/railtrackr_test.yml (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/rails
- Property svn:ignore set to
log
- Property svn:ignore set to
trunk/rails/app/controllers/application.rb
r4 r9 3 3 4 4 class ApplicationController < ActionController::Base 5 before_filter :welcome_check 6 5 7 helper :all # include all helpers, all the time 6 8 … … 8 10 # Uncomment the :secret if you're not using the cookie session store 9 11 protect_from_forgery # :secret => 'a5f2541f4f32fffc2fe6698f2cbb8dbf' 12 13 def welcome_check 14 redirect_to :controller => "welcome" if AppConfig.flickr == AppConfig.FLICKR_UNDEF 15 end 10 16 end trunk/rails/app/views/home/index.html.erb
r7 r9 33 33 var curimg = 0; 34 34 35 function show_no_images_warning() { 36 var warningEl = new Element('p', { 'style' : 'color:red'}); 37 warningEl.appendChild(document.createTextNode('No images found.')); 38 warningEl.appendChild(new Element('br')); 39 warningEl.appendChild(document.createTextNode(' You may want to double-check your configuration file and restart RailTrackr.')); 40 $('coverFlowId').appendChild(warningEl); 41 $('coverFlowId').appendChild(document.createTextNode('<%= AppConfig.CONFIG_FILE %>')); 42 } 43 35 44 function open_user(imgnum) { 36 45 $("coverFlowParagraphId").innerHTML = "Loading photosets from the requested user..." … … 61 70 Event.observe(window,'load', 62 71 function() { 63 load_next_image(); 72 if (imgs.length == 0) { 73 show_no_images_warning(); 74 } else { 75 load_next_image(); 76 } 64 77 }); 65 78 trunk/rails/config/environments/development.rb
r4 r9 17 17 # Don't care if the mailer can't send 18 18 config.action_mailer.raise_delivery_errors = false 19 20 require 'ruby-debug' trunk/rails/config/initializers/railtrackr.rb
r8 r9 1 1 require 'ostruct' 2 require 'yaml' 2 3 3 4 ::AppConfig = OpenStruct.new 5 AppConfig.FLICKR_UNDEF = "API_KEY_MISSING" 6 AppConfig.CONFIG_FILE = File.dirname(__FILE__) + "/../railtrackr_#{ENV['RAILS_ENV']}.yml" 4 7 5 # Put your flickr API key here 6 AppConfig.flickr = "YOUR API KEY HERE" 8 config = YAML.load_file(AppConfig.CONFIG_FILE) 7 9 8 # Put your Google Analytics code here (old version), if you have one 9 AppConfig.urchin = ""10 AppConfig.flickr = config['flickrapikey'].blank? ? AppConfig.FLICKR_UNDEF : config['flickrapikey'] 11 AppConfig.urchin = config['urchin']