Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 15 commits
  • 27 files changed
  • 0 comments
  • 3 contributors
Mar 08, 2011
Josef Šimánek Added option per_page to crudify used in administration only b1fa9fc
Terence Lee looser bundler dependency like rails3
bundler 1.x promises to be backwards compatible with 1.0.
31efad0
Terence Lee update the bundler dependency for gemspec.rb as well 5ace097
Mar 09, 2011
Philip Arndt Merged + whitespaced. e2524ef
Philip Arndt Deprecated the rake refinery:update task in favour of rails generate …
…refinerycms --update which handles migrations correctly.
1d09aed
Philip Arndt 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
Philip Arndt Documented the recent changes in the changelog. 6c7d61b
Philip Arndt Exchanged (help) links for the information.png 'refinery icon'. This …
…will happen automatically if you used refinery_help_tag.
d239bba
Philip Arndt Ensure :per_page has a default value and that it will either evaluate…
… to true or false not, say, 20.
c4def61
Philip Arndt Ordered the default attributes in crudify alphabetically. edc21fe
Philip Arndt Apparently I fail at alphabet. I comes before O. fb5827b
Philip Arndt 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
Mar 10, 2011
Philip Arndt Updated refinerycms-i18n to 0.9.9.12 - Closes GH-515 769752f
Philip Arndt Implemented non-cached html5 pagination which doesn't have the browse…
…r bugs we used to have. Closes GH-425
f1b0483
Philip Arndt 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
2  Gemfile
@@ -53,5 +53,5 @@ end
53 53
 # gem 'refinerycms-page-images,   '~> 1.0
54 54
 
55 55
 # Add i18n support (optional, you can remove this if you really want to).
56  
-gem 'refinerycms-i18n',         '~> 0.9.9.11'
  56
+gem 'refinerycms-i18n',         '~> 0.9.9.12'
57 57
 # END USER DEFINED
62  Gemfile.lock
... ...
@@ -1,47 +1,47 @@
1 1
 PATH
2 2
   remote: .
3 3
   specs:
4  
-    refinerycms (0.9.9.5)
5  
-      bundler (~> 1.0.10)
6  
-      refinerycms-authentication (~> 0.9.9.5)
7  
-      refinerycms-base (~> 0.9.9.5)
8  
-      refinerycms-core (~> 0.9.9.5)
9  
-      refinerycms-dashboard (~> 0.9.9.5)
10  
-      refinerycms-images (~> 0.9.9.5)
11  
-      refinerycms-pages (~> 0.9.9.5)
12  
-      refinerycms-resources (~> 0.9.9.5)
13  
-      refinerycms-settings (~> 0.9.9.5)
14  
-    refinerycms-authentication (0.9.9.5)
  4
+    refinerycms (0.9.9.7)
  5
+      bundler (~> 1.0)
  6
+      refinerycms-authentication (~> 0.9.9.7)
  7
+      refinerycms-base (~> 0.9.9.7)
  8
+      refinerycms-core (~> 0.9.9.7)
  9
+      refinerycms-dashboard (~> 0.9.9.7)
  10
+      refinerycms-images (~> 0.9.9.7)
  11
+      refinerycms-pages (~> 0.9.9.7)
  12
+      refinerycms-resources (~> 0.9.9.7)
  13
+      refinerycms-settings (~> 0.9.9.7)
  14
+    refinerycms-authentication (0.9.9.7)
15 15
       devise (~> 1.1)
16  
-      refinerycms-core (~> 0.9.9.5)
17  
-    refinerycms-base (0.9.9.5)
18  
-    refinerycms-core (0.9.9.5)
  16
+      refinerycms-core (~> 0.9.9.7)
  17
+    refinerycms-base (0.9.9.7)
  18
+    refinerycms-core (0.9.9.7)
19 19
       acts_as_indexed (~> 0.7)
20 20
       friendly_id_globalize3 (~> 3.2.1)
21 21
       globalize3 (>= 0.1.0.beta)
22 22
       moretea-awesome_nested_set (= 1.4.3.1)
23 23
       rails (~> 3.0.5)
24 24
       rdoc (>= 2.5.11)
25  
-      refinerycms-base (~> 0.9.9.5)
  25
+      refinerycms-base (~> 0.9.9.7)
26 26
       refinerycms-generators (~> 0.9.9.3)
27  
-      refinerycms-settings (~> 0.9.9.5)
  27
+      refinerycms-settings (~> 0.9.9.7)
28 28
       truncate_html (~> 0.5)
29 29
       will_paginate (~> 3.0.pre)
30  
-    refinerycms-dashboard (0.9.9.5)
31  
-      refinerycms-core (~> 0.9.9.5)
32  
-    refinerycms-images (0.9.9.5)
  30
+    refinerycms-dashboard (0.9.9.7)
  31
+      refinerycms-core (~> 0.9.9.7)
  32
+    refinerycms-images (0.9.9.7)
33 33
       dragonfly (~> 0.8.2)
34 34
       rack-cache (>= 0.5.3)
35  
-      refinerycms-core (~> 0.9.9.5)
36  
-    refinerycms-pages (0.9.9.5)
37  
-      refinerycms-core (~> 0.9.9.5)
38  
-    refinerycms-resources (0.9.9.5)
  35
