Skip to content

Commit

Permalink
Merge branch 'master' into enhancement_lh_81_abbr_on_table_headers
Browse files Browse the repository at this point in the history
* master: (28 commits)
  bugfix: tabbing was missing the 'move to another basket' select because of incorrect options setup
  bugfix: fixed syntax error where ) was too early in link_to call
  refinement: adding safari text size control notes
  bugfix: fixed a error 500 when page=0, fixed massive cpu spike when current_page was too high (merged from 1-1-stable - 85c712f)
  bugfix: was missing the nessesary code for refining searches of related items (it was making a new search instead). Merged in from 1-1-stable.
  bugfix: updated redbox via piston from github, edited CSS to fix IE6 and IE7 issues
  bugfix: the new accessibility topic wasn't being assigned a contributor on install/upgrade or version on install
  refinement: forgot a few steps needed when upgrading to the latest code
  removing robots.txt file so it's built when first requested, instead of serving up the stale file
  refinement: make sure we have the correct versions of gems needed to run Kete
  update: updating backgroundrb to release 1.1 (requires packet 0.1.14 or higher)
  bugfix: when a text based captcha failed, it would leave an aditional div closing tag, causing an xml parsing error
  refinement: #84 - adding exipermental support for exported xml directly from past perfect 4, rather than only through a third party dbf export tool\n [#84 status:open responsible:walter]
  refinement: make sure we add the new accessibility topic to an existing Kete installation on upgrade
  refinement: many more tabindexs for the most popular used forms. Some inconsistancies, but overall, tabbing works more smoothly now
  bugfix: updating files nessesary for starting/stopping backgroundrb, added missing column through migrations
  update: updating backgroundrb plugin using piston update
  enhancement: added tabindex's to topic new/edit form, and the menus surrounding it
  update: added options params to acts_as_licensed radio_button_for_license_selection method
  refinement: changing search field to match previous behaviour
  ...
  • Loading branch information
Walter McGinnis committed Oct 16, 2008
2 parents 0616202 + 2581c74 commit 4e13807
Show file tree
Hide file tree
Showing 125 changed files with 1,694 additions and 797 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions UPGRADE
Expand Up @@ -39,6 +39,15 @@ Due to a missing configuration in the Capistrano deployment recipes, private fil
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".
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application.rb
Expand Up @@ -853,7 +853,7 @@ def rss_tag(options = { })
if auto_detect
tag += "\" />"
else
tag += "\">" # A tag has a closing </a>
tag += "tabindex='1' \">" # A tag has a closing </a>
end
end

Expand Down
8 changes: 8 additions & 0 deletions app/controllers/baskets_controller.rb
Expand Up @@ -7,6 +7,7 @@ class BasketsController < ApplicationController
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
Expand Down Expand Up @@ -246,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
10 changes: 10 additions & 0 deletions 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)
Expand Down Expand Up @@ -239,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
32 changes: 22 additions & 10 deletions app/controllers/search_controller.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'] }

Expand Down
37 changes: 20 additions & 17 deletions app/helpers/application_helper.rb
Expand Up @@ -31,7 +31,7 @@ def header_links_to_baskets
if baskets_limit < total_baskets_count
html += '<li>' + link_to_unless_current('more...',
url_for(:urlified_name => @site_basket.urlified_name,
:controller => 'baskets' )) + '</li>'
:controller => 'baskets' ), {:tabindex => '2'}) + '</li>'
end

html += '</ul>'
Expand All @@ -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
Expand All @@ -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 + '</li>'
:trailing_slash => true}, {:tabindex => '2'} ) + current_basket_html + '</li>'
end

def header_add_links
Expand All @@ -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 + '</li>'
:urlified_name => @site_basket.urlified_name},
{:tabindex => '2'}) + current_basket_html + '</li>'
end


Expand Down Expand Up @@ -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 += '</ul>'
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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={})
Expand All @@ -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={})
Expand Down Expand Up @@ -438,7 +441,7 @@ def tags_for(item)

def tags_input_field(form,label_for)
"<div class=\"form-element\"><label for=\"#{label_for}\">Tags (separated by commas):</label>
#{form.text_field :tag_list}</div>"
#{form.text_field :tag_list, :tabindex => '1'}</div>"
end

