Skip to content

Commit

Permalink
Merge pull request #42 from refinery/feature/refinery-4
Browse files Browse the repository at this point in the history
Feature/refinery 4
  • Loading branch information
bricesanchez authored Oct 4, 2017
2 parents 4beaf69 + 92118d1 commit 9d42e9b
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 43 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ group :assets do
end

group :development do
gem 'quiet_assets'
gem 'listen'
end

group :test do
Expand Down
2 changes: 1 addition & 1 deletion app/views/refinery/admin/settings/_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<%= render '/refinery/admin/search', :url => refinery.admin_settings_path %>
</li>
<li>
<%= 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') %>
</li>
</ul>
29 changes: 14 additions & 15 deletions app/views/refinery/admin/settings/_setting.html.erb
Original file line number Diff line number Diff line change
@@ -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)
}
}
%>

<li class='clearfix record <%= cycle("on", "on-hover") %>'>
<span class='title'>
<%= t(setting.name, :scope => 'refinery.admin.settings.form.title', :default => setting.title) %>
<span class="preview">- <%= truncate(setting.value.to_s, :length => 40) %></span>
</span>
<span class='actions'>
<%= 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 %>
</span>
</li>
11 changes: 1 addition & 10 deletions app/views/refinery/admin/settings/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,4 @@
</div>
<div id='actions'>
<%= render 'actions' %>
</div>
<% content_for :javascripts do %>
<script>
$(document).ready(function() {
$('#records ul li .actions a[href*=edit]').each(function(i, li) {
$(li).attr('name', $(li).attr('tooltip'));
});
});
</script>
<% end -%>
</div>
12 changes: 9 additions & 3 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20130414130143_add_slug_to_refinery_settings.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddTitleToRefinerySettings < ActiveRecord::Migration
class AddTitleToRefinerySettings < ActiveRecord::Migration[4.2]
def change
add_column :refinery_settings, :title, :string
end
Expand Down
6 changes: 3 additions & 3 deletions refinerycms-settings.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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{[email protected]}
Expand All @@ -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
3 changes: 0 additions & 3 deletions spec/features/refinery/admin/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 9d42e9b

Please sign in to comment.