Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ActiveAdmin 1.0 and 1.1.0 #25

Merged
merged 9 commits into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ sudo: false
language: ruby
# Limit ruby versions to currently supported versions to avoid a big build matrix
rvm:
- 2.2
- 2.3.0
# Update bundler on travis, since current one is broken, see https://github.com/rubygems/rubygems/issues/1419
before_install:
- gem install bundler
- 2.2.7
- 2.3.4
- 2.4.1
# Load database schema before rake
before_script: bundle exec rake db:schema:load
# Test on all supported rails versions
gemfile:
- gemfiles/activeadmin_master.gemfile
- gemfiles/rails4_1.gemfile
- gemfiles/rails4_2.gemfile
- gemfiles/rails5_0.gemfile
- gemfiles/rails5_1.gemfile
18 changes: 9 additions & 9 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
appraise 'rails4_1' do
gem 'rails', '~> 4.1.12'
gem 'globalize', '~> 4.0.3'
appraise 'rails4_2' do
gem 'rails', '~> 4.2.9'
gem 'globalize', '~> 5.0.0'
end

appraise 'rails4_2' do
gem 'rails', '~> 4.2.3'
appraise 'rails5_0' do
gem 'rails', '~> 4.2.9'
gem 'globalize', '~> 5.0.0'
end

# Run tests on latest github version of ActiveAdmin
appraise 'activeadmin_master' do
gem 'rails', '~> 4.2.0'
gem 'activeadmin', github: 'activeadmin/activeadmin'
appraise 'rails5_1' do
gem 'devise', '~> 4.3'
gem 'rails', '~> 5.1.3'
gem 'globalize', '~> 5.1.0.beta2'
end
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ gem 'devise', '~> 3.2'

group :test do
gem 'sqlite3', '~> 1.3.5'
gem 'rspec-rails', '~> 2.14.0'
gem 'rspec-rails', '~> 3.6.1'
gem 'factory_girl_rails', '~> 4.2.1'
gem 'database_cleaner', '~> 1.0.1'
gem 'spring', require: false
gem 'spring-commands-rspec', require: false
gem 'capybara', '~> 2.1.0'
gem 'capybara', '~> 2.15'
gem 'capybara-screenshot'
gem 'poltergeist'
gem 'fuubar'
gem 'fuubar', '~> 2.2'
gem 'appraisal'
# Useful to debug tests
gem 'awesome_print'
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ Makes it easy to translate your resource fields.
This version targets Rails 4 and greater and ActiveAdmin >= 1.0.0.pre.

```ruby
gem 'activeadmin-globalize', '~> 1.0.0.pre', github: 'fabn/activeadmin-globalize', branch: 'develop'
gem 'activeadmin-globalize', '~> 1.0.0', github: 'fabn/activeadmin-globalize', branch: 'develop'
```

