Skip to content

Commit

Permalink
Merge branch 'master' into enhancement_upgraded_authorizable_plugin
Browse files Browse the repository at this point in the history
* master: (38 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: moved the valid actions check from application.rhtml to the uses_tiny_mce declaration, removed unneeded convertWord function
  refinement: many more tabindexs for the most popular used forms. Some inconsistancies, but overall, tabbing works more smoothly now
  refinement: updates to the way tinymce is initilized (less logic, same effect). Moved configuration options to an initializer
  update: updating tiny_mce plugin via piston update (and used update rake task to update public/javascripts/tiny_mce  folder)
  bugfix: updating files nessesary for starting/stopping backgroundrb, added missing column through migrations
  update: updating backgroundrb plugin using piston update
  ...
  • Loading branch information
Walter McGinnis committed Oct 16, 2008
2 parents c728930 + 2581c74 commit 5ad3462
Show file tree
Hide file tree
Showing 222 changed files with 4,991 additions and 3,225 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
15 changes: 15 additions & 0 deletions UPGRADE
Expand Up @@ -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".
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/account_controller.rb
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/application.rb
Expand Up @@ -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)
Expand Down 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
33 changes: 10 additions & 23 deletions 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
Expand Down Expand Up @@ -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
25 changes: 2 additions & 23 deletions app/controllers/importers_controller.rb
Expand Up @@ -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
Expand Down
17 changes: 12 additions & 5 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 @@ -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'}
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/controllers/members_controller.rb
Expand Up @@ -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'
Expand Down
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
25 changes: 2 additions & 23 deletions app/controllers/topics_controller.rb
Expand Up @@ -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
Expand Down

0 comments on commit 5ad3462

Please sign in to comment.