+      refinerycms-core (~> 0.9.9.7)
  36
+    refinerycms-pages (0.9.9.7)
  37
+      refinerycms-core (~> 0.9.9.7)
  38
+    refinerycms-resources (0.9.9.7)
39 39
       dragonfly (~> 0.8.2)
40 40
       rack-cache (>= 0.5.3)
41  
-      refinerycms-core (~> 0.9.9.5)
42  
-    refinerycms-settings (0.9.9.5)
43  
-      refinerycms-base (~> 0.9.9.5)
44  
-    refinerycms-testing (0.9.9.5)
  41
+      refinerycms-core (~> 0.9.9.7)
  42
+    refinerycms-settings (0.9.9.7)
  43
+      refinerycms-base (~> 0.9.9.7)
  44
+    refinerycms-testing (0.9.9.7)
45 45
       autotest
46 46
       autotest-notification
47 47
       autotest-rails
@@ -54,7 +54,7 @@ PATH
54 54
       json_pure
55 55
       launchy
56 56
       rack-test (~> 0.5.6)
57  
-      refinerycms-core (~> 0.9.9.5)
  57
+      refinerycms-core (~> 0.9.9.7)
58 58
       rspec-rails (~> 2.5)
59 59
 
60 60
 GEM
@@ -121,7 +121,7 @@ GEM
121 121
     cucumber-rails (0.3.2)
122 122
       cucumber (>= 0.8.0)
123 123
     culerity (0.2.15)
124  
-    database_cleaner (0.6.4)
  124
+    database_cleaner (0.6.5)
125 125
     devise (1.1.7)
126 126
       bcrypt-ruby (~> 2.1.2)
127 127
       warden (~> 1.0.2)
@@ -179,7 +179,7 @@ GEM
179 179
     rake (0.8.7)
180 180
     rdoc (3.5.3)
181 181
     refinerycms-generators (0.9.9.6)
182  
-    refinerycms-i18n (0.9.9.11)
  182
+    refinerycms-i18n (0.9.9.12)
183 183
       refinerycms (>= 0.9.8)
184 184
       routing-filter (>= 0.2.3)
185 185
     routing-filter (0.2.3)
@@ -221,6 +221,6 @@ PLATFORMS
221 221
 
222 222
 DEPENDENCIES
223 223
   refinerycms!
224  
-  refinerycms-i18n (~> 0.9.9.11)
  224
+  refinerycms-i18n (~> 0.9.9.12)
225 225
   refinerycms-testing (~> 0.9.9.5)
226 226
   sqlite3
12  authentication/app/controllers/admin/users_controller.rb
... ...
@@ -1,17 +1,13 @@
1 1
 module Admin
2 2
   class UsersController < Admin::BaseController
3 3
 
4  
-    crudify :user, :order => 'username ASC', :title_attribute => 'username'
  4
+    crudify :user,
  5
+            :order => 'username ASC',
  6
+            :title_attribute => 'username',
  7
+            :xhr_paging => true
5 8
 
6 9
     before_filter :load_available_plugins_and_roles, :only => [:new, :create, :edit, :update]
7 10
 
8  
-    def index
9  
-      search_all_users if searching?
10  
-      paginate_all_users
11  
-
12  
-      render :partial => 'users' if request.xhr?
13  
-    end
14  
-
15 11
     def new
16 12
       @user = User.new
17 13
       @selected_plugin_names = []
6  authentication/refinerycms-authentication.gemspec
@@ -2,10 +2,10 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms-authentication}
5  
-  s.version           = %q{0.9.9.5}
  5
+  s.version           = %q{0.9.9.7}
6 6
   s.summary           = %q{Authentication engine for Refinery CMS}
7 7
   s.description       = %q{The default authentication engine for Refinery CMS}
8  
-  s.date              = %q{2011-03-08}
  8
+  s.date              = %q{2011-03-10}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
11 11
   s.rubyforge_project = %q{refinerycms}
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14 14
   s.require_paths     = %w(lib)
15 15
   s.executables       = %w()
16 16
 
17  
-  s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
  17
+  s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
18 18
   s.add_dependency 'devise',           '~> 1.1'
19 19
 
20 20
   s.files             = [
2  base/lib/refinery/version.rb
@@ -3,7 +3,7 @@ class Version
3 3
     @major = 0
4 4
     @minor = 9
5 5
     @tiny  = 9
6  
-    @build = 6
  6
+    @build = 7
7 7
 
8 8
     class << self
9 9
       attr_reader :major, :minor, :tiny, :build
4  base/refinerycms-base.gemspec
@@ -2,10 +2,10 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms-base}
5  
-  s.version           = %q{0.9.9.6}
  5
+  s.version           = %q{0.9.9.7}
6 6
   s.summary           = %q{Base engine for Refinery CMS}
7 7
   s.description       = %q{The basic base for Refinery CMS Refinery CMS}
8  
-  s.date              = %q{2011-03-08}
  8
+  s.date              = %q{2011-03-10}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
11 11
   s.rubyforge_project = %q{refinerycms}
95  bin/refinerycms
@@ -28,17 +28,18 @@ module Refinery
28 28
       # Default options
29 29
       @input = input
