Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: resolve/refinerycms
...
head fork: resolve/refinerycms
Checking mergeability… Don't worry, you can still create the pull request.
  • 15 commits
  • 27 files changed
  • 0 commit comments
  • 3 contributors
Commits on Mar 08, 2011
@simi simi Added option per_page to crudify used in administration only b1fa9fc
@parndt parndt Merged + whitespaced. e2524ef
@parndt parndt Deprecated the rake refinery:update task in favour of rails generate …
…refinerycms --update which handles migrations correctly.
1d09aed
@parndt parndt Added options[:database][:skip] which relates to --skip-db to cause t…
…he installer not to run any database tasks (or subsequently rails generate refinerycms task). Defaults to false to maintain current functionality. Closes GH-512
a0c2665
@parndt parndt Documented the recent changes in the changelog. 6c7d61b
@parndt parndt Exchanged (help) links for the information.png 'refinery icon'. This …
…will happen automatically if you used refinery_help_tag.
d239bba
Commits on Mar 09, 2011
@hone hone looser bundler dependency like rails3
bundler 1.x promises to be backwards compatible with 1.0.
31efad0
@hone hone update the bundler dependency for gemspec.rb as well 5ace097
@parndt parndt Ensure :per_page has a default value and that it will either evaluate…
… to true or false not, say, 20.
c4def61
@parndt parndt Ordered the default attributes in crudify alphabetically. edc21fe
@parndt parndt Apparently I fail at alphabet. I comes before O. fb5827b
@parndt parndt Added xhr_paging as an option in crudify which handles the server-sid…
…e usage of the HTML5 History API (or some other thing that's requesting the index page via xhr request).
06fe0fb
@parndt parndt Updated refinerycms-i18n to 0.9.9.12 - Closes GH-515 769752f
@parndt parndt Implemented non-cached html5 pagination which doesn't have the browse…
…r bugs we used to have. Closes GH-425
f1b0483
@parndt parndt 0.9.9.7 may be identical to 1.0.0 - Can everybody PLEASE test this ve…
…rsion in all platforms and all browsers that they can to track down any lingering bugs since releasing a buggy 1.0.0 is embarrassing ;-) If we think of anything else that should go into 1.0.0 then we'll just keep pushing new versions until everybody agrees.
e1b5a4e
Showing with 236 additions and 205 deletions.
  1. +1 −1  Gemfile
  2. +31 −31 Gemfile.lock
  3. +4 −8 authentication/app/controllers/admin/users_controller.rb
  4. +3 −3 authentication/refinerycms-authentication.gemspec
  5. +1 −1  base/lib/refinery/version.rb
  6. +2 −2 base/refinerycms-base.gemspec
  7. +58 −37 bin/refinerycms
  8. +10 −0 changelog.md
  9. +15 −6 core/lib/refinery/crud.rb
  10. +3 −2 core/lib/refinery/helpers/tag_helper.rb
  11. +4 −44 core/lib/tasks/refinery.rake
  12. +31 −9 core/public/javascripts/refinery/admin.js
  13. +7 −1 core/public/stylesheets/refinery/refinery.css
  14. +4 −4 core/refinerycms-core.gemspec
  15. +3 −3 dashboard/refinerycms-dashboard.gemspec
  16. +23 −0 doc/crud.md
  17. +2 −8 images/app/controllers/admin/images_controller.rb
  18. +3 −3 images/refinerycms-images.gemspec
  19. +1 −1  lib/gemspec.rb
  20. +1 −1  lib/refinerycms.rb
  21. +3 −3 pages/refinerycms-pages.gemspec
  22. +11 −12 refinerycms.gemspec
  23. +4 −8 resources/app/controllers/admin/resources_controller.rb
  24. +3 −3 resources/refinerycms-resources.gemspec
  25. +2 −8 settings/app/controllers/admin/refinery_settings_controller.rb
  26. +3 −3 settings/refinerycms-settings.gemspec
  27. +3 −3 testing/refinerycms-testing.gemspec