As soon as ActiveAdmin 1.x is released to rubygems, I'll release the gem with no need for github dependency. See
[this issue](https://github.com/activeadmin/activeadmin/issues/3448) for more details.

Previous version with support for Rails 3 is maintained in branch [support/0.6.x](https://github.com/fabn/activeadmin-globalize/tree/support/0.6.x)

## Require Assets

- active_admin.js: `//= require active_admin/active_admin_globalize.js`
- active_admin.css: `*= require active_admin/active_admin_globalize`

## Your model

```ruby
Expand Down Expand Up @@ -68,7 +73,7 @@ form do |f|
end

# You can also set locales to show in tabs
# For example we want to show English translation fields without tab, and want to show other languages within tabs
# For example we want to show English translation fields without tab, and want to show other languages within tabs
form do |f|
# ...
f.inputs do
Expand Down
5 changes: 2 additions & 3 deletions activeadmin-globalize.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Gem::Specification.new do |s|
s.email = ['[email protected]', '[email protected]']
s.homepage = 'http://github.com/fabn/activeadmin-globalize'
s.summary = 'Handles globalize translations'
s.description = 'Handles globalize translations in ActiveAdmin 0.6.3 and Rails 3.2.x'
s.description = 'Handles globalize translations in ActiveAdmin 1.0 and Rails 4.x-5.x'

s.files = Dir['{app,config,db,lib}/**/*'] + %w(MIT-LICENSE README.md)

s.add_dependency 'activeadmin', '~> 1.0.0.pre'
s.add_dependency 'activeadmin', '>= 1.0', '< 1.2'
# Try to support rails from 3.2 up to 4.2.x
s.add_dependency 'globalize', '>= 3.1.0', '< 6.0'

Expand All @@ -25,4 +25,3 @@ Gem::Specification.new do |s|
# Other development dependencies moved into Gemfile

end

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "active_admin/mixins"

@import "active_admin_globalize_mixins"
@import "active_admin_globalize_flags"

.active_admin
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@mixin border-top-radius($radius)
-webkit-border-top-right-radius: $radius
border-top-right-radius: $radius
-webkit-border-top-left-radius: $radius
border-top-left-radius: $radius
background-clip: padding-box

@mixin border-right-radius($radius)
-webkit-border-bottom-right-radius: $radius
border-bottom-right-radius: $radius
-webkit-border-top-right-radius: $radius
border-top-right-radius: $radius
background-clip: padding-box

@mixin border-bottom-radius($radius)
-webkit-border-bottom-right-radius: $radius
border-bottom-right-radius: $radius
-webkit-border-bottom-left-radius: $radius
border-bottom-left-radius: $radius
background-clip: padding-box

@mixin border-left-radius($radius)
-webkit-border-bottom-left-radius: $radius
border-bottom-left-radius: $radius
-webkit-border-top-left-radius: $radius
border-top-left-radius: $radius
background-clip: padding-box
16 changes: 8 additions & 8 deletions gemfiles/rails4_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ source "https://rubygems.org"

gem "sass-rails"
gem "coffee-rails"
gem "therubyracer", :platforms => :ruby
gem "therubyracer", platforms: :ruby
gem "uglifier"
gem "jquery-rails"
gem "devise", "~> 3.2"
gem "rails", "~> 4.2.3"
gem "rails", "~> 4.2.9"
gem "globalize", "~> 5.0.0"

group :test do
gem "sqlite3", "~> 1.3.5"
gem "rspec-rails", "~> 2.14.0"
gem "rspec-rails", "~> 3.6.1"
gem "factory_girl_rails", "~> 4.2.1"
gem "database_cleaner", "~> 1.0.1"
gem "spring", :require => false
gem "spring-commands-rspec", :require => false
gem "capybara", "~> 2.1.0"
gem "spring", require: false
gem "spring-commands-rspec", require: false
gem "capybara", "~> 2.15"
gem "capybara-screenshot"
gem "poltergeist"
gem "fuubar"
gem "fuubar", "~> 2.2"
gem "appraisal"
gem "awesome_print"
gem "pry"
end

gemspec :path => "../"
gemspec path: "../"
18 changes: 9 additions & 9 deletions gemfiles/rails4_1.gemfile → gemfiles/rails5_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ source "https://rubygems.org"

gem "sass-rails"
gem "coffee-rails"
gem "therubyracer", :platforms => :ruby
gem "therubyracer", platforms: :ruby
gem "uglifier"
gem "jquery-rails"
gem "devise", "~> 3.2"
gem "rails", "~> 4.1.12"
gem "globalize", "~> 4.0.3"
gem "rails", "~> 4.2.9"
gem "globalize", "~> 5.0.0"

group :test do
gem "sqlite3", "~> 1.3.5"
gem "rspec-rails", "~> 2.14.0"
gem "rspec-rails", "~> 3.6.1"
gem "factory_girl_rails", "~> 4.2.1"
gem "database_cleaner", "~> 1.0.1"
gem "spring", :require => false
gem "spring-commands-rspec", :require => false
gem "capybara", "~> 2.1.0"
gem "spring", require: false
gem "spring-commands-rspec", require: false
gem "capybara", "~> 2.15"
gem "capybara-screenshot"
gem "poltergeist"
gem "fuubar"
gem "fuubar", "~> 2.2"
gem "appraisal"
gem "awesome_print"
gem "pry"
end

gemspec :path => "../"
gemspec path: "../"
20 changes: 10 additions & 10 deletions gemfiles/activeadmin_master.gemfile → gemfiles/rails5_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ source "https://rubygems.org"

gem "sass-rails"
gem "coffee-rails"
gem "therubyracer", :platforms => :ruby
gem "therubyracer", platforms: :ruby
gem "uglifier"
gem "jquery-rails"
gem "devise", "~> 3.2"
gem "rails", "~> 4.2.0"
gem "activeadmin", :github => "activeadmin/activeadmin"
gem "devise", "~> 4.3"
gem "rails", "~> 5.1.3"
gem "globalize", "~> 5.1.0.beta2"

group :test do
gem "sqlite3", "~> 1.3.5"
gem "rspec-rails", "~> 2.14.0"
gem "rspec-rails", "~> 3.6.1"
gem "factory_girl_rails", "~> 4.2.1"
gem "database_cleaner", "~> 1.0.1"
gem "spring", :require => false
gem "spring-commands-rspec", :require => false
gem "capybara", "~> 2.1.0"
gem "spring", require: false
gem "spring-commands-rspec", require: false
gem "capybara", "~> 2.15"
gem "capybara-screenshot"
gem "poltergeist"
gem "fuubar"
gem "fuubar", "~> 2.2"
gem "appraisal"
gem "awesome_print"
gem "pry"
end

gemspec :path => "../"
gemspec path: "../"
7 changes: 0 additions & 7 deletions lib/active_admin/globalize/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ class Engine < ::Rails::Engine
"active_admin/active_admin_globalize.js"
]
end

initializer "add assets" do
ActiveAdmin.application.register_stylesheet "active_admin/active_admin_globalize.css", :media => :screen
ActiveAdmin.application.register_javascript "active_admin/active_admin_globalize.js"
end

end
end
end

3 changes: 1 addition & 2 deletions lib/active_admin/globalize/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module ActiveAdmin
module Globalize
VERSION = '1.0.0.pre'
VERSION = '1.0.0'
end
end