30 30
       @options = {
  31
+        :confirm => false,
31 32
         :database => {
32 33
           :adapter => 'sqlite3',
33 34
           :ident => false,
  35
+          :password => nil,
34 36
           :username => 'root',
35  
-          :password => nil
  37
+          :skip => false
36 38
         },
37  
-        :force => false,
38  
-        :heroku => false,
39 39
         :duostack => false,
40  
-        :confirm => false,
41  
-        :gems => []
  40
+        :force => false,
  41
+        :gems => [],
  42
+        :heroku => false
42 43
       }
43 44
 
44 45
       @optparse = OptionParser.new do |opts|
@@ -77,6 +78,10 @@ module Refinery
77 78
           @options[:database][:password] = password
78 79
         end
79 80
 
  81
+        opts.on('--skip-db', "Skip any database creation or migration tasks") do
  82
+          @options[:database][:skip] = true
  83
+        end
  84
+
80 85
         opts.on("-g", "--gems gem1,gem2,gem3", Array, "Additional gems to install") do |gems|
81 86
           @options[:gems] = gems.reject {|g| g.to_s =~ /^refinerycms/}.map {|g| "gem '#{g.to_s}'"}
82 87
         end
@@ -122,27 +127,29 @@ module Refinery
122 127
       # Bundle the application which activates Refinery CMS
123 128
       bundle!
124 129
 
125  
-      # Ensure the database exists so that queries like .table_exists? don't fail.
126  
-      puts "\nCreating a new database.."
127  
-      # Warn about incorrect username or password.
128  
-      unless @options[:database][:adapter] == 'sqlite3'
129  
-        if @options[:database][:ident]
130  
-          note = "NOTE: If ident authentication fails then the installer will stall or fail here.\n\n"
131  
-        else
132  
-          note = "NOTE: if your database username is not '#{@options[:database][:username]}'"
133  
-          note << " or your password is not '#{@options[:database][:password]}' then the installer will stall here.\n\n"
  130
+      unless @options[:database][:skip]
  131
+        # Ensure the database exists so that queries like .table_exists? don't fail.
  132
+        puts "\nCreating a new database.."
  133
+        # Warn about incorrect username or password.
  134
+        unless @options[:database][:adapter] == 'sqlite3'
  135
+          if @options[:database][:ident]
  136
+            note = "NOTE: If ident authentication fails then the installer will stall or fail here.\n\n"
  137
+          else
  138
+            note = "NOTE: if your database username is not '#{@options[:database][:username]}'"
  139
+            note << " or your password is not '#{@options[:database][:password]}' then the installer will stall here.\n\n"
  140
+          end
  141
+          puts note
134 142
         end
135  
-        puts note
  143
+        run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:create", {
  144
+          :fail => "Unable to create the application's database"
  145
+        })
  146
+
  147
+        # Run the newly activated Refinery CMS generator.
  148
+        run_command("rails generate refinerycms", {
  149
+          :cd => true,
  150
+          :fail => "Could not run the refinerycms generator successfully."
  151
+        })
136 152
       end
137  
-      run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:create", {
138  
-        :fail => "Unable to create the application's database"
139  
-      })
140  
-
141  
-      # Run the newly activated Refinery CMS generator.
142  
-      run_command("rails generate refinerycms", {
143  
-        :cd => true,
144  
-        :fail => "Could not run the refinerycms generator successfully."
145  
-      })
146 153
 
147 154
       # Output helpful messages to user
148 155
       output!
@@ -283,8 +290,10 @@ module Refinery
283 290
     end
284 291
 
285 292
     def output!
286  
-      puts "\n\nSetting up your development database..\n"
287  
-      run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:migrate")
  293
+      unless @options[:database][:skip]
  294
+        puts "\n\nSetting up your development database..\n"
  295
+        run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:migrate")
  296
+      end
288 297
 
289 298
       # Deploy to Heroku
290 299
       hosting = nil
@@ -310,21 +319,33 @@ module Refinery
310 319
       end
311 320
       # End automation
312 321
 
313  
-      # Output helpful messages
314  
-      puts "\n=== ACTION REQUIRED ==="
315  
-      puts "Now you can launch your webserver using:"
316  
-      puts "\ncd #{@app_path}"
317  
-      puts "rails server"
318  
-      puts "\nThis will launch the built-in webserver at port 3000."
319  
-      puts "You can now see your site running in your browser at http://localhost:3000"
  322
+      # Construct helpful output messages
  323
+      note = ["\n=== ACTION REQUIRED ==="]
  324
+      if @options[:database][:skip]
  325
+        note << "Because you elected to skip database creation and migration in the installer"
  326
+        note << "you will need to run the following tasks manually to maintain correct operation:"
  327
+        note << "\ncd #{@app_path}"
  328
+        note << "rake db:create"
  329
+        note << "rails generate refinerycms"
  330
+        note << "rake db:migrate"
  331
+        note << "\n---------\n"
  332
+      end
  333
+      note << "Now you can launch your webserver using:"
  334
+      note << "\ncd #{@app_path}"
  335
+      note << "rails server"
  336
+      note << "\nThis will launch the built-in webserver at port 3000."
  337
+      note << "You can now see your site running in your browser at http://localhost:3000"
320 338
 
321 339
       if @options[:heroku]
