From 7a79b27970c86c6a7a0e911e0b9847246eb9cce7 Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Mon, 7 Aug 2017 15:00:29 -0400 Subject: [PATCH 1/5] add border mixins and remove deprecated activeadmin methods --- README.md | 7 ++++- .../active_admin/active_admin_globalize.sass | 28 +++++++++++++++++++ lib/active_admin/globalize/engine.rb | 7 ----- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a16eabdf..1faa1845 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,11 @@ As soon as ActiveAdmin 1.x is released to rubygems, I'll release the gem with no 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.scss: `@import "active_admin/active_admin_globalize.css";` + ## Your model ```ruby @@ -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 diff --git a/app/assets/stylesheets/active_admin/active_admin_globalize.sass b/app/assets/stylesheets/active_admin/active_admin_globalize.sass index 59871443..5566dc64 100644 --- a/app/assets/stylesheets/active_admin/active_admin_globalize.sass +++ b/app/assets/stylesheets/active_admin/active_admin_globalize.sass @@ -2,6 +2,34 @@ @import "active_admin_globalize_flags" +@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 + .active_admin .activeadmin-translations margin-bottom: 20px diff --git a/lib/active_admin/globalize/engine.rb b/lib/active_admin/globalize/engine.rb index 8dd58f6b..f1ef9037 100644 --- a/lib/active_admin/globalize/engine.rb +++ b/lib/active_admin/globalize/engine.rb @@ -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 - From 33bd87458ea3291b330dbe20d1b79fb59718bbf0 Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Mon, 7 Aug 2017 15:03:14 -0400 Subject: [PATCH 2/5] remove 1.0.0.pre requirement --- activeadmin-globalize.gemspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/activeadmin-globalize.gemspec b/activeadmin-globalize.gemspec index 22867161..d8073b01 100644 --- a/activeadmin-globalize.gemspec +++ b/activeadmin-globalize.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.files = Dir['{app,config,db,lib}/**/*'] + %w(MIT-LICENSE README.md) - s.add_dependency 'activeadmin', '~> 1.0.0.pre' + s.add_dependency 'activeadmin' # Try to support rails from 3.2 up to 4.2.x s.add_dependency 'globalize', '>= 3.1.0', '< 6.0' @@ -25,4 +25,3 @@ Gem::Specification.new do |s| # Other development dependencies moved into Gemfile end - From b5ff7459979879e108dff4144876d54433ed5591 Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Mon, 7 Aug 2017 15:08:10 -0400 Subject: [PATCH 3/5] move mixins to separate file before flags import --- .../active_admin/active_admin_globalize.sass | 30 +------------------ .../active_admin_globalize_mixins.sass | 27 +++++++++++++++++ 2 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 app/assets/stylesheets/active_admin/active_admin_globalize_mixins.sass diff --git a/app/assets/stylesheets/active_admin/active_admin_globalize.sass b/app/assets/stylesheets/active_admin/active_admin_globalize.sass index 5566dc64..ef59114f 100644 --- a/app/assets/stylesheets/active_admin/active_admin_globalize.sass +++ b/app/assets/stylesheets/active_admin/active_admin_globalize.sass @@ -1,35 +1,7 @@ @import "active_admin/mixins" - +@import "active_admin_globalize_mixins" @import "active_admin_globalize_flags" -@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 - .active_admin .activeadmin-translations margin-bottom: 20px diff --git a/app/assets/stylesheets/active_admin/active_admin_globalize_mixins.sass b/app/assets/stylesheets/active_admin/active_admin_globalize_mixins.sass new file mode 100644 index 00000000..51cb1d2c --- /dev/null +++ b/app/assets/stylesheets/active_admin/active_admin_globalize_mixins.sass @@ -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 From ac703c726b8b6bde88762589ebd5a70d3862fedf Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Mon, 7 Aug 2017 15:20:31 -0400 Subject: [PATCH 4/5] update version to match activeadmin --- lib/active_admin/globalize/version.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/active_admin/globalize/version.rb b/lib/active_admin/globalize/version.rb index 05a94b8a..0854d0a6 100644 --- a/lib/active_admin/globalize/version.rb +++ b/lib/active_admin/globalize/version.rb @@ -1,6 +1,5 @@ module ActiveAdmin module Globalize - VERSION = '1.0.0.pre' + VERSION = '1.1.0' end end - From 2a92bb596868a8d51ea74357bb86a0695a46754f Mon Sep 17 00:00:00 2001 From: Rob Florence Date: Wed, 9 Aug 2017 09:14:37 -0400 Subject: [PATCH 5/5] css file needs to be required, not imported --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1faa1845..1ba9b886 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Previous version with support for Rails 3 is maintained in branch [support/0.6.x ## Require Assets - active_admin.js: `//= require active_admin/active_admin_globalize.js` -- active_admin.scss: `@import "active_admin/active_admin_globalize.css";` +- active_admin.css: `*= require active_admin/active_admin_globalize` ## Your model