Skip to content

Commit

Permalink
Merge branch 'rails3' of git://github.com/resolve/refinerycms into ra…
Browse files Browse the repository at this point in the history
…ils3
  • Loading branch information
jgdavey committed Aug 7, 2010
2 parents bb40aa6 + b9d82bc commit f710f0d
Show file tree
Hide file tree
Showing 120 changed files with 1,113 additions and 168 deletions.
8 changes: 4 additions & 4 deletions Gemfile
Expand Up @@ -19,6 +19,9 @@ gem 'sqlite3-ruby', '~>1.2.5', :require => 'sqlite3' # db_adapter=sqlite3
# gem 'aws-s3'

# REFINERY CMS ================================================================
# Add i18n support
gem 'routing-filter'

# Use the default Refinery CMS Engines:
gem 'refinerycms', :path => '.'

Expand Down Expand Up @@ -48,9 +51,7 @@ gem 'will_paginate', '3.0.pre2',
# REFINERY CMS ================================================================

group :test do
gem 'json_pure', :require => 'json/pure',
:git => 'git://github.com/parndt/json.git',
:branch => 'master'
gem 'json_pure', '= 1.4.5', :require => 'json/pure'

gem 'rspec', RSPEC_VERSION
gem 'rspec-core', RSPEC_VERSION, :require => 'rspec/core'
Expand All @@ -68,4 +69,3 @@ group :test do
gem 'factory_girl'
gem 'ruby-prof'
end

13 changes: 5 additions & 8 deletions Gemfile.lock
Expand Up @@ -13,13 +13,6 @@ GIT
dragonfly (0.6.2)
rack

GIT
remote: git://github.com/parndt/json.git
revision: 34ad345
branch: master
specs:
json_pure (1.4.3)

PATH
remote: .
specs:
Expand Down Expand Up @@ -130,6 +123,7 @@ GEM
rake (>= 0.8.7)
rubyforge (>= 2.0.4)
i18n (0.4.1)
json_pure (1.4.5)
launchy (0.3.7)
configuration (>= 0.0.5)
rake (>= 0.8.1)
Expand Down Expand Up @@ -162,6 +156,8 @@ GEM
thor (~> 0.14.0)
rake (0.8.7)
rmagick (2.12.2)
routing-filter (0.1.6)
actionpack
rspec (2.0.0.beta.19)
rspec-core (= 2.0.0.beta.19)
rspec-expectations (= 2.0.0.beta.19)
Expand Down Expand Up @@ -208,10 +204,11 @@ DEPENDENCIES
dragonfly!
factory_girl
gherkin
json_pure!
json_pure (= 1.4.5)
launchy
refinerycms!
rmagick (~> 2.12.0)
routing-filter
rspec (~> 2.0.0.beta.19)
rspec-core (~> 2.0.0.beta.19)
rspec-expectations (~> 2.0.0.beta.19)
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -7,4 +7,4 @@ require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/refinery'
Rails::Application.load_tasks
Refinery::Application.load_tasks
2 changes: 1 addition & 1 deletion authentication/app/views/admin/users/_form.html.erb
Expand Up @@ -11,7 +11,7 @@
<div class='field'>
<%= f.label :password %>
<%= f.password_field :password, :autocomplete => 'off' %>
<%= "<br /><span class='preview'>#{t('.blank_password_keeps_current')}</span>" unless @user.new_record? %>
<%= "<br /><span class='preview'>#{t('.blank_password_keeps_current')}</span>".html_safe unless @user.new_record? %>
</div>
<div class='field'>
<%= f.label :password_confirmation %>
Expand Down
2 changes: 1 addition & 1 deletion authentication/config/routes.rb
@@ -1,4 +1,4 @@
Rails::Application.routes.draw do
Refinery::Application.routes.draw do