322  
-        puts "\nIf you want files and images to work on heroku, you will need setup S3:"
323  
-        puts "heroku config:add S3_BUCKET=XXXXXXXXX S3_KEY=XXXXXXXXX S3_SECRET=XXXXXXXXXX"
  340
+        note << "\nIf you want files and images to work on heroku, you will need setup S3:"
  341
+        note << "heroku config:add S3_BUCKET=XXXXXXXXX S3_KEY=XXXXXXXXX S3_SECRET=XXXXXXXXXX"
324 342
       end
325 343
 
326  
-      puts "\nThanks for installing Refinery, enjoy creating your new application!"
327  
-      puts "---------\n\n"
  344
+      note << "\nThanks for installing Refinery, enjoy creating your new application!"
  345
+      note << "---------\n\n"
  346
+
  347
+      # finally, output.
  348
+      puts note.join("\n")
328 349
     end
329 350
 
330 351
     private :validate!, :generate!, :bundle!, :output!
10  changelog.md
Source Rendered
... ...
@@ -1,3 +1,13 @@
  1
+## 0.9.9.7 [10 March 2011]
  2
+
  3
+* 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)
  4
+* Deprecated `rake refinery:update` in favour of rails `generate refinerycms --update`. [Philip Arndt](https://github.com/parndt)
  5
+* 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)
  6
+* 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)
  7
+* 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)
  8
