refinerycms 0.9.6.12 → 0.9.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. data/.gitignore +0 -1
  2. data/Gemfile +2 -3
  3. data/Rakefile +22 -8
  4. data/VERSION +1 -1
  5. data/bin/refinery +2 -2
  6. data/config/application.rb +5 -6
  7. data/config/preinitializer.rb +3 -5
  8. data/db/migrate/20100223211536_remove_themes_table.rb +17 -0
  9. data/db/schema.rb +1 -12
  10. data/db/seeds.rb +2 -10
  11. data/lib/refinery_initializer.rb +14 -10
  12. data/public/javascripts/refinery/admin.js +20 -13
  13. data/readme.md +15 -9
  14. data/test/fixtures/users.yml +16 -0
  15. data/test/functional/dashboard_controller_test.rb +24 -0
  16. data/test/test_helper.rb +5 -0
  17. data/themes/demolicious/LICENSE +21 -0
  18. data/themes/demolicious/README +1 -0
  19. data/themes/demolicious/images/footer_background.png +0 -0
  20. data/themes/demolicious/images/header_background.png +0 -0
  21. data/themes/demolicious/stylesheets/application.css +94 -0
  22. data/themes/demolicious/stylesheets/formatting.css +36 -0
  23. data/themes/demolicious/stylesheets/home.css +8 -0
  24. data/themes/demolicious/stylesheets/ie6.css +0 -0
  25. data/themes/demolicious/stylesheets/ie7.css +0 -0
  26. data/themes/demolicious/views/layouts/application.html.erb +20 -0
  27. data/themes/demolicious/views/pages/home.html.erb +1 -0
  28. data/themes/demolicious/views/pages/show.html.erb +1 -0
  29. data/themes/hemingway/LICENSE +7 -0
  30. data/themes/hemingway/README +3 -0
  31. data/themes/hemingway/images/archives.gif +0 -0
  32. data/themes/hemingway/images/footer_black.gif +0 -0
  33. data/themes/hemingway/images/kyle-header.jpg +0 -0
  34. data/themes/hemingway/images/readon_black.gif +0 -0
  35. data/themes/hemingway/images/search.gif +0 -0
  36. data/themes/hemingway/images/spinner.gif +0 -0
  37. data/themes/hemingway/images/trackback_pingback.gif +0 -0
  38. data/themes/hemingway/stylesheets/application.css +713 -0
  39. data/themes/hemingway/stylesheets/formatting.css +1 -0
  40. data/themes/hemingway/stylesheets/home.css +1 -0
  41. data/themes/hemingway/views/layouts/application.html.erb +55 -0
  42. data/todo.md +3 -1
  43. data/vendor/plugins/authentication/app/controllers/users_controller.rb +3 -5
  44. data/vendor/plugins/dashboard/app/controllers/admin/dashboard_controller.rb +1 -0
  45. data/vendor/plugins/dashboard/app/helpers/admin/dashboard_helper.rb +1 -1
  46. data/vendor/plugins/images/app/models/image.rb +2 -2
  47. data/vendor/plugins/pages/rails/init.rb +1 -1
  48. data/vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb +1 -1
  49. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_singular_name.html.erb +0 -1
  50. data/vendor/plugins/refinery/lib/refinery.rb +1 -0
  51. data/vendor/plugins/refinery/lib/refinery/admin_base_controller.rb +4 -3
  52. data/vendor/plugins/refinery/lib/refinery/application_controller.rb +0 -1
  53. data/vendor/plugins/refinery/lib/refinery/application_helper.rb +0 -27
  54. data/vendor/plugins/refinery/lib/refinery/initializer.rb +10 -5
  55. data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_refinery_setting.html.erb +0 -1
  56. data/vendor/plugins/resources/app/models/resource.rb +2 -2
  57. data/vendor/plugins/themes/app/helpers/themes_helper.rb +25 -0
  58. data/vendor/plugins/themes/lib/theme_server.rb +11 -7
  59. data/vendor/plugins/themes/rails/init.rb +18 -19
  60. data/vendor/plugins/themes/themes.md +1 -23
  61. metadata +43 -18
  62. data/test/fixtures/themes.yml +0 -5
  63. data/test/unit/theme_test.rb +0 -19
  64. data/vendor/plugins/themes/app/controllers/admin/themes_controller.rb +0 -25
  65. data/vendor/plugins/themes/app/models/theme.rb +0 -56
  66. data/vendor/plugins/themes/app/views/admin/themes/_form.html.erb +0 -11
  67. data/vendor/plugins/themes/app/views/admin/themes/_theme.html.erb +0 -18
  68. data/vendor/plugins/themes/app/views/admin/themes/edit.html.erb +0 -1
  69. data/vendor/plugins/themes/app/views/admin/themes/index.html.erb +0 -34
  70. data/vendor/plugins/themes/app/views/admin/themes/new.html.erb +0 -1
  71. data/vendor/plugins/themes/config/routes.rb +0 -12