View
2  Gemfile
@@ -53,5 +53,5 @@ end
# gem 'refinerycms-page-images, '~> 1.0
# Add i18n support (optional, you can remove this if you really want to).
-gem 'refinerycms-i18n', '~> 0.9.9.11'
+gem 'refinerycms-i18n', '~> 0.9.9.12'
# END USER DEFINED
View
62 Gemfile.lock
@@ -1,47 +1,47 @@
PATH
remote: .
specs:
- refinerycms (0.9.9.5)
- bundler (~> 1.0.10)
- refinerycms-authentication (~> 0.9.9.5)
- refinerycms-base (~> 0.9.9.5)
- refinerycms-core (~> 0.9.9.5)
- refinerycms-dashboard (~> 0.9.9.5)
- refinerycms-images (~> 0.9.9.5)
- refinerycms-pages (~> 0.9.9.5)
- refinerycms-resources (~> 0.9.9.5)
- refinerycms-settings (~> 0.9.9.5)
- refinerycms-authentication (0.9.9.5)
+ refinerycms (0.9.9.7)
+ bundler (~> 1.0)
+ refinerycms-authentication (~> 0.9.9.7)
+ refinerycms-base (~> 0.9.9.7)
+ refinerycms-core (~> 0.9.9.7)
+ refinerycms-dashboard (~> 0.9.9.7)
+ refinerycms-images (~> 0.9.9.7)
+ refinerycms-pages (~> 0.9.9.7)
+ refinerycms-resources (~> 0.9.9.7)
+ refinerycms-settings (~> 0.9.9.7)
+ refinerycms-authentication (0.9.9.7)
devise (~> 1.1)
- refinerycms-core (~> 0.9.9.5)
- refinerycms-base (0.9.9.5)
- refinerycms-core (0.9.9.5)
+ refinerycms-core (~> 0.9.9.7)
+ refinerycms-base (0.9.9.7)
+ refinerycms-core (0.9.9.7)
acts_as_indexed (~> 0.7)
friendly_id_globalize3 (~> 3.2.1)
globalize3 (>= 0.1.0.beta)
moretea-awesome_nested_set (= 1.4.3.1)
rails (~> 3.0.5)
rdoc (>= 2.5.11)
- refinerycms-base (~> 0.9.9.5)
+ refinerycms-base (~> 0.9.9.7)
refinerycms-generators (~> 0.9.9.3)
- refinerycms-settings (~> 0.9.9.5)
+ refinerycms-settings (~> 0.9.9.7)
truncate_html (~> 0.5)
will_paginate (~> 3.0.pre)
- refinerycms-dashboard (0.9.9.5)
- refinerycms-core (~> 0.9.9.5)
- refinerycms-images (0.9.9.5)
+ refinerycms-dashboard (0.9.9.7)
+ refinerycms-core (~> 0.9.9.7)
+ refinerycms-images (0.9.9.7)
dragonfly (~> 0.8.2)
rack-cache (>= 0.5.3)
- refinerycms-core (~> 0.9.9.5)
- refinerycms-pages (0.9.9.5)
- refinerycms-core (~> 0.9.9.5)
- refinerycms-resources (0.9.9.5)
+ refinerycms-core (~> 0.9.9.7)
+ refinerycms-pages (0.9.9.7)
+ refinerycms-core (~> 0.9.9.7)
+ refinerycms-resources (0.9.9.7)
dragonfly (~> 0.8.2)
rack-cache (>= 0.5.3)
- refinerycms-core (~> 0.9.9.5)
- refinerycms-settings (0.9.9.5)
- refinerycms-base (~> 0.9.9.5)
- refinerycms-testing (0.9.9.5)
+ refinerycms-core (~> 0.9.9.7)
+ refinerycms-settings (0.9.9.7)
+ refinerycms-base (~> 0.9.9.7)
+ refinerycms-testing (0.9.9.7)
autotest
autotest-notification
autotest-rails
@@ -54,7 +54,7 @@ PATH
json_pure
launchy
rack-test (~> 0.5.6)
- refinerycms-core (~> 0.9.9.5)
+ refinerycms-core (~> 0.9.9.7)
rspec-rails (~> 2.5)
GEM
@@ -121,7 +121,7 @@ GEM
cucumber-rails (0.3.2)
cucumber (>= 0.8.0)
culerity (0.2.15)
- database_cleaner (0.6.4)
+ database_cleaner (0.6.5)
devise (1.1.7)
bcrypt-ruby (~> 2.1.2)
warden (~> 1.0.2)
@@ -179,7 +179,7 @@ GEM
rake (0.8.7)
rdoc (3.5.3)
refinerycms-generators (0.9.9.6)
- refinerycms-i18n (0.9.9.11)
+ refinerycms-i18n (0.9.9.12)
refinerycms (>= 0.9.8)
routing-filter (>= 0.2.3)
routing-filter (0.2.3)
@@ -221,6 +221,6 @@ PLATFORMS
DEPENDENCIES
refinerycms!
- refinerycms-i18n (~> 0.9.9.11)
+ refinerycms-i18n (~> 0.9.9.12)
refinerycms-testing (~> 0.9.9.5)
sqlite3
View
12 authentication/app/controllers/admin/users_controller.rb
@@ -1,17 +1,13 @@
module Admin
class UsersController < Admin::BaseController
- crudify :user, :order => 'username ASC', :title_attribute => 'username'
+ crudify :user,
+ :order => 'username ASC',
+ :title_attribute => 'username',
+ :xhr_paging => true
before_filter :load_available_plugins_and_roles, :only => [:new, :create, :edit, :update]
- def index
- search_all_users if searching?
- paginate_all_users
-
- render :partial => 'users' if request.xhr?
- end
-
def new
@user = User.new
@selected_plugin_names = []
View
6 authentication/refinerycms-authentication.gemspec
@@ -2,10 +2,10 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-authentication}
- s.version = %q{0.9.9.5}
+ s.version = %q{0.9.9.7}
s.summary = %q{Authentication engine for Refinery CMS}
s.description = %q{The default authentication engine for Refinery CMS}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.require_paths = %w(lib)
s.executables = %w()
- s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
+ s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
s.add_dependency 'devise', '~> 1.1'
s.files = [
View
2  base/lib/refinery/version.rb
@@ -3,7 +3,7 @@ class Version
@major = 0
@minor = 9
@tiny = 9
- @build = 6
+ @build = 7
class << self
attr_reader :major, :minor, :tiny, :build
View
4 base/refinerycms-base.gemspec
@@ -2,10 +2,10 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-base}
- s.version = %q{0.9.9.6}
+ s.version = %q{0.9.9.7}
s.summary = %q{Base engine for Refinery CMS}
s.description = %q{The basic base for Refinery CMS Refinery CMS}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
View
95 bin/refinerycms
@@ -28,17 +28,18 @@ module Refinery
# Default options
@input = input
@options = {
+ :confirm => false,
:database => {
:adapter => 'sqlite3',
:ident => false,
+ :password => nil,
:username => 'root',
- :password => nil
+ :skip => false
},
- :force => false,
- :heroku => false,
:duostack => false,
- :confirm => false,
- :gems => []
+ :force => false,
+ :gems => [],
+ :heroku => false
}
@optparse = OptionParser.new do |opts|
@@ -77,6 +78,10 @@ module Refinery
@options[:database][:password] = password
end
+ opts.on('--skip-db', "Skip any database creation or migration tasks") do
+ @options[:database][:skip] = true
+ end
+
opts.on("-g", "--gems gem1,gem2,gem3", Array, "Additional gems to install") do |gems|
@options[:gems] = gems.reject {|g| g.to_s =~ /^refinerycms/}.map {|g| "gem '#{g.to_s}'"}
end
@@ -122,27 +127,29 @@ module Refinery
# Bundle the application which activates Refinery CMS
bundle!
- # Ensure the database exists so that queries like .table_exists? don't fail.
- puts "\nCreating a new database.."
- # Warn about incorrect username or password.
- unless @options[:database][:adapter] == 'sqlite3'
- if @options[:database][:ident]
- note = "NOTE: If ident authentication fails then the installer will stall or fail here.\n\n"
- else
- note = "NOTE: if your database username is not '#{@options[:database][:username]}'"
- note << " or your password is not '#{@options[:database][:password]}' then the installer will stall here.\n\n"
+ unless @options[:database][:skip]
+ # Ensure the database exists so that queries like .table_exists? don't fail.
+ puts "\nCreating a new database.."
+ # Warn about incorrect username or password.
+ unless @options[:database][:adapter] == 'sqlite3'
+ if @options[:database][:ident]
+ note = "NOTE: If ident authentication fails then the installer will stall or fail here.\n\n"
+ else
+ note = "NOTE: if your database username is not '#{@options[:database][:username]}'"
+ note << " or your password is not '#{@options[:database][:password]}' then the installer will stall here.\n\n"
+ end
+ puts note
end
- puts note
+ run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:create", {
+ :fail => "Unable to create the application's database"
+ })
+
+ # Run the newly activated Refinery CMS generator.
+ run_command("rails generate refinerycms", {
+ :cd => true,
+ :fail => "Could not run the refinerycms generator successfully."
+ })
end
- run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:create", {
- :fail => "Unable to create the application's database"
- })
-
- # Run the newly activated Refinery CMS generator.
- run_command("rails generate refinerycms", {
- :cd => true,
- :fail => "Could not run the refinerycms generator successfully."
- })
# Output helpful messages to user
output!
@@ -283,8 +290,10 @@ module Refinery
end
def output!
- puts "\n\nSetting up your development database..\n"
- run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:migrate")
+ unless @options[:database][:skip]
+ puts "\n\nSetting up your development database..\n"
+ run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:migrate")
+ end
# Deploy to Heroku
hosting = nil
@@ -310,21 +319,33 @@ module Refinery
end
# End automation
- # Output helpful messages
- puts "\n=== ACTION REQUIRED ==="
- puts "Now you can launch your webserver using:"
- puts "\ncd #{@app_path}"
- puts "rails server"
- puts "\nThis will launch the built-in webserver at port 3000."
- puts "You can now see your site running in your browser at http://localhost:3000"
+ # Construct helpful output messages
+ note = ["\n=== ACTION REQUIRED ==="]
+ if @options[:database][:skip]
+ note << "Because you elected to skip database creation and migration in the installer"
+ note << "you will need to run the following tasks manually to maintain correct operation:"
+ note << "\ncd #{@app_path}"
+ note << "rake db:create"
+ note << "rails generate refinerycms"
+ note << "rake db:migrate"
+ note << "\n---------\n"
+ end
+ note << "Now you can launch your webserver using:"
+ note << "\ncd #{@app_path}"
+ note << "rails server"
+ note << "\nThis will launch the built-in webserver at port 3000."
+ note << "You can now see your site running in your browser at http://localhost:3000"
if @options[:heroku]
- puts "\nIf you want files and images to work on heroku, you will need setup S3:"
- puts "heroku config:add S3_BUCKET=XXXXXXXXX S3_KEY=XXXXXXXXX S3_SECRET=XXXXXXXXXX"
+ note << "\nIf you want files and images to work on heroku, you will need setup S3:"
+ note << "heroku config:add S3_BUCKET=XXXXXXXXX S3_KEY=XXXXXXXXX S3_SECRET=XXXXXXXXXX"
end
- puts "\nThanks for installing Refinery, enjoy creating your new application!"
- puts "---------\n\n"
+ note << "\nThanks for installing Refinery, enjoy creating your new application!"
+ note << "---------\n\n"
+
+ # finally, output.
+ puts note.join("\n")
end
private :validate!, :generate!, :bundle!, :output!
View
10 changelog.md
@@ -1,3 +1,13 @@
+## 0.9.9.7 [10 March 2011]
+
+* Added `:per_page` option to `crudify` for overriding the number of items to display per page with will_paginate. [Josef Šimánek](https://github.com/simi)
+* Deprecated `rake refinery:update` in favour of rails `generate refinerycms --update`. [Philip Arndt](https://github.com/parndt)
+* Added `--skip-db` option to `bin/refinerycms` installer which doesn't automate any database creation/migration and skips the `rails generate refinerycms` generator. [Philip Arndt](https:/github.com/parndt)
+* Exchanged (help) links for the information.png 'refinery icon'. This will happen automatically if you used `refinery_help_tag`. [Philip Arndt](https://github.com/parndt)
+* Added xhr_paging as an option in crudify which handles the server-side usage of the HTML5 History API. [Philip Arndt](https://github.com/parndt)
+* Looser Bundler dependency (now `~> 1.0`). [Terence Lee](https://github.com/hone)
+* [See full list](https://github.com/resolve/refinerycms/compare/0.9.9.6...0.9.9.7)
+
## 0.9.9.6 [7 March 2011]
* Fixed an issue that caused the installer to fail on some systems. [Philip Arndt](https://github.com/parndt)
View
21 core/lib/refinery/crud.rb
@@ -18,15 +18,17 @@ def self.default_options(model_name)
this_class = class_name.constantize.base_class
{
- :title_attribute => "title",
- :order => ('position ASC' if this_class.table_exists? and this_class.column_names.include?('position')),
:conditions => '',
- :sortable => true,
- :searchable => true,
:include => [],
+ :order => ('position ASC' if this_class.table_exists? and this_class.column_names.include?('position')),
:paging => true,
+ :per_page => false,
+ :redirect_to_url => "admin_#{plural_name}_url",
+ :searchable => true,
:search_conditions => '',
- :redirect_to_url => "admin_#{plural_name}_url"
+ :sortable => true,
+ :title_attribute => "title",
+ :xhr_paging => false
}
end
@@ -161,8 +163,11 @@ def paginate_all_#{plural_name}
paging_options = {:page => params[:page]}
+ # Use per_page from crudify options.
+ if #{options[:per_page].present?.inspect}
+ paging_options.update({:per_page => #{options[:per_page].inspect}})
# Seems will_paginate doesn't always use the implicit method.
- if #{class_name}.methods.map(&:to_sym).include?(:per_page)
+ elsif #{class_name}.methods.map(&:to_sym).include?(:per_page)
paging_options.update({:per_page => #{class_name}.per_page})
end
@@ -193,6 +198,8 @@ def search_all_#{plural_name}
def index
search_all_#{plural_name} if searching?
paginate_all_#{plural_name}
+
+ render :partial => '#{plural_name}' if #{options[:xhr_paging].inspect} && request.xhr?
end
)
else
@@ -212,6 +219,8 @@ def index
module_eval %(
def index
paginate_all_#{plural_name}
+
+ render :partial => '#{plural_name}' if #{options[:xhr_paging].inspect} && request.xhr?
end
)
else
View
5 core/lib/refinery/helpers/tag_helper.rb
@@ -2,17 +2,18 @@ module Refinery
module Helpers
module TagHelper
- # Returns <span class='help' title='Your Input'>(help)</span>
+ # Returns <img class='help' tooltip='Your Input' src='refinery/icons/information.png' />
# Remember to wrap your block with <span class='label_with_help'></span> if you're using a label next to the help tag.
def refinery_help_tag(title='')
title = h(title) unless title.html_safe?
- "<span class=\"help\" title=\"#{title}\">(#{t('help', :scope => 'shared.admin')})</span>".html_safe
+ refinery_icon_tag('information', :class => 'help', :tooltip => title)
end
# This is just a quick wrapper to render an image tag that lives inside refinery/icons.
# They are all 16x16 so this is the default but is able to be overriden with supplied options.
def refinery_icon_tag(filename, options = {})
+ filename = "#{filename}.png" unless filename.split('.').many?
image_tag "refinery/icons/#{filename}", {:width => 16, :height => 16}.merge(options)
end
View
48 core/lib/tasks/refinery.rake
@@ -162,50 +162,10 @@ namespace :refinery do
desc "Update the core files with the gem"
task :update => :environment do
- verbose = ENV["verbose"] || false
- require 'fileutils'
-
- # Clean up mistakes
- if (bad_migration = Rails.root.join('db', 'migrate', '20100913234704_add_cached_slug_to_pages.rb')).file?
- FileUtils::rm bad_migration
- end
-
- unless (devise_config = Rails.root.join('config', 'initializers', 'devise.rb')).file?
- devise_config.parent.mkpath
- FileUtils::cp Refinery.roots('core').join(*%w(lib generators templates config initializers devise.rb)),
- devise_config,
- :verbose => verbose
- end
-
- (contents = Rails.root.join('Gemfile').read).gsub!("group :test do", "group :development, :test do")
- Rails.root.join('Gemfile').open("w") do |f|
- f.puts contents
- end
-
- # copy in any new migrations, except for ones that create schemas (this is an update!)
- # or ones that exist already.
- Rails.root.join("db", "migrate").mkpath
- migrations = Pathname.glob(Refinery.roots.map{|r| r.join("db", "migrate", "*.rb")}).reject{|m|
- m.to_s =~ %r{\d+_create_refinerycms_.+?_schema\.rb} or
- Dir[Rails.root.join('db', 'migrate', "*#{m.basename.to_s.split(/\d+_/).last}")].any?
- }
- FileUtils::cp migrations,
- Rails.root.join('db', 'migrate').cleanpath.to_s,
- :verbose => verbose
-
- Rails.root.join("db", "seeds").mkpath
- Pathname.glob(Refinery.roots.map{|r| r.join('db', 'seeds', '*.rb')}).each do |seed|
- unless (destination = Rails.root.join('db', 'seeds', seed.basename)).exist?
- FileUtils::cp seed, destination.to_s, :verbose => verbose
- end
- end
-
- puts "\n" if verbose
-
- unless (ENV["from_installer"] || 'false').to_s == 'true'
- puts "\n=== ACTION REQUIRED ==="
- puts "Please run rake db:migrate to ensure your database is at the correct version.\n"
- end
+ puts "\nThe rake refinery:update task is DEPRECATED."
+ puts "Please use the generator instead:"
+ puts "rails generate refinerycms --update"
+ puts "\n"
end
namespace :cache do
View
40 core/public/javascripts/refinery/admin.js
@@ -13,14 +13,31 @@ if(typeof(window.onpopstate) == "object"){
$(window).bind('popstate', function(e) {
// this fires on initial page load too which we don't need.
if(!initialLoad) {
- $.get(location.href, function(data) {
- $('.pagination_container').slideTo(data);
- });
+ $(document).paginateTo((location.pathname + location.href.split(location.pathname)[1]));
}
initialLoad = false;
});
}
+$.fn.paginateTo = function(stateUrl) {
+ // Grab the url, ensuring not to cache.
+ $.ajax({
+ url: stateUrl,
+ cache: false,
+ success: function(data) {
+ $('.pagination_container').slideTo(data);
+
+ // remove caching _ argument.
+ $('.pagination_container .pagination a').each(function(i, a){
+ $(this).attr('href', $(this).attr('href').replace(/\?\_\=[^&]+&/, '?'));
+ })
+ },
+ failure: function(data) {
+ window.location = popstate_location;
+ }
+ });
+}
+
$.fn.slideTo = function(response) {
$(this).html(response);
$(this).applyMinimumHeightFromChildren();
@@ -46,12 +63,17 @@ init_ajaxy_pagination = function(){
if(typeof(window.history.pushState) == 'function' && $('.pagination_container').length > 0){
var pagination_pages = $('.pagination_container .pagination a');
pagination_pages.live('click',function(e) {
- this.href = (this.href.replace(/(\&(amp\;)?)?from_page\=\d+/, '')
- + '&from_page=' + $(this).parent().find('em').text()).replace('?&', '?');
- history.pushState({ path: this.path }, '', this.href);
- $.get(this.href, function(data) {
- $('.pagination_container').slideTo(data)
- })
+ navigate_to = this.href.replace(/(\&(amp\;)?)?from_page\=\d+/, '');
+ navigate_to += '&from_page=' + $(this).parent().find('em').text();
+ navigate_to = navigate_to.replace('?&', '?');
+
+ var current_state_location = (location.pathname + location.href.split(location.pathname)[1]);
+ window.history.pushState({
+ path: current_state_location
+ }, '', navigate_to);
+
+ $(document).paginateTo(navigate_to);
+
e.preventDefault();
});
}
View
8 core/public/stylesheets/refinery/refinery.css
@@ -1369,9 +1369,15 @@ input.button.close_dialog:active, a.button.close_dialog:active, #content a.butto
.hemisquare small {
font-size: 0.9em;
}
-.label_with_help label, .label_with_help span.help {
+.label_with_help {
+ vertical-align: middle;
+}
+.label_with_help label, .label_with_help span.help, .label_with_help img.help {
display: inline;
}
+.label_with_help img.help {
+ vertical-align: middle;
+}
.label_with_help span.help {
font-weight: normal;
margin-left: 3px;
View
8 core/refinerycms-core.gemspec
@@ -2,10 +2,10 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-core}
- s.version = %q{0.9.9.5}
+ s.version = %q{0.9.9.7}
s.summary = %q{Core engine for Refinery CMS}
s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most engines}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
@@ -14,8 +14,8 @@ Gem::Specification.new do |s|
s.require_paths = %w(lib)
s.executables = %w()
- s.add_dependency 'refinerycms-base', '~> 0.9.9.5'
- s.add_dependency 'refinerycms-settings', '~> 0.9.9.5'
+ s.add_dependency 'refinerycms-base', '~> 0.9.9.7'
+ s.add_dependency 'refinerycms-settings', '~> 0.9.9.7'
s.add_dependency 'refinerycms-generators', '~> 0.9.9.3'
s.add_dependency 'acts_as_indexed', '~> 0.7'
s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
View
6 dashboard/refinerycms-dashboard.gemspec
@@ -2,10 +2,10 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-dashboard}
- s.version = %q{0.9.9.5}
+ s.version = %q{0.9.9.7}
s.summary = %q{Dashboard engine for Refinery CMS}
s.description = %q{The dashboard is usually the first engine the user sees in the backend of Refinery CMS. It displays useful information and contains links to common functionality.}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
@@ -68,5 +68,5 @@ Gem::Specification.new do |s|
'refinerycms-dashboard.gemspec'
]
- s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
+ s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
end
View
23 doc/crud.md
@@ -134,6 +134,29 @@ Default value is ``true``
The ``:paging`` option tells ``crudify`` you don't just want one big long list
but rather to break it out into pages and support paging methods uses [will_paginate](http://wiki.github.com/mislav/will_paginate/).
+### ``:xhr_paging``
+
+Default value is ``false``
+
+The ``:xhr_paging`` option tells ``crudify`` you want to use more advanced paging.
+This works using the HTML5 History API to swap out only the content that is being
+paged rather than the entire webpage. To support this option you will need a partial
+named after the plural name for example with ``news_items``:
+
+ class NewsItemsController < ApplicationController
+
+ crudify :news_item, :paging => true, :xhr_paging => true
+
+ end
+
+This requires a partial called "news_items" in the appropriate directory which contains:
+
+ <%= will_paginate @news_items %>
+ <ul class="<%= ['pagination_frame', pagination_css_class].compact.join(' ') %>">
+ <%= render :partial => 'news_item',
+ :collection => @news_items %>
+ </ul>
+
### ``:search_conditions``
Default value is ``nil``
View
10 images/app/controllers/admin/images_controller.rb
@@ -5,17 +5,11 @@ class ImagesController < Admin::BaseController
crudify :image,
:order => "created_at DESC",
- :sortable => false
+ :sortable => false,
+ :xhr_paging => true
before_filter :change_list_mode_if_specified, :init_dialog
- def index
- search_all_images if searching?
- paginate_all_images
-
- render :partial => 'images' if request.xhr?
- end
-
def new
@image = Image.new if @image.nil?
View
6 images/refinerycms-images.gemspec
@@ -2,10 +2,10 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-images}
- s.version = %q{0.9.9.5}
+ s.version = %q{0.9.9.7}
s.summary = %q{Images engine for Refinery CMS}
s.description = %q{Handles all image upload and processing functionality in Refinery CMS.}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
@@ -91,7 +91,7 @@ Gem::Specification.new do |s|
'spec/uploads/beach.jpeg'
]
- s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
+ s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
s.add_dependency 'dragonfly', '~> 0.8.2'
s.add_dependency 'rack-cache', '>= 0.5.3'
end
View
2  lib/gemspec.rb
@@ -44,7 +44,7 @@
s.executables = %w(#{Dir['bin/*'].join(' ').gsub('bin/', '')})
# Bundler
- s.add_dependency 'bundler', '~> 1.0.10'
+ s.add_dependency 'bundler', '~> 1.0'
# Refinery CMS
s.add_dependency 'refinerycms-authentication', '~> #{::Refinery::Version}'
View
2  lib/refinerycms.rb
@@ -1,3 +1,3 @@
require 'refinerycms-base'
-require File.expand_path('../refinerycms/all', __FILE__) unless defined?(REFINERYCMS_INSTALLER)
+require File.expand_path('../refinerycms/all', __FILE__) unless defined?(REFINERYCMS_INSTALLER)
View
6 pages/refinerycms-pages.gemspec
@@ -2,10 +2,10 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-pages}
- s.version = %q{0.9.9.5}
+ s.version = %q{0.9.9.7}
s.summary = %q{Pages engine for Refinery CMS}
s.description = %q{The default content engine of Refinery CMS. This engine handles the administration and display of user-editable pages.}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
@@ -107,5 +107,5 @@ Gem::Specification.new do |s|
'spec/models/page_spec.rb'
]
- s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
+ s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
end
View
23 refinerycms.gemspec
@@ -2,9 +2,9 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms}
- s.version = %q{0.9.9.6}
+ s.version = %q{0.9.9.7}
s.description = %q{A Ruby on Rails CMS that supports Rails 3. It's easy to extend and sticks to 'the Rails way' where possible.}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.summary = %q{A Ruby on Rails CMS that supports Rails 3}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
@@ -15,17 +15,17 @@ Gem::Specification.new do |s|
s.executables = %w(refinerycms)
# Bundler
- s.add_dependency 'bundler', '~> 1.0.10'
+ s.add_dependency 'bundler', '~> 1.0'
# Refinery CMS
- s.add_dependency 'refinerycms-authentication', '~> 0.9.9.5'
- s.add_dependency 'refinerycms-base', '~> 0.9.9.5'
- s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
- s.add_dependency 'refinerycms-dashboard', '~> 0.9.9.5'
- s.add_dependency 'refinerycms-images', '~> 0.9.9.5'
- s.add_dependency 'refinerycms-pages', '~> 0.9.9.5'
- s.add_dependency 'refinerycms-resources', '~> 0.9.9.5'
- s.add_dependency 'refinerycms-settings', '~> 0.9.9.5'
+ s.add_dependency 'refinerycms-authentication', '~> 0.9.9.7'
+ s.add_dependency 'refinerycms-base', '~> 0.9.9.7'
+ s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
+ s.add_dependency 'refinerycms-dashboard', '~> 0.9.9.7'
+ s.add_dependency 'refinerycms-images', '~> 0.9.9.7'
+ s.add_dependency 'refinerycms-pages', '~> 0.9.9.7'
+ s.add_dependency 'refinerycms-resources', '~> 0.9.9.7'
+ s.add_dependency 'refinerycms-settings', '~> 0.9.9.7'
s.files = [
'.gitignore',
@@ -64,7 +64,6 @@ Gem::Specification.new do |s|
'lib/refinerycms.rb',
'license.md',
'license.md',
- 'public',
'readme.md',
'readme.md',
'refinerycms.gemspec',
View
12 resources/app/controllers/admin/resources_controller.rb
@@ -1,7 +1,10 @@
module Admin
class ResourcesController < Admin::BaseController
- crudify :resource, :order => "updated_at DESC"
+ crudify :resource,
+ :order => "updated_at DESC",
+ :xhr_paging => true
+
before_filter :init_dialog
def new
@@ -36,13 +39,6 @@ def create
end
end
- def index
- search_all_resources if searching?
- paginate_all_resources
-
- render :partial => 'resources' if request.xhr?
- end
-
def insert
self.new if @resource.nil?
View
6 resources/refinerycms-resources.gemspec
@@ -2,10 +2,10 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-resources}
- s.version = %q{0.9.9.5}
+ s.version = %q{0.9.9.7}
s.summary = %q{Resources engine for Refinery CMS}
s.description = %q{Handles all file upload and processing functionality in Refinery CMS.}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
@@ -84,7 +84,7 @@ Gem::Specification.new do |s|
'spec/uploads/refinery_is_awesome.txt'
]
- s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
+ s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
s.add_dependency 'dragonfly', '~> 0.8.2'
s.add_dependency 'rack-cache', '>= 0.5.3'
end
View
10 settings/app/controllers/admin/refinery_settings_controller.rb
@@ -6,18 +6,12 @@ class RefinerySettingsController < Admin::BaseController
crudify :refinery_setting,
:title_attribute => :title,
:order => "name ASC",
- :redirect_to_url => :redirect_to_where?
+ :redirect_to_url => :redirect_to_where?,
+ :xhr_paging => true
before_filter :sanitise_params, :only => [:create, :update]
after_filter :fire_setting_callback, :only => [:update]
- def index
- search_all_refinery_settings if searching?
- paginate_all_refinery_settings
-
- render :partial => 'refinery_settings' if request.xhr?
- end
-
def new
if current_user.has_role?(:superuser) and params[:form_value_type].present?
@refinery_setting = RefinerySetting.new(:form_value_type => params[:form_value_type])
View
6 settings/refinerycms-settings.gemspec
@@ -2,10 +2,10 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-settings}
- s.version = %q{0.9.9.5}
+ s.version = %q{0.9.9.7}
s.summary = %q{Settings engine for Refinery CMS}
s.description = %q{The default settings engine that is required by Refinery CMS core. Adds programmer creatable, user editable settings for each engine.}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
@@ -80,5 +80,5 @@ Gem::Specification.new do |s|
'spec/models/refinery_setting_spec.rb'
]
- s.add_dependency 'refinerycms-base', '~> 0.9.9.5'
+ s.add_dependency 'refinerycms-base', '~> 0.9.9.7'
end
View
6 testing/refinerycms-testing.gemspec
@@ -2,10 +2,10 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-testing}
- s.version = %q{0.9.9.5}
+ s.version = %q{0.9.9.7}
s.summary = %q{Testing plugin for Refinery CMS}
s.description = %q{This plugin adds the ability to run cucumber and rspec against the RefineryCMS gem while inside a RefineryCMS project}
- s.date = %q{2011-03-08}
+ s.date = %q{2011-03-10}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.require_paths = %w(lib)
s.executables = %w()
- s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
+ s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
# RSpec
s.add_dependency 'rspec-rails', '~> 2.5'

No commit comments for this range

Something went wrong with that request. Please try again.