resource :session
match '/users/reset/:reset_code', :to => 'users#reset', :as => 'reset_users'
Expand Down
11 changes: 8 additions & 3 deletions changelog.md
@@ -1,17 +1,22 @@
## 0.9.7.11 [unreleased]
## 0.9.7.11 [07 August 2010]
* Removed ``app/controllers/application.rb`` due to its serious deprecation. Fixed deprecations in how we use acts_as_indexed. [Philip Arndt](http://github.com/parndt)
* Added passing cucumber features for search for: [Uģis Ozols](http://github.com/ugisozols)
- Images
- Files
- Inquiries
- Pages
* Moved HTML5 enabling script to a partial so that IE always runs it first. [Philip Arndt](http://github.com/parndt)
* Fixed some invalid HTML [Bo Frederiksen](http://github.com/bofrede) and [Philip Arndt](http://github.com/parndt)
* Fixed some invalid HTML. [Bo Frederiksen](http://github.com/bofrede)
* Added Danish translation for WYMeditor. [Bo Frederiksen](http://github.com/bofrede)
* Fixes for Tooltips [Philip Arndt](http://github.com/parndt)
- Tooltips were not showing in dialogues, they now are.
- Tooltips would not position properly above links, they now do.
- The Tooltips' nibs (the arrow) would not sit properly centered above the element if the tooltip had to move for the browser window size, they now do.
* [See full list](http://github.com/resolve/refinerycms/compare/0.9.7.10...master)
* Lots of fixes for translations. [Uģis Ozols](http://github.com/ugisozols)
* Fix XSS vulnerability on page meta information by escaping the relevant fields properly [David Jones](http://github.com/djones)
* Ensure that the generator script grabs the first attribute that is a string, not just the first attribute, when choosing the field for Dashboard activity. [Joe Sak](http://github.com/joemsak)
* Updated ``json-pure`` to ``1.4.5``, now using the actual gem [Philip Arndt](http://github.com/parndt)
* [See full list](http://github.com/resolve/refinerycms/compare/0.9.7.10...0.9.7.11)


## 0.9.7.10 [02 August 2010]
Expand Down
2 changes: 1 addition & 1 deletion config.ru
Expand Up @@ -5,4 +5,4 @@ require ::File.expand_path('../config/environment', __FILE__)
# use Rack::ShowExceptions
# use Rack::Lint

run Refinerycms::Application
run Refinery::Application
3 changes: 1 addition & 2 deletions config/application.rb
@@ -1,14 +1,13 @@
require File.expand_path('../boot', __FILE__)


require 'rails/all'

# Auto-require default libraries and those for the current Rails environment.
Bundler.require :default, Rails.env

require 'refinery/all'

module Refinerycms
module Refinery
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down
2 changes: 1 addition & 1 deletion config/environment.rb
Expand Up @@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)

# Initialize the rails application
Refinerycms::Application.initialize!
Refinery::Application.initialize!
4 changes: 3 additions & 1 deletion config/environments/development.rb
@@ -1,4 +1,4 @@
Refinerycms::Application.configure do
Refinery::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
config.reload_plugins = true

Expand All @@ -19,4 +19,6 @@
config.action_mailer.raise_delivery_errors = false

config.log_level = :debug

config.active_support.deprecation = :log
end
24 changes: 23 additions & 1 deletion config/environments/production.rb
@@ -1,4 +1,4 @@
Refinerycms::Application.configure do
Refinery::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb

# The production environment is meant for finished, "live" apps.
Expand Down Expand Up @@ -30,6 +30,28 @@

# Enable threaded mode
# config.threadsafe!

config.active_support.deprecation = :log

config.after_initialize do
# override translate, but only in production
::I18n.module_eval do
class << self
alias_method :original_rails_i18n_translate, :translate
def translate(key, options = {})
begin
original_rails_i18n_translate(key, options.merge!({:raise => true}))
rescue ::I18n::MissingTranslationData => e
if self.config.locale != ::Refinery::I18n.default_locale
self.translate(key, options.update(:locale => ::Refinery::I18n.default_locale))
else
raise e
end
end
end
end
end
end
end

# When true will use Amazon's Simple Storage Service on your production machine
Expand Down
4 changes: 3 additions & 1 deletion config/environments/test.rb
@@ -1,4 +1,4 @@
Refinerycms::Application.configure do
Refinery::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb

# The test environment is used exclusively to run your application's
Expand Down Expand Up @@ -26,4 +26,6 @@
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql

config.active_support.deprecation = :stderr
end
2 changes: 1 addition & 1 deletion config/initializers/field_with_error_fix.rb
@@ -1,3 +1,3 @@
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
"<span class=\"fieldWithErrors\">#{html_tag}</span>"
"<span class=\"fieldWithErrors\">#{html_tag}</span>".html_safe
end
7 changes: 4 additions & 3 deletions config/routes.rb
@@ -1,7 +1,7 @@
Refinerycms::Application.routes.draw do |map|
Refinery::Application.routes.draw do |map|

# FIXME for Rails 3 + i18n
# map.filter(:locale)
filter(:refinery_locales)

# The priority is based upon order of creation:
# first created -> highest priority.
Expand Down Expand Up @@ -71,8 +71,9 @@

# Install the default routes as the lowest priority.

match 'admin' => redirect('/refinery')
match 'admin/*path' => redirect('/refinery/%{path}')
# match 'refinery/*path' => 'admin/base#error_404'
match 'refinery/*path' => 'admin/base#error_404'

# Marketable URLs should be appended to routes by the Pages Engine.

Expand Down
1 change: 1 addition & 0 deletions core/app/views/admin/_head.html.erb
Expand Up @@ -29,6 +29,7 @@ if request.env['HTTP_USER_AGENT'] =~ /MSIE/%>
'jquery/jquery.textTruncate.js',
'jquery/jquery.html5-placeholder-shim.js',
'jquery/jquery.timers.js',
'jquery/jquery.jcarousel.js',
:cache => (js_caching ? "cache/jquery-plugins" : false) %>
<%= javascript_include_tag 'refinery/i18n' %>
Expand Down
12 changes: 8 additions & 4 deletions core/app/views/shared/_content_page.html.erb
Expand Up @@ -5,17 +5,21 @@

sections = [
{:yield => :body_content_title, :fallback => page_title, :id => 'body_content_page_title', :title => true},
{:yield => :body_content_left, :fallback => @page.present? ? @page[:body] : nil},
{:yield => :body_content_right, :fallback => @page.present? ? @page[:side_body] : nil}
{:yield => :body_content_left, :fallback => (@page.present? ? @page[:body] : nil)},
{:yield => :body_content_right, :fallback => (@page.present? ? @page[:side_body] : nil)}
].reject {|section| hide_sections.include?(section[:yield]) }

css = []
sections.each do |section|
dom_id = (section[:id] ||= section[:yield].to_s)
section[:html] = (yield(section[:yield]))

if section[:html].blank? and !show_empty_sections and !remove_automatic_sections and section.keys.include?(:fallback)
section[:html] = section[:fallback].html_safe
if section[:html].blank? and
!show_empty_sections and
!remove_automatic_sections and
section.keys.include?(:fallback) and
section[:fallback].present?
section[:html] = section[:fallback].to_s.html_safe
end

unless section[:html].blank?
Expand Down
4 changes: 2 additions & 2 deletions core/app/views/shared/_head.html.erb
Expand Up @@ -10,8 +10,8 @@
<%= "<!--[if IE 7]>#{stylesheet_link_tag 'ie7'}<![endif]-->" if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
<link rel="shortcut icon" href="/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%= "<meta name=\"keywords\" content=\"#{h @meta.meta_keywords}\" />" if @meta.meta_keywords.present? %>
<%= "<meta name=\"description\" content=\"#{h @meta.meta_description}\" />" if @meta.meta_description.present? -%>
<%= "<meta name=\"keywords\" content=\"#{h @meta.meta_keywords}\" />".html_safe if @meta.meta_keywords.present? %>
<%= "<meta name=\"description\" content=\"#{h @meta.meta_description}\" />".html_safe if @meta.meta_description.present? -%>
<%= yield :head_libraries %>
<%= yield :head %>
</head>
6 changes: 5 additions & 1 deletion core/app/views/shared/_header.html.erb
@@ -1,4 +1,8 @@
<div id='header_content'>
<h1><%= link_to RefinerySetting[:site_name], root_url(:only_path => true) %></h1>
<%= render :partial => "/shared/menu" %>
<%= render :partial => "/shared/menu",
:locals => {
:dom_id => 'menu',
:css => 'menu'
} -%>
</div>
5 changes: 0 additions & 5 deletions core/app/views/shared/_language_switcher.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion core/app/views/shared/_menu_branch.html.erb
Expand Up @@ -6,7 +6,6 @@
<%= link_to menu_branch.title, menu_branch.url %>
<% unless hide_children or
menu_branch.parent_id.present? or
(children = menu_branch.children.reject{|c| !c.in_menu?}).empty? %>
<nav class='clearfix'>
<%=
Expand Down
6 changes: 3 additions & 3 deletions core/app/views/shared/admin/_continue_editing.html.erb
@@ -1,3 +1,3 @@
<% unless f.object.new_record? -%>
<%= f.submit t('.save_and_continue_editing'), :id => "submit_continue_button", :class => "wymupdate button" %>
<% end -%>
<%= f.submit t('.save_and_continue_editing'),
:id => "submit_continue_button",
:class => "wymupdate button" unless f.object.new_record? %>
3 changes: 2 additions & 1 deletion core/app/views/welcome.html.erb
Expand Up @@ -11,6 +11,7 @@

<div class='form-actions'>
<div class='form-actions-left'>
<%= button_to t('.continue'), new_user_url %>
<%= link_to t('.continue'), new_user_url(:only_path => true),
:class => 'button' %>
</div>
</div>
2 changes: 1 addition & 1 deletion core/config/locales/en.yml
Expand Up @@ -32,7 +32,7 @@ en:
message:
close: Close
continue_editing:
save_and_continue_editing: "Save &amp; continue editing"
save_and_continue_editing: "Save & continue editing"
form_actions:
or: or
save: Save
Expand Down
2 changes: 1 addition & 1 deletion core/config/routes.rb
@@ -1,4 +1,4 @@
Rails::Application.routes.draw do
Refinery::Application.routes.draw do

match 'wymiframe/:id', :to => 'refinery/fast#wymiframe', :as => :wymiframe

Expand Down
@@ -1,4 +1,4 @@
Rails::Application.routes.draw do
Refinery::Application.routes.draw do
resources :<%= class_name.pluralize.underscore.downcase %>

scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
Expand Down
4 changes: 2 additions & 2 deletions core/lib/refinery.rb
Expand Up @@ -59,8 +59,8 @@ def self.to_s
# this tells refinery where this plugin is located on the filesystem and helps with urls.
# plugin.directory = directory
end
#require_dependency 'refinery/form_helpers'
#require_dependency 'refinery/base_presenter'
require_dependency 'refinery/form_helpers'
require_dependency 'refinery/base_presenter'

RefineryEngine.class_eval do
config.autoload_paths += %W( #{config.root}/lib )
Expand Down

0 comments on commit f710f0d

Please sign in to comment.