data/.gitignore CHANGED
@@ -20,5 +20,4 @@ public/javascripts/cache
20
20
  public/stylesheets/cache
21
21
  config/database.yml.example
22
22
  .yardoc/
23
- themes/*
24
23
  refinerycms.gemspec
data/Gemfile CHANGED
@@ -1,13 +1,12 @@
1
1
  # Please add your gems above the Refinery required gems here:
2
2
 
3
3
  #===REFINERY REQUIRED GEMS===
4
- source "http://gemcutter.org"
4
+ source "http://rubygems.org"
5
5
  gem "aasm", ">= 2.1.3", :require => "aasm"
6
6
  gem "friendly_id", ">= 2.2.2", :require => "friendly_id"
7
7
  gem "hpricot", ">= 0.8.1", :require => "hpricot"
8
- gem "slim_scrooge", ">= 1.0.3", :require => "slim_scrooge" unless RUBY_PLATFORM =~ /mswin|mingw/ # kill gem requirement when windows is running.
8
+ gem "slim_scrooge", ">= 1.0.5", :require => "slim_scrooge"
9
9
  gem "will_paginate", ">= 2.3.11", :require => "will_paginate"
10
10
  gem "rails", ">= 2.3.5", :require => "rails"
11
- gem "rubyzip", ">= 0.9.1", :require => "zip/zip"
12
11
  gem "rake", ">= 0.8.3", :require => "rake"
13
12
  #===REFINERY END OF REQUIRED GEMS===
data/Rakefile CHANGED
@@ -3,30 +3,44 @@
3
3
 
4
4
  begin
5
5
  # Load up the environment instead of just the boot file because we want all of the tasks available.
6
- require(File.join(File.dirname(__FILE__), 'config', 'environment'))
6
+ require File.join(File.dirname(__FILE__), 'config', 'environment')
7
7
  rescue Exception
8
+ # Log the exception to the console/logfile.
9
+ puts "*** Couldn't load the config/environment file because something went wrong. Trace below: ***"
10
+ puts $!.backtrace
11
+ puts "\n*** So, we'll attempt to load in config/boot instead... ***"
12
+
8
13
  # Load up the boot file instead because there's something wrong with the environment.
9
- require(File.join(File.dirname(__FILE__), 'config', 'boot'))
14
+ require File.join(File.dirname(__FILE__), 'config', 'boot')
10
15
  end
11
16
 
17
+ # Require the standard stuff
12
18
  require 'rake'
13
19
  require 'rake/testtask'
14
20
  require 'rake/rdoctask'
15
-
16
21
  require 'tasks/rails'
17
22
 
23
+ # Because we use plugins that are shipped via gems, we lose their rake tasks.
24
+ # So here, we find them (if there are any) and include them into rake.
18
25
  extra_rake_tasks = []
19
- # When running Refinery from a gem we lose the rake tasks, so add them back in:
20
- extra_rake_tasks << Dir[Refinery.root.join("vendor", "plugins", "*", "**", "tasks", "**", "*", "*.rake")].sort unless Refinery.root == Rails.root
26
+ if Refinery.is_a_gem
27
+ extra_rake_tasks << Dir[Refinery.root.join("vendor", "plugins", "*", "**", "tasks", "**", "*", "*.rake")].sort
28
+ end
29
+
21
30
  # We also need to load in the rake tasks from gem plugins whether Refinery is a gem or not:
22
- extra_rake_tasks << $refinery_gem_plugin_lib_paths.collect {|path| Dir[File.join(%W(#{path} tasks ** *.rake))].sort} if defined?($refinery_gem_plugin_lib_paths) && !$refinery_gem_plugin_lib_paths.nil?
31
+ if defined?($refinery_gem_plugin_lib_paths) && !$refinery_gem_plugin_lib_paths.nil?
32
+ extra_rake_tasks << $refinery_gem_plugin_lib_paths.collect {|path| Dir[File.join(%W(#{path} tasks ** *.rake))].sort}
33
+ end
34
+
35
+ # Load in any extra tasks that we've found.
23
36
  extra_rake_tasks.flatten.compact.uniq.each {|rake| load rake }
24
37
 
25
- desc 'Removes trailing whitespace'
38
+ desc 'Removes trailing whitespace across the entire application.'
26
39
  task :whitespace do
27
40
  sh %{find . -name '*.*rb' -exec sed -i '' 's/\t/ /g' {} \\; -exec sed -i '' 's/ *$//g' {} \\; }
28
41
  end
29
42
 
43
+ # You don't need to worry about this unless you're releasing Refinery gems.
30
44
  begin
31
45
  require 'jeweler'
32
46
  Jeweler::Tasks.new do |s|
@@ -43,7 +57,7 @@ begin
43
57
 
44
58
  namespace :version do
45
59
  namespace :bump do
46
- desc "Bump the gemspec by a build version."
60
+ desc "Bump the application's version by a build version."
47
61
  task :build => [:version_required, :version] do
48
62
  version = Jeweler::VersionHelper.new(Rails.root.to_s)
49
63
  version.update_to(version.major, version.minor, version.patch, ((version.build || 0).to_i + 1))
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.6.12
1
+ 0.9.6.13
@@ -20,11 +20,11 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
20
20
  FileUtils::makedirs RAILS_ROOT
21
21
 
22
22
  # copy in all of the relevant directories and root files.
23
- to_copy = %w(app config db lib public script contributors.md license.md Rakefile readme.md VERSION).map do |dir|
23
+ to_copy = %w(app config db lib public themes script contributors.md license.md Rakefile readme.md VERSION).map do |dir|
24
24
  REFINERY_ROOT.join(dir).to_s
25
25
  end
26
26
  FileUtils::cp_r to_copy, RAILS_ROOT, :verbose => false
27
- FileUtils::mkdir File.join(%W(#{RAILS_ROOT} themes))
27
+
28
28
  # ensure lib/refinery_initializer.rb doesn't make it in.
29
29
  FileUtils::rm File.join(%W(#{RAILS_ROOT} lib refinery_initializer.rb)) if File.exists?(File.join(%W(#{RAILS_ROOT} lib refinery_initializer.rb)))
30
30
 
@@ -21,7 +21,7 @@ else
21
21
  # Specifies gem version of Rails to use when vendor/rails is not present
22
22
  RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
23
23
  # Freeze to a specific version of refinerycms when running as a gem
24
- # REFINERY_GEM_VERSION = '0.9.6' unless defined? REFINERY_GEM_VERSION
24
+ # REFINERY_GEM_VERSION = '0.9.6.13' unless defined? REFINERY_GEM_VERSION
25
25
 
26
26
  # Bootstrap the Rails environment, frameworks, and default configuration
27
27
  require File.join(File.dirname(__FILE__), 'boot')
@@ -78,13 +78,12 @@ else
78
78
  #===REFINERY REQUIRED GEMS===
79
79
  config.gem "bundler", :version => ">= 0.9.4"
80
80
  config.gem "rake", :version => ">= 0.8.3", :lib => "rake"
81
- config.gem "rubyzip", :version => ">= 0.9.1", :lib => "zip/zip"
82
81
  config.gem "friendly_id", :version => ">= 2.2.2", :lib => "friendly_id"
83
- config.gem "will_paginate", :version => ">= 2.3.11", :lib => "will_paginate", :source => "http://gemcutter.org"
82
+ config.gem "will_paginate", :version => ">= 2.3.11", :lib => "will_paginate"
84
83
  config.gem "rails", :version => ">= 2.3.5", :lib => "rails"
85
- config.gem "aasm", :version => ">= 2.1.3", :lib => "aasm", :source => "http://gemcutter.org"
86
- config.gem "slim_scrooge", :version => ">= 1.0.3", :lib => "slim_scrooge", :source => "http://gemcutter.org" unless RUBY_PLATFORM =~ /mswin|mingw/ # kill gem when windows is running.
87
- config.gem "hpricot", :version => ">= 0.8.1", :lib => "hpricot", :source => "http://gemcutter.org"
84
+ config.gem "aasm", :version => ">= 2.1.3", :lib => "aasm"
85
+ config.gem "slim_scrooge", :version => ">= 1.0.5", :lib => "slim_scrooge"
86
+ config.gem "hpricot", :version => ">= 0.8.1", :lib => "hpricot"
88
87
  #===REFINERY END OF REQUIRED GEMS===
89
88
  end
90
89
  end
@@ -1,10 +1,10 @@
1
1
  require 'pathname'
2
2
 
3
3
  # until Rails 3
4
- ENV["GEM_HOME"] = File.expand_path('../../vendor/bundler_gems', __FILE__)
4
+ # ENV["GEM_HOME"] = File.expand_path('../../vendor/bundler_gems', __FILE__)
5
5
 
6
6
  # pick the refinery root path
7
- rails_root = defined?(Rails.root) ? Rails.root : Pathname.new(RAILS_ROOT)
7
+ rails_root = (defined?(Rails.root) ? Rails.root : Pathname.new(RAILS_ROOT)).cleanpath
8
8
  if (non_gem_path = rails_root.join("lib", "refinery_initializer.rb")).exist?
9
9
  require non_gem_path.to_s
10
10
  else
@@ -14,7 +14,7 @@ else
14
14
  elsif ENV.include?("REFINERY_GEM_VERSION")
15
15
  ENV["REFINERY_GEM_VERSION"]
16
16
  else
17
- $1 if rails_root.join("config", "application.rb") =~ /^[^#]*REFINERY_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
17
+ $1 if rails_root.join("config", "application.rb").read =~ /^[^#]*REFINERY_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
18
18
  end
19
19
 
20
20
  if version
@@ -26,8 +26,6 @@ else
26
26
  require 'refinery_initializer'
27
27
  end
28
28
 
29
- Refinery.root = rails_root unless defined?(Refinery.root) && Refinery.root.is_a?(Pathname)
30
-
31
29
  # Set to true in your environment specific file (e.g. production.rb) to use Amazon's Simple
32
30
  # Storage Service instead of the default file system for resources and images
33
31
  USE_S3_BACKEND = false unless defined?(USE_S3_BACKEND)
@@ -0,0 +1,17 @@
1
+ class RemoveThemesTable < ActiveRecord::Migration
2
+ def self.up
3
+ drop_table :themes
4
+ end
5
+
6
+ def self.down
7
+ create_table "themes", :force => true do |t|
8
+ t.integer "size"
9
+ t.string "content_type"
10
+ t.string "filename"
11
+ t.string "title"
12
+ t.text "description"
13
+ t.text "license"
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -9,7 +9,7 @@
9
9
  #
10
10
  # It's strongly recommended to check this file into your version control system.
11
11
 
12
- ActiveRecord::Schema.define(:version => 20100204011654) do
12
+ ActiveRecord::Schema.define(:version => 20100223211536) do
13
13
 
14
14
  create_table "images", :force => true do |t|
15
15
  t.integer "parent_id"
@@ -119,17 +119,6 @@ ActiveRecord::Schema.define(:version => 20100204011654) do
119
119
  add_index "slugs", ["name", "sluggable_type", "scope", "sequence"], :name => "index_slugs_on_name_and_sluggable_type_and_scope_and_sequence", :unique => true
120
120
  add_index "slugs", ["sluggable_id"], :name => "index_slugs_on_sluggable_id"
121
121
 
122
- create_table "themes", :force => true do |t|
123
- t.integer "size"
124
- t.string "content_type"
125
- t.string "filename"
126
- t.string "title"
127
- t.text "description"
128
- t.text "licence"
129
- t.datetime "created_at"
130
- t.datetime "updated_at"
131
- end
132
-
133
122
  create_table "user_plugins", :force => true do |t|
134
123
  t.integer "user_id"
135
124
  t.string "title"
@@ -117,13 +117,5 @@ Page.create(:title => "Down for maintenance",
117
117
  :body => "<p>Our site is currently down for maintenance. Please try back later.</p>"
118
118
  })
119
119
 
120
- # Install default themes.
121
- Rails.root.join("themes").mkdir unless Rails.root.join("themes").directory?
122
- Dir[Refinery.root.join("themes", "*.zip")].each do |theme|
123
- Theme.create(:uploaded_data => {
124
- "size" => File.size(theme),
125
- "content_type" => "application/zip",
126
- "filename" => theme.split('/').last,
127
- 'tempfile' => File.open(theme)
128
- }).read_theme
129
- end
120
+ # Create a default themes directory.
121
+ Rails.root.join("themes").mkdir unless Rails.root.join("themes").directory?
@@ -1,17 +1,21 @@
1
1
  require 'pathname'
2
- begin
3
- require 'vendor/plugins/refinery/lib/refinery'
4
- rescue LoadError => load_error
5
- # We won't be able to load this if we're in the gem as there is no such thing.
2
+ root_directory = Pathname.new(File.expand_path(File.dirname(__FILE__) << "/.."))
3
+ rails_root = ((defined?(Rails.root) && Rails.root.realpath.length > 0) ? Rails.root : Pathname.new(RAILS_ROOT))
4
+
5
+ if (non_gem_refinery = rails_root.join("vendor", "plugins", "refinery", "lib", "refinery.rb")).exist?
6
+ require non_gem_refinery.realpath.to_s # this won't exist when using a gem.
7
+ else
8
+ require root_directory.join("vendor", "plugins", "refinery", "lib", "refinery.rb").realpath.to_s
6
9
  end
7
10
 
8
- refinery_root = Pathname.new((defined?(Refinery.root) ? Refinery.root.to_s : File.expand_path(File.dirname(__FILE__) << "/..")))
9
- unless refinery_root == (defined?(Rails.root) ? Rails.root : Pathname.new(RAILS_ROOT)) # e.g. only if we're in a gem.
10
- $LOAD_PATH.unshift refinery_root.join("vendor", "plugins").to_s
11
- $LOAD_PATH.unshift refinery_root.join("vendor", "plugins", "refinery", "lib").to_s
11
+ # Now we need to set some things that are used by the rest of the application.
12
+ Refinery.root = root_directory.cleanpath
13
+ if (Refinery.is_a_gem = (Refinery.root.realpath != rails_root.realpath))
14
+ # If Refinery is installed from a gem then we need to load in a few extra files.
15
+ $LOAD_PATH.unshift Refinery.root.join("vendor", "plugins").to_s
16
+ $LOAD_PATH.unshift Refinery.root.join("vendor", "plugins", "refinery", "lib").to_s
12
17
 
13
- require 'refinery'
14
- Refinery.root = refinery_root
18
+ # We also need the refinery initializer when using a gem because this won't be autoloaded.
15
19
  require 'refinery/initializer'
16
20
  end
17
21
 
@@ -583,25 +583,32 @@ var list_reorder = {
583
583
  , disable_reordering: function(e) {
584
584
  if(e) { e.preventDefault(); }
585
585
 
586
- serialized = "";
587
- list_reorder.sortable_list.find('> li[id]').each(function(index, li) {
588
- if (list_reorder.tree) {
589
- serialized += list_reorder.parse_branch([index], li);
590
- }
591
- else {
592
- serialized += "&sortable_list[]=" + $($(li).attr('id').split('_')).last().get(0);
593
- }
594
- });
595
- serialized += "&tree=" + list_reorder.tree + "&authenticity_token=" + encodeURIComponent($('#reorder_authenticity_token').val() + "&continue_reordering=false");
586
+ if (list_reorder.update_url != null) {
587
+ serialized = "";
588
+ list_reorder.sortable_list.find('> li[id]').each(function(index, li) {
589
+ if (list_reorder.tree) {
590
+ serialized += list_reorder.parse_branch([index], li);
591
+ }
592
+ else {
593
+ serialized += "&sortable_list[]=" + $($(li).attr('id').split('_')).last().get(0);
594
+ }
595
+ });
596
+ serialized += "&tree=" + list_reorder.tree + "&authenticity_token=" + encodeURIComponent($('#reorder_authenticity_token').val() + "&continue_reordering=false");
596
597
 
597
- $.post(list_reorder.update_url, serialized, function(data) {
598
- $(list_reorder.sortable_list.get(0)).html(data);
598
+ $.post(list_reorder.update_url, serialized, function(data) {
599
+ $(list_reorder.sortable_list.get(0)).html(data);
599
600
 
601
+ $(list_reorder.sortable_list).removeClass('reordering').sortable('destroy');
602
+
603
+ $('#reorder_action_done').hide();
604
+ $('#reorder_action').show();
605
+ });
606
+ } else {
600
607
  $(list_reorder.sortable_list).removeClass('reordering').sortable('destroy');
601
608
 
602
609
  $('#reorder_action_done').hide();
603
610
  $('#reorder_action').show();
604
- });
611
+ }
605
612
  }
606
613
  }
607
614
 
data/readme.md CHANGED
@@ -29,14 +29,14 @@ Unlike other content managers, Refinery is truly aimed at the end user making it
29
29
 
30
30
  Refinery runs using a number of gems which (as of Refinery version 0.9.5.29) are outlined below:
31
31
 
32
- * [rake >= 0.8.3](http://gemcutter.org/gems/rake)
33
- * [friendly_id >= 2.2.2](http://gemcutter.org/gems/friendly_id)
34
- * [will_paginate >= 2.3.11](http://gemcutter.org/gems/will_paginate)
35
- * [rails >= 2.3.5](http://gemcutter.org/gems/rails)
36
- * [aasm >= 2.1.3](http://gemcutter.org/gems/aasm)
37
- * [unicode >= 0.1](http://gemcutter.org/gems/unicode)
38
- * [hpricot >= 0.8.1](http://gemcutter.org/gems/hpricot)
39
- * [slim_scrooge >= 1.0.3](http://gemcutter.org/gems/slim_scrooge) (_Windows & JRuby users can ignore this one_)
32
+ * [rake >= 0.8.3](http://rubygems.org/gems/rake)
33
+ * [friendly_id >= 2.2.2](http://rubygems.org/gems/friendly_id)
34
+ * [will_paginate >= 2.3.11](http://rubygems.org/gems/will_paginate)
35
+ * [rails >= 2.3.5](http://rubygems.org/gems/rails)
36
+ * [aasm >= 2.1.3](http://rubygems.org/gems/aasm)
37
+ * [unicode >= 0.1](http://rubygems.org/gems/unicode)
38
+ * [hpricot >= 0.8.1](http://rubygems.org/gems/hpricot)
39
+ * [slim_scrooge >= 1.0.5](http://rubygems.org/gems/slim_scrooge)
40
40
 
41
41
  ### Other dependancies
42
42
 
@@ -49,7 +49,7 @@ Mac OS users [shell install script](http://github.com/maddox/magick-installer) w
49
49
 
50
50
  #### Install the Gem
51
51
 
52
- gem install refinerycms --source http://gemcutter.org
52
+ gem install refinerycms
53
53
  refinery path/to/project
54
54
 
55
55
  #### Or, clone Refinery's GIT repository
@@ -164,6 +164,12 @@ Extend Refinery easily by running the Refinery generator
164
164
 
165
165
  to get help on how to use that. Or read the full documentation on [writing plugins for Refinery](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/refinery/plugins.md)
166
166
 
167
+ ### Run the Tests
168
+
169
+ If you have installed Refinery using GIT (described above in step 1 of installing Refinery) then you'll be able to run the tests. At your Rails root run:
170
+
171
+ rake test
172
+
167
173
  ### What about a portfolio?
168
174
 
169
175
  Check out the [portfolio plugin gem](http://github.com/resolve/refinery-portfolio)
@@ -0,0 +1,16 @@
1
+ quentin:
2
+ id: 1
3
+ login: quentin
4
+ email: quentin@example.com
5
+ salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
6
+ crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
7
+ created_at: <%%= 5.days.ago.to_s :db %>
8
+ state: active
9
+ aaron:
10
+ id: 2
11
+ login: aaron
12
+ email: aaron@example.com
13
+ salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
14
+ crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
15
+ created_at: <%%= 1.days.ago.to_s :db %>
16
+ state: pending
@@ -0,0 +1,24 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+ require 'admin/dashboard_controller'
3
+
4
+ class Admin::DashboardController; def rescue_action(e) raise e end; end
5
+
6
+ class DashboardControllerTest < ActionController::TestCase
7
+
8
+ fixtures :users
9
+
10
+ def setup
11
+ @controller = Admin::DashboardController.new
12
+ @request = ActionController::TestRequest.new
13
+ @response = ActionController::TestResponse.new
14
+ end
15
+
16
+ def test_should_get_index
17
+ login_as(:quentin)
18
+
19
+ get :index
20
+ assert_response :success
21
+ assert_not_nil assigns(:recent_activity)
22
+ end
23
+
24
+ end
@@ -35,4 +35,9 @@ class ActiveSupport::TestCase
35
35
  fixtures :all
36
36
 
37
37
  # Add more helper methods to be used by all tests here...
38
+
39
+ def login_as(user)
40
+ @request.session[:user_id] = user ? users(user).id : nil
41
+ end
42
+
38
43
  end
@@ -0,0 +1,21 @@
1
+ == MIT License
2
+
3
+ Copyright (c) 2005-2009 Resolve Digital Ltd.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ Clean simple theme used and provided for free with Refinery. It's used in the demo Refinery site, http://demo.refinerycms.org
@@ -0,0 +1,94 @@
1
+ @import url('/stylesheets/refinery/application.css');
2
+ /*
3
+ Override default refinery application CSS below.
4
+ Formatting applies to all frontend.
5
+ */
6
+ body {
7
+ margin: 0px;
8
+ padding: 0px;
9
+ }
10
+ #body_content {
11
+ margin-top: 36px;
12
+ }
13
+ #body_content_left {
14
+ width: 544px;
15
+ }
16
+ #body_content_right {
17
+ width: 396px;
18
+ }
19
+ #body_content_right img {
20
+ border: 3px solid #c7c7c7;
21
+ }
22
+ #page {
23
+ width: 100%;
24
+ padding: 0px;
25
+ margin: 0px;
26
+ }
27
+ #body, #header_content, #footer_content {
28
+ width: 960px;
29
+ margin: 0px auto;
30
+ }
31
+ #header {
32
+ background: url('/theme/images/header_background.png') repeat-x;
33
+ }
34
+ #header_content {
35
+ position: relative;
36
+ height: 132px;
37
+ }
38
+ #header_content h1, #header_content h1 a {
39
+ color: #feffff;
40
+ font-size: 24px;
41
+ font-weight: normal;
42
+ left: 0px;
43
+ text-decoration: none;
44
+ }
45
+ #header_content h1, #header_content #menu {
46
+ position: absolute;
47
+ bottom: 30px;
48
+ margin: 0px;
49
+ }
50
+ #header_content #menu {
51
+ right: 0px;
52
+ padding: 0px;
53
+ }
54
+ #menu li {
55
+ float: left;
56
+ list-style: none;
57
+ position: relative;
58
+ }
59
+ #menu li a, #menu li:hover ul li a {
60
+ color: #969792;
61
+ display: block;
62
+ padding: 10px 18px;
63
+ text-decoration: none;
64
+ cursor: pointer;
65
+ }
66
+ #menu li.selected a, #menu li:hover a, #menu li a:hover, #menu li ul li a:hover {
67
+ color: #32322b;
68
+ background: white;
69
+ }
70
+ #menu li ul {
71
+ position: absolute;
72
+ left: -99999px;
73
+ padding: 0px;
74
+ margin: 0px;
75
+ min-width: 140px;
76
+ max-width: 300px;
77
+ background: white;
78
+ }
79
+ #menu li ul li {
80
+ float: left;
81
+ }
82
+ #menu li:hover ul {
83
+ left: auto;
84
+ }
85
+ #footer {
86
+ margin-top: 120px;
87
+ background: url('/theme/images/footer_background.png') repeat-x;
88
+ }
89
+ #footer_content {
90
+ height: 103px;
91
+ padding-top: 94px;
92
+ background: url('/images/refinery/logo.png') 0px 80px no-repeat;
93
+ text-align: right;
94
+ }