refinerycms 0.9.8.4 → 0.9.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/changelog.md +10 -1
- data/todo.md +8 -36
- data/vendor/refinerycms/authentication/config/locales/en.yml +2 -2
- data/vendor/refinerycms/authentication/config/locales/zh-CN.yml +4 -4
- data/vendor/refinerycms/authentication/features/manage_users.feature +2 -2
- data/vendor/refinerycms/core/config/locales/en.yml +5 -5
- data/vendor/refinerycms/core/config/locales/zh-CN.yml +2 -2
- data/vendor/refinerycms/core/engines.md +21 -16
- data/vendor/refinerycms/core/features/search.feature +3 -1
- data/vendor/refinerycms/core/features/step_definitions/core_steps.rb +1 -1
- data/vendor/refinerycms/core/lib/core.rb +76 -0
- data/vendor/refinerycms/core/lib/generators/refinery_engine/refinery_engine_generator.rb +5 -50
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/app/controllers/admin/plural_name_controller.rb +2 -2
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/app/views/plural_name/index.html.erb +1 -3
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/app/views/plural_name/show.html.erb +2 -6
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/config/locales/en.yml +4 -0
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/migrate/{migration_number_create_plural_name.rb → create_plural_name.rb} +0 -0
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb +2 -2
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/generators/refinerycms_plural_name_generator.rb +6 -0
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/plural_name.rb +4 -0
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/tasks/plural_name.rake +13 -0
- data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/readme.md +10 -0
- data/vendor/refinerycms/core/lib/refinery/crud.rb +1 -0
- data/vendor/refinerycms/core/lib/refinery/helpers/image_helper.rb +5 -4
- data/vendor/refinerycms/core/lib/refinery/helpers/site_bar_helper.rb +1 -1
- data/vendor/refinerycms/core/public/javascripts/refinery/admin.js +1 -1
- data/vendor/refinerycms/core/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +16 -8
- data/vendor/refinerycms/dashboard/config/locales/en.yml +1 -1
- data/vendor/refinerycms/dashboard/config/locales/zh-CN.yml +1 -1
- data/vendor/refinerycms/dashboard/features/dashboard.feature +1 -1
- data/vendor/refinerycms/images/config/locales/en.yml +2 -2
- data/vendor/refinerycms/images/config/locales/zh-CN.yml +2 -2
- data/vendor/refinerycms/images/features/manage_images.feature +4 -4
- data/vendor/refinerycms/images/lib/images.rb +23 -0
- data/vendor/refinerycms/pages/config/locales/en.yml +3 -3
- data/vendor/refinerycms/pages/config/locales/ru.yml +4 -4
- data/vendor/refinerycms/pages/config/locales/zh-CN.yml +2 -2
- data/vendor/refinerycms/pages/features/manage_pages.feature +5 -5
- data/vendor/refinerycms/pages/features/step_definitions/page_steps.rb +1 -0
- data/vendor/refinerycms/refinery.rb +1 -1
- data/vendor/refinerycms/resources/features/manage_files.feature +1 -1
- data/vendor/refinerycms/resources/lib/resources.rb +23 -0
- data/vendor/refinerycms/settings/config/locales/en.yml +1 -1
- data/vendor/refinerycms/settings/features/step_definitions/setting_steps.rb +2 -2
- data/vendor/refinerycms/settings/features/support/paths.rb +1 -1
- metadata +8 -5
data/Gemfile
CHANGED
@@ -36,7 +36,7 @@ gem 'sqlite3-ruby', :require => 'sqlite3'
|
|
36
36
|
gem 'refinerycms', :path => '.'
|
37
37
|
|
38
38
|
# Specify additional Refinery CMS Engines here (all optional):
|
39
|
-
gem 'refinerycms-inquiries', '~> 0.9.8.
|
39
|
+
gem 'refinerycms-inquiries', '~> 0.9.8.8'
|
40
40
|
# gem 'refinerycms-news', '~> 0.9.9'
|
41
41
|
# gem 'refinerycms-portfolio', '~> 0.9.8'
|
42
42
|
# gem 'refinerycms-theming', '~> 0.9.8'
|
data/changelog.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 0.9.8.5 [unreleased]
|
2
|
+
* Fixed an issue with the engine generator that was putting a comma in the wrong place breaking the call to ``crudify``. [Maarten Hoogendoorn](http://github.com/moretea)
|
3
|
+
* Made the delete messages consistent. [Uģis Ozols](http://github.com/ugisozols)
|
4
|
+
* ``zh-CN`` was overriding en locale in core locale file, fixed. [Philip Arndt](http://github.com/parndt)
|
5
|
+
* Changed verbiage from created to added, create to add as it describes it better for things like images. [Philip Arndt](http://github.com/parndt)
|
6
|
+
* ``image_fu`` no longer gives you the width and height of the image due to performance problems. [Philip Arndt](http://github.com/parndt) and [David Jones](http://github.com/djones)
|
7
|
+
* Implemented a standardised API for the engine generator. The core now includes a standard engine install generator. Engines generate a readme file explaining how to build an engine as a gem. [David Jones](http://github.com/djones)
|
8
|
+
* [See full list](http://github.com/resolve/refinerycms/compare/0.9.8.4...0.9.8.5)
|
9
|
+
|
1
10
|
## 0.9.8.4 [17 September 2010]
|
2
11
|
* Recursive deletion of page parts. [primerano](http://github.com/primerano)
|
3
12
|
* Move around the default pages. [Philip Arndt](http://github.com/parndt)
|
@@ -32,7 +41,7 @@
|
|
32
41
|
* Better use of dragonfly resizing. [Philip Arndt](http://github.com/parndt)
|
33
42
|
* Partial Latvian translation. [Uģis Ozols](http://github.com/ugisozols)
|
34
43
|
* Review Portugese translation. [Kivanio Barbosa](http://github.com/kivanio)
|
35
|
-
* Bugfix with wymeditor in the engine generator. [Karmen Blake]
|
44
|
+
* Bugfix with wymeditor in the engine generator. [Karmen Blake](http://github.com/kblake)
|
36
45
|
* Split ``application_helper`` into smaller, more usable files. [Philip Arndt](http://github.com/parndt)
|
37
46
|
* Move features and specs to each engine directory. [Philip Arndt](http://github.com/parndt)
|
38
47
|
* Bugfixes to ensure that reordering works under ``awesome_nested_set``. [Maarten Hoogendoorn](http://github.com/moretea) and [Philip Arndt](http://github.com/parndt)
|
data/todo.md
CHANGED
@@ -1,33 +1,14 @@
|
|
1
1
|
# Todos required for 0.9.9 release
|
2
2
|
|
3
|
-
##
|
4
|
-
|
5
|
-
Responsible person: ``djones``
|
6
|
-
|
7
|
-
rails g refinery_engine does the following things:
|
8
|
-
|
9
|
-
- Creates what it does now
|
10
|
-
- Creates a gemspec with the gem name of "refinerycms-#{engine_name}"
|
11
|
-
- Puts the gem in the Gemfile
|
12
|
-
- Copies db files to the vendor/engines/engine_name/db folder ONLY
|
13
|
-
- Creates a generator in lib/generators which will install the db to the right place
|
14
|
-
- Creates a public, spec, and features empty folders
|
15
|
-
- Creates lib/tasks as a template
|
16
|
-
- Maybe some sort of README on how to release your gem open source
|
17
|
-
|
18
|
-
Then the process will be:
|
19
|
-
|
20
|
-
### To create a fully releasable engine
|
21
|
-
|
22
|
-
rails g refinery_engine events name:string date:date picture:image
|
23
|
-
|
24
|
-
### To install the plugin into your app
|
3
|
+
## Solid Test Coverage
|
25
4
|
|
26
|
-
|
27
|
-
bundle install
|
28
|
-
rake db:migrate
|
5
|
+
Responsible person: ``VGoff``, ``hubble``
|
29
6
|
|
30
|
-
|
7
|
+
* Add more Cucumber features for the whole of Refinery.
|
8
|
+
* Add RSpec for the whole of Refinery, particularly:
|
9
|
+
- User, User engine and User mailer
|
10
|
+
- Inquiry mailer
|
11
|
+
- Refinery settings
|
31
12
|
|
32
13
|
## Internet Explorer 7+ Support
|
33
14
|
|
@@ -35,19 +16,10 @@ Responsible person: ``parndt``
|
|
35
16
|
|
36
17
|
* WYMEditor and the dialogs are the weakest areas right now.
|
37
18
|
|
38
|
-
Responsible person: ``stevenheidel``, ``djones``
|
19
|
+
Responsible person: ``stevenheidel``, ``djones``, ``everyone``
|
39
20
|
|
40
21
|
* Finding and filing issues found in IE
|
41
22
|
|
42
|
-
## Solid Test Coverage
|
43
|
-
|
44
|
-
Responsible person: ``VGoff``
|
45
|
-
|
46
|
-
* Add more Cucumber features for the whole of Refinery.
|
47
|
-
* Add RSpec for the whole of Refinery, particularly:
|
48
|
-
- User, User plugin and User mailer
|
49
|
-
- Inquiry mailer and Inquiry setting
|
50
|
-
|
51
23
|
## I18n support
|
52
24
|
|
53
25
|
* Check all the views for missing translations
|
@@ -13,10 +13,10 @@ en:
|
|
13
13
|
blank_password_keeps_current: Leaving password blank keeps the current password
|
14
14
|
enable_all: enable all
|
15
15
|
index:
|
16
|
-
create_new_user:
|
16
|
+
create_new_user: Add New User
|
17
17
|
user:
|
18
18
|
email_user: Email this user
|
19
|
-
preview: (%{who})
|
19
|
+
preview: (%{who}) added %{created_at}
|
20
20
|
sessions:
|
21
21
|
login_successful: Logged in successfully
|
22
22
|
new:
|
@@ -10,14 +10,14 @@ zh-CN:
|
|
10
10
|
blank_password_keeps_current: Leaving password blank keeps the current password
|
11
11
|
enable_all: enable all
|
12
12
|
index:
|
13
|
-
create_new_user:
|
14
|
-
no_users_yet: There are no users yet. Click "
|
13
|
+
create_new_user: Add New User
|
14
|
+
no_users_yet: There are no users yet. Click "Add New User" to add your first user.
|
15
15
|
user:
|
16
16
|
confirm_delete_message: "Are you sure you want to delete '%{who}'?"
|
17
17
|
confirm_delete_title: Remove this user forever
|
18
18
|
edit_user: Edit this user
|
19
19
|
email_user: Email this user
|
20
|
-
preview: (%{who})
|
20
|
+
preview: (%{who}) added %{created_at}
|
21
21
|
sessions:
|
22
22
|
login_successful: Logged in successfully
|
23
23
|
login_failed: Sorry, your password or username was incorrect.
|
@@ -51,7 +51,7 @@ zh-CN:
|
|
51
51
|
please_activate: Please activate your new account
|
52
52
|
activated: Your account has been activated!
|
53
53
|
activated_email: "%{who}, your account has been activated. You may now start adding your plugins:"
|
54
|
-
account_created: Your account has been
|
54
|
+
account_created: Your account has been added.
|
55
55
|
user_name: Username %{name}
|
56
56
|
password: Password %{password}
|
57
57
|
visit_url: "Visit this url to activate your account:"
|
@@ -34,14 +34,14 @@ Feature: Manage Users
|
|
34
34
|
Given I have a user named "resolve"
|
35
35
|
And I am a logged in refinery user
|
36
36
|
When I go to the list of users
|
37
|
-
And I follow "
|
37
|
+
And I follow "Add New User"
|
38
38
|
And I fill in "Login" with "cucumber"
|
39
39
|
And I fill in "Email" with "green@cucumber.com"
|
40
40
|
And I fill in "Password" with "greenandjuicy"
|
41
41
|
And I fill in "Password confirmation" with "greenandjuicy"
|
42
42
|
And I press "Save"
|
43
43
|
Then I should be on the list of users
|
44
|
-
And I should see "cucumber was successfully
|
44
|
+
And I should see "cucumber was successfully added."
|
45
45
|
And I should see "cucumber (green@cucumber.com)"
|
46
46
|
|
47
47
|
Scenario: Edit User
|
@@ -21,9 +21,9 @@ en:
|
|
21
21
|
cancel: Cancel
|
22
22
|
refinery:
|
23
23
|
crudify:
|
24
|
-
created: %{what} was successfully
|
24
|
+
created: %{what} was successfully added.
|
25
25
|
updated: %{what} was successfully updated.
|
26
|
-
destroyed: %{what} was successfully
|
26
|
+
destroyed: %{what} was successfully removed.
|
27
27
|
shared:
|
28
28
|
site_bar:
|
29
29
|
log_out: Log out
|
@@ -35,8 +35,8 @@ en:
|
|
35
35
|
form_actions:
|
36
36
|
save: Save
|
37
37
|
cancel: Cancel
|
38
|
-
cancel_lose_changes:
|
39
|
-
delete:
|
38
|
+
cancel_lose_changes: If you cancel you will lose any changes you have made here
|
39
|
+
delete: Remove
|
40
40
|
previous: Previous
|
41
41
|
next: Next
|
42
42
|
close: Close
|
@@ -57,7 +57,7 @@ en:
|
|
57
57
|
results_for: Search results for '%{query}'
|
58
58
|
no_results: Sorry, no results found
|
59
59
|
delete:
|
60
|
-
message: Are you sure you want to
|
60
|
+
message: Are you sure you want to remove '%{title}'?
|
61
61
|
error_messages:
|
62
62
|
problems_in_following_fields: There were problems with the following fields
|
63
63
|
help: help
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
zh-CN:
|
2
2
|
welcome:
|
3
3
|
there_are_no_users: "There are no users yet, so we'll set you up first."
|
4
4
|
remember_admin_location: "Remember your Refinery admin area is at:"
|
@@ -16,7 +16,7 @@ en:
|
|
16
16
|
reorder: "Reorder %{what}"
|
17
17
|
reorder_done: "Done Reordering %{what}"
|
18
18
|
crudify:
|
19
|
-
created: "%{what} was successfully
|
19
|
+
created: "%{what} was successfully added."
|
20
20
|
updated: "%{what} was successfully updated."
|
21
21
|
destroyed: "%{what} was successfully destroyed."
|
22
22
|
shared:
|
@@ -1,10 +1,10 @@
|
|
1
|
-
# Extending Refinery with
|
1
|
+
# Extending Refinery with Engines
|
2
2
|
|
3
3
|
## Introduction
|
4
4
|
|
5
5
|
__Refinery is designed to be easily extended so you can quickly customise your Refinery site to manage new areas you want to add to your site. If you see something you want to customise, the chances are you can customise it.__
|
6
6
|
|
7
|
-
The main way of extending Refinery is through adding new
|
7
|
+
The main way of extending Refinery is through adding new engines to your app. By default you can edit pages in Refinery's backend, but how do you add a new section to manage like products?
|
8
8
|
|
9
9
|
## The Refinery Generator
|
10
10
|
|
@@ -30,10 +30,15 @@ This will output the help on how to use the generator. To generate the new secti
|
|
30
30
|
|
31
31
|
rails generate refinery_engine product title:string description:text image:image brochure:resource
|
32
32
|
|
33
|
-
The generator will output a list of files it generated. You'll notice there is a new
|
33
|
+
The generator will output a list of files it generated. You'll notice there is a new engine that has been added in ``vendor/engines/products``. This is where both the backend and front end files are held for this new products area.
|
34
34
|
|
35
|
-
|
35
|
+
Engines are treated like gems. When you generate a new engine it adds the gem dependency for this engine to the end of your ``Gemfile``. Because your ``Gemfile`` has changed you now need to run:
|
36
36
|
|
37
|
+
bundle install
|
38
|
+
|
39
|
+
When the products engine was generated a products generator was also created. This installs any migrations and seeds into your Rails app. Here's how to finish off the install
|
40
|
+
|
41
|
+
rails generate refinerycms_products
|
37
42
|
rake db:migrate
|
38
43
|
|
39
44
|
Start up your app by running ``ruby script/server`` go to [http://localhost:3000](http://localhost:3000) and you'll see instantly a new menu item called "products". Click on that and you'll see there are no products yet.
|
@@ -42,11 +47,11 @@ Now go to the backend of your site by visiting [http://localhost:3000/refinery](
|
|
42
47
|
|
43
48
|
Now you have a fully managed products section in Refinery, nice.
|
44
49
|
|
45
|
-
If you want to modify your generated
|
50
|
+
If you want to modify your generated engine you need to understand the basic structure of how they work.
|
46
51
|
|
47
|
-
## The Structure of
|
52
|
+
## The Structure of an Engine
|
48
53
|
|
49
|
-
Think of a
|
54
|
+
Think of a engine in Refinery as a small Rails app. Engines have a structure that is extremely similar to a Rails app. Here's an example of Refinery's pages engine (located in Refinery's ``vendor/refinerycms/pages/`` folder)
|
50
55
|
|
51
56
|
pages
|
52
57
|
|- app
|
@@ -91,23 +96,23 @@ This bit is important. It's where all the controllers are held to manage pages i
|
|
91
96
|
|
92
97
|
end
|
93
98
|
|
94
|
-
This single controller allows us to create, read, update and delete pages in the backend. With a little bit of Refinery magic we utilise the [crudify mixin](http://github.com/resolve/refinerycms/blob/master/vendor/
|
99
|
+
This single controller allows us to create, read, update and delete pages in the backend. With a little bit of Refinery magic we utilise the [crudify mixin](http://github.com/resolve/refinerycms/blob/master/vendor/refinerycms/core/crud.md) which gives us all of these regular features out of the box.
|
95
100
|
|
96
|
-
How crudify works is an entire topic of it's own. Checkout the [crudify documentation](http://github.com/resolve/refinerycms/blob/master/vendor/
|
101
|
+
How crudify works is an entire topic of it's own. Checkout the [crudify documentation](http://github.com/resolve/refinerycms/blob/master/vendor/refinerycms/core/crud.md) to get an insight into how that works.
|
97
102
|
|
98
103
|
### app/views and app/helpers
|
99
104
|
|
100
|
-
Works exactly the same as ``app/views`` and ``app/helpers`` in a normal Rails app. You just put the views and helpers related to this
|
105
|
+
Works exactly the same as ``app/views`` and ``app/helpers`` in a normal Rails app. You just put the views and helpers related to this engine in here instead of in your actual main app directory.
|
101
106
|
|
102
107
|
### config/routes.rb
|
103
108
|
|
104
|
-
Works exactly the same as ``config/routes.rb`` in your app except this routes file only loads the routes for this
|
109
|
+
Works exactly the same as ``config/routes.rb`` in your app except this routes file only loads the routes for this engine.
|
105
110
|
|
106
111
|
### rails/init.rb
|
107
112
|
|
108
|
-
This file runs when your site is started up. All is does is registers this
|
113
|
+
This file runs when your site is started up. All is does is registers this engine with Refinery so it knows that it exists, how to handle it in the Refinery admin menu and how to render recent activity on the Dashboard (see "Getting your Engine to Report Activity in the Dashboard")
|
109
114
|
|
110
|
-
NOTE: The latest version of Refinery requires that you only specify a
|
115
|
+
NOTE: The latest version of Refinery requires that you only specify a engine.name. plugin.title & plugin.description will be looked up by the I18n system.
|
111
116
|
|
112
117
|
# pages/lib/pages.rb
|
113
118
|
Refinery::Plugin.register do |plugin|
|
@@ -130,11 +135,11 @@ NOTE: The latest version of Refinery requires that you only specify a plugin.nam
|
|
130
135
|
title: Pages
|
131
136
|
description: Manage content pages
|
132
137
|
|
133
|
-
## Getting your
|
138
|
+
## Getting your Engine to Report Activity in the Dashboard
|
134
139
|
|
135
|
-
Recent activity reporting is built right in, so all you need to do is follow the convention below and your
|
140
|
+
Recent activity reporting is built right in, so all you need to do is follow the convention below and your engine will start showing up in the recent activity list of the Dashboard.
|
136
141
|
|
137
|
-
In our example above we showed the use of ``plugin.activity`` for the pages
|
142
|
+
In our example above we showed the use of ``plugin.activity`` for the pages engine.
|
138
143
|
|
139
144
|
Refinery::Plugin.register do |plugin|
|
140
145
|
plugin.name = "pages"
|
@@ -20,7 +20,7 @@ Feature: Search
|
|
20
20
|
|page |testitem|pages |
|
21
21
|
|inquiry |testitem|inquiries |
|
22
22
|
|inquiry |testitem|spam inquiries|
|
23
|
-
|
|
23
|
+
|setting |testitem|settings |
|
24
24
|
|
25
25
|
# This will only run when resources engine is installed.
|
26
26
|
@search-file
|
@@ -55,3 +55,5 @@ Feature: Search
|
|
55
55
|
|files |files |
|
56
56
|
|inquiries|inquiries |
|
57
57
|
|inquiries|spam inquiries|
|
58
|
+
|settings |settings |
|
59
|
+
|
@@ -7,6 +7,8 @@ require 'dragonfly'
|
|
7
7
|
require 'friendly_id'
|
8
8
|
require 'truncate_html'
|
9
9
|
require 'will_paginate'
|
10
|
+
require 'rails/generators'
|
11
|
+
require 'rails/generators/migration'
|
10
12
|
|
11
13
|
module Refinery
|
12
14
|
autoload :Plugin, File.expand_path('../refinery/plugin', __FILE__)
|
@@ -73,4 +75,78 @@ module Refinery
|
|
73
75
|
end
|
74
76
|
end
|
75
77
|
end
|
78
|
+
|
79
|
+
module Generators
|
80
|
+
# The core engine installer streamlines the installation of custom generated
|
81
|
+
# engines. It takes the migrations and seeds in your engine and moves them
|
82
|
+
# into the rails app db directory, ready to migrate.
|
83
|
+
class EngineInstaller < Rails::Generators::Base
|
84
|
+
include Rails::Generators::Migration
|
85
|
+
|
86
|
+
def self.engine_name(name = nil)
|
87
|
+
@engine_name = name unless name.nil?
|
88
|
+
@engine_name
|
89
|
+
end
|
90
|
+
|
91
|
+
# Implement the required interface for Rails::Generators::Migration.
|
92
|
+
# taken from http://github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb
|
93
|
+
# can be removed once this issue is fixed:
|
94
|
+
# # https://rails.lighthouseapp.com/projects/8994/tickets/3820-make-railsgeneratorsmigrationnext_migration_number-method-a-class-method-so-it-possible-to-use-it-in-custom-generators
|
95
|
+
def self.next_migration_number(dirname)
|
96
|
+
if ActiveRecord::Base.timestamped_migrations
|
97
|
+
Time.now.utc.strftime("%Y%m%d%H%M%S")
|
98
|
+
else
|
99
|
+
"%.3d" % (current_migration_number(dirname) + 1)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def generate
|
104
|
+
Dir.glob(File.expand_path(File.join(self.class.source_root, '../db/**/**'))).each do |path|
|
105
|
+
unless File.directory?(path)
|
106
|
+
if path =~ /.*migrate.*/
|
107
|
+
migration_template path, Rails.root.join("db/migrate/create_#{self.class.engine_name}")
|
108
|
+
else
|
109
|
+
template path, Rails.root.join("db/seeds/#{self.class.engine_name}.rb")
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
puts "------------------------"
|
115
|
+
puts "Now run:"
|
116
|
+
puts "rake db:migrate"
|
117
|
+
puts "------------------------"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
76
122
|
end
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
# Below is a hack until this issue:
|
128
|
+
# https://rails.lighthouseapp.com/projects/8994/tickets/3820-make-railsgeneratorsmigrationnext_migration_number-method-a-class-method-so-it-possible-to-use-it-in-custom-generators
|
129
|
+
# is fixed on the Rails project.
|
130
|
+
|
131
|
+
require 'rails/generators/named_base'
|
132
|
+
require 'rails/generators/migration'
|
133
|
+
require 'rails/generators/active_model'
|
134
|
+
require 'active_record'
|
135
|
+
|
136
|
+
module ActiveRecord
|
137
|
+
module Generators
|
138
|
+
class Base < Rails::Generators::NamedBase #:nodoc:
|
139
|
+
include Rails::Generators::Migration
|
140
|
+
|
141
|
+
# Implement the required interface for Rails::Generators::Migration.
|
142
|
+
def self.next_migration_number(dirname) #:nodoc:
|
143
|
+
next_migration_number = current_migration_number(dirname) + 1
|
144
|
+
if ActiveRecord::Base.timestamped_migrations
|
145
|
+
[Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
|
146
|
+
else
|
147
|
+
"%.3d" % next_migration_number
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
@@ -9,7 +9,8 @@ class RefineryEngineGenerator < Rails::Generators::NamedBase
|
|
9
9
|
|
10
10
|
def generate
|
11
11
|
unless attributes.empty?
|
12
|
-
Dir.glob(File.expand_path('../templates/**/**', __FILE__)).each do |path|
|
12
|
+
Dir.glob(File.expand_path('../templates/**/**', __FILE__), File::FNM_DOTMATCH).each do |path|
|
13
|
+
# ignore directories which are created automatically by template()
|
13
14
|
unless File.directory?(path)
|
14
15
|
template path, plugin_path_for(path)
|
15
16
|
end
|
@@ -24,6 +25,7 @@ class RefineryEngineGenerator < Rails::Generators::NamedBase
|
|
24
25
|
puts "------------------------"
|
25
26
|
puts "Now run:"
|
26
27
|
puts "bundle install"
|
28
|
+
puts "rails generate refinerycms_#{plural_name}"
|
27
29
|
puts "rake db:migrate"
|
28
30
|
puts "------------------------"
|
29
31
|
elsif self.behavior == :revoke
|
@@ -39,56 +41,9 @@ protected
|
|
39
41
|
|
40
42
|
def plugin_path_for(path)
|
41
43
|
path = path.gsub(File.dirname(__FILE__) + "/templates/", "vendor/engines/#{plural_name}/")
|
44
|
+
|
42
45
|
path = path.gsub("plural_name", plural_name)
|
43
46
|
path = path.gsub("singular_name", singular_name)
|
44
|
-
path = path.gsub(".migration", '')
|
45
|
-
|
46
|
-
# hack can be removed after issue is fixed
|
47
|
-
unless self.behavior == :revoke
|
48
|
-
next_migration_number = ActiveRecord::Generators::Base.next_migration_number(File.dirname(__FILE__))
|
49
|
-
else
|
50
|
-
if (migrations = Dir[Rails.root.join('db', 'migrate', "*create_#{plural_name}*.rb").to_s]).any?
|
51
|
-
next_migration_number = migrations.first.split('/').last.split('_').first
|
52
|
-
else
|
53
|
-
next_migration_number = ''
|
54
|
-
end
|
55
|
-
end
|
56
|
-
path = path.gsub("migration_number", next_migration_number.to_s)
|
57
|
-
|
58
|
-
# replace our local db path with the app one instead.
|
59
|
-
path = path.gsub("/db/", "/../../../db/")
|
60
47
|
end
|
61
48
|
|
62
|
-
end
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
# Below is a hack until this issue:
|
70
|
-
# https://rails.lighthouseapp.com/projects/8994/tickets/3820-make-railsgeneratorsmigrationnext_migration_number-method-a-class-method-so-it-possible-to-use-it-in-custom-generators
|
71
|
-
# is fixed on the Rails project.
|
72
|
-
|
73
|
-
require 'rails/generators/named_base'
|
74
|
-
require 'rails/generators/migration'
|
75
|
-
require 'rails/generators/active_model'
|
76
|
-
require 'active_record'
|
77
|
-
|
78
|
-
module ActiveRecord
|
79
|
-
module Generators
|
80
|
-
class Base < Rails::Generators::NamedBase #:nodoc:
|
81
|
-
include Rails::Generators::Migration
|
82
|
-
|
83
|
-
# Implement the required interface for Rails::Generators::Migration.
|
84
|
-
def self.next_migration_number(dirname) #:nodoc:
|
85
|
-
next_migration_number = current_migration_number(dirname) + 1
|
86
|
-
if ActiveRecord::Base.timestamped_migrations
|
87
|
-
[Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
|
88
|
-
else
|
89
|
-
"%.3d" % next_migration_number
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
49
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Admin::<%= class_name.pluralize %>Controller < Admin::BaseController
|
2
2
|
|
3
|
-
crudify :<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title'
|
4
|
-
|
3
|
+
crudify :<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>,
|
4
|
+
:title_attribute => '<%= title.name %>'
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
end
|
@@ -2,9 +2,7 @@
|
|
2
2
|
<ul id="<%= plural_name %>">
|
3
3
|
<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
|
4
4
|
<li>
|
5
|
-
<%%= link_to <%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>
|
6
|
-
.<%= title.name %>
|
7
|
-
<% end %>, <%= singular_name %>_url(<%= singular_name %>) %>
|
5
|
+
<%%= link_to <%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>.<%= title.name %><% end %>, <%= singular_name %>_url(<%= singular_name %>) %>
|
8
6
|
</li>
|
9
7
|
<%% end %>
|
10
8
|
</ul>
|
@@ -1,7 +1,5 @@
|
|
1
1
|
<%% content_for :body_content_title do %>
|
2
|
-
<%%= @<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>
|
3
|
-
.<%= title.name %>
|
4
|
-
<% end %> %>
|
2
|
+
<%%= @<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>.<%= title.name %><% end %> %>
|
5
3
|
<%% end %>
|
6
4
|
|
7
5
|
<%% content_for :body_content_left do %>
|
@@ -24,9 +22,7 @@
|
|
24
22
|
<ul id="<%= plural_name %>">
|
25
23
|
<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
|
26
24
|
<li>
|
27
|
-
<%%= link_to <%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>
|
28
|
-
.<%= title.name %>
|
29
|
-
<% end %>, <%= singular_name %>_url(<%= singular_name %>) %>
|
25
|
+
<%%= link_to <%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>.<%= title.name %><% end %>, <%= singular_name %>_url(<%= singular_name %>) %>
|
30
26
|
</li>
|
31
27
|
<%% end %>
|
32
28
|
</ul>
|
File without changes
|
data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
CHANGED
@@ -10,6 +10,6 @@ page = Page.create(
|
|
10
10
|
:position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
|
11
11
|
:menu_match => "^/<%= plural_name %>(\/|\/.+?|)$"
|
12
12
|
)
|
13
|
-
|
13
|
+
Page.default_parts.each do |default_page_part|
|
14
14
|
page.parts.create(:title => default_page_part, :body => nil)
|
15
|
-
end
|
15
|
+
end
|
@@ -3,6 +3,10 @@ require 'refinery'
|
|
3
3
|
module Refinery
|
4
4
|
module <%= class_name.pluralize %>
|
5
5
|
class Engine < Rails::Engine
|
6
|
+
initializer "static assets" do |app|
|
7
|
+
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
8
|
+
end
|
9
|
+
|
6
10
|
config.after_initialize do
|
7
11
|
Refinery::Plugin.register do |plugin|
|
8
12
|
plugin.name = "<%= class_name.pluralize.underscore.downcase %>"
|
data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/tasks/plural_name.rake
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
namespace :refinery do
|
2
|
+
|
3
|
+
namespace :<%= plural_name %> do
|
4
|
+
|
5
|
+
# call this task my running: rake refinery:<%= plural_name %>:my_task
|
6
|
+
# desc "Description of my task below"
|
7
|
+
# task :my_task => :environment do
|
8
|
+
# # add your logic here
|
9
|
+
# end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# <%= plural_name.titleize %> engine for Refinery CMS.
|
2
|
+
|
3
|
+
## How to build this engine as a gem
|
4
|
+
|
5
|
+
cd vendor/engines/<%= plural_name %>
|
6
|
+
gem build refinerycms-<%= plural_name %>.gempspec
|
7
|
+
gem install refinerycms-<%= plural_name %>.gem
|
8
|
+
|
9
|
+
# Sign up for a http://rubygems.org/ account and publish the gem
|
10
|
+
gem push refinerycms-<%= plural_name %>.gem
|
@@ -22,12 +22,13 @@ module Refinery
|
|
22
22
|
# <%= image_fu @model.image, '200x200' %> or with no thumbnail: <%= image_fu @model.image %>
|
23
23
|
def image_fu(image, geometry = nil, options={})
|
24
24
|
if image.present?
|
25
|
-
# call rails' image tag function with default alt
|
25
|
+
# call rails' image tag function with default alt tag.
|
26
26
|
# if any other options were supplied these are merged in and can replace the defaults.
|
27
|
-
|
27
|
+
# if the geomtry is nil, then we know the image height and width already.
|
28
|
+
image_tag(image.thumbnail(geometry).url, {
|
28
29
|
:alt => image.respond_to?(:title) ? image.title : image.image_name,
|
29
|
-
:width =>
|
30
|
-
:height =>
|
30
|
+
:width => (image.image_width if geometry.nil?),
|
31
|
+
:height => (image.image_height if geometry.nil?)
|
31
32
|
}.merge(options))
|
32
33
|
end
|
33
34
|
end
|
@@ -16,7 +16,7 @@ module Refinery
|
|
16
16
|
elsif defined?(@page) and @page.present? and !@page.home?
|
17
17
|
edit_admin_page_url(@page, :only_path => true)
|
18
18
|
else
|
19
|
-
(request.fullpath.to_s == '/') ? admin_root_url(:only_path => true) : "/admin#{request.
|
19
|
+
(request.fullpath.to_s == '/') ? admin_root_url(:only_path => true) : "/admin#{request.fullpath}/edit"
|
20
20
|
end rescue admin_root_url(:only_path => true))
|
21
21
|
end
|
22
22
|
end
|
@@ -307,7 +307,7 @@ init_tooltips = function(args){
|
|
307
307
|
$(element).attr('tooltip', $(element).attr('title'));
|
308
308
|
}
|
309
309
|
// wipe clean the title on any children too.
|
310
|
-
$(element).add($(element).children('img')).
|
310
|
+
$(element).add($(element).children('img')).removeAttr('title');
|
311
311
|
});
|
312
312
|
}
|
313
313
|
|
@@ -1262,22 +1262,30 @@ WYMeditor.editor.prototype.dialog = function( dialogType ) {
|
|
1262
1262
|
// wrap the current selection with a funky span.
|
1263
1263
|
if (this._selected_image == null)
|
1264
1264
|
{
|
1265
|
-
if (
|
1265
|
+
if (selected != null && selected.tagName.toLowerCase() != WYMeditor.A && wym._iframe.contentWindow.getSelection) {
|
1266
1266
|
// Fixes webkit issue where it would not paste at cursor.
|
1267
1267
|
selection = wym._iframe.contentWindow.getSelection();
|
1268
|
-
selected_html = $(selected).html();
|
1268
|
+
selected_html = $(selected).html().replace(' ', ' ');
|
1269
1269
|
|
1270
|
-
if ((
|
1271
|
-
|
1270
|
+
if ((offset = selected_html.indexOf(selection.focusNode.textContent)) == -1) {
|
1271
|
+
offset = 0;
|
1272
|
+
}
|
1273
|
+
focus = offset + selection.focusOffset;
|
1274
|
+
anchor = offset + selection.anchorOffset;
|
1275
|
+
length = (focus - anchor);
|
1276
|
+
|
1277
|
+
if (length > 1) {
|
1278
|
+
new_html = selected_html.substring(0, anchor)
|
1272
1279
|
+ "<span id='replace_me_with_" + this._current_unique_stamp + "'>"
|
1273
|
-
+ selected_html.substring(
|
1280
|
+
+ selected_html.substring(anchor, focus)
|
1274
1281
|
+ "</span>"
|
1275
|
-
+ selected_html.substring(
|
1282
|
+
+ selected_html.substring(focus);
|
1276
1283
|
} else {
|
1277
|
-
new_html = selected_html.substring(0,
|
1284
|
+
new_html = selected_html.substring(0, focus)
|
1278
1285
|
+ "<span id='replace_me_with_" + this._current_unique_stamp + "'></span>"
|
1279
|
-
+ selected_html.substring(
|
1286
|
+
+ selected_html.substring(focus);
|
1280
1287
|
}
|
1288
|
+
new_html = new_html.replace(' ', ' ');
|
1281
1289
|
|
1282
1290
|
$(selected).html(new_html);
|
1283
1291
|
} else {
|
@@ -16,7 +16,7 @@ Feature: Dashboard
|
|
16
16
|
When I fill in "Title" with "Page test from Dashboard"
|
17
17
|
And I press "Save"
|
18
18
|
Then I should be on the Dashboard
|
19
|
-
And I should see "'Page test from Dashboard' was successfully
|
19
|
+
And I should see "'Page test from Dashboard' was successfully added."
|
20
20
|
And I should have 1 page
|
21
21
|
|
22
22
|
Scenario: Update a Page Button
|
@@ -18,8 +18,8 @@ en:
|
|
18
18
|
current_image: Current Image
|
19
19
|
maximum_image_size: The maximum image size is %{megabytes} megabytes.
|
20
20
|
index:
|
21
|
-
create_new_image:
|
22
|
-
no_images_yet: There are no images yet. Click "
|
21
|
+
create_new_image: Add New Image
|
22
|
+
no_images_yet: There are no images yet. Click "Add New Image" to add your first image.
|
23
23
|
view:
|
24
24
|
switch_to: Switch to %{view_name} view
|
25
25
|
list: list
|
@@ -15,8 +15,8 @@ zh-CN:
|
|
15
15
|
current_image: Current Image
|
16
16
|
maximum_image_size: The maximum image size is %{megabytes} megabytes.
|
17
17
|
index:
|
18
|
-
create_new_image:
|
19
|
-
no_images_yet: There are no images yet. Click "
|
18
|
+
create_new_image: Add New Image
|
19
|
+
no_images_yet: There are no images yet. Click "Add New Image" to add your first image.
|
20
20
|
view:
|
21
21
|
switch_to: Switch to %{view_name} view
|
22
22
|
list: list
|
@@ -11,7 +11,7 @@ Feature: Manage Images
|
|
11
11
|
@images-create
|
12
12
|
Scenario: Create Valid Image
|
13
13
|
When I go to the list of images
|
14
|
-
And I follow "
|
14
|
+
And I follow "Add New Image"
|
15
15
|
And I attach the image at "beach.jpeg"
|
16
16
|
And I press "Save"
|
17
17
|
Then the image "beach.jpeg" should have uploaded successfully
|
@@ -23,10 +23,10 @@ Feature: Manage Images
|
|
23
23
|
|
24
24
|
Scenario: Create Invalid Image (format)
|
25
25
|
When I go to the list of images
|
26
|
-
And I follow "
|
26
|
+
And I follow "Add New Image"
|
27
27
|
And I attach the image at "refinery_is_awesome.txt"
|
28
28
|
And I press "Save"
|
29
|
-
Then I should not see "successfully
|
29
|
+
Then I should not see "successfully added"
|
30
30
|
And I should have 0 images
|
31
31
|
|
32
32
|
@images-edit
|
@@ -44,5 +44,5 @@ Feature: Manage Images
|
|
44
44
|
When I upload the image at "beach.jpeg"
|
45
45
|
When I go to the list of images
|
46
46
|
And I follow "Remove this image forever"
|
47
|
-
Then I should see "'Beach' was successfully
|
47
|
+
Then I should see "'Beach' was successfully removed."
|
48
48
|
And I should have 0 images
|
@@ -5,6 +5,29 @@ require 'refinery'
|
|
5
5
|
module Refinery
|
6
6
|
module Images
|
7
7
|
class Engine < Rails::Engine
|
8
|
+
initializer 'fix-tempfile-not-closing-with-dragonfly-images' do |app|
|
9
|
+
# see http://github.com/markevans/dragonfly/issues#issue/18/comment/415807
|
10
|
+
require 'tempfile'
|
11
|
+
class Tempfile
|
12
|
+
|
13
|
+
def unlink
|
14
|
+
# keep this order for thread safeness
|
15
|
+
begin
|
16
|
+
if File.exist?(@tmpname)
|
17
|
+
closed? or close
|
18
|
+
File.unlink(@tmpname)
|
19
|
+
end
|
20
|
+
@@cleanlist.delete(@tmpname)
|
21
|
+
@data = @tmpname = nil
|
22
|
+
ObjectSpace.undefine_finalizer(self)
|
23
|
+
rescue Errno::EACCES
|
24
|
+
# may not be able to unlink on Windows; just ignore
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
8
31
|
initializer 'images-with-dragonfly' do |app|
|
9
32
|
app_images = Dragonfly[:images]
|
10
33
|
app_images.configure_with(:rmagick)
|
@@ -40,7 +40,7 @@ en:
|
|
40
40
|
form_new_page_parts:
|
41
41
|
title: Title
|
42
42
|
form_page_parts:
|
43
|
-
create_content_section:
|
43
|
+
create_content_section: Add content section
|
44
44
|
delete_content_section: Delete content section
|
45
45
|
form_advanced_options:
|
46
46
|
toggle_advanced_options: Click to access meta tag settings and menu options
|
@@ -71,10 +71,10 @@ en:
|
|
71
71
|
meta_description_title: Meta description
|
72
72
|
meta_description_help: Enter a concise two or three sentences describing what this page is about.
|
73
73
|
index:
|
74
|
-
create_new_page:
|
74
|
+
create_new_page: Add New Page
|
75
75
|
reorder_pages: Reorder Pages
|
76
76
|
reorder_pages_done: Done Reordering Pages
|
77
|
-
no_pages_yet: There are no pages yet. Click "
|
77
|
+
no_pages_yet: There are no pages yet. Click "Add New Page" to add your first page.
|
78
78
|
activerecord:
|
79
79
|
models:
|
80
80
|
page: page
|
@@ -43,7 +43,7 @@ ru:
|
|
43
43
|
toggle_advanced_options: Click to access meta tag settings and menu options
|
44
44
|
parent_page: Родительская страница
|
45
45
|
title: Заголовок
|
46
|
-
create_content_section:
|
46
|
+
create_content_section: Add content section
|
47
47
|
delete_content_section: Delete content section
|
48
48
|
advanced_options: Дополнительная настройка
|
49
49
|
explain_page_different_title: "Если вы хотите, чтобы страница имела заголовок, отличный от того, что в меню или в заголовке браузера, введите его здесь."
|
@@ -55,7 +55,7 @@ ru:
|
|
55
55
|
text: Текст
|
56
56
|
image: Изображение
|
57
57
|
custom_url: Custom URL
|
58
|
-
custom_url_explanation: "Enter a URL if this page links to an external site or to a pre-existing resource e.g. a contact page. <br/> Note: This URL must point to a location that exists; a new one will not be
|
58
|
+
custom_url_explanation: "Enter a URL if this page links to an external site or to a pre-existing resource e.g. a contact page. <br/> Note: This URL must point to a location that exists; a new one will not be added."
|
59
59
|
draft: Черновик
|
60
60
|
show_in_menu_title: Показ в меню
|
61
61
|
show_in_menu_description: Отображать эту страницу в меню сайта
|
@@ -81,7 +81,7 @@ ru:
|
|
81
81
|
meta_description_help: "Введите два-три коротких предложения, описывающих страницу."
|
82
82
|
js:
|
83
83
|
content_section:
|
84
|
-
create:
|
84
|
+
create: Add Content Section
|
85
85
|
already_exists: "A content section with that title already exists, please choose another."
|
86
86
|
title_empty: "You have not entered a title for the content section, please enter one."
|
87
87
|
confirm_delete: "This will remove the content section {{section_name}} when the page is saved and erase all content that has been entered into it, Are you sure?"
|
@@ -90,7 +90,7 @@ ru:
|
|
90
90
|
reorder_pages: Изменить порядок страниц
|
91
91
|
reorder_pages_done: Сохранить такой порядок страниц
|
92
92
|
sorry_no_results: Sorry! There are no results found.
|
93
|
-
no_pages_yet: There are no pages yet. Click "
|
93
|
+
no_pages_yet: There are no pages yet. Click "Add New Page" to add your first page.
|
94
94
|
activerecord:
|
95
95
|
attributes:
|
96
96
|
page:
|
@@ -36,7 +36,7 @@ zh-CN:
|
|
36
36
|
form_new_page_parts:
|
37
37
|
title: Title
|
38
38
|
form_page_parts:
|
39
|
-
create_content_section:
|
39
|
+
create_content_section: Add content section
|
40
40
|
delete_content_section: Delete content section
|
41
41
|
form_advanced_options:
|
42
42
|
toggle_advanced_options: Click to access meta tag settings and menu options
|
@@ -69,7 +69,7 @@ zh-CN:
|
|
69
69
|
create_new_page: ������ҳ��
|
70
70
|
reorder_pages: Reorder Pages
|
71
71
|
reorder_pages_done: Done Reordering Pages
|
72
|
-
no_pages_yet: There are no pages yet. Click "
|
72
|
+
no_pages_yet: There are no pages yet. Click "Add New Page" to add your first page.
|
73
73
|
activerecord:
|
74
74
|
models:
|
75
75
|
page: page
|
@@ -16,15 +16,15 @@ Feature: Manage Pages
|
|
16
16
|
|
17
17
|
Scenario: Create Valid Page
|
18
18
|
When I go to the list of pages
|
19
|
-
And I follow "
|
19
|
+
And I follow "Add New Page"
|
20
20
|
And I fill in "Title" with "Pickles are Cucumbers Soaked in Evil"
|
21
21
|
And I press "Save"
|
22
|
-
Then I should see "'Pickles are Cucumbers Soaked in Evil' was successfully
|
22
|
+
Then I should see "'Pickles are Cucumbers Soaked in Evil' was successfully added."
|
23
23
|
And I should have 1 page
|
24
24
|
|
25
25
|
Scenario: Create Invalid Page (without title)
|
26
26
|
When I go to the list of pages
|
27
|
-
And I follow "
|
27
|
+
And I follow "Add New Page"
|
28
28
|
And I press "Save"
|
29
29
|
Then I should see "Title can't be blank"
|
30
30
|
And I should have 0 pages
|
@@ -32,7 +32,7 @@ Feature: Manage Pages
|
|
32
32
|
Scenario: Create Duplicate Page
|
33
33
|
Given I only have pages titled Home, About
|
34
34
|
When I go to the list of pages
|
35
|
-
And I follow "
|
35
|
+
And I follow "Add New Page"
|
36
36
|
And I fill in "Title" with "About"
|
37
37
|
And I press "Save"
|
38
38
|
Then I should have 3 pages
|
@@ -42,6 +42,6 @@ Feature: Manage Pages
|
|
42
42
|
Given I only have a page titled "test"
|
43
43
|
When I go to the list of pages
|
44
44
|
And I follow "Remove this page forever"
|
45
|
-
Then I should see "'test' was successfully
|
45
|
+
Then I should see "'test' was successfully removed."
|
46
46
|
And I should have 0 pages
|
47
47
|
And I should have 0 page_parts
|
@@ -35,5 +35,5 @@ Feature: Manage Files
|
|
35
35
|
When I upload the file at "refinery_is_awesome.txt"
|
36
36
|
And I go to the list of files
|
37
37
|
And I follow "Remove this file forever"
|
38
|
-
Then I should see "'Refinery Is Awesome' was successfully
|
38
|
+
Then I should see "'Refinery Is Awesome' was successfully removed."
|
39
39
|
And I should have 0 files
|
@@ -5,6 +5,29 @@ require 'refinery'
|
|
5
5
|
module Refinery
|
6
6
|
module Resources
|
7
7
|
class Engine < Rails::Engine
|
8
|
+
initializer 'fix-tempfile-not-closing-with-dragonfly-resources' do |app|
|
9
|
+
# see http://github.com/markevans/dragonfly/issues#issue/18/comment/415807
|
10
|
+
require 'tempfile'
|
11
|
+
class Tempfile
|
12
|
+
|
13
|
+
def unlink
|
14
|
+
# keep this order for thread safeness
|
15
|
+
begin
|
16
|
+
if File.exist?(@tmpname)
|
17
|
+
closed? or close
|
18
|
+
File.unlink(@tmpname)
|
19
|
+
end
|
20
|
+
@@cleanlist.delete(@tmpname)
|
21
|
+
@data = @tmpname = nil
|
22
|
+
ObjectSpace.undefine_finalizer(self)
|
23
|
+
rescue Errno::EACCES
|
24
|
+
# may not be able to unlink on Windows; just ignore
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
8
31
|
initializer 'resources-with-dragonfly' do |app|
|
9
32
|
app_resources = Dragonfly[:resources]
|
10
33
|
app_resources.configure_with(:rmagick)
|
@@ -1,8 +1,8 @@
|
|
1
|
-
Given /^I have no (refinery )
|
1
|
+
Given /^I have no (?:|refinery )settings$/ do
|
2
2
|
RefinerySetting.delete_all
|
3
3
|
end
|
4
4
|
|
5
|
-
Given /^I (only )?have a (refinery )
|
5
|
+
Given /^I (only )?have a (?:|refinery )setting titled "([^"]*)"$/ do |only, title|
|
6
6
|
RefinerySetting.delete_all if only
|
7
7
|
|
8
8
|
RefinerySetting.set(title.to_s.gsub(' ', '').underscore.to_sym, nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 45
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
9
|
- 8
|
10
|
-
-
|
11
|
-
version: 0.9.8.
|
10
|
+
- 5
|
11
|
+
version: 0.9.8.5
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Resolve Digital
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2010-09-
|
21
|
+
date: 2010-09-21 00:00:00 +12:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
@@ -374,9 +374,12 @@ files:
|
|
374
374
|
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/config/locales/nb.yml
|
375
375
|
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/config/locales/nl.yml
|
376
376
|
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/config/routes.rb
|
377
|
-
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/migrate/
|
377
|
+
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/migrate/create_plural_name.rb
|
378
378
|
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
|
379
|
+
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/generators/refinerycms_plural_name_generator.rb
|
379
380
|
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/plural_name.rb
|
381
|
+
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/tasks/plural_name.rake
|
382
|
+
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/readme.md
|
380
383
|
- vendor/refinerycms/core/lib/generators/refinery_engine/templates/refinerycms-plural_name.gemspec
|
381
384
|
- vendor/refinerycms/core/lib/refinery/activity.rb
|
382
385
|
- vendor/refinerycms/core/lib/refinery/admin_base_controller.rb
|