spree_essentials 0.4.0.rc2 → 0.4.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/.gitignore +10 -0
  2. data/.travis.yml +11 -0
  3. data/CHANGELOG.md +125 -0
  4. data/Gemfile +6 -0
  5. data/README.md +79 -112
  6. data/Versionfile +7 -0
  7. data/app/assets/javascripts/{date.js → admin/date.js} +0 -0
  8. data/app/assets/javascripts/{jquery.autodate.js → admin/jquery.autodate.js} +0 -0
  9. data/app/assets/javascripts/{jquery.markitup.js → admin/jquery.markitup.js} +1 -1
  10. data/app/assets/javascripts/{markdown.set.js → admin/markdown.set.js} +0 -0
  11. data/app/assets/javascripts/admin/spree_essentials.js +1 -0
  12. data/app/assets/stylesheets/{markitup.css.erb → admin/markitup.css.erb} +5 -0
  13. data/app/assets/stylesheets/admin/spree_essentials.css +3 -0
  14. data/app/controllers/spree/admin/markdown_controller.rb +1 -1
  15. data/app/controllers/spree/admin/uploads_controller.rb +0 -4
  16. data/app/helpers/spree/admin/spree_essentials_helper.rb +16 -10
  17. data/app/models/spree/upload.rb +5 -3
  18. data/app/overrides/admin/spree_essentials.rb +13 -0
  19. data/app/views/spree/admin/shared/_contents_sub_menu.html.erb +9 -7
  20. data/app/views/spree/admin/uploads/edit.html.erb +0 -2
  21. data/app/views/spree/admin/uploads/index.html.erb +0 -1
  22. data/app/views/spree/admin/uploads/new.html.erb +0 -2
  23. data/config/routes.rb +5 -4
  24. data/{lib/generators/templates/db/migrate/add_attachment_file_size_to_assets.rb → db/migrate/20120306185618_add_attachment_file_size_to_assets.rb} +0 -0
  25. data/lib/generators/spree_essentials/install_generator.rb +16 -6
  26. data/lib/spree_essentials.rb +5 -24
  27. data/lib/spree_essentials/engine.rb +25 -0
  28. data/lib/spree_essentials/{test_helper.rb → testing/integration_case.rb} +13 -30
  29. data/lib/spree_essentials/testing/test_helper.rb +30 -0
  30. data/lib/spree_essentials/version.rb +1 -1
  31. data/spree_essentials.gemspec +34 -0
  32. data/test/dummy_hooks/after_migrate.rb.sample +1 -0
  33. data/test/dummy_hooks/before_migrate.rb +30 -0
  34. data/test/dummy_hooks/templates/admin/all.css +3 -0
  35. data/test/dummy_hooks/templates/admin/all.js +1 -0
  36. data/test/dummy_hooks/templates/spree_user_error_fix.rb +3 -0
  37. data/test/dummy_hooks/templates/store/all.css +3 -0
  38. data/test/dummy_hooks/templates/store/all.js +1 -0
  39. data/test/dummy_hooks/templates/store/screen.css +749 -0
  40. data/test/integration/spree/admin/extension_integration_test.rb +50 -0
  41. data/test/integration/spree/admin/markdown_integration_test.rb +50 -0
  42. data/test/integration/spree/admin/upload_integration_test.rb +85 -0
  43. data/test/integration_test_helper.rb +2 -0
  44. data/test/spree_essential_example/README.md +3 -0
  45. data/test/spree_essential_example/app/controllers/spree/admin/examples_controller.rb +26 -0
  46. data/test/spree_essential_example/app/models/spree/example.rb +2 -0
  47. data/test/spree_essential_example/app/views/spree/admin/examples/_form.html.erb +21 -0
  48. data/test/spree_essential_example/app/views/spree/admin/examples/edit.html.erb +12 -0
  49. data/test/spree_essential_example/app/views/spree/admin/examples/index.html.erb +26 -0
  50. data/test/spree_essential_example/app/views/spree/admin/examples/new.html.erb +13 -0
  51. data/test/spree_essential_example/app/views/spree/admin/examples/show.html.erb +8 -0
  52. data/test/spree_essential_example/config/routes.rb +5 -0
  53. data/test/spree_essential_example/db/migrate/20120307043727_create_spree_examples.rb +12 -0
  54. data/test/spree_essential_example/lib/generators/spree_essentials/example_generator.rb +13 -0
  55. data/test/spree_essential_example/lib/spree_essential_example.rb +18 -0
  56. data/test/spree_essential_example/lib/spree_essential_example/engine.rb +21 -0
  57. data/test/spree_essential_example/lib/spree_essential_example/version.rb +3 -0
  58. data/test/spree_essential_example/spree_essential_example.gemspec +23 -0
  59. data/test/support/files/1.gif +0 -0
  60. data/test/support/files/1.jpg +0 -0
  61. data/test/support/files/1.png +0 -0
  62. data/test/support/files/2.gif +0 -0
  63. data/test/support/files/2.jpg +0 -0
  64. data/test/support/files/2.png +0 -0
  65. data/test/support/files/3.gif +0 -0
  66. data/test/support/files/3.jpg +0 -0
  67. data/test/support/files/3.png +0 -0
  68. data/test/support/files/test.pdf +0 -0
  69. data/test/support/files/test.zip +0 -0
  70. data/test/test_helper.rb +14 -0
  71. data/test/unit/spree/asset_test.rb +18 -0
  72. data/test/unit/spree/extension_test.rb +33 -0
  73. data/test/unit/spree/helpers/admin/spree_essentials_helper_test.rb +38 -0
  74. data/test/unit/spree/upload_test.rb +52 -0
  75. data/test/unit/validators/datetime_validator_test.rb +29 -0
  76. metadata +144 -47
  77. data/app/overrides/spree_essentials.rb +0 -5
  78. data/lib/generators/essentials_base.rb +0 -32