+* Looser Bundler dependency (now `~> 1.0`). [Terence Lee](https://github.com/hone)
  9
+* [See full list](https://github.com/resolve/refinerycms/compare/0.9.9.6...0.9.9.7)
  10
+
1 11
 ## 0.9.9.6 [7 March 2011]
2 12
 
3 13
 * Fixed an issue that caused the installer to fail on some systems. [Philip Arndt](https://github.com/parndt)
21  core/lib/refinery/crud.rb
@@ -18,15 +18,17 @@ def self.default_options(model_name)
18 18
       this_class = class_name.constantize.base_class
19 19
 
20 20
       {
21  
-        :title_attribute => "title",
22  
-        :order => ('position ASC' if this_class.table_exists? and this_class.column_names.include?('position')),
23 21
         :conditions => '',
24  
-        :sortable => true,
25  
-        :searchable => true,
26 22
         :include => [],
  23
+        :order => ('position ASC' if this_class.table_exists? and this_class.column_names.include?('position')),
27 24
         :paging => true,
  25
+        :per_page => false,
  26
+        :redirect_to_url => "admin_#{plural_name}_url",
  27
+        :searchable => true,
28 28
         :search_conditions => '',
29  
-        :redirect_to_url => "admin_#{plural_name}_url"
  29
+        :sortable => true,
  30
+        :title_attribute => "title",
  31
+        :xhr_paging => false
30 32
       }
31 33
     end
32 34
 
@@ -161,8 +163,11 @@ def paginate_all_#{plural_name}
161 163
 
162 164
             paging_options = {:page => params[:page]}
163 165
 
  166
+            # Use per_page from crudify options.
  167
+            if #{options[:per_page].present?.inspect}
  168
+              paging_options.update({:per_page => #{options[:per_page].inspect}})
164 169
             # Seems will_paginate doesn't always use the implicit method.
165  
-            if #{class_name}.methods.map(&:to_sym).include?(:per_page)
  170
+            elsif #{class_name}.methods.map(&:to_sym).include?(:per_page)
166 171
               paging_options.update({:per_page => #{class_name}.per_page})
167 172
             end
168 173
 
@@ -193,6 +198,8 @@ def search_all_#{plural_name}
193 198
               def index
194 199
                 search_all_#{plural_name} if searching?
195 200
                 paginate_all_#{plural_name}
  201
+
  202
+                render :partial => '#{plural_name}' if #{options[:xhr_paging].inspect} && request.xhr?
196 203
               end
197 204
             )
198 205
           else
@@ -212,6 +219,8 @@ def index
212 219
             module_eval %(
213 220
               def index
214 221
                 paginate_all_#{plural_name}
  222
+
  223
+                render :partial => '#{plural_name}' if #{options[:xhr_paging].inspect} && request.xhr?
215 224
               end
216 225
             )
217 226
           else
5  core/lib/refinery/helpers/tag_helper.rb
@@ -2,17 +2,18 @@ module Refinery
2 2
   module Helpers
3 3
     module TagHelper
4 4
 
5  
-      # Returns <span class='help' title='Your Input'>(help)</span>
  5
+      # Returns <img class='help' tooltip='Your Input' src='refinery/icons/information.png' />
6 6
       # Remember to wrap your block with <span class='label_with_help'></span> if you're using a label next to the help tag.
7 7
       def refinery_help_tag(title='')
8 8
         title = h(title) unless title.html_safe?
9 9
 
10  
-        "<span class=\"help\" title=\"#{title}\">(#{t('help', :scope => 'shared.admin')})</span>".html_safe
  10
+        refinery_icon_tag('information', :class => 'help', :tooltip => title)
11 11
       end
12 12
 
13 13
       # This is just a quick wrapper to render an image tag that lives inside refinery/icons.
14 14
       # They are all 16x16 so this is the default but is able to be overriden with supplied options.
15 15
       def refinery_icon_tag(filename, options = {})
  16
+        filename = "#{filename}.png" unless filename.split('.').many?
16 17
         image_tag "refinery/icons/#{filename}", {:width => 16, :height => 16}.merge(options)
17 18
       end
18 19
 
48  core/lib/tasks/refinery.rake
@@ -162,50 +162,10 @@ namespace :refinery do
162 162
 
163 163
   desc "Update the core files with the gem"
164 164
   task :update => :environment do
165  
-    verbose = ENV["verbose"] || false
166  
-    require 'fileutils'
167  
-
168  
-    # Clean up mistakes
169  
-    if (bad_migration = Rails.root.join('db', 'migrate', '20100913234704_add_cached_slug_to_pages.rb')).file?
170  
-      FileUtils::rm bad_migration
171  
-    end
172  
-
173  
-    unless (devise_config = Rails.root.join('config', 'initializers', 'devise.rb')).file?
174  
-      devise_config.parent.mkpath
175  
-      FileUtils::cp Refinery.roots('core').join(*%w(lib generators templates config initializers devise.rb)),
176  
-                    devise_config,
177  
-                    :verbose => verbose
178  
-    end
179  
-
180  
-    (contents = Rails.root.join('Gemfile').read).gsub!("group :test do", "group :development, :test do")
181  
-    Rails.root.join('Gemfile').open("w") do |f|
182  
-      f.puts contents
183  
-    end
184  
-
185  
-    # copy in any new migrations, except for ones that create schemas (this is an update!)
186  
-    # or ones that exist already.
187  
-    Rails.root.join("db", "migrate").mkpath
188  
-    migrations = Pathname.glob(Refinery.roots.map{|r| r.join("db", "migrate", "*.rb")}).reject{|m|
189  
-      m.to_s =~ %r{\d+_create_refinerycms_.+?_schema\.rb} or
190  
-      Dir[Rails.root.join('db', 'migrate', "*#{m.basename.to_s.split(/\d+_/).last}")].any?
191  
-    }
192  
-    FileUtils::cp migrations,
193  
-                  Rails.root.join('db', 'migrate').cleanpath.to_s,
194  
-                  :verbose => verbose
195  
-
196  
-    Rails.root.join("db", "seeds").mkpath
197  
-    Pathname.glob(Refinery.roots.map{|r| r.join('db', 'seeds', '*.rb')}).each do |seed|
198  
-      unless (destination = Rails.root.join('db', 'seeds', seed.basename)).exist?
199  
-        FileUtils::cp seed, destination.to_s, :verbose => verbose
200  
-      end
201  
-    end
202  
-
203  
-    puts "\n" if verbose
204  
-
205  
-    unless (ENV["from_installer"] || 'false').to_s == 'true'
206  
-      puts "\n=== ACTION REQUIRED ==="
207  
-      puts "Please run rake db:migrate to ensure your database is at the correct version.\n"
208  
-    end
  165
+    puts "\nThe rake refinery:update task is DEPRECATED."
  166
+    puts "Please use the generator instead:"
  167
+    puts "rails generate refinerycms --update"
  168
+    puts "\n"
209 169
   end
210 170
 
211 171
   namespace :cache do
40  core/public/javascripts/refinery/admin.js
@@ -13,14 +13,31 @@ if(typeof(window.onpopstate) == "object"){
13 13
   $(window).bind('popstate', function(e) {
14 14
     // this fires on initial page load too which we don't need.
15 15
     if(!initialLoad) {
16  
-      $.get(location.href, function(data) {
17  
-        $('.pagination_container').slideTo(data);
18  
-      });
  16
+      $(document).paginateTo((location.pathname + location.href.split(location.pathname)[1]));
19 17
     }
20 18
     initialLoad = false;
21 19
   });
22 20
 }
23 21
 
  22
+$.fn.paginateTo = function(stateUrl) {
  23
+  // Grab the url, ensuring not to cache.
  24
+  $.ajax({
  25
+    url: stateUrl,
  26
+    cache: false,
  27
+    success: function(data) {
  28
+      $('.pagination_container').slideTo(data);
  29
+
  30
+      // remove caching _ argument.
  31
+      $('.pagination_container .pagination a').each(function(i, a){
  32
+        $(this).attr('href', $(this).attr('href').replace(/\?\_\=[^&]+&/, '?'));
  33
+      })
  34
+    },
  35
+    failure: function(data) {
  36
+      window.location = popstate_location;
  37
+    }
  38
+  });
  39
+}
  40
+
24 41
 $.fn.slideTo = function(response) {
25 42
   $(this).html(response);
26 43
   $(this).applyMinimumHeightFromChildren();
@@ -46,12 +63,17 @@ init_ajaxy_pagination = function(){
46 63
   if(typeof(window.history.pushState) == 'function' && $('.pagination_container').length > 0){
47 64
     var pagination_pages = $('.pagination_container .pagination a');
48 65
     pagination_pages.live('click',function(e) {
49  
-      this.href = (this.href.replace(/(\&(amp\;)?)?from_page\=\d+/, '')
50  
-                   + '&from_page=' + $(this).parent().find('em').text()).replace('?&', '?');
51  
-      history.pushState({ path: this.path }, '', this.href);
52  
-      $.get(this.href, function(data) {
53  
-        $('.pagination_container').slideTo(data)
54  
-      })
  66
+      navigate_to = this.href.replace(/(\&(amp\;)?)?from_page\=\d+/, '');
  67
+      navigate_to += '&from_page=' + $(this).parent().find('em').text();
  68
+      navigate_to = navigate_to.replace('?&', '?');
  69
+
  70
+      var current_state_location = (location.pathname + location.href.split(location.pathname)[1]);
  71
+      window.history.pushState({
  72
+        path: current_state_location
  73
+      }, '', navigate_to);
  74
+
  75
+      $(document).paginateTo(navigate_to);
  76
+
55 77
       e.preventDefault();
56 78
     });
57 79
   }
8  core/public/stylesheets/refinery/refinery.css
@@ -1369,9 +1369,15 @@ input.button.close_dialog:active, a.button.close_dialog:active, #content a.butto
1369 1369
 .hemisquare small {
1370 1370
   font-size: 0.9em;
1371 1371
 }
1372  
-.label_with_help label, .label_with_help span.help {
  1372
+.label_with_help {
  1373
+  vertical-align: middle;
  1374
+}
  1375
+.label_with_help label, .label_with_help span.help, .label_with_help img.help {
1373 1376
   display: inline;
1374 1377
 }
  1378
+.label_with_help img.help {
  1379
+  vertical-align: middle;
  1380
+}
1375 1381
 .label_with_help span.help {
1376 1382
   font-weight: normal;
1377 1383
   margin-left: 3px;
8  core/refinerycms-core.gemspec
@@ -2,10 +2,10 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms-core}
5  
-  s.version           = %q{0.9.9.5}
  5
+  s.version           = %q{0.9.9.7}
6 6
   s.summary           = %q{Core engine for Refinery CMS}
7 7
   s.description       = %q{The core of Refinery CMS. This handles the common functionality and is required by most engines}
8  
-  s.date              = %q{2011-03-08}
  8
+  s.date              = %q{2011-03-10}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
11 11
   s.rubyforge_project = %q{refinerycms}
@@ -14,8 +14,8 @@ Gem::Specification.new do |s|
14 14
   s.require_paths     = %w(lib)
15 15
   s.executables       = %w()
16 16
 
17  
-  s.add_dependency 'refinerycms-base',            '~> 0.9.9.5'
18  
-  s.add_dependency 'refinerycms-settings',        '~> 0.9.9.5'
  17
+  s.add_dependency 'refinerycms-base',            '~> 0.9.9.7'
  18
+  s.add_dependency 'refinerycms-settings',        '~> 0.9.9.7'
19 19
   s.add_dependency 'refinerycms-generators',      '~> 0.9.9.3'
20 20
   s.add_dependency 'acts_as_indexed',             '~> 0.7'
21 21
   s.add_dependency 'friendly_id_globalize3',      '~> 3.2.1'
6  dashboard/refinerycms-dashboard.gemspec
@@ -2,10 +2,10 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms-dashboard}
5  
-  s.version           = %q{0.9.9.5}
  5
+  s.version           = %q{0.9.9.7}
6 6
   s.summary           = %q{Dashboard engine for Refinery CMS}
7 7
   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.}
8  
-  s.date              = %q{2011-03-08}
  8
+  s.date              = %q{2011-03-10}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
11 11
   s.rubyforge_project = %q{refinerycms}
@@ -68,5 +68,5 @@ Gem::Specification.new do |s|
68 68
     'refinerycms-dashboard.gemspec'
69 69
   ]
70 70
 
71  
-  s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
  71
+  s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
72 72
 end
23  doc/crud.md
Source Rendered
@@ -134,6 +134,29 @@ Default value is ``true``
134 134
 The ``:paging`` option tells ``crudify`` you don't just want one big long list
135 135
 but rather to break it out into pages and support paging methods uses [will_paginate](http://wiki.github.com/mislav/will_paginate/).
136 136
 
  137
+### ``:xhr_paging``
  138
+
  139
+Default value is ``false``
  140
+
  141
+The ``:xhr_paging`` option tells ``crudify`` you want to use more advanced paging.
  142
+This works using the HTML5 History API to swap out only the content that is being
  143
+paged rather than the entire webpage.  To support this option you will need a partial
  144
+named after the plural name for example with ``news_items``:
  145
+
  146
+    class NewsItemsController < ApplicationController
  147
+
  148
+      crudify :news_item, :paging => true, :xhr_paging => true
  149
+
  150
+    end
  151
+
  152
+This requires a partial called "news_items" in the appropriate directory which contains:
  153
+
  154
+    <%= will_paginate @news_items %>
  155
+    <ul class="<%= ['pagination_frame', pagination_css_class].compact.join(' ') %>">
  156
+      <%= render :partial => 'news_item',
  157
+                 :collection => @news_items %>
  158
+    </ul>
  159
+
137 160
 ### ``:search_conditions``
138 161
 
139 162
 Default value is ``nil``
10  images/app/controllers/admin/images_controller.rb
@@ -5,17 +5,11 @@ class ImagesController < Admin::BaseController
5 5
 
6 6
     crudify :image,
7 7
             :order => "created_at DESC",
8  
-            :sortable => false
  8
+            :sortable => false,
  9
+            :xhr_paging => true
9 10
 
10 11
     before_filter :change_list_mode_if_specified, :init_dialog
11 12
 
12  
-    def index
13  
-      search_all_images if searching?
14  
-      paginate_all_images
15  
-
16  
-      render :partial => 'images' if request.xhr?
17  
-    end
18  
-
19 13
     def new
20 14
       @image = Image.new if @image.nil?
21 15
 
6  images/refinerycms-images.gemspec
@@ -2,10 +2,10 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms-images}
5  
-  s.version           = %q{0.9.9.5}
  5
+  s.version           = %q{0.9.9.7}
6 6
   s.summary           = %q{Images engine for Refinery CMS}
7 7
   s.description       = %q{Handles all image upload and processing functionality in Refinery CMS.}
8  
-  s.date              = %q{2011-03-08}
  8
+  s.date              = %q{2011-03-10}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
11 11
   s.rubyforge_project = %q{refinerycms}
@@ -91,7 +91,7 @@ Gem::Specification.new do |s|
91 91
     'spec/uploads/beach.jpeg'
92 92
   ]
93 93
 
94  
-  s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
  94
+  s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
95 95
   s.add_dependency 'dragonfly',        '~> 0.8.2'
96 96
   s.add_dependency 'rack-cache',       '>= 0.5.3'
97 97
 end
2  lib/gemspec.rb
@@ -44,7 +44,7 @@
44 44
   s.executables       = %w(#{Dir['bin/*'].join(' ').gsub('bin/', '')})
45 45
 
46 46
   # Bundler
47  
-  s.add_dependency    'bundler',                    '~> 1.0.10'
  47
+  s.add_dependency    'bundler',                    '~> 1.0'
48 48
 
49 49
   # Refinery CMS
50 50
   s.add_dependency    'refinerycms-authentication', '~> #{::Refinery::Version}'
2  lib/refinerycms.rb
... ...
@@ -1,3 +1,3 @@
1 1
 require 'refinerycms-base'
2 2
 
3  
-require File.expand_path('../refinerycms/all', __FILE__) unless defined?(REFINERYCMS_INSTALLER)
  3
+require File.expand_path('../refinerycms/all', __FILE__) unless defined?(REFINERYCMS_INSTALLER)
6  pages/refinerycms-pages.gemspec
@@ -2,10 +2,10 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms-pages}
5  
-  s.version           = %q{0.9.9.5}
  5
+  s.version           = %q{0.9.9.7}
6 6
   s.summary           = %q{Pages engine for Refinery CMS}
7 7
   s.description       = %q{The default content engine of Refinery CMS. This engine handles the administration and display of user-editable pages.}
8  
-  s.date              = %q{2011-03-08}
  8
+  s.date              = %q{2011-03-10}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
11 11
   s.rubyforge_project = %q{refinerycms}
@@ -107,5 +107,5 @@ Gem::Specification.new do |s|
107 107
     'spec/models/page_spec.rb'
108 108
   ]
109 109
 
110  
-  s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
  110
+  s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
111 111
 end
23  refinerycms.gemspec
@@ -2,9 +2,9 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms}
5  
-  s.version           = %q{0.9.9.6}
  5
+  s.version           = %q{0.9.9.7}
6 6
   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.}
7  
-  s.date              = %q{2011-03-08}
  7
+  s.date              = %q{2011-03-10}
8 8
   s.summary           = %q{A Ruby on Rails CMS that supports Rails 3}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
@@ -15,17 +15,17 @@ Gem::Specification.new do |s|
15 15
   s.executables       = %w(refinerycms)
16 16
 
17 17
   # Bundler
18  
-  s.add_dependency    'bundler',                    '~> 1.0.10'
  18
+  s.add_dependency    'bundler',                    '~> 1.0'
19 19
 
20 20
   # Refinery CMS
21  
-  s.add_dependency    'refinerycms-authentication', '~> 0.9.9.5'
22  
-  s.add_dependency    'refinerycms-base',           '~> 0.9.9.5'
23  
-  s.add_dependency    'refinerycms-core',           '~> 0.9.9.5'
24  
-  s.add_dependency    'refinerycms-dashboard',      '~> 0.9.9.5'
25  
-  s.add_dependency    'refinerycms-images',         '~> 0.9.9.5'
26  
-  s.add_dependency    'refinerycms-pages',          '~> 0.9.9.5'
27  
-  s.add_dependency    'refinerycms-resources',      '~> 0.9.9.5'
28  
-  s.add_dependency    'refinerycms-settings',       '~> 0.9.9.5'
  21
+  s.add_dependency    'refinerycms-authentication', '~> 0.9.9.7'
  22
+  s.add_dependency    'refinerycms-base',           '~> 0.9.9.7'
  23
+  s.add_dependency    'refinerycms-core',           '~> 0.9.9.7'
  24
+  s.add_dependency    'refinerycms-dashboard',      '~> 0.9.9.7'
  25
+  s.add_dependency    'refinerycms-images',         '~> 0.9.9.7'
  26
+  s.add_dependency    'refinerycms-pages',          '~> 0.9.9.7'
  27
+  s.add_dependency    'refinerycms-resources',      '~> 0.9.9.7'
  28
+  s.add_dependency    'refinerycms-settings',       '~> 0.9.9.7'
29 29
 
30 30
   s.files             = [
31 31
     '.gitignore',
@@ -64,7 +64,6 @@ Gem::Specification.new do |s|
64 64
     'lib/refinerycms.rb',
65 65
     'license.md',
66 66
     'license.md',
67  
-    'public',
68 67
     'readme.md',
69 68
     'readme.md',
70 69
     'refinerycms.gemspec',
12  resources/app/controllers/admin/resources_controller.rb
... ...
@@ -1,7 +1,10 @@
1 1
 module Admin
2 2
   class ResourcesController < Admin::BaseController
3 3
 
4  
-    crudify :resource, :order => "updated_at DESC"
  4
+    crudify :resource,
  5
+            :order => "updated_at DESC",
  6
+            :xhr_paging => true
  7
+
5 8
     before_filter :init_dialog
6 9
 
7 10
     def new
@@ -36,13 +39,6 @@ def create
36 39
       end
37 40
     end
38 41
 
39  
-    def index
40  
-      search_all_resources if searching?
41  
-      paginate_all_resources
42  
-
43  
-      render :partial => 'resources' if request.xhr?
44  
-    end
45  
-
46 42
     def insert
47 43
       self.new if @resource.nil?
48 44
 
6  resources/refinerycms-resources.gemspec
@@ -2,10 +2,10 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms-resources}
5  
-  s.version           = %q{0.9.9.5}
  5
+  s.version           = %q{0.9.9.7}
6 6
   s.summary           = %q{Resources engine for Refinery CMS}
7 7
   s.description       = %q{Handles all file upload and processing functionality in Refinery CMS.}
8  
-  s.date              = %q{2011-03-08}
  8
+  s.date              = %q{2011-03-10}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
11 11
   s.rubyforge_project = %q{refinerycms}
@@ -84,7 +84,7 @@ Gem::Specification.new do |s|
84 84
     'spec/uploads/refinery_is_awesome.txt'
85 85
   ]
86 86
 
87  
-  s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
  87
+  s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
88 88
   s.add_dependency 'dragonfly',        '~> 0.8.2'
89 89
   s.add_dependency 'rack-cache',       '>= 0.5.3'
90 90
 end
10  settings/app/controllers/admin/refinery_settings_controller.rb
@@ -6,18 +6,12 @@ class RefinerySettingsController < Admin::BaseController
6 6
     crudify :refinery_setting,
7 7
             :title_attribute => :title,
8 8
             :order => "name ASC",
9  
-            :redirect_to_url => :redirect_to_where?
  9
+            :redirect_to_url => :redirect_to_where?,
  10
+            :xhr_paging => true
10 11
 
11 12
     before_filter :sanitise_params, :only => [:create, :update]
12 13
     after_filter :fire_setting_callback, :only => [:update]
13 14
 
14  
-    def index
15  
-      search_all_refinery_settings if searching?
16  
-      paginate_all_refinery_settings
17  
-
18  
-      render :partial => 'refinery_settings' if request.xhr?
19  
-    end
20  
-
21 15
     def new
22 16
       if current_user.has_role?(:superuser) and params[:form_value_type].present?
23 17
         @refinery_setting = RefinerySetting.new(:form_value_type => params[:form_value_type])
6  settings/refinerycms-settings.gemspec
@@ -2,10 +2,10 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms-settings}
5  
-  s.version           = %q{0.9.9.5}
  5
