diff --git a/.travis.yml b/.travis.yml
index 63cea48..0c10f83 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,8 +9,7 @@ notifications:
webhooks:
- https://webhooks.gitter.im/e/b5d48907cdc89864b874
rvm:
- - 2.3.1
- - 2.2
- - 2.1
- - 2.0.0
+ - 2.4.2
+ - 2.3.5
+ - 2.2.8
sudo: false
\ No newline at end of file
diff --git a/Gemfile b/Gemfile
index 394db2d..8043266 100644
--- a/Gemfile
+++ b/Gemfile
@@ -37,7 +37,7 @@ group :assets do
end
group :development do
- gem 'quiet_assets'
+ gem 'listen'
end
group :test do
diff --git a/app/views/refinery/admin/settings/_actions.html.erb b/app/views/refinery/admin/settings/_actions.html.erb
index bcd23a3..741d269 100644
--- a/app/views/refinery/admin/settings/_actions.html.erb
+++ b/app/views/refinery/admin/settings/_actions.html.erb
@@ -3,6 +3,6 @@
<%= render '/refinery/admin/search', :url => refinery.admin_settings_path %>
- <%= link_to t('.new'), refinery.new_admin_setting_path(:dialog => true), :class => "add_icon" %>
+ <%= action_label :add, refinery.new_admin_setting_path(dialog: true), t('.new') %>
diff --git a/app/views/refinery/admin/settings/_setting.html.erb b/app/views/refinery/admin/settings/_setting.html.erb
index 353e501..854410c 100644
--- a/app/views/refinery/admin/settings/_setting.html.erb
+++ b/app/views/refinery/admin/settings/_setting.html.erb
@@ -1,23 +1,22 @@
+<% # setup params for various action links
+ edit_url ||= refinery.edit_admin_setting_path(setting, dialog: true, width: 725, height: 525)
+ delete_url ||= refinery.admin_setting_path(setting)
+ delete_options ||= {
+ class: "cancel confirm-delete",
+ data: {
+ confirm: t('message', scope: 'refinery.admin.delete', title: setting.title)
+ }
+ }
+%>
+
<%= t(setting.name, :scope => 'refinery.admin.settings.form.title', :default => setting.title) %>
- <%= truncate(setting.value.to_s, :length => 40) %>
- <%= link_to refinery_icon_tag('application_edit.png'),
- refinery.edit_admin_setting_path(setting, :dialog => true, :width => 725, :height => 525),
- :title => t('edit', :scope => 'refinery.admin.settings') %>
- <%= link_to refinery_icon_tag('delete.png'),
- refinery.admin_setting_path(setting),
- :class => 'cancel confirm-delete',
- :title => t('delete', :scope => 'refinery.admin.settings'),
- :data => { :confirm => t('message', :scope => 'refinery.admin.delete', :title => setting.title) },
- :method => :delete if setting.destroyable %>
-
- <% unless (help = t(setting.name, :scope => 'refinery.admin.settings.form.help', :default => '')).blank? %>
- <%= link_to refinery_icon_tag('information.png'), '#',
- :tooltip => help,
- :class => 'information suppress' %>
- <% end %>
+ <%= action_icon(:info, '#', t('restricted', scope: 'refinery.admin.settings')) if setting.restricted %>
+ <%= action_icon(:edit, edit_url, t('edit', scope: 'refinery.admin.settings')) %>
+ <%= action_icon(:delete, delete_url, t('delete', scope: 'refinery.admin.settings'), delete_options) if setting.destroyable %>
diff --git a/app/views/refinery/admin/settings/index.html.erb b/app/views/refinery/admin/settings/index.html.erb
index 8eb20e3..a22ae32 100644
--- a/app/views/refinery/admin/settings/index.html.erb
+++ b/app/views/refinery/admin/settings/index.html.erb
@@ -3,13 +3,4 @@
<%= render 'actions' %>
-
-<% content_for :javascripts do %>
-
-<% end -%>
+
\ No newline at end of file
diff --git a/bin/rails b/bin/rails
index 0bf61b1..cd03e38 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,5 +1,11 @@
#!/usr/bin/env ruby
-# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+# This command will automatically be run when you run "rails" with Rails gems
+# installed from the root of your application.
-ENGINE_PATH = File.expand_path('../..', __FILE__)
-load File.expand_path('../../spec/dummy/bin/rails', __FILE__)
+begin
+ load File.join(File.expand_path('../../', __FILE__), 'spec/dummy/bin/rails')
+rescue LoadError => load_error
+ warn "No dummy Rails application found! \n" \
+ "To create one in spec/dummy, please run: \n\n" \
+ " rake refinery:testing:dummy_app"
+end
\ No newline at end of file
diff --git a/config/locales/en.yml b/config/locales/en.yml
index b102ee2..6ab2864 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -8,6 +8,7 @@ en:
settings:
delete: Remove this setting forever
edit: Edit this setting
+ restricted: This setting is only visible and editable by users who are superusers (like you).
actions:
new: Add new setting
records:
diff --git a/db/migrate/20100913234710_create_refinerycms_settings_schema.rb b/db/migrate/20100913234710_create_refinerycms_settings_schema.rb
index 65e89d8..c22ca8f 100644
--- a/db/migrate/20100913234710_create_refinerycms_settings_schema.rb
+++ b/db/migrate/20100913234710_create_refinerycms_settings_schema.rb
@@ -1,4 +1,4 @@
-class CreateRefinerycmsSettingsSchema < ActiveRecord::Migration
+class CreateRefinerycmsSettingsSchema < ActiveRecord::Migration[4.2]
def change
create_table :refinery_settings do |t|
t.string :name
diff --git a/db/migrate/20130414130143_add_slug_to_refinery_settings.rb b/db/migrate/20130414130143_add_slug_to_refinery_settings.rb
index 3688a97..f929f00 100644
--- a/db/migrate/20130414130143_add_slug_to_refinery_settings.rb
+++ b/db/migrate/20130414130143_add_slug_to_refinery_settings.rb
@@ -1,4 +1,4 @@
-class AddSlugToRefinerySettings < ActiveRecord::Migration
+class AddSlugToRefinerySettings < ActiveRecord::Migration[4.2]
def change
add_column :refinery_settings, :slug, :string, :unique => true
end
diff --git a/db/migrate/20130422105953_add_title_to_refinery_settings.rb b/db/migrate/20130422105953_add_title_to_refinery_settings.rb
index 8afbb92..4a7b1ad 100644
--- a/db/migrate/20130422105953_add_title_to_refinery_settings.rb
+++ b/db/migrate/20130422105953_add_title_to_refinery_settings.rb
@@ -1,4 +1,4 @@
-class AddTitleToRefinerySettings < ActiveRecord::Migration
+class AddTitleToRefinerySettings < ActiveRecord::Migration[4.2]
def change
add_column :refinery_settings, :title, :string
end
diff --git a/refinerycms-settings.gemspec b/refinerycms-settings.gemspec
index e628288..d8bae8e 100644
--- a/refinerycms-settings.gemspec
+++ b/refinerycms-settings.gemspec
@@ -3,7 +3,7 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = %q{refinerycms-settings}
- s.version = %q{3.0.1}
+ s.version = %q{4.0.0}
s.summary = %q{Settings engine for Refinery CMS}
s.description = %q{Adds programmer creatable, user editable settings.}
s.email = %q{info@refinerycms.com}
@@ -15,6 +15,6 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- spec/*`.split("\n")
- s.add_dependency 'refinerycms-core', ['~> 3.0', '>= 3.0.0']
- s.add_dependency 'friendly_id', ['~> 5.0', '>= 5.0.1']
+ s.add_dependency 'refinerycms-core', ['~> 4.0', '>= 4.0.0']
+ s.add_dependency 'friendly_id', ['>= 5.1.0', '< 5.3']
end
diff --git a/spec/features/refinery/admin/settings_spec.rb b/spec/features/refinery/admin/settings_spec.rb
index b07a4e5..b75f93a 100644
--- a/spec/features/refinery/admin/settings_spec.rb
+++ b/spec/features/refinery/admin/settings_spec.rb
@@ -47,7 +47,6 @@ module Admin
click_button "submit_button"
end
expect(page).not_to have_css("#dialog_iframe")
- expect(page).to have_content("'Test Setting' was successfully added.")
expect(page).to have_content("Test Setting - true")
end
@@ -64,7 +63,6 @@ module Admin
click_button "submit_button"
end
- expect(page).to have_content("'Test/Setting' was successfully added.")
expect(page).to have_content("Test/Setting - true")
visit refinery.edit_admin_setting_path(Refinery::Setting.last)
@@ -90,7 +88,6 @@ module Admin
click_button "Save"
end
- expect(page).to have_content("'Edit and Update Title' was successfully updated.")
expect(page).to have_content("Edit and Update Title - 2")
end
end