diff --git a/.gitignore b/.gitignore
index 0facca209..998341198 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ config/database.yml
config/backgroundrb.yml
db/schema.rb
public/blank.html
+public/robots.txt
public/images/active_scaffold/DO_NOT_EDIT
public/javascripts/cache/
public/stylesheets/active_scaffold/DO_NOT_EDIT
diff --git a/UPGRADE b/UPGRADE
index 05e41201c..2d37db0cb 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -33,6 +33,21 @@ GENERAL NOTE: if you are upgrading your production Kete instance rather than dev
GENERAL NOTE: if you are running in production mode, you may also want to do a "rake tmp:cache:clear" as your last step to any of these.
However, if you updated your code via a Capistrano deploy, this is probably not necessary.
+== 2008/10/01 - Private files need to be copied to system folder
+
+Due to a missing configuration in the Capistrano deployment recipes, private files were archived every time the site was deploy.
+A fix has been committed which resolves the problem for future deployments. But you need to manually copy the old private files
+from the releases/[timestamp]/private directory to the new system folder at shared/system/private
+
+== 2008/09/26 - Backgroundrb configuration yml file updated
+
+1. Stop your Backgroundrb processes
+2. Update packet by running
+ sudo gem update packet
+3. Open up background.yml and add the following line to the :backgroundrb: section and save
+ :persistent_disabled: true
+2. Start your Backgroundrb processes
+
== 2008/09/17 - CSS "tags" Identifier Changed
To fix an IE6 specific printing bug, the CSS identifier "tags" has been changed to "tags-box". If you are running Kete with a custom theme, be sure to update your theme templates and CSS files to refer to the new "tags-box" CSS identifier, and not the older "tags".
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index 82e887cec..6baaf9351 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -158,7 +158,7 @@ def show
@extended_fields = @user.xml_attributes
else
flash[:notice] = "You must be logged in to view user profiles."
- redirect_to :action => 'index'
+ redirect_to :action => 'login'
end
end
diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index befb1f4ea..bdf40a42b 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -306,7 +306,7 @@ def expire_show_caches
if caches_controllers.include?(params[:controller])
# James - 2008-07-01
# Ensure caches are expired in the context of privacy.
- item = item_from_controller_and_id
+ item = item_from_controller_and_id(false)
item.private_version! if item.respond_to?(:private) && item.latest_version_is_private?
expire_show_caches_for(item)
@@ -853,7 +853,7 @@ def rss_tag(options = { })
if auto_detect
tag += "\" />"
else
- tag += "\">" # A tag has a closing
+ tag += "tabindex='1' \">" # A tag has a closing
end
end
diff --git a/app/controllers/baskets_controller.rb b/app/controllers/baskets_controller.rb
index c59c44255..54d53d303 100644
--- a/app/controllers/baskets_controller.rb
+++ b/app/controllers/baskets_controller.rb
@@ -1,33 +1,13 @@
class BasketsController < ApplicationController
### TinyMCE WYSIWYG editor stuff
- uses_tiny_mce(:options => { :theme => 'advanced',
- :mode => "textareas",
- :convert_urls => false,
- :content_css => "/stylesheets/base.css",
- :remove_script_host => true,
- :theme_advanced_toolbar_location => "top",
- :theme_advanced_toolbar_align => "left",
- :theme_advanced_resizing => true,
- :theme_advanced_resize_horizontal => false,
- :theme_advanced_buttons1 => %w{ bold italic underline strikethrough separator justifyleft justifycenter justifyright indent outdent separator bullist numlist forecolor backcolor separator link unlink image undo redo code},
- :theme_advanced_buttons2 => %w{ formatselect fontselect fontsizeselect pastetext pasteword selectall },
- :theme_advanced_buttons3_add => %w{ tablecontrols fullscreen},
- :editor_selector => 'mceEditor',
- :paste_create_paragraphs => true,
- :paste_create_linebreaks => true,
- :paste_use_dialog => true,
- :paste_auto_cleanup_on_paste => true,
- :paste_convert_middot_lists => false,
- :paste_unindented_list_class => "unindentedList",
- :paste_convert_headers_to_strong => true,
- :paste_insert_word_content_callback => "convertWord",
- :plugins => %w{ contextmenu paste table fullscreen} },
- :only => [:new, :pick, :create, :edit, :update, :homepage_options])
+ uses_tiny_mce :options => DEFAULT_TINYMCE_SETTINGS,
+ :only => VALID_TINYMCE_ACTIONS
### end TinyMCE WYSIWYG editor stuff
permit "site_admin or admin of :current_basket", :except => [:index, :list, :show, :choose_type, :permission_denied]
after_filter :repopulate_basket_permissions, :only => [:create, :destroy]
+ after_filter :remove_robots_txt_cache, :only => [:create, :update, :destroy]
def index
list
@@ -267,4 +247,11 @@ def repopulate_basket_permissions
session[:has_access_on_baskets] = current_user.get_basket_permissions
end
+ # Kieran Pilkington, 2008/10/01
+ # When a basket is created, edited, or deleted, we have to clear
+ # the robots txt file caches to the new settings take effect
+ def remove_robots_txt_cache
+ expire_page "/robots.txt"
+ end
+
end
diff --git a/app/controllers/importers_controller.rb b/app/controllers/importers_controller.rb
index 446bb6fbc..a4268d5ce 100644
--- a/app/controllers/importers_controller.rb
+++ b/app/controllers/importers_controller.rb
@@ -13,29 +13,8 @@ class ImportersController < ApplicationController
permit "site_admin or admin of :current_basket or tech_admin of :site or member of :current_basket or moderater of :current_basket", :only => [:new_related_set_from_archive_file, :create]
### TinyMCE WYSIWYG editor stuff
- uses_tiny_mce(:options => { :theme => 'advanced',
- :mode => "textareas",
- :convert_urls => false,
- :content_css => "/stylesheets/kete.css",
- :remove_script_host => true,
- :theme_advanced_toolbar_location => "top",
- :theme_advanced_toolbar_align => "left",
- :theme_advanced_resizing => true,
- :theme_advanced_resize_horizontal => false,
- :theme_advanced_buttons1 => %w{ bold italic underline strikethrough separator justifyleft justifycenter justifyright indent outdent separator bullist numlist forecolor backcolor separator link unlink image undo redo code},
- :theme_advanced_buttons2 => %w{ formatselect fontselect fontsizeselect pastetext pasteword selectall },
- :theme_advanced_buttons3_add => %w{ tablecontrols fullscreen},
- :editor_selector => 'mceEditor',
- :paste_create_paragraphs => true,
- :paste_create_linebreaks => true,
- :paste_use_dialog => true,
- :paste_auto_cleanup_on_paste => true,
- :paste_convert_middot_lists => false,
- :paste_unindented_list_class => "unindentedList",
- :paste_convert_headers_to_strong => true,
- :paste_insert_word_content_callback => "convertWord",
- :plugins => %w{ contextmenu paste table fullscreen} },
- :only => [:new, :new_related_set_from_archive_file])
+ uses_tiny_mce :options => DEFAULT_TINYMCE_SETTINGS,
+ :only => VALID_TINYMCE_ACTIONS
### end TinyMCE WYSIWYG editor stuff
# Get the Privacy Controls helper
diff --git a/app/controllers/index_page_controller.rb b/app/controllers/index_page_controller.rb
index 2f11a22da..39e9dd45f 100644
--- a/app/controllers/index_page_controller.rb
+++ b/app/controllers/index_page_controller.rb
@@ -1,4 +1,6 @@
class IndexPageController < ApplicationController
+ caches_page :robots
+
def index
if !@current_basket.index_page_redirect_to_all.blank?
redirect_to_all_for(@current_basket.index_page_redirect_to_all)
@@ -61,13 +63,10 @@ def index
stats_by_type_for(@current_basket)
end
-
# prepare blog list of most recent topics
# replace limit with param from basket
- @recent_topics_limit = @current_basket.index_page_number_of_recent_topics
- if @recent_topics_limit.blank?
- @recent_topics_limit = 0
- end
+ @recent_topics_limit = @current_basket.index_page_number_of_recent_topics.blank? ? 0 : @current_basket.index_page_number_of_recent_topics
+
# exclude index_topic
if @recent_topics_limit > 0
recent_query_hash = { :limit => @recent_topics_limit, :order => 'created_at desc'}
@@ -242,4 +241,12 @@ def validate_kete_net_link
render(:xml => { :url => SITE_URL, :datetime => "#{Time.new.utc.xmlschema}" })
end
+ # page that tells search engines where not to go
+ # search forms, rss feeds, user comments etc
+ def robots
+ @baskets = Basket.all
+ @controller_names = ZOOM_CLASSES.collect { |name| zoom_class_controller(name) }
+ render :action => 'robots', :layout => false
+ end
+
end
diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb
index 1fbe51c91..f70a8ff33 100644
--- a/app/controllers/members_controller.rb
+++ b/app/controllers/members_controller.rb
@@ -22,7 +22,7 @@ def list
@rss_tag_link = rss_tag(:auto_detect => false, :replace_page_with_rss => true)
# list people who have all other roles
- @current_basket.accepted_roles.each do |role|
+ @current_basket.accepted_roles(true).each do |role|
role_plural = role.name.pluralize
# we cover members above
if role_plural != 'members'
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index 5da4a4bb9..0778c2db8 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -134,7 +134,7 @@ def search
@contributor = params[:contributor] ? User.find(params[:contributor]) : nil
# calculate where to start and end based on page
- @current_page = params[:page] ? params[:page].to_i : 1
+ @current_page = (params[:page] && params[:page].to_i > 0) ? params[:page].to_i : 1
@next_page = @current_page + 1
@previous_page = @current_page - 1
@@ -221,17 +221,17 @@ def rss
def load_results(from_result_set)
@results = Array.new
+ # protect against malformed requests
+ # for a start record that is more than the numbers of matching records, return a 404
+ # since it only seems to be bots that make the malformed request
@end_record = from_result_set.size if from_result_set.size < @end_record
+ if @start_record > @end_record
+ rescue_404
+ return false
+ end
if from_result_set.size > 0
still_image_results = Array.new
- # protect against malformed requests
- # for a start record that is more than the numbers of matching records
- # not handling adjust @start_record in view
- # since it only seems to be bots that make the malformed request
- if @start_record > @end_record
- @start_record = 0
- end
# get the raw xml results from zoom
raw_results = Module.class_eval(@current_class).records_from_zoom_result_set( :result_set => from_result_set,
@@ -447,22 +447,34 @@ def terms_to_page_url_redirect
end
if !params[:search_terms].blank?
+ # we are searching
location_hash.merge!({ :search_terms_slug => to_search_terms_slug(params[:search_terms]),
:search_terms => params[:search_terms],
:action => 'for' })
else
+ # we are viewing all
location_hash.merge!({ :action => 'all' })
end
+ # If we're searching by tag, this will be set
if !params[:tag].blank?
location_hash.merge!({ :tag => params[:tag] })
end
+ # If we're searching by contributor, this will be set
if !params[:contributor].blank?
location_hash.merge!({ :contributor => params[:contributor] })
end
- logger.info("terms_to_page_url_redirect hash: " + location_hash.inspect)
+ # If we're searching by relation, these will be set
+ if !params[:source_controller_singular].blank?
+ location_hash.merge!({ :source_controller_singular => params[:source_controller_singular] })
+ end
+ if !params[:source_item].blank?
+ location_hash.merge!({ :source_item => params[:source_item] })
+ end
+
+ logger.debug("terms_to_page_url_redirect hash: " + location_hash.inspect)
redirect_to url_for(location_hash)
end
@@ -876,7 +888,7 @@ def store_results_for_slideshow
# if @results_sets is emtpy, then @result_sets[@current_class] is nil so we have
# to stop here if thats the case, or we get a 500 error calling .size below
- return if @result_sets[@current_class].nil?
+ return if @result_sets[@current_class].nil? or @displaying_error
results = @results.map{ |r| r['url'] }
diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb
index 06138ee60..58cfc2a4c 100644
--- a/app/controllers/topics_controller.rb
+++ b/app/controllers/topics_controller.rb
@@ -19,29 +19,8 @@ class TopicsController < ApplicationController
# the code should easily transferred to something else if we decide to drop it
### TinyMCE WYSIWYG editor stuff
- uses_tiny_mce(:options => { :theme => 'advanced',
- :mode => "textareas",
- :convert_urls => false,
- :content_css => "/stylesheets/base.css",
- :remove_script_host => true,
- :theme_advanced_toolbar_location => "top",
- :theme_advanced_toolbar_align => "left",
- :theme_advanced_resizing => true,
- :theme_advanced_resize_horizontal => false,
- :theme_advanced_buttons1 => %w{ bold italic underline strikethrough separator justifyleft justifycenter justifyright indent outdent separator bullist numlist forecolor backcolor separator link unlink image undo redo code},
- :theme_advanced_buttons2 => %w{ formatselect fontselect fontsizeselect pastetext pasteword selectall },
- :theme_advanced_buttons3_add => %w{ tablecontrols fullscreen},
- :editor_selector => 'mceEditor',
- :paste_create_paragraphs => true,
- :paste_create_linebreaks => true,
- :paste_use_dialog => true,
- :paste_auto_cleanup_on_paste => true,
- :paste_convert_middot_lists => false,
- :paste_unindented_list_class => "unindentedList",
- :paste_convert_headers_to_strong => true,
- :paste_insert_word_content_callback => "convertWord",
- :plugins => %w{ contextmenu paste table fullscreen} },
- :only => [:new, :pick, :create, :edit, :update, :pick_topic_type])
+ uses_tiny_mce :options => DEFAULT_TINYMCE_SETTINGS,
+ :only => VALID_TINYMCE_ACTIONS
### end TinyMCE WYSIWYG editor stuff
# stuff related to flagging and moderation
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 9117f1e6d..607b152b3 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -31,7 +31,7 @@ def header_links_to_baskets
if baskets_limit < total_baskets_count
html += '
' + link_to_unless_current('more...',
url_for(:urlified_name => @site_basket.urlified_name,
- :controller => 'baskets' )) + ' '
+ :controller => 'baskets' ), {:tabindex => '2'}) + ''
end
html += ''
@@ -44,7 +44,7 @@ def header_links_to_baskets
def header_link_to_current_basket
html = String.new
- html += ': ' + link_to_index_for(@current_basket, { :class => 'basket' }) if @current_basket != @site_basket
+ html += ': ' + link_to_index_for(@current_basket, { :class => 'basket', :tabindex => '2' }) if @current_basket != @site_basket
end
def search_link_to_searched_basket
@@ -67,22 +67,22 @@ def header_browse_links
site_link_text = @site_basket.name
privacy_type = (@current_basket.private_default_with_inheritance? && permitted_to_view_private_items?) ? 'private' : nil
current_basket_html = " or " + link_to_unless_current( @current_basket.name,
- :controller => 'search',
+ {:controller => 'search',
:action => 'all',
:urlified_name => @current_basket.urlified_name,
:controller_name_for_zoom_class => 'topics',
:trailing_slash => true,
- :privacy_type => privacy_type )
+ :privacy_type => privacy_type}, {:tabindex => '2'} )
else
site_link_text = 'Browse'
end
html += pre_text + link_to_unless_current( site_link_text,
- :controller => 'search',
+ {:controller => 'search',
:action => 'all',
:urlified_name => @site_basket.urlified_name,
:controller_name_for_zoom_class => 'topics',
- :trailing_slash => true ) + current_basket_html + ''
+ :trailing_slash => true}, {:tabindex => '2'} ) + current_basket_html + ''
end
def header_add_links
@@ -97,17 +97,19 @@ def header_add_links
pre_text = 'Add item to '
site_link_text = @site_basket.name
current_basket_html = " or " + link_to_unless_current( @current_basket.name,
- :controller => 'baskets',
+ {:controller => 'baskets',
:action => 'choose_type',
- :urlified_name => @current_basket.urlified_name)
+ :urlified_name => @current_basket.urlified_name},
+ {:tabindex => '2'})
else
site_link_text = 'Add item'
end
html += pre_text + link_to_unless_current( site_link_text,
- :controller => 'baskets',
+ {:controller => 'baskets',
:action => 'choose_type',
- :urlified_name => @site_basket.urlified_name) + current_basket_html + ''
+ :urlified_name => @site_basket.urlified_name},
+ {:tabindex => '2'}) + current_basket_html + ''
end
@@ -164,10 +166,11 @@ def render_baskets_as_menu
if basket.topics.count > basket_topic_count && basket_topic_count > 0
html += content_tag("li", link_to("More..",
- :controller => 'search',
+ {:controller => 'search',
:action => 'all',
:urlified_name => basket.urlified_name,
- :controller_name_for_zoom_class => 'topics'))
+ :controller_name_for_zoom_class => 'topics'},
+ {:tabindex => '2'}))
end
html += ''
@@ -228,9 +231,9 @@ def link_to_last_stored_location
def link_to_cancel
if session[:return_to].blank?
- return link_to("Cancel", :action => 'list')
+ return link_to("Cancel", :action => 'list', :tabindex => '1')
else
- return link_to("Cancel", url_for(session[:return_to]))
+ return link_to("Cancel", url_for(session[:return_to]), :tabindex => '1')
end
end
@@ -281,7 +284,7 @@ def link_to_add_item(options={})
phrase += ' in ' + @current_basket.name
end
- return link_to(phrase, :controller => zoom_class_controller(item_class), :action => :new)
+ return link_to(phrase, {:controller => zoom_class_controller(item_class), :action => :new}, :tabindex => '1')
end
def link_to_add_related_item(options={})
@@ -305,7 +308,7 @@ def link_to_link_related_item(options={})
:related_class => options[:related_class],
:relate_to_topic => options[:relate_to_topic],
:function => "add" },
- :popup => ['links', 'height=500,width=500,scrollbars=yes,top=100,left=100,resizable=yes'])
+ {:popup => ['links', 'height=500,width=500,scrollbars=yes,top=100,left=100,resizable=yes']})
end
def link_to_unlink_related_item(options={})
@@ -438,7 +441,7 @@ def tags_for(item)
def tags_input_field(form,label_for)
"Tags (separated by commas):
- #{form.text_field :tag_list}
"
+ #{form.text_field :tag_list, :tabindex => '1'}"
end
#---- related to extended_fields for either topic_types or content_types
diff --git a/app/helpers/baskets_helper.rb b/app/helpers/baskets_helper.rb
index d3cf462cb..ea454c944 100644
--- a/app/helpers/baskets_helper.rb
+++ b/app/helpers/baskets_helper.rb
@@ -5,11 +5,11 @@ def link_to_link_index_topic(options={})
:action => :find_index,
:current_basket_id => options[:current_basket_id],
:current_homepage_id => options[:current_homepage_id] },
- :popup => ['links', 'height=500,width=500,scrollbars=yes,top=100,left=100']
+ :popup => ['links', 'height=500,width=500,scrollbars=yes,top=100,left=100'], :tabindex => '1'
end
def link_to_add_index_topic(options={})
- link_to options[:phrase], :controller => 'topics', :action => :new, :index_for_basket => options[:index_for_basket]
+ link_to options[:phrase], {:controller => 'topics', :action => :new, :index_for_basket => options[:index_for_basket]}, :tabindex => '1'
end
def toggle_elements_applicable(listenToThisElementID, whenElementValueCondition, whenElementValueThis, toggleThisElementID, listenToElementIsCheckbox=false)
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 8bf642c14..4b245b00f 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -6,11 +6,11 @@ module SearchHelper
def link_to_zoom_class_results(zoom_class,results_count)
if params[:action] == 'all'
link_to("#{zoom_class_plural_humanize(zoom_class)} (#{number_with_delimiter(results_count)})",
- :overwrite_params => {:controller_name_for_zoom_class => zoom_class_controller(zoom_class), :page => nil},
- :trailing_slash => true)
+ {:overwrite_params => {:controller_name_for_zoom_class => zoom_class_controller(zoom_class), :page => nil},
+ :trailing_slash => true}, :tabindex => '1')
else
link_to("#{zoom_class_plural_humanize(zoom_class)} (#{number_with_delimiter(results_count)})",
- :overwrite_params => {:controller_name_for_zoom_class => zoom_class_controller(zoom_class), :page => nil})
+ {:overwrite_params => {:controller_name_for_zoom_class => zoom_class_controller(zoom_class), :page => nil}}, :tabindex => '1')
end
end
diff --git a/app/views/account/_userForm.rhtml b/app/views/account/_userForm.rhtml
index 4368b30c9..ad1ab04b9 100644
--- a/app/views/account/_userForm.rhtml
+++ b/app/views/account/_userForm.rhtml
@@ -2,6 +2,6 @@
Email Address
-<%= text_field 'user', 'email' %>
+<%= text_field 'user', 'email', :tabindex => '1' %>
<%=
diff --git a/app/views/account/activate.rhtml b/app/views/account/activate.rhtml
index be114b0e5..ffa553b0e 100644
--- a/app/views/account/activate.rhtml
+++ b/app/views/account/activate.rhtml
@@ -7,12 +7,12 @@
Activation Code
- <%= text_field_tag(:activation_code, params[:activation_code], :size=>50 ) %>
+ <%= text_field_tag(:activation_code, params[:activation_code], {:size=>50, :tabindex => '1'} ) %>
- <%= submit_tag 'Activate' %>
+ <%= submit_tag 'Activate', :tabindex => '1' %>
<% end %>
diff --git a/app/views/account/change_password.rhtml b/app/views/account/change_password.rhtml
index 04cc2e8c3..f934b5101 100644
--- a/app/views/account/change_password.rhtml
+++ b/app/views/account/change_password.rhtml
@@ -6,17 +6,17 @@
Old Password
-<%= password_field_tag 'old_password', @old_password %>
+<%= password_field_tag 'old_password', @old_password, :tabindex => '1' %>
Password
-<%= password_field_tag 'password' %>
+<%= password_field_tag 'password', nil, :tabindex => '1' %>
Confirm Password
-<%= password_field_tag 'password_confirmation' %>
+<%= password_field_tag 'password_confirmation', nil, :tabindex => '1' %>
-<%= submit_tag 'Change password' %>
+<%= submit_tag 'Change password', :tabindex => '1' %>
<% end %>
<%= render(:partial => "topics/content_wrapper_end" ) %>
\ No newline at end of file
diff --git a/app/views/account/edit.rhtml b/app/views/account/edit.rhtml
index 449157d6a..fca2f25ea 100644
--- a/app/views/account/edit.rhtml
+++ b/app/views/account/edit.rhtml
@@ -9,11 +9,11 @@
<%= error_messages_for :user %>
-Email <%= f.text_field :email %>
+Email <%= f.text_field :email, :tabindex => '1' %>
@@ -34,13 +34,13 @@
-
<%= submit_tag 'Save' %>
+
<%= submit_tag 'Save', :tabindex => '1' %>
<% end -%>
diff --git a/app/views/account/forgot_password.rhtml b/app/views/account/forgot_password.rhtml
index 9262de919..b405502e6 100644
--- a/app/views/account/forgot_password.rhtml
+++ b/app/views/account/forgot_password.rhtml
@@ -7,12 +7,12 @@
What is the email address used to create your account?
- <%= form.text_field :email, :size => 50 %>
+ <%= form.text_field :email, {:size => 50, :tabindex => '1'} %>
-
<%= submit_tag "Request Password" %>
+
<%= submit_tag "Request Password", :tabindex => '1' %>
<% end %>
<%= render(:partial => "topics/content_wrapper_end" ) %>
\ No newline at end of file
diff --git a/app/views/account/login.rhtml b/app/views/account/login.rhtml
index 5cd1318d4..6915f21ae 100644
--- a/app/views/account/login.rhtml
+++ b/app/views/account/login.rhtml
@@ -31,9 +31,9 @@
<% if IS_CONFIGURED -%>
Are you registered? You will need to <%= link_to("register",
- :controller => 'account',
+ {:controller => 'account',
:action => 'signup',
- :urlified_name => 'site') -%> first before you can login.
+ :urlified_name => 'site'}, :tabindex => '1') -%> first before you can login.
<% else -%>
Please enter the default administrator account login and password
to continue to configuration of the site.
@@ -41,25 +41,25 @@
Login:
- <%= text_field_tag 'login' %>
+ <%= text_field_tag 'login', nil, :tabindex => '1' %>
Password:
- <%= password_field_tag 'password' %>
+ <%= password_field_tag 'password', nil, :tabindex => '1' %>
<% if IS_CONFIGURED -%>
Remember me:
- <%= check_box_tag 'remember_me' %>
+ <%= check_box_tag 'remember_me', "1", false, :tabindex => '1' %>
-
Forgot your password? <%= link_to('Click here', :controller => 'account', :action => 'forgot_password', :urlified_name => 'site') -%>
+
Forgot your password? <%= link_to('Click here', {:controller => 'account', :action => 'forgot_password', :urlified_name => 'site'}, :tabindex => '1') -%>
<% end -%>
-
<%= submit_tag 'Log in',:class => "login-button" %>
+
<%= submit_tag 'Log in',{:class => "login-button", :tabindex => '1'} %>
<% end -%>
<% end -%>
diff --git a/app/views/account/reset_password.rhtml b/app/views/account/reset_password.rhtml
index 7c51cb774..c432fdb12 100644
--- a/app/views/account/reset_password.rhtml
+++ b/app/views/account/reset_password.rhtml
@@ -7,13 +7,13 @@
Password:
- <%= form.password_field :password %>
+ <%= form.password_field :password, :tabindex => '1' %>
Confirm Password:
- <%= form.password_field :password_confirmation %>
+ <%= form.password_field :password_confirmation, :tabindex => '1' %>
- <%= submit_tag "Reset Your Password" %>
+ <%= submit_tag "Reset Your Password", :tabindex => '1' %>
<% end %>
diff --git a/app/views/account/signup.rhtml b/app/views/account/signup.rhtml
index 76d527e42..c3409af9e 100644
--- a/app/views/account/signup.rhtml
+++ b/app/views/account/signup.rhtml
@@ -8,17 +8,17 @@
<%= error_messages_for :user %>
-Email: <%= f.text_field :email %>
+Email: <%= f.text_field :email, :tabindex => '1' %>
-Password: <%= f.password_field :password %>
+Password: <%= f.password_field :password, :tabindex => '1' %>
-Confirm Password: <%= f.password_field :password_confirmation %>
+Confirm Password: <%= f.password_field :password_confirmation, :tabindex => '1' %>
<% form_fields = @content_type.content_type_to_field_mappings -%>
@@ -36,39 +36,37 @@
<%= render :partial => 'topics/license_chooser_or_agreement',:locals => {:item => @user} %>
-<%= hidden_field_tag "captcha_type", @captcha_type %>
+<%= hidden_field_tag "captcha_type", @captcha_type, :tabindex => '1' %>
-<%= f.check_box :agree_to_terms %> I agree that I have read and accept the
-<%= link_to_remote("Terms and conditions", :update => 'disclaimer', :url => { :action => :disclaimer, :id => 4 }) %>,
-<%= link_to_remote("Privacy policy", :update => 'disclaimer', :url => { :action => :disclaimer, :id => 5 }) %>, and
-<%= link_to_remote("House Rules", :update => 'disclaimer', :url => { :action => :disclaimer, :id => 2 }) %>.
+<%= f.check_box :agree_to_terms, :tabindex => '1' %> I agree that I have read and accept the
+<%= link_to_remote("Terms and conditions", :update => 'disclaimer', :url => { :action => :disclaimer, :id => 4 }, :html => {:tabindex => '1'}) %>,
+<%= link_to_remote("Privacy policy", :update => 'disclaimer', :url => { :action => :disclaimer, :id => 5 }, :html => {:tabindex => '1'}) %>, and
+<%= link_to_remote("House Rules", :update => 'disclaimer', :url => { :action => :disclaimer, :id => 2 }, :html => {:tabindex => '1'}) %>.
-<%= submit_tag 'Sign up', :class => "save-button" %>
+<%= submit_tag 'Sign up', {:class => "save-button", :tabindex => '1'} %>
<% end -%>
diff --git a/app/views/audio/_form.rhtml b/app/views/audio/_form.rhtml
index 2ad049ed6..4c345fed6 100644
--- a/app/views/audio/_form.rhtml
+++ b/app/views/audio/_form.rhtml
@@ -14,7 +14,7 @@
<% if edit and @site_admin %>
Move to another basket?
- <%= form.select 'basket_id', @baskets %>
+ <%= form.select 'basket_id', @baskets, {}, :tabindex => '1' %>
<% end -%>
@@ -23,11 +23,11 @@
Privacy
- <%= form.radio_button :private, false, :id => "audio_recording_private_false" %>
+ <%= form.radio_button :private, false, {:id => "audio_recording_private_false", :tabindex => '1'} %>
Public (Can be viewed by everyone)
- <%= form.radio_button :private, true, :id => "audio_recording_private_true" %>
+ <%= form.radio_button :private, true, {:id => "audio_recording_private_true", :tabindex => '1'} %>
Private (Can be viewed only by basket members)
@@ -41,11 +41,11 @@
<% end %>
Title:
- <%= form.text_field :title %>
+ <%= form.text_field :title, :tabindex => '1' %>
<% end -%>
<%= render :partial => 'topics/license_chooser_or_agreement',:locals => {:item => @audio_recording} %>
diff --git a/app/views/audio/edit.rhtml b/app/views/audio/edit.rhtml
index b01a3bf6e..953ad9700 100644
--- a/app/views/audio/edit.rhtml
+++ b/app/views/audio/edit.rhtml
@@ -8,7 +8,7 @@
:id => @audio_recording },
:html => { :multipart => true } do |form| %>
<%= render :partial => 'form', :object => form %>
- <%= submit_tag 'Save' , :class => "save-button" %>
+ <%= submit_tag 'Save' , {:class => "save-button", :tabindex => '1'} %>
<% end %>
<%= link_to_cancel %>
diff --git a/app/views/audio/new.rhtml b/app/views/audio/new.rhtml
index 5bbad1d99..8307012a9 100644
--- a/app/views/audio/new.rhtml
+++ b/app/views/audio/new.rhtml
@@ -6,7 +6,7 @@
:url => { :action => 'create'},
:html => { :multipart => true } do |form| %>
<%= render :partial => 'form', :object => form %>
- <%= submit_tag "Create", :class => "save-button" %>
+ <%= submit_tag "Create", {:class => "save-button", :tabindex => '1'} %>
<% end %>
<%= link_to_cancel %>
diff --git a/app/views/baskets/_actions_menu.rhtml b/app/views/baskets/_actions_menu.rhtml
index b0de8199c..f861923c6 100644
--- a/app/views/baskets/_actions_menu.rhtml
+++ b/app/views/baskets/_actions_menu.rhtml
@@ -20,22 +20,22 @@
<% end -%>
<%= link_to "#{tab_label} ",
- :action => tab_action,
+ {:action => tab_action,
:controller => tab_controller,
- :id => item %>
+ :id => item}, :tabindex => '1' %>
<% tab_count += 1 -%>
<% end -%>
<% if @tech_admin -%>
<%= link_to "Importers",
- :action => :list,
- :controller => 'importers' %>
+ {:action => :list,
+ :controller => 'importers'}, :tabindex => '1' %>
<% end -%>
<% if @current_basket != @site_basket -%>
<%= link_to "Delete",
{:action => :destroy,
:id => item},
:method => :post,
- :confirm => 'Are you sure? All items in this basket will be deleted forever!'%>
+ :confirm => 'Are you sure? All items in this basket will be deleted forever!', :tabindex => '1' %>
<% end -%>
diff --git a/app/views/baskets/_form.rhtml b/app/views/baskets/_form.rhtml
index f49c5c933..12424e46c 100644
--- a/app/views/baskets/_form.rhtml
+++ b/app/views/baskets/_form.rhtml
@@ -4,13 +4,13 @@
Name:
- <%= form.text_field :name %>
+ <%= form.text_field :name, :tabindex => '1' %>
Moderation
Policy:
- <%= select_tag 'settings[fully_moderated]', @basket.moderation_select_options, "id" => "settings_fully_moderated" %>
+ <%= select_tag 'settings[fully_moderated]', @basket.moderation_select_options, {"id" => "settings_fully_moderated", :tabindex => '1'} %>
<% # make hidden and disabled to start
@@ -22,7 +22,7 @@
<% ZOOM_CLASSES.each do |zoom_class| -%>
/>
+ ' checked="checked"' if !@basket.settings[:moderated_except].blank? && @basket.settings[:moderated_except].include?(zoom_class) -%> tabindex="1" />
<%= zoom_class_plural_humanize(zoom_class) %>
<% end -%>
@@ -35,7 +35,7 @@
<% else %>
- <%= link_to h(title), "#{source_url}" %>
+ <%= link_to h(title), "#{source_url}", :tabindex => '1' %>
<%= strip_tags(short_summary) %>
- <%= link_to("more >>", "#{source_url}", { :title => "More information on #{title}" })%>
+ <%= link_to("more >>", "#{source_url}", { :title => "More information on #{title}", :tabindex => '1' })%>
<% end %>
diff --git a/app/views/search/_image.rhtml b/app/views/search/_image.rhtml
index 621cfb2c7..8e1da1131 100644
--- a/app/views/search/_image.rhtml
+++ b/app/views/search/_image.rhtml
@@ -33,11 +33,11 @@ check_box_tag("topic_#{result}",'yes',false,{:style => 'float:left',
<% end %>
<%= strip_tags(short_summary) %>
- <%= link_to("more >>", "#{source_url}", { :title => "More information on #{title}" })%>
+ <%= link_to("more >>", "#{source_url}", { :title => "More information on #{title}", :tabindex => '1' })%>
<% end %>
diff --git a/app/views/search/_results.rhtml b/app/views/search/_results.rhtml
index 734f97b38..c09e310a9 100644
--- a/app/views/search/_results.rhtml
+++ b/app/views/search/_results.rhtml
@@ -15,7 +15,7 @@
<% ZOOM_CLASSES.each do |zoom_class| %>
<% if zoom_class == @current_class %>
- <%= zoom_class_plural_humanize(zoom_class) %> (<%= number_with_delimiter(@result_sets[zoom_class].size) %>)
+ <%= zoom_class_plural_humanize(zoom_class) %> (<%= number_with_delimiter(@result_sets[zoom_class].size) %>)
<% else %>
<% if !results_as_form %>
<%= link_to_zoom_class_results(zoom_class,@result_sets[zoom_class].size) -%>
@@ -84,7 +84,7 @@
<% # TODO: a helper? %>
<% RECORDS_PER_PAGE_CHOICES.each do |choice| %>
<% if @number_per_page != choice %>
- <%= link_to(choice, :overwrite_params => { :number_of_results_per_page => choice, :page => 1 }) %>
+ <%= link_to(choice, :overwrite_params => { :number_of_results_per_page => choice, :page => 1 }, :tabindex => '1') %>
<% else %>
<%= choice %>
<% end %>
diff --git a/app/views/search/oai_record.rxml b/app/views/search/oai_record.rxml
index e1bbc3da9..fac4113f5 100644
--- a/app/views/search/oai_record.rxml
+++ b/app/views/search/oai_record.rxml
@@ -6,7 +6,7 @@ xml.tag!("OAI-PMH", "xmlns:xsi".to_sym => "http://www.w3.org/2001/XMLSchema-inst
xml.record do
xml.header do
oai_dc_xml_oai_identifier(xml,item)
- xml.datestamp(item.updated_at.utc.xmlschema)
+ oai_dc_xml_oai_datestamp(xml, item)
oai_dc_xml_oai_set_specs(xml,item)
end
xml.metadata do
diff --git a/app/views/topics/_actions_menu.rhtml b/app/views/topics/_actions_menu.rhtml
index 16d9491d5..8db64a32d 100644
--- a/app/views/topics/_actions_menu.rhtml
+++ b/app/views/topics/_actions_menu.rhtml
@@ -1,18 +1,18 @@
- View
+ View
this Item
<% cache_with_privacy(item, {:part => 'edit'}) do -%>
<%= link_to "Edit ",
- :action => :edit,
- :id => item, :private => params[:private] %>
+ {:action => :edit,
+ :id => item, :private => params[:private]}, :tabindex => '1' %>
<% end %>
<% cache({:part => 'history', :id => @cache_id}) do -%>
<%= link_to "History ",
- :action => :history,
- :id => item %>
+ {:action => :history,
+ :id => item}, :tabindex => '1' %>
<% end %>
- Discuss
+ Discuss
<% if logged_in? and @site_admin -%>
<% cache({:part => 'zoom_reindex', :id => @cache_id}) do -%>
@@ -22,10 +22,10 @@
:items_to_rebuild => items_to_rebuild(item),
:authenticity_token => form_authenticity_token},
:method => :post,
- :confirm => 'Are you sure you want to update?'%>
+ :confirm => 'Are you sure you want to update?', :tabindex => '1' %>
<% if !@document.nil? -%>
<% if @document.could_be_new_theme? -%>
- <%= link_to 'Make theme', :action => 'make_theme', :id => @document -%>
+ <%= link_to 'Make theme', {:action => 'make_theme', :id => @document}, :tabindex => '1' -%>
<% end -%>
<% end -%>
<% end -%>
@@ -37,7 +37,7 @@
{:action => :destroy,
:id => item},
:method => :post,
- :confirm => 'Are you sure?'%>
+ :confirm => 'Are you sure?', :tabindex => '1' %>
<% end %>
<% end -%>
<%= render :partial => 'topics/privacy_chooser', :locals => { :item => item } if @show_privacy_chooser -%>
diff --git a/app/views/topics/_form.rhtml b/app/views/topics/_form.rhtml
index e6af3598b..92741555e 100644
--- a/app/views/topics/_form.rhtml
+++ b/app/views/topics/_form.rhtml
@@ -16,7 +16,7 @@
Move to another basket?
<% # TODO: ugly hack till we move this to form.select -%>
- <%= collection_select('topic', 'basket_id', Basket.find(:all), :id, :name, {:class=>"select"}) %>
+ <%= collection_select('topic', 'basket_id', Basket.find(:all), :id, :name, {}, {:class=>"select", :tabindex => '1' }) %>
<% end -%>
<% if edit %>
@@ -29,8 +29,8 @@
@@ -43,16 +43,16 @@
Title:
- <%= text_field 'topic', 'title', {:class => "text-input"} %>
+ <%= text_field 'topic', 'title', {:class => "text-input", :tabindex => '1'} %>
Short Summary:
- <%= text_area 'topic', 'short_summary', {:class => "text-area", :cols => 120, :rows => 2 } %>
+ <%= text_area 'topic', 'short_summary', {:class => "text-area", :cols => 120, :rows => 2, :tabindex => '1' } %>
<% end %>
<%= render :partial => 'license_chooser_or_agreement',:locals => {:item => @topic || Topic.new} %>
diff --git a/app/views/topics/_license_chooser_or_agreement.html.erb b/app/views/topics/_license_chooser_or_agreement.html.erb
index 8fcafca18..86e7311f9 100644
--- a/app/views/topics/_license_chooser_or_agreement.html.erb
+++ b/app/views/topics/_license_chooser_or_agreement.html.erb
@@ -4,7 +4,7 @@
<% if item.has_license? %>
This <%= item.class.name.humanize.singularize.downcase%> is licensed under the <%=item.license.title%>.
- By editing it you agree that your changes will fall under this license (
view license ).
+ By editing it you agree that your changes will fall under this license (
view license ).
<% else
@@ -14,7 +14,7 @@
<% if licenses_are_available? %>
<% available_licenses do |license| %>
- <%= radio_button_for_license_selection(item.class.table_name.singularize, license) %>
+ <%= radio_button_for_license_selection(item.class.table_name.singularize, license, { :tabindex => '1' }) %>
<% end -%>
<% if params[:controller] != 'account' -%>
@@ -22,7 +22,7 @@
profile
<% end %>
<% else %>
-
Please see the <%= link_to "site terms and conditions", :urlified_name => "about", :controller => "topics", :action => "show", :id => 4 -%> for information on how contributions are licensed.
+
Please see the <%= link_to "site terms and conditions", :urlified_name => "about", :controller => "topics", :action => "show", :id => 4, :tabindex => '1' -%> for information on how contributions are licensed.
<% end %>
<% end -%>
diff --git a/app/views/topics/_preview_actions.html.erb b/app/views/topics/_preview_actions.html.erb
index 74f44689b..03126b46f 100644
--- a/app/views/topics/_preview_actions.html.erb
+++ b/app/views/topics/_preview_actions.html.erb
@@ -2,8 +2,8 @@
Actions:
<%= link_to "History",
- :action => :history,
- :id => item %>
+ {:action => :history,
+ :id => item}, :tabindex => '1' %>
<% if can_moderate -%>
<%= link_to "Make this revision live",
{:action => :restore,
@@ -11,7 +11,7 @@
:version => item.version,
:authenticity_token => form_authenticity_token},
:method => :post,
- :confirm => 'Are you sure?' %>
+ :confirm => 'Are you sure?', :tabindex => '1' %>
<%= link_to "reject",
{:action => :flag_form,
:id => item,
@@ -19,7 +19,7 @@
:version => item.version,
:authenticity_token => form_authenticity_token},
:method => :post,
- :confirm => 'Are you sure?'%>
+ :confirm => 'Are you sure?', :tabindex => '1' %>
<% end -%>
diff --git a/app/views/topics/_privacy_chooser.rhtml b/app/views/topics/_privacy_chooser.rhtml
index b25e2e463..278f55ac1 100644
--- a/app/views/topics/_privacy_chooser.rhtml
+++ b/app/views/topics/_privacy_chooser.rhtml
@@ -1,9 +1,9 @@
<% cache_with_privacy(item, {:part => 'privacy_chooser'}) do -%>
<% if item.respond_to?(:private?) -%>
<% if item.private? -%>
- <%= link_to "Public version (live)", :controller => params[:controller], :action => 'show', :id => params[:id], :private => "false" %>
+ <%= link_to "Public version (live)", {:controller => params[:controller], :action => 'show', :id => params[:id], :private => "false"}, :tabindex => '1' %>
<% elsif !item.private? && item.has_private_version? -%>
- <%= link_to "Private version", :controller => params[:controller], :action => 'show', :id => params[:id], :private => "true", :only_path => false %>
+ <%= link_to "Private version", {:controller => params[:controller], :action => 'show', :id => params[:id], :private => "true", :only_path => false}, :tabindex => '1' %>
<% end -%>
<% end -%>
<% end -%>
\ No newline at end of file
diff --git a/app/views/topics/_topic_types.rhtml b/app/views/topics/_topic_types.rhtml
index 76f044fcf..ed215dcc5 100644
--- a/app/views/topics/_topic_types.rhtml
+++ b/app/views/topics/_topic_types.rhtml
@@ -1,4 +1,4 @@
Type of Topic?
- <%= topic_type_select_with_indent('topic', 'topic_type_id', topic_types, :id, :name, {:class=>"select"}) %>
+ <%= topic_type_select_with_indent('topic', 'topic_type_id', topic_types, :id, :name, {}, {:class=>"select", :tabindex => '1'}) %>
diff --git a/app/views/topics/edit.rhtml b/app/views/topics/edit.rhtml
index e11feb709..8c73bb9d5 100644
--- a/app/views/topics/edit.rhtml
+++ b/app/views/topics/edit.rhtml
@@ -5,7 +5,7 @@
<% form_tag :action => 'update', :id => @topic do %>
<%= render :partial => 'form' %>
- <%= submit_tag 'Save', :class => "save-button" %>
+ <%= submit_tag 'Save', :class => "save-button", :tabindex => '1' %>
<% end %>
<%= link_to_cancel %>
diff --git a/app/views/topics/flag_form.rhtml b/app/views/topics/flag_form.rhtml
index 0337baf66..53a12cfb0 100644
--- a/app/views/topics/flag_form.rhtml
+++ b/app/views/topics/flag_form.rhtml
@@ -23,11 +23,11 @@
- <%= submit_tag @submit_text %>
+ <%= submit_tag @submit_text, :tabindex => '1' %>
<% end %>
<%= link_to_cancel %>
diff --git a/app/views/topics/new.rhtml b/app/views/topics/new.rhtml
index 50eca0777..de2110f3a 100644
--- a/app/views/topics/new.rhtml
+++ b/app/views/topics/new.rhtml
@@ -4,10 +4,10 @@
<% form_tag :action => 'pick_topic_type' do %>
<%= render :partial => 'pick_form' %>
- <%= submit_tag "Choose" , :class => "save-button" %>
+ <%= submit_tag "Choose" , {:class => "save-button", :tabindex => '1'} %>
<% end %>
<%= link_to_cancel %> |
-<%= link_to("help", { :controller => 'index_page', :action => :help_file }, :popup => ['help', 'height=500,width=780,scrollbars=yes,top=100,left=100']) %>
+<%= link_to("help", { :controller => 'index_page', :action => :help_file }, :popup => ['help', 'height=500,width=780,scrollbars=yes,top=100,left=100'], :tabindex => '1') %>
<%= render(:partial => "content_wrapper_end" ) %>
diff --git a/app/views/topics/pick_topic_type.rhtml b/app/views/topics/pick_topic_type.rhtml
index 0125cab90..19b2458f0 100644
--- a/app/views/topics/pick_topic_type.rhtml
+++ b/app/views/topics/pick_topic_type.rhtml
@@ -5,7 +5,7 @@
<% form_tag :action => 'create' do %>
<%= render :partial => 'form' %>
- <%= submit_tag "Create", :class => "save-button" %>
+ <%= submit_tag "Create", {:class => "save-button", :tabindex => '1'} %>
<% end %>
<%= link_to_cancel %>
diff --git a/app/views/video/_form.rhtml b/app/views/video/_form.rhtml
index 072919812..85c94f47f 100644
--- a/app/views/video/_form.rhtml
+++ b/app/views/video/_form.rhtml
@@ -16,7 +16,7 @@
<% if edit and @site_admin %>
Move to another basket?
- <%= form.select 'basket_id', @baskets %>
+ <%= form.select 'basket_id', @baskets, {}, :tabindex => '1' %>
<% end -%>
@@ -26,11 +26,11 @@
Privacy
- <%= form.radio_button :private, false, :id => "video_private_false" %>
+ <%= form.radio_button :private, false, {:id => "video_private_false", :tabindex => '1'} %>
Public (Can be viewed by everyone)
- <%= form.radio_button :private, true, :id => "video_private_true" %>
+ <%= form.radio_button :private, true, {:id => "video_private_true", :tabindex => '1'} %>
Private (Can be viewed only by basket members)
@@ -44,10 +44,10 @@
<% end %>
Title:
- <%= form.text_field :title %>
+ <%= form.text_field :title, :tabindex => '1' %>
<% end -%>
diff --git a/app/views/video/edit.rhtml b/app/views/video/edit.rhtml
index c9dba6a7f..a13e5a12e 100644
--- a/app/views/video/edit.rhtml
+++ b/app/views/video/edit.rhtml
@@ -8,7 +8,7 @@
:id => @video },
:html => { :multipart => true } do |form| %>
<%= render :partial => 'form', :object => form %>
- <%= submit_tag 'Save' , :class => "save-button" %>
+ <%= submit_tag 'Save' , {:class => "save-button", :tabindex => '1'} %>
<% end %>
<%= link_to_cancel %>
diff --git a/app/views/video/new.rhtml b/app/views/video/new.rhtml
index 353945079..3bdb58b2d 100644
--- a/app/views/video/new.rhtml
+++ b/app/views/video/new.rhtml
@@ -6,7 +6,7 @@
:url => { :action => 'create'},
:html => { :multipart => true } do |form| %>
<%= render :partial => 'form', :object => form %>
- <%= submit_tag "Create" %>
+ <%= submit_tag "Create", :tabindex => '1' %>
<% end %>
<%= link_to_cancel %>
diff --git a/app/views/web_links/_form.rhtml b/app/views/web_links/_form.rhtml
index 03673b871..98437b297 100644
--- a/app/views/web_links/_form.rhtml
+++ b/app/views/web_links/_form.rhtml
@@ -14,7 +14,7 @@
Move to another basket?
<% # TODO: ugly hack till we move this to form.select -%>
- <%= collection_select('web_link', 'basket_id', Basket.find(:all), :id, :name) %>
+ <%= collection_select('web_link', 'basket_id', Basket.find(:all), :id, :name, {}, {:tabindex => '1'}) %>
<% end -%>
@@ -23,11 +23,11 @@
Privacy
- <%= radio_button 'web_link', :private, false, { :id => "web_link_private_false" }.merge((@current_basket.private_default? && @web_link.private.nil?) ? Hash.new : { "checked" => "checked" }) %>
+ <%= radio_button 'web_link', :private, false, { :id => "web_link_private_false", :tabindex => '1' }.merge((@current_basket.private_default? && @web_link.private.nil?) ? Hash.new : { "checked" => "checked" }) %>
Public (Can be viewed by everyone)
- <%= radio_button 'web_link', :private, true, { :id => "web_link_private_true" }.merge((@current_basket.private_default? && @web_link.private.nil?) ? { "checked" => "checked" } : Hash.new) %>
+ <%= radio_button 'web_link', :private, true, { :id => "web_link_private_true", :tabindex => '1' }.merge((@current_basket.private_default? && @web_link.private.nil?) ? { "checked" => "checked" } : Hash.new) %>
Private (Can be viewed only by basket members)
@@ -43,12 +43,12 @@
Title:
- <%= text_field 'web_link', 'title' , {:class=>"text-input"} %>
+ <%= text_field 'web_link', 'title' , {:class=>"text-input", :tabindex => '1'} %>
Description:
- <%= text_area 'web_link', 'description', :class => "mceEditor", :cols => 120 %>
+ <%= text_area 'web_link', 'description', {:class => "mceEditor", :cols => 120, :tabindex => '1'} %>
<% end -%>
<% if show_privacy_controls_for?(@web_link) %>
-
Attached web link privacy: <%= radio_button 'web_link', 'file_private', false, file_private_radio_options(@web_link) %> Can be accessed by everyone <%= radio_button 'web_link', 'file_private', true, file_private_radio_options(@web_link) %> Can only be accessed by people who have <%= @current_basket.private_file_visibility -%> access.
+
Attached web link privacy: <%= radio_button 'web_link', 'file_private', false, file_private_radio_options(@web_link).merge({:tabindex => '1'}) %> Can be accessed by everyone <%= radio_button 'web_link', 'file_private', true, file_private_radio_options(@web_link).merge({:tabindex => '1'}) %> Can only be accessed by people who have <%= @current_basket.private_file_visibility -%> access.
Please note that once public, a web link cannot be made private.
<% else %>
<%# Use the default %>
@@ -74,13 +74,13 @@
Tags (separated by commas):
- <%= text_field 'web_link', 'tag_list', {:class => "text-input"} %>
+ <%= text_field 'web_link', 'tag_list', {:class => "text-input", :tabindex => '1'} %>
<% if show_privacy_controls_for?(@web_link) || !edit %>
URL:
- <%= text_field 'web_link', 'url', {:class=>"text-input"} %>
+ <%= text_field 'web_link', 'url', {:class=>"text-input", :tabindex => '1'} %>
<% end %>
@@ -98,7 +98,7 @@
Comment on this edit:
<% # delete the last version_comment's value
@web_link.version_comment = nil -%>
- <%= text_field 'web_link', 'version_comment', {:class => "text-input"} %>
+ <%= text_field 'web_link', 'version_comment', {:class => "text-input", :tabindex => '1'} %>
<% end -%>
diff --git a/app/views/web_links/edit.rhtml b/app/views/web_links/edit.rhtml
index 03418be83..6e0807c76 100644
--- a/app/views/web_links/edit.rhtml
+++ b/app/views/web_links/edit.rhtml
@@ -5,7 +5,7 @@
<% form_tag :action => 'update', :id => @web_link do %>
<%= render :partial => 'form' %>
-
<%= submit_tag 'Save',:class => "save-button" %>
+
<%= submit_tag 'Save',{:class => "save-button", :tabindex => '1'} %>
<% end %>
<%= link_to_cancel %>
diff --git a/app/views/web_links/new.rhtml b/app/views/web_links/new.rhtml
index ddda4d724..faa262050 100644
--- a/app/views/web_links/new.rhtml
+++ b/app/views/web_links/new.rhtml
@@ -5,7 +5,7 @@
<% form_tag :action => 'create' do %>
<%= render :partial => 'form' %>
-
<%= submit_tag "Create", :class => "save-button" %>
+
<%= submit_tag "Create", {:class => "save-button", :tabindex => '1'} %>
<% end %>
<%= link_to_cancel %>
diff --git a/config/backgroundrb.yml.example b/config/backgroundrb.yml.example
index 153dca91c..533c2c10a 100644
--- a/config/backgroundrb.yml.example
+++ b/config/backgroundrb.yml.example
@@ -3,6 +3,7 @@
:port: 11006
:ip: 127.0.0.1
:environment: production
+ :persistent_disabled: true
:result_storage: memcache
-
+
:memcache: "127.0.0.1:11211"
\ No newline at end of file
diff --git a/config/environment.rb b/config/environment.rb
index d496e3aed..1cdb0ca1f 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -39,7 +39,9 @@
# Specify gems that this application depends on.
# They can then be installed with "rake gems:install" on new installations.
-
+ # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
+ # config.gem "aws-s3", :lib => "aws/s3"
+
# Walter McGinnis, 2008-07-02
# we currently use a hacked version of oai gem
# and place it under vendor/gems
@@ -48,14 +50,11 @@
# Kieran, 2008-07-22
# specify the specific versions we need to run Kete
- # (currently causes problems, will investigate)
- # lib-xml 0.8.0 causes errors in acts_as_zoom
- #config.gem "libxml-ruby", :version => '< 0.8.0'
- # packet 0.1.8 causes imports to fail silently
- #config.gem "packet", :version => '0.1.7'
-
- # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
- # config.gem "aws-s3", :lib => "aws/s3"
+ # libxml-ruby 0.8.0 causes errors in acts_as_zoom
+ config.gem 'libxml-ruby', :lib => 'libxml', :version => '< 0.8.0'
+ # backgroundrb 1.1 requires packet 0.1.14
+ config.gem 'packet', :version => '>= 0.1.14'
+
# Only load the plugins named here, in the order given. By default, all plugins
# in vendor/plugins are loaded in alphabetical order.
diff --git a/config/initializers/tinymce.rb b/config/initializers/tinymce.rb
index e83350c77..13a0b6e83 100644
--- a/config/initializers/tinymce.rb
+++ b/config/initializers/tinymce.rb
@@ -1 +1,28 @@
EXTENDED_VALID_ELEMENTS = 'code[class|dir
'advanced',
+ :theme_advanced_toolbar_location => "top",
+ :theme_advanced_toolbar_align => "left",
+ :theme_advanced_statusbar_location => "bottom",
+ :theme_advanced_buttons1 => %w{ bold italic underline strikethrough separator justifyleft justifycenter justifyright justifyfull separator indent outdent separator bullist numlist forecolor backcolor separator link unlink image separator undo redo separator code},
+ :theme_advanced_buttons2 => %w{ formatselect fontselect fontsizeselect separator pastetext pasteword selectall },
+ :theme_advanced_buttons3_add => %w{ tablecontrols fullscreen },
+ :theme_advanced_resizing => true,
+ :theme_advanced_resize_horizontal => false,
+
+ # link / image path conversions
+ :convert_urls => false,
+ :content_css => "/stylesheets/base.css",
+
+ # paste plugin specific settings
+ :paste_auto_cleanup_on_paste => true,
+ :paste_convert_middot_lists => false,
+ :paste_convert_headers_to_strong => true,
+
+ # which plugins we are enabling
+ :plugins => %w{ contextmenu paste table fullscreen }
+}
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 469444a95..f4459ad27 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -136,6 +136,8 @@
map.connect 'zebra_uptime.txt', :controller => "index_page", :action => 'zebra_uptime'
# to make sure that registration is valid
map.connect 'validate_kete_net_link.xml', :controller => "index_page", :action => 'validate_kete_net_link'
+ # for search engines, ask them not to go to certain places
+ map.connect 'robots.txt', :controller => "index_page", :action => 'robots'
map.connect '*path', :controller => 'application', :action => 'rescue_404' unless ActionController::Base.consider_all_requests_local
end
diff --git a/db/bootstrap/contributions.yml b/db/bootstrap/contributions.yml
index 65a777be5..757d553d6 100755
--- a/db/bootstrap/contributions.yml
+++ b/db/bootstrap/contributions.yml
@@ -134,3 +134,12 @@ contributions_015:
contributed_item_id: "14"
created_at: <%= Time.now.utc.to_s :db %>
updated_at: <%= Time.now.utc.to_s :db %>
+contributions_016:
+ contributed_item_type: Topic
+ id: "16"
+ version: "1"
+ contributor_role: creator
+ user_id: "1"
+ contributed_item_id: "15"
+ created_at: <%= Time.now.utc.to_s :db %>
+ updated_at: <%= Time.now.utc.to_s :db %>
diff --git a/db/bootstrap/system_settings.yml b/db/bootstrap/system_settings.yml
index df130c6f3..31bf391ea 100644
--- a/db/bootstrap/system_settings.yml
+++ b/db/bootstrap/system_settings.yml
@@ -470,3 +470,11 @@ system_settings_053:
id: "53"
value: "[]"
section: System
+systsystem_settings_054:
+ name: Government Website
+ technically_advanced: true
+ required_to_be_configured: false
+ explanation: "Your local/countries government website. Opening [ and closing ] are required. Format: ['name', 'url']"
+ id: "54"
+ value: "['newzealand.govt.nz', 'http://newzealand.govt.nz/']"
+ section: System
\ No newline at end of file
diff --git a/db/bootstrap/topic_versions.yml b/db/bootstrap/topic_versions.yml
index ea606c503..f2c95e7ba 100644
--- a/db/bootstrap/topic_versions.yml
+++ b/db/bootstrap/topic_versions.yml
@@ -458,3 +458,118 @@ topics_014:
Lastly you will want to edit this topic using the edit link below. You can also replace it, either with another topic or by redirecting users to results for all topics, images, audio, video, web links, documents, or discussion via the site basket edit page.
Credits
This topic was originally written by Walter McGinnis at Katipo Communications and Russel Garlick at Liblime .
+topics_015:
+ title: Accessibility
+ short_summary: Accessibility features of this website
+ raw_tag_list: ""
+ id: "15"
+ topic_id: "15"
+ version: "1"
+ basket_id: "2"
+ topic_type_id: "1"
+ index_for_basket_id:
+ created_at: <%= Time.now.utc.to_s :db %>
+ updated_at: <%= Time.now.utc.to_s :db %>
+ description: |+
+ Standards
+ This site was produced to meet New Zealand Government Web Standards and Recommendations v 1.0
+ Access keys
+ Access keys help you to navigate to commonly used pages in the site without needing to use a mouse or other pointing device. To activate an access key, hold down the ALT key (for PCs) or CONTROL key (for Apple Macintosh) plus the relevant access key shown below (at the same time). For some browsers you may need to press enter to confirm your choice.
+ The available keyboard shortcuts are:
+ 0 = Accessibility help page
+ 1 = Home page
+ 2 = Site map
+ 3 = Search
+ 9 = Contact us
+ [ = jump to content beginning
+ / = link to govt.nz website
+ To use the keyboard Accesskeys:
+
+
+
+ Browser
+ Version
+ Activate Accesskey
+
+
+ Internet Explorer
+ IE 5+ (Windows)
+ Alt + Accesskey, then Enter
+
+
+ Internet Explorer
+ IE 5, 6 (Mac)
+ Ctrl+ Accesskey
+
+
+ Firefox
+ FF <= 1.5 (Windows)
+ Alt + Accesskey
+
+
+ Firefox
+ FF 2 (Windows)
+ Alt + Shift + Accesskey
+
+
+ Firefox
+ FF 2 (Mac)
+ Ctrl+ Accesskey
+
+
+ Firefox
+ FF 3 (Windows)
+ Alt + Shift + Accesskey
+
+
+ Opera
+ Early versions
+ Accesskey not supported
+
+
+ Opera
+ v7+ (Windows or Mac)
+ Shift + Escape, (release) then Accesskey
+
+
+ Mozilla
+ (Windows)
+ Alt + Accesskey
+
+
+ Mozilla
+ (Mac)
+ Ctrl+ Accesskey
+
+
+ Safari
+ v1.2+ (Mac)
+ Ctrl+ Accesskey
+
+
+ Netscape
+ NN 6-8 (Windows)
+ Alt + Accesskey
+
+
+ Netscape
+ NN 9 (Windows)
+ Alt + Shift + Accesskey
+
+
+ Netscape
+ NN 6+ (Mac)
+ Ctrl+ Accesskey
+
+
+
+ Note: Some browers do not support the numbers on the Number Pad being used as Accesskeys. Use the numbers at the top of the keyboard.
+ Text size
+ You can make the text on this site bigger or smaller to suit you if your browser supports text resizing (i.e. recent versions of Internet Explorer, Firefox, Safari or Opera).
+ To resize your fonts:
+
+ In Microsoft Internet Explorer: go to the View menu at the top of your screen, select Text size, then choose to view with larger or smaller type.
+ In Firefox and Safari on a PC: press CTL + to make text bigger, and CTL - to make text smaller.
+ In Firefox and Safari on a Mac: press Command + to make text bigger, and Command - to make text smaller.
+ In other browsers: consult the browser Help for details on how to resize the text.
+
diff --git a/db/bootstrap/topics.yml b/db/bootstrap/topics.yml
index 141d9519c..bb164b5de 100644
--- a/db/bootstrap/topics.yml
+++ b/db/bootstrap/topics.yml
@@ -456,3 +456,118 @@ topics_014:
Lastly you will want to edit this topic using the edit link below. You can also replace it, either with another topic or by redirecting users to results for all topics, images, audio, video, web links, documents, or discussion via the site basket edit page.
Credits
This topic was originally written by Walter McGinnis at Katipo Communications and Russel Garlick at Liblime .
+
+topics_015:
+ title: Accessibility
+ short_summary: Accessibility features of this website
+ raw_tag_list: ""
+ id: "15"
+ version: "1"
+ basket_id: "2"
+ topic_type_id: "1"
+ index_for_basket_id:
+ created_at: <%= Time.now.utc.to_s :db %>
+ updated_at: <%= Time.now.utc.to_s :db %>
+ description: |+
+ Standards
+ This site was produced to meet New Zealand Government Web Standards and Recommendations v 1.0
+ Access keys
+ Access keys help you to navigate to commonly used pages in the site without needing to use a mouse or other pointing device. To activate an access key, hold down the ALT key (for PCs) or CONTROL key (for Apple Macintosh) plus the relevant access key shown below (at the same time). For some browsers you may need to press enter to confirm your choice.
+ The available keyboard shortcuts are:
+ 0 = Accessibility help page
+ 1 = Home page
+ 2 = Site map
+ 3 = Search
+ 9 = Contact us
+ [ = jump to content beginning
+ / = link to govt.nz website
+ To use the keyboard Accesskeys:
+
+
+
+ Browser
+ Version
+ Activate Accesskey
+
+
+ Internet Explorer
+ IE 5+ (Windows)
+ Alt + Accesskey, then Enter
+
+
+ Internet Explorer
+ IE 5, 6 (Mac)
+ Ctrl+ Accesskey
+
+
+ Firefox
+ FF <= 1.5 (Windows)
+ Alt + Accesskey
+
+
+ Firefox
+ FF 2 (Windows)
+ Alt + Shift + Accesskey
+
+
+ Firefox
+ FF 2 (Mac)
+ Ctrl+ Accesskey
+
+
+ Firefox
+ FF 3 (Windows)
+ Alt + Shift + Accesskey
+
+
+ Opera
+ Early versions
+ Accesskey not supported
+
+
+ Opera
+ v7+ (Windows or Mac)
+ Shift + Escape, (release) then Accesskey
+
+
+ Mozilla
+ (Windows)
+ Alt + Accesskey
+
+
+ Mozilla
+ (Mac)
+ Ctrl+ Accesskey
+
+
+ Safari
+ v1.2+ (Mac)
+ Ctrl+ Accesskey
+
+
+ Netscape
+ NN 6-8 (Windows)
+ Alt + Accesskey
+
+
+ Netscape
+ NN 9 (Windows)
+ Alt + Shift + Accesskey
+
+
+ Netscape
+ NN 6+ (Mac)
+ Ctrl+ Accesskey
+
+
+
+ Note: Some browers do not support the numbers on the Number Pad being used as Accesskeys. Use the numbers at the top of the keyboard.
+ Text size
+ You can make the text on this site bigger or smaller to suit you if your browser supports text resizing (i.e. recent versions of Internet Explorer, Firefox, Safari or Opera).
+ To resize your fonts:
+
+ In Microsoft Internet Explorer: go to the View menu at the top of your screen, select Text size, then choose to view with larger or smaller type.
+ In Firefox and Safari on a PC: press CTL + to make text bigger, and CTL - to make text smaller.
+ In Firefox and Safari on a Mac: press Command + to make text bigger, and Command - to make text smaller.
+ In other browsers: consult the browser Help for details on how to resize the text.
+
\ No newline at end of file
diff --git a/db/migrate/20081005210917_add_scheduled_at_to_bdrb_job_queues.rb b/db/migrate/20081005210917_add_scheduled_at_to_bdrb_job_queues.rb
new file mode 100644
index 000000000..a04150ae8
--- /dev/null
+++ b/db/migrate/20081005210917_add_scheduled_at_to_bdrb_job_queues.rb
@@ -0,0 +1,9 @@
+class AddScheduledAtToBdrbJobQueues < ActiveRecord::Migration
+ def self.up
+ add_column :bdrb_job_queues, :scheduled_at, :datetime
+ end
+
+ def self.down
+ remove_column :bdrb_job_queues, :scheduled_at
+ end
+end
diff --git a/lib/extended_content_controller.rb b/lib/extended_content_controller.rb
index e835139a9..fcadd82d1 100644
--- a/lib/extended_content_controller.rb
+++ b/lib/extended_content_controller.rb
@@ -24,29 +24,8 @@ def self.included(klass)
klass.send :protect_from_forgery, :secret => KETE_SECRET, :except => ['new', 'destroy']
### TinyMCE WYSIWYG editor stuff
- klass.send :uses_tiny_mce, :options => { :theme => 'advanced',
- :mode => "textareas",
- :convert_urls => false,
- :content_css => "/stylesheets/base.css",
- :remove_script_host => true,
- :theme_advanced_toolbar_location => "top",
- :theme_advanced_toolbar_align => "left",
- :theme_advanced_resizing => true,
- :theme_advanced_resize_horizontal => false,
- :theme_advanced_buttons1 => %w{ bold italic underline strikethrough separator justifyleft justifycenter justifyright indent outdent separator bullist numlist forecolor backcolor separator link unlink image undo redo code},
- :theme_advanced_buttons2 => %w{ formatselect fontselect fontsizeselect pastetext pasteword selectall },
- :theme_advanced_buttons3_add => %w{ tablecontrols fullscreen},
- :editor_selector => 'mceEditor',
- :paste_create_paragraphs => true,
- :paste_create_linebreaks => true,
- :paste_use_dialog => true,
- :paste_auto_cleanup_on_paste => true,
- :paste_convert_middot_lists => false,
- :paste_unindented_list_class => "unindentedList",
- :paste_convert_headers_to_strong => true,
- :paste_insert_word_content_callback => "convertWord",
- :plugins => %w{ contextmenu paste table fullscreen} },
- :only => [:new, :pick, :create, :edit, :update, :pick_topic_type]
+ klass.send :uses_tiny_mce, :options => DEFAULT_TINYMCE_SETTINGS,
+ :only => VALID_TINYMCE_ACTIONS
### end TinyMCE WYSIWYG editor stuff
def load_content_type
diff --git a/lib/importer.rb b/lib/importer.rb
index 725625713..8ce3f5161 100644
--- a/lib/importer.rb
+++ b/lib/importer.rb
@@ -362,13 +362,25 @@ def importer_process(record, params)
# switching to pulling record to a hash
# and grabbing the specific fields
# we need to check
- def importer_xml_record_to_hash(record)
+ def importer_xml_record_to_hash(record, upcase = false)
record_hash = Hash.from_xml(record.to_s)
# HACK to go down one more level
record_hash.keys.each do |record_field|
record_hash = record_hash[record_field]
end
+
+ # move all hash keys to upcase
+ # we use this to smooth some legacy code in past perfect import
+ if upcase
+ new_record_hash = Hash.new
+ record_hash.each do |key, value|
+ key = key.upcase if key.is_a?(String)
+ new_record_hash[key] = value
+ end
+ record_hash = new_record_hash
+ end
+
logger.info("record_hash inspect: " + record_hash.inspect)
record_hash
end
@@ -384,13 +396,13 @@ def importer_trim_fat_from_xml_import_file(path_to_original_file,path_to_output,
fatty_re = Regexp.new("\/\>.*")
- accessno_re = Regexp.new("ACCESSNO>(.*)<")
+ accessno_re = Regexp.new(/ACCESSNO>(.*) or line, so that it can be replaced
+ # putting in both styles of records
+ if line.include?("ACCESSNO") || line.include?("accessno") ||
+ line.include?("DESCRIP") || line.include?("descrip") ||
+ line.include?("\/Record") || line.include?("\/export") ||
+ line.include?("Information") ||
+ line.include?("Root") || line.include?("VFPData")
+ if line.include?("accessno") || line.include?("ACCESSNO")
accessno = line.match(accessno_re)[1]
- new_start_record_line = "\n"
+ if @root_element_name == 'Root'
+ new_start_record_line = "\n"
+ else
+ new_start_record_line = "\n"
+ end
+
fat_free_file << new_start_record_line
else
fat_free_file << line
diff --git a/lib/importer_zoom.rb b/lib/importer_zoom.rb
index 0eac40b5f..e86bc4ac4 100644
--- a/lib/importer_zoom.rb
+++ b/lib/importer_zoom.rb
@@ -24,7 +24,7 @@ def importer_oai_record_xml(options = { })
xml.record do
xml.header do
oai_dc_xml_oai_identifier(xml,item)
- xml.datestamp(Time.now.utc.xmlschema)
+ oai_dc_xml_oai_datestamp(xml, item)
oai_dc_xml_oai_set_specs(xml,item)
end
xml.metadata do
diff --git a/lib/oai_dc_helpers.rb b/lib/oai_dc_helpers.rb
index e582950c4..409158897 100644
--- a/lib/oai_dc_helpers.rb
+++ b/lib/oai_dc_helpers.rb
@@ -30,6 +30,37 @@ def oai_dc_xml_oai_identifier(xml, item)
xml.identifier("#{ZoomDb.zoom_id_stub}#{item.basket.urlified_name}:#{item.class.name}:#{item.id}")
end
+ # Walter McGinnis, 2008-10-05
+ # adding better logic for determining last time the item was changed
+ # we want the datestamp to reflect the most recent change to the item
+ # that can be either when it is created/edited
+ # or when a relationship has been added
+ # note that if a relation is removed, this may result in rolling back in time
+ # of datestamp, which may be counterintuitive, however that is a rare case
+ def oai_dc_xml_oai_datestamp(xml, item)
+ most_recent_updated_at = item.updated_at
+
+ if item.class.name == 'Topic'
+ # topics can be on either side of the content_item_relation join model
+ # so to get all possible relations, you have to combine them
+ all_relations = item.content_item_relations + item.child_content_item_relations
+
+ if all_relations.size > 0
+ all_relations.sort! { |a,b| a.updated_at <=> b.updated_at }
+
+ last_relation = all_relations.last
+ if last_relation.updated_at > most_recent_updated_at
+ most_recent_updated_at = last_relation.updated_at
+ end
+ end
+ elsif item.content_item_relations.count > 0 &&
+ item.content_item_relations.last.updated_at > most_recent_updated_at
+ most_recent_updated_at = item.content_item_relations.last.updated_at
+ end
+
+ xml.datestamp(most_recent_updated_at.utc.xmlschema)
+ end
+
# Walter McGinnis, 2008-06-16
# adding oai pmh set support
# assumes public zoom_db
diff --git a/lib/recipes/kete.rb b/lib/recipes/kete.rb
index 5dc05e15e..c9559876c 100644
--- a/lib/recipes/kete.rb
+++ b/lib/recipes/kete.rb
@@ -20,6 +20,7 @@
deploy.update_code
deploy.prepare.setup_zebra
deploy.prepare.setup_imports
+ deploy.prepare.setup_private
deploy.prepare.setup_themes
deploy.symlink
deploy.prepare.default
@@ -52,6 +53,11 @@
run "cp -r #{latest_release}/imports #{shared_path}/system/"
end
+ desc "The directory that holds everything related to private items needs to live under share/system/private"
+ task :setup_private, :roles => :app do
+ run "cp -r #{latest_release}/private #{shared_path}/system/"
+ end
+
desc "The directory that holds everything related to themes needs to live under share/system/themes"
task :setup_themes, :roles => :app do
run "cp -r #{latest_release}/public/themes #{shared_path}/system/"
@@ -100,6 +106,12 @@
run "rm -rf #{current_path}/imports"
run "ln -nfs #{shared_path}/system/imports #{current_path}/"
+ # handle our private directory and all the stuff that lives in it
+ # make system/private if it doesn't exist already
+ run "mkdir -p #{shared_path}/system/private"
+ run "rm -rf #{current_path}/private"
+ run "ln -nfs #{shared_path}/system/private #{current_path}/"
+
# handle our themes directory and all the stuff that lives in it
# make system/themes if it doesn't exist already
run "mkdir -p #{shared_path}/system/themes"
diff --git a/lib/tasks/tools.rake b/lib/tasks/tools.rake
new file mode 100644
index 000000000..e24af93de
--- /dev/null
+++ b/lib/tasks/tools.rake
@@ -0,0 +1,15 @@
+# lib/tasks/tools.rake
+#
+# miscellaneous tools for kete (clearing robots.txt file)
+#
+# Kieran Pilkington, 2008-10-01
+#
+namespace :kete do
+ namespace :tools do
+ desc 'Remove /robots.txt (will rebuild next time a bot visits the page)'
+ task :remove_robots_txt => :environment do
+ path = "#{RAILS_ROOT}/public/robots.txt"
+ File.delete(path) if File.exist?(path)
+ end
+ end
+end
diff --git a/lib/tasks/upgrade.rake b/lib/tasks/upgrade.rake
index f1b9559c3..a1364990a 100644
--- a/lib/tasks/upgrade.rake
+++ b/lib/tasks/upgrade.rake
@@ -10,12 +10,14 @@ namespace :kete do
task :upgrade => ['kete:upgrade:add_new_baskets',
'kete:upgrade:add_tech_admin',
'kete:upgrade:add_new_system_settings',
+ 'kete:upgrade:add_new_default_topics',
'kete:upgrade:change_zebra_password',
'kete:upgrade:check_required_software',
'kete:upgrade:add_missing_mime_types',
'kete:upgrade:correct_basket_defaults',
'zebra:load_initial_records',
- 'kete:upgrade:update_existing_comments_commentable_private']
+ 'kete:upgrade:update_existing_comments_commentable_private',
+ 'kete:tools:remove_robots_txt']
namespace :upgrade do
desc 'Privacy Controls require that Comment#commentable_private be set. Update existing comments to have this data.'
task :update_existing_comments_commentable_private => :environment do
@@ -51,6 +53,31 @@ namespace :kete do
end
end
+ desc 'Add the new default topics that are missing from our Kete installation.'
+ task :add_new_default_topics => :environment do
+ topics_from_yml = YAML.load_file("#{RAILS_ROOT}/db/bootstrap/topics.yml")
+
+ # for each topic from yml
+ # check if it's in the db
+ # if not, add it
+ # system settings have unique names
+ topics_from_yml.each do |topic_array|
+ topic_hash = topic_array[1]
+
+ # if there are existing topics
+ # drop id from hash, as we want to determine it dynamically
+ # else we want to use the bootstap versions
+ topic_hash.delete('id') if Topic.count > 0
+
+ if !Topic.find_by_title_and_basket_id(topic_hash['title'], topic_hash['basket_id'])
+ topic = Topic.create!(topic_hash)
+ topic.creator = User.first
+ topic.save
+ p "added topic: " + topic_hash['title']
+ end
+ end
+ end
+
desc 'Add any new default baskets that are missing from our system.'
task :add_new_baskets => :environment do
baskets_from_yml = YAML.load_file("#{RAILS_ROOT}/db/bootstrap/baskets.yml")
diff --git a/lib/workers/past_perfect4_importer_worker.rb b/lib/workers/past_perfect4_importer_worker.rb
index 7c44d44eb..d91978f2c 100644
--- a/lib/workers/past_perfect4_importer_worker.rb
+++ b/lib/workers/past_perfect4_importer_worker.rb
@@ -59,6 +59,12 @@ def do_work(args = nil)
logger.info("params: " + params.inspect)
@import_photos_file_path = "#{@import_dir_path}/records.xml"
+
+ # this sets the instance vars that tell us what xml element paths we are using
+ # old style or new style
+ determine_elements_used(@import_photos_file_path)
+
+ # this gets rid of xml elements that have empty values
@path_to_trimmed_photos = importer_trim_fat_from_xml_import_file(@import_photos_file_path,"#{RAILS_ROOT}/tmp/trimmed_photos_pp4.xml")
@import_photos_xml = REXML::Document.new File.open(@path_to_trimmed_photos)
@@ -81,7 +87,7 @@ def do_work(args = nil)
# and grab information from the accessions file
# bases on ACCESSNO as a kind of forein key
# as we need it
- @import_photos_xml.elements.each("Root/Information/Record") do |record|
+ @import_photos_xml.elements.each(@root_element_name + '/' + @record_element_path) do |record|
# we override this locally for our customizations
importer_process(record, params)
end
@@ -104,7 +110,7 @@ def importer_process(record, params)
image_objectid = nil
objectid = nil
- record_hash = importer_xml_record_to_hash(record)
+ record_hash = importer_xml_record_to_hash(record, true)
# make sure there is a imagefile value
# if not, log record to skipped photos file with reason skipped
@@ -176,7 +182,7 @@ def importer_process(record, params)
# file may time out
related_accession_record = nil
- related_accession_record = @import_accessions_xml_root.elements["Information/Record[@ACCESSNO=\'#{related_topic_pp4_objectid}\']"]
+ related_accession_record = @import_accessions_xml_root.elements["#{@record_element_path}[@ACCESSNO=\'#{related_topic_pp4_objectid}\']"]
# we have some accesion record's that are mangled
# by being three sections
# rather than two
@@ -199,13 +205,13 @@ def importer_process(record, params)
end
if related_topic.nil?
- related_accession_record = @import_accessions_xml_root.elements["Information/Record[@ACCESSNO=\'#{cleaned_up_accessno}\']"]
+ related_accession_record = @import_accessions_xml_root.elements["#{@record_element_path}[@ACCESSNO=\'#{cleaned_up_accessno}\']"]
end
related_topic_pp4_objectid = cleaned_up_accessno
end
if !related_accession_record.blank? and related_topic.nil?
- accession_record_hash = importer_xml_record_to_hash(related_accession_record)
+ accession_record_hash = importer_xml_record_to_hash(related_accession_record, true)
# create a new topic from related_accession_record
# prepare user_reference for extended_content
@@ -484,4 +490,25 @@ def create_new_item_from_record(record, zoom_class, options = {})
logger.info("new_record: " + new_record.inspect)
return new_record
end
+
+ # set up the correct xml paths to use
+ # based on what is in the source file
+ def determine_elements_used(in_file)
+ # assume original style root element and paths
+ @root_element_name = 'Root'
+ @record_element_path = 'Information/Record'
+ # this should tell us what we need to know by around the second line
+ IO.foreach(in_file) do |line|
+ # if exported directly from Past Perfect, should match this
+ # empty means no match
+ if line.include?("")
+ @root_element_name = 'VFPData'
+ @record_element_path = 'export'
+ return
+ else
+ # we have matched the previous style, return without resetting vars
+ return if line.include?("")
+ end
+ end
+ end
end
diff --git a/public/javascripts/redbox.js b/public/javascripts/redbox.js
index bce499a84..0d9ebca39 100644
--- a/public/javascripts/redbox.js
+++ b/public/javascripts/redbox.js
@@ -11,17 +11,21 @@ var RedBox = {
loading: function()
{
this.showOverlay();
- Element.show('RB_loading');
- this.setWindowPosition();
+ Element.show('RB_window');
+ this.setWindowPositions();
},
addHiddenContent: function(id)
{
this.removeChildrenFromNode($('RB_window'));
this.moveChildren($(id), $('RB_window'));
+ this.activateRBWindow();
+ },
+
+ activateRBWindow: function()
+ {
Element.hide('RB_loading');
- new Effect.Appear('RB_window', {duration: 0.4, queue: 'end'});
- this.setWindowPosition();
+ this.setWindowPositions();
},
close: function()
@@ -33,16 +37,16 @@ var RedBox = {
showOverlay: function()
{
+ var inside_redbox = '
'
if ($('RB_redbox'))
{
Element.update('RB_redbox', "");
- new Insertion.Top($('RB_redbox'), '
');
+ new Insertion.Top($('RB_redbox'), inside_redbox);
}
else
{
- new Insertion.Top(document.body, '');
+ new Insertion.Top(document.body, '' + inside_redbox + '
');
}
- new Insertion.Bottom('RB_redbox', '
');
this.setOverlaySize();
this.hideSelectBoxes();
@@ -66,29 +70,109 @@ var RedBox = {
$("RB_overlay").style['height'] = yScroll +"px";
},
- setWindowPosition: function()
+ setWindowPositions: function()
{
- var pagesize = this.getPageSize();
-
- $("RB_window").style['width'] = 'auto';
- $("RB_window").style['height'] = 'auto';
-
- var dimensions = Element.getDimensions($("RB_window"));
- var width = dimensions.width;
- var height = dimensions.height;
-
- $("RB_window").style['left'] = ((pagesize[0] - width)/2) + "px";
- $("RB_window").style['top'] = ((pagesize[1] - height)/2) + "px";
+ this.setWindowPosition('RB_window');
},
+ setWindowPosition: function(window_id)
+ {
+ var arrayPageSize = this.getPageSize();
+ var arrayPageScroll = this.getPageScroll();
+
+ var boxTop = arrayPageScroll[1] + (arrayPageSize[3] / 10);
+ var boxLeft = arrayPageScroll[0];
+ Element.setTop(window_id, boxTop);
+ Element.setLeft(window_id, boxLeft);
+ },
+
+ //
+ // getPageScroll()
+ // Returns array with x,y page scroll values.
+ // Stolen by from lightbox.js, by Lokesh Dhakar - http://www.huddletogether.com
+ // Core code from - quirksmode.com
+ //
+ getPageScroll: function(){
+
+ var xScroll, yScroll;
+
+ if (self.pageYOffset) {
+ yScroll = self.pageYOffset;
+ xScroll = self.pageXOffset;
+ } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict
+ yScroll = document.documentElement.scrollTop;
+ xScroll = document.documentElement.scrollLeft;
+ } else if (document.body) {// all other Explorers
+ yScroll = document.body.scrollTop;
+ xScroll = document.body.scrollLeft;
+ }
- getPageSize: function() {
- var de = document.documentElement;
- var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
- var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
+ arrayPageScroll = new Array(xScroll,yScroll)
+ return arrayPageScroll;
+ },
- arrayPageSize = new Array(w,h)
- return arrayPageSize;
+ //
+ // getPageSize()
+ // Returns array with page width, height and window width, height
+ // Stolen by from lightbox.js, by Lokesh Dhakar - http://www.huddletogether.com
+ // Core code from - quirksmode.com
+ // Edit for Firefox by pHaez
+ //
+ getPageSize: function() {
+
+ var xScroll, yScroll;
+
+ if (window.innerHeight && window.scrollMaxY) {
+ xScroll = window.innerWidth + window.scrollMaxX;
+ yScroll = window.innerHeight + window.scrollMaxY;
+ } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
+ xScroll = document.body.scrollWidth;
+ yScroll = document.body.scrollHeight;
+ } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
+ xScroll = document.body.offsetWidth;
+ yScroll = document.body.offsetHeight;
+ }
+
+ var windowWidth, windowHeight;
+
+ // console.log(self.innerWidth);
+ // console.log(document.documentElement.clientWidth);
+
+ if (self.innerHeight) { // all except Explorer
+ if(document.documentElement.clientWidth){
+ windowWidth = document.documentElement.clientWidth;
+ } else {
+ windowWidth = self.innerWidth;
+ }
+ windowHeight = self.innerHeight;
+ } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
+ windowWidth = document.documentElement.clientWidth;
+ windowHeight = document.documentElement.clientHeight;
+ } else if (document.body) { // other Explorers
+ windowWidth = document.body.clientWidth;
+ windowHeight = document.body.clientHeight;
+ }
+
+ // for small pages with total height less then height of the viewport
+ if(yScroll < windowHeight){
+ pageHeight = windowHeight;
+ } else {
+ pageHeight = yScroll;
+ }
+
+ // console.log("xScroll " + xScroll)
+ // console.log("windowWidth " + windowWidth)
+
+ // for small pages with total width less then width of the viewport
+ if(xScroll < windowWidth){
+ pageWidth = xScroll;
+ } else {
+ pageWidth = windowWidth;
+ }
+ // console.log("pageWidth " + pageWidth)
+
+ arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
+ return arrayPageSize;
},
removeChildrenFromNode: function(node)
@@ -113,7 +197,7 @@ var RedBox = {
content.style['display'] = 'block';
$('RB_window').appendChild(content);
- this.setWindowPosition();
+ this.setWindowPositions();
},
hideSelectBoxes: function()
diff --git a/public/javascripts/tiny_mce/plugins/advimage/js/image.js b/public/javascripts/tiny_mce/plugins/advimage/js/image.js
index 0db894ca3..64fc6f677 100755
--- a/public/javascripts/tiny_mce/plugins/advimage/js/image.js
+++ b/public/javascripts/tiny_mce/plugins/advimage/js/image.js
@@ -103,7 +103,7 @@ var ImageDialog = {
if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
if (!f.alt.value) {
- tinyMCEPopup.editor.windowManager.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
+ tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
if (s)
t.insertAndClose();
});
diff --git a/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js b/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js
index 2efc1b731..a89625014 100755
--- a/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js
+++ b/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js
@@ -428,7 +428,6 @@ function setAllAttribs(elm) {
var target = getSelectValue(formObj, 'targetlist');
setAttrib(elm, 'href', href);
- setAttrib(elm, 'mce_href', href);
setAttrib(elm, 'title');
setAttrib(elm, 'target', target == '_self' ? '' : target);
setAttrib(elm, 'id');
@@ -464,7 +463,7 @@ function setAllAttribs(elm) {
function getSelectValue(form_obj, field_name) {
var elm = form_obj.elements[field_name];
- if (elm == null || elm.options == null)
+ if (!elm || elm.options == null || elm.selectedIndex == -1)
return "";
return elm.options[elm.selectedIndex].value;
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js
index 31423da17..727beb574 100755
--- a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js
+++ b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js
@@ -1 +1 @@
-(function(){tinymce.create('tinymce.plugins.FullPagePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceFullPageProperties',function(){ed.windowManager.open({file:url+'/fullpage.htm',width:430+parseInt(ed.getLang('fullpage.delta_width',0)),height:495+parseInt(ed.getLang('fullpage.delta_height',0)),inline:1},{plugin_url:url,head_html:t.head});});ed.addButton('fullpage',{title:'fullpage.desc',cmd:'mceFullPageProperties'});ed.onBeforeSetContent.add(t._setContent,t);ed.onSetContent.add(t._setBodyAttribs,t);ed.onGetContent.add(t._getContent,t);},getInfo:function(){return{longname:'Fullpage',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_setBodyAttribs:function(ed,o){var bdattr,i,len,kv,k,v,t,attr=this.head.match(/body(.*?)>/i);if(attr&&attr[1]){bdattr=attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);for(i=0,len=bdattr.length;i',sp);t.head=c.substring(0,sp+1);ep=c.indexOf(' \n';t.foot='\n