#---- related to extended_fields for either topic_types or content_types
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/baskets_helper.rb
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions app/helpers/search_helper.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/account/_userForm.rhtml
Expand Up @@ -2,6 +2,6 @@
<!--[form:user]-->
<!-- Incluide all custom fields here -->
<p><label for="user_email">Email Address</label><br/>
<%= text_field 'user', 'email' %>
<%= text_field 'user', 'email', :tabindex => '1' %>
<%= </p>
<!--[eoform:user]-->
4 changes: 2 additions & 2 deletions app/views/account/activate.rhtml
Expand Up @@ -7,12 +7,12 @@
<!--[form:activate]-->
<div class="form-element">
<label for="activation_code">Activation Code</label>
<%= text_field_tag(:activation_code, params[:activation_code], :size=>50 ) %>
<%= text_field_tag(:activation_code, params[:activation_code], {:size=>50, :tabindex => '1'} ) %>
</div>
<!--[eoform:activate]-->
</fieldset>

<%= submit_tag 'Activate' %>
<%= submit_tag 'Activate', :tabindex => '1' %>
<% end %>

8 changes: 4 additions & 4 deletions app/views/account/change_password.rhtml
Expand Up @@ -6,17 +6,17 @@
<fieldset>

<p><label for="old_password">Old Password</label><br/>
<%= password_field_tag 'old_password', @old_password %></p>
<%= password_field_tag 'old_password', @old_password, :tabindex => '1' %></p>

<p><label for="password">Password</label><br/>
<%= password_field_tag 'password' %></p>
<%= password_field_tag 'password', nil, :tabindex => '1' %></p>

<p><label for="password_confirmation">Confirm Password</label><br/>
<%= password_field_tag 'password_confirmation' %></p>
<%= password_field_tag 'password_confirmation', nil, :tabindex => '1' %></p>

</fieldset>

<p><%= submit_tag 'Change password' %></p>
<p><%= submit_tag 'Change password', :tabindex => '1' %></p>
<% end %>
<%= render(:partial => "topics/content_wrapper_end" ) %>
8 changes: 4 additions & 4 deletions app/views/account/edit.rhtml
Expand Up @@ -9,11 +9,11 @@
<%= error_messages_for :user %>

<div class="form-element">
<label for="user_login">Login</label> <%= f.text_field :login %>
<label for="user_login">Login</label> <%= f.text_field :login, :tabindex => '1' %>
<div class="form_example">Your username must be unique and contain no spaces. You will be asked for this and your password everytime you login. If your names is "John Smith" then you could use "jsmith" as your login.</div>
</div>
<div class="form-element">
<label for="user_email">Email</label> <%= f.text_field :email %>
<label for="user_email">Email</label> <%= f.text_field :email, :tabindex => '1' %>
</div>

<div class="form-element">
Expand All @@ -34,13 +34,13 @@

</fieldset>

<div class="wrap"><%= submit_tag 'Save' %></div>
<div class="wrap"><%= submit_tag 'Save', :tabindex => '1' %></div>

<% end -%>

<div class="detail-tools">
<ul>
<li class="first"><%= link_to 'Change Password', :action => 'change_password' %></li>
<li class="first"><%= link_to 'Change Password', {:action => 'change_password'}, :tabindex => '1' %></li>
</ul>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/views/account/forgot_password.rhtml
Expand Up @@ -7,12 +7,12 @@
<!--[form:reset_password]-->
<div class="form-element">
<label for="user_email">What is the email address used to create your account?</label>
<%= form.text_field :email, :size => 50 %>
<%= form.text_field :email, {:size => 50, :tabindex => '1'} %>
</div>
<p>&nbsp;</p>
<!--[eoform:reset_password]-->
</fieldset>
<div class="wrap"><%= submit_tag "Request Password" %></div>
<div class="wrap"><%= submit_tag "Request Password", :tabindex => '1' %></div>
<% end %>
<%= render(:partial => "topics/content_wrapper_end" ) %>

0 comments on commit 4e13807

Please sign in to comment.