@@ -0,0 +1,10 @@
1
+ *.gem
2
+ *.log
3
+ *.sqlite3
4
+ .bundle
5
+ .DS_Store
6
+ coverage
7
+ Gemfile.lock
8
+ pkg/*
9
+ test/dummy_hooks/after_migrate.rb
10
+ test/dummy
@@ -0,0 +1,11 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - ree
6
+
7
+ before_script:
8
+ - "sh -e /etc/init.d/xvfb start"
9
+ - "bundle exec dummier"
10
+
11
+ script: "DISPLAY=:99.0 bundle exec rake"
@@ -0,0 +1,125 @@
1
+ ------------------------------------------------------------------------------
2
+ Change Log
3
+ ------------------------------------------------------------------------------
4
+
5
+ **0.40.0.rc3 - 2012/3/7**
6
+
7
+ * Normalize upload attachment location
8
+ * Use rails engine conventions for installation
9
+ * Remove shared InstallGenerator class
10
+ * Improved test coverage
11
+ * Added test/spree_essential_example
12
+
13
+
14
+ **0.40.0.rc2, 0.3.3 - 2012/1/20**
15
+
16
+ * Precompile admin assets in production
17
+
18
+
19
+ **0.4.0.rc1 - 2012/1/16**
20
+
21
+ * Add Spree 1.0.0 compatibility
22
+ * Breaks with previous versions of Spree
23
+
24
+
25
+ **0.3.2 - 2011/12/30**
26
+
27
+ * Safer decorator load path
28
+
29
+
30
+ **0.3.1 - 2011/12/13**
31
+
32
+ * Fix broken markitup editor
33
+ * Rework 'selected' class on content tab
34
+
35
+
36
+ **0.3.0 - 2011/12/13**
37
+
38
+ * Upgrade to Spree 0.70.x
39
+ * Remove spork dependency
40
+
41
+
42
+ **0.2.3 - 2012/1/6**
43
+
44
+ * Removed automatic attachment config with SpreeHeroku [0.60.x]
45
+
46
+
47
+ **0.2.2 - 2011/7/22**
48
+
49
+ * Moved pagination above new image form
50
+
51
+
52
+ **0.2.1 - 2011/7/22**
53
+
54
+ * Added pagination to admin/uploads ... oops!
55
+
56
+
57
+ **0.2.0 - 2011/7/14**
58
+
59
+ * Depend on Spree 0.60.x and above
60
+ * Remove spree_auth dependency
61
+ * Removed `app/controllers/admin/resource_controller.rb` in favor of the Spree Default one
62
+ * Updated development gems to most recent versions
63
+
64
+
65
+ **0.1.4 - 2011/6/10**
66
+
67
+ * Removed console.log from jquery.autodate.js
68
+ * Updated resource controller with better flash message handling
69
+ * Added faker.lorem.words to en.yml to prevent NoMethodError in integration tests
70
+
71
+
72
+ **0.1.3 - 2011/6/8**
73
+
74
+ * Added test in teardown to check for missing translations
75
+ * Removed some old bits of CMS code
76
+
77
+
78
+ **0.1.2 - 2011/6/7**
79
+
80
+ * Added missing translation
81
+ * Cleanup
82
+
83
+
84
+ **0.1.1 - 2011/6/7**
85
+
86
+ * Released 0.1.1
87
+ * Updated resource_controller.rb to Spree 0.60.0's and added `translated_object_name` method. ([pull request #419](https://github.com/spree/spree/pull/419) on Spree)
88
+ * Added upload integration test
89
+ * Cleaned up en.yml
90
+
91
+
92
+ **2011/6/6**
93
+
94
+ * Removed `spree_auth` requirement
95
+ * Added a few test helpers
96
+ * Updated readme
97
+
98
+
99
+ **0.1.0 2011/6/1**
100
+
101
+ * Added [dummier](https://github.com/citrus/dummier)
102
+ * Removed some remaining CMS bits
103
+
104
+
105
+ **2011/4/26**
106
+
107
+ * Modularized CMS. It can now be found [here](https://github.com/citrus/spree_essential_cms)
108
+
109
+
110
+ **2011/4/12**
111
+
112
+ * Added content contexts for multiple contents per page
113
+ * Namespaced posts into blog/posts
114
+ * Added `<!-- more -->` tag to posts
115
+
116
+
117
+ **2011/4/4**
118
+
119
+ * Added Page Images and starting to remove resource_controller.
120
+
121
+
122
+ **2011/4/3**
123
+
124
+ * Automatically adds [Heroku](http://heroku.com) support when you include [spree_heroku](https://github.com/paxer/spree-heroku) in your Gemfile. Check the [spree_heroku readme](https://github.com/paxer/spree-heroku#readme) for full installation instructions.
125
+ * Creates default content when you create a new page.
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+ gemspec
3
+
4
+ group :development, :test do
5
+ gem "spree_essential_example", :path => "test/spree_essential_example"
6
+ end
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # Spree Essentials [![Build Status](https://secure.travis-ci.org/citrus/spree_essentials.png)](http://travis-ci.org/citrus/spree_essentials)
2
2
 
3
-
4
3
  Spree Essentials is the base for many content related extensions for Spree. It doesn't do much on it's own ;)
5
4
 
6
5
  Spree Essentials provides other extensions with:
@@ -19,140 +18,129 @@ Current essential-aware extensions include:
19
18
  * [spree_essential_press](https://github.com/citrus/spree_essential_press): A simple press page for displaying media related content.
20
19
 
21
20
 
22
-
21
+ ------------------------------------------------------------------------------
23
22
  Installation
24
- ------------
23
+ ------------------------------------------------------------------------------
25
24
 
26
25
  If you don't already have an existing Spree site, [click here](https://gist.github.com/946719) then come back later... You can also read the Spree docs [here](http://spreecommerce.com/documentation/getting_started.html)...
27
26
 
28
27
  Spree Essentials can be installed by itself by adding the following to your Gemfile:
29
-
30
- # Spree 1.0.x
31
- gem 'spree_essentials', '~> 0.4.0.rc2'
28
+
29
+ ```ruby
30
+ # Spree 1.0.x
31
+ gem 'spree_essentials', '~> 0.4.0.rc3'
32
32
 
33
- # Spree 0.70.x
34
- gem 'spree_essentials', '~> 0.3.3'
33
+ # Spree 0.70.x
34
+ gem 'spree_essentials', '~> 0.3.3'
35
+
36
+ # Spree 0.60.x
37
+ gem 'spree_essentials', '~> 0.2.3'
38
+ ```
35
39
 
36
- # Spree 0.60.x
37
- gem 'spree_essentials', '~> 0.2.3'
38
-
39
40
  This isn't necessary if you're using spree_essentials based extensions. If that's the case, just include the extensions normally:
40
-
41
- gem 'spree_essential_cms'
42
- gem 'spree_essential_blog'
43
41
 
42
+ ```ruby
43
+ gem 'spree_essential_cms'
44
+ gem 'spree_essential_blog'
45
+ ```
44
46
 
45
47
  Then run:
46
48
 
47
- bundle install
48
-
49
+ ```bash
50
+ bundle install
51
+ ```
49
52
 
50
53
  Once that's complete, run the migration generator and migrate your database:
51
54
 
52
55
  To see your available generators run
53
56
 
54
- rails g
55
-
57
+ ```bash
58
+ rails g
59
+ ```
56
60
 
57
61
  Now run the generators for extensions you wish to install
58
-
59
- rails g spree_essentials:install
60
- rails g spree_essentials:cms
61
- rails g spree_essentials:blog
62
-
62
+
63
+ ```bash
64
+ rails g spree_essentials:install
65
+ rails g spree_essentials:cms
66
+ rails g spree_essentials:blog
67
+ ```
63
68
 
64
69
  Then migrate your database:
65
- rake db:migrate
66
70
 
71
+ ```bash
72
+ rake db:migrate
73
+ ```
67
74
 
68
75
  If that all went smoothly, you should be ready to boot the server with:
69
76
 
70
- rails s
71
-
77
+ ```bash
78
+ rails s
79
+ ```
72
80
 
73
81
  Now login to the admin and click on the 'Content' tab!
74
82
 
75
83
 
76
-
77
- Essential Awareness
78
- -------------------
79
-
80
- Spree Essentials is designed to allow other extensions to reside under it's global 'Content' tab in the admin. [SpreeEssentialPress](https://github.com/citrus/spree_essential_press) is the first of many extensions that can run with or without spree_essentials installed.
81
-
82
- Setting up an essential aware extension is easy. In your `lib/[extension_name].rb` file, add something like this:
83
-
84
-
85
- module SpreeEssentialPress
86
-
87
- def self.tab
88
- { :label => "Press", :route => :admin_press_index }
89
- end
90
-
91
- def self.sub_tab
92
- [:press, { :route => :admin_press_index, :label => 'admin.subnav.press', :match_path => '/press' }]
93
- end
94
-
95
- def self.independent?
96
- return true unless defined?(SpreeEssentials)
97
- !SpreeEssentials.respond_to(:register)
98
- end
99
-
100
- end
101
-
102
- unless SpreeEssentialPress.independent?
103
- # register with Spree Essentials and reside under the "Content" tab
104
- SpreeEssentials.register :press, SpreeEssentialPress
105
- end
106
-
107
-
108
-
109
-
84
+ ------------------------------------------------------------------------------
110
85
  Notes
111
- -----
86
+ ------------------------------------------------------------------------------
112
87
 
113
- Spree Essentials is under constant development... Development is being done on OSX with Ruby 1.9.2 and usually the latest version of Spree. (currently 0.70.0)
88
+ Spree Essentials is under constant development... Development is being done on OSX with Ruby 1.9.3 and usually the latest version of Spree. (currently 1.0.1)
114
89
 
115
90
  Please let me know if you find any bugs or have feature requests you'd like to see.
116
91
 
117
92
 
93
+ ------------------------------------------------------------------------------
118
94
  Testing
119
- -------
95
+ ------------------------------------------------------------------------------
120
96
 
121
97
  The test suite can be run like so:
122
98
 
123
- git clone git://github.com/citrus/spree_essentials.git
124
- cd spree_essentials
125
- bundle install
126
- bundle exec dummier
127
- rake
128
-
129
-
99
+ ```bash
100
+ git clone git://github.com/citrus/spree_essentials.git
101
+ cd spree_essentials
102
+ bundle install
103
+ bundle exec dummier
104
+ rake
105
+ ```
106
+
107
+
108
+ ------------------------------------------------------------------------------
130
109
  Demo
131
- ----
110
+ ------------------------------------------------------------------------------
132
111
 
133
112
  You can easily use the test/dummy app as a demo of spree_essentials. Just `cd` to where you develop and run:
134
-
135
- git clone git://github.com/citrus/spree_essentials.git
136
- cd spree_essentials
137
- mv lib/dummy_hooks/after_migrate.rb.sample lib/dummy_hooks/after_migrate.rb
138
- bundle install
139
- bundle exec dummier
140
- cd test/dummy
141
- rails s
142
-
143
-
144
-
113
+
114
+ ```bash
115
+ git clone git://github.com/citrus/spree_essentials.git
116
+ cd spree_essentials
117
+ cp test/dummy_hooks/after_migrate.rb.sample test/dummy_hooks/after_migrate.rb
118
+ bundle install
119
+ bundle exec dummier
120
+ cd test/dummy
121
+ rails s
122
+ ```
145
123
 
124
+
125
+ ------------------------------------------------------------------------------
146
126
  To Do
147
- -----
148
-
149
- * more tests
150
- * better documentation
127
+ ------------------------------------------------------------------------------
151
128
 
129
+ * better documentation (you know you want to help!)
152
130
 
153
131
 
132
+ ------------------------------------------------------------------------------
154
133
  Change Log
155
- ----------
134
+ ------------------------------------------------------------------------------
135
+
136
+ **0.40.0.rc3 - 2012/3/7**
137
+
138
+ * Normalize upload attachment location
139
+ * Use rails engine conventions for installation
140
+ * Remove shared InstallGenerator class
141
+ * Improved test coverage
142
+ * Added test/spree_essential_example
143
+
156
144
 
157
145
  **0.40.0.rc2, 0.3.3 - 2012/1/20**
158
146
 
@@ -182,41 +170,20 @@ Change Log
182
170
  * Remove spork dependency
183
171
 
184
172
 
185
- **0.2.3 - 2012/1/6**
186
-
187
- * Removed automatic attachment config with SpreeHeroku [0.60.x]
188
-
189
-
190
- **0.2.2 - 2011/7/22**
191
-
192
- * Moved pagination above new image form
193
-
194
-
195
- **0.2.1 - 2011/7/22**
196
-
197
- * Added pagination to admin/uploads
198
-
199
-
200
- **0.2.0 - 2011/7/14**
201
-
202
- * Depend on Spree 0.60.x and above
203
- * Remove spree_auth dependency
204
- * Removed `app/controllers/admin/resource_controller.rb` in favor of the Spree Default one
205
- * Updated development gems to most recent versions
206
-
207
173
  ....more in [CHANGELOG.md](https://github.com/citrus/spree_essentials/blob/master/CHANGELOG.md)
208
174
 
209
175
 
176
+ ------------------------------------------------------------------------------
210
177
  Contributors
211
- ------------
178
+ ------------------------------------------------------------------------------
212
179
 
213
180
  So far it's just me; Spencer Steffen.
214
181
 
215
182
  If you'd like to help out feel free to fork and send me pull requests!
216
183
 
217
184
 
218
-
185
+ ------------------------------------------------------------------------------
219
186
  License
220
- -------
187
+ ------------------------------------------------------------------------------
221
188
 
222
189
  Copyright (c) 2011 - 2012 Spencer Steffen & Citrus, released under the New BSD License All rights reserved.
@@ -0,0 +1,7 @@
1
+ "1.0.x" => { :version => "0.4.0.rc3" }
2
+ "0.70.x" => { :version => "0.3.2" }
3
+ "0.60.x" => { :version => "0.2.3" }
4
+ "0.50.x" => { :version => "0.2.3" }
5
+ "0.40.x" => {}
6
+ "0.30.x" => {}
7
+ "0.10.x" => {}
@@ -443,7 +443,7 @@
443
443
  previewWindow.close();
444
444
  });
445
445
  } else {
446
- iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
446
+ iFrame = $('<iframe class="markItUpPreviewFrame" name="markItUpPreviewFrame"></iframe>');
447
447
  if (options.previewPosition == 'after') {
448
448
  iFrame.insertAfter(footer);
449
449
  } else {