+  s.version           = %q{0.9.9.7}
6 6
   s.summary           = %q{Settings engine for Refinery CMS}
7 7
   s.description       = %q{The default settings engine that is required by Refinery CMS core. Adds programmer creatable, user editable settings for each engine.}
8  
-  s.date              = %q{2011-03-08}
  8
+  s.date              = %q{2011-03-10}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
11 11
   s.rubyforge_project = %q{refinerycms}
@@ -80,5 +80,5 @@ Gem::Specification.new do |s|
80 80
     'spec/models/refinery_setting_spec.rb'
81 81
   ]
82 82
 
83  
-  s.add_dependency 'refinerycms-base', '~> 0.9.9.5'
  83
+  s.add_dependency 'refinerycms-base', '~> 0.9.9.7'
84 84
 end
6  testing/refinerycms-testing.gemspec
@@ -2,10 +2,10 @@
2 2
 
3 3
 Gem::Specification.new do |s|
4 4
   s.name              = %q{refinerycms-testing}
5  
-  s.version           = %q{0.9.9.5}
  5
+  s.version           = %q{0.9.9.7}
6 6
   s.summary           = %q{Testing plugin for Refinery CMS}
7 7
   s.description       = %q{This plugin adds the ability to run cucumber and rspec against the RefineryCMS gem while inside a RefineryCMS project}
8  
-  s.date              = %q{2011-03-08}
  8
+  s.date              = %q{2011-03-10}
9 9
   s.email             = %q{info@refinerycms.com}
10 10
   s.homepage          = %q{http://refinerycms.com}
11 11
   s.rubyforge_project = %q{refinerycms}
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14 14
   s.require_paths     = %w(lib)
15 15
   s.executables       = %w()
16 16
 
17  
-  s.add_dependency 'refinerycms-core', '~> 0.9.9.5'
  17
+  s.add_dependency 'refinerycms-core', '~> 0.9.9.7'
18 18
   # RSpec
19 19
   s.add_dependency 'rspec-rails',       '~> 2.5'
20 20
 

No commit comments for this range

Something went wrong with that request. Please try again.