From 08749ee4b3f381b9ffdcd1fed623cd2dcd6fb1e9 Mon Sep 17 00:00:00 2001 From: Ramon Date: Fri, 31 Oct 2014 15:55:03 +0100 Subject: [PATCH 01/13] 'form_buffers' has been removed from ActiveAdmin::FormBuilder --- lib/active_admin/translate/form_builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_admin/translate/form_builder.rb b/lib/active_admin/translate/form_builder.rb index bf076ed..a43ede9 100644 --- a/lib/active_admin/translate/form_builder.rb +++ b/lib/active_admin/translate/form_builder.rb @@ -11,7 +11,7 @@ module FormBuilder # @param [Proc] block the block for the additional inputs # def translate_inputs(name = :translations, &block) - form_buffers.last << template.content_tag(:div, :class => "activeadmin-translate #{ translate_id }") do + template.content_tag(:div, :class => "activeadmin-translate #{ translate_id }") do locale_tabs << locale_fields(name, block) << tab_script end end From 62f8c6306b2b346cc7bd57e3cd9883dfea61a54d Mon Sep 17 00:00:00 2001 From: Ramon Date: Sat, 6 Dec 2014 19:59:13 +0100 Subject: [PATCH 02/13] - Remove Globalize3 dependency. - Fix UI tab issues. - Fix compatibility with current ActiveAdmin. --- CHANGELOG.md | 6 ++ README.md | 4 +- activeadmin-translate.gemspec | 5 +- .../active_admin/translate.css.scss | 77 +++++++------------ lib/active_admin/translate/version.rb | 2 +- .../views/translate_attributes_table.rb | 2 +- lib/activeadmin-translate.rb | 2 +- 7 files changed, 40 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dd258b..4bef7d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # ActiveAdmin Translate Changelog +## 0.2.3 - December 6, 2014 + +- Remove Globalize3 dependency. +- Fix UI tab issues. +- Fix compatibility with current ActiveAdmin. + ## 0.2.2 - November 16, 2012 - Include SCSS mixins. diff --git a/README.md b/README.md index bb67471..1a7f6aa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ActiveAdmin Translate -Translate your [Globalize3](https://github.com/svenfuchs/globalize3) ActiveModel translations in -[ActiveAdmin](https://github.com/gregbell/active_admin), using [jQueryUI tabs](http://jqueryui.com/tabs/) to switch +Translate your [Globalize](https://github.com/globalize/globalize) ActiveModel translations in +[ActiveAdmin](https://github.com/activeadmin/activeadmin), using [jQueryUI tabs](http://jqueryui.com/tabs/) to switch between the locales. ## Installation diff --git a/activeadmin-translate.gemspec b/activeadmin-translate.gemspec index 78193d6..ae157a0 100644 --- a/activeadmin-translate.gemspec +++ b/activeadmin-translate.gemspec @@ -5,15 +5,16 @@ Gem::Specification.new do |gem| gem.authors = ['Michael Kessler'] gem.email = %w(michi@flinkfinger.com) gem.summary = %q{Translate models with ActiveAdmin.} - gem.description = %q{Translate your models in ActiveAdmin with Globalize3.} + gem.description = %q{Translate your models in ActiveAdmin with Globalize.} gem.homepage = 'https://github.com/netzpirat/activeadmin-translate' gem.files = Dir['{app,lib,config}/**/*'] + %w(LICENSE README.md CHANGELOG.md CONTRIBUTING.md) gem.name = 'activeadmin-translate' gem.require_paths = %w(lib) gem.version = ActiveAdmin::Translate::VERSION + gem.license = 'MIT' gem.add_dependency 'activeadmin' - gem.add_dependency 'globalize3' + gem.add_dependency 'globalize' gem.add_dependency 'railties' end diff --git a/app/assets/stylesheets/active_admin/translate.css.scss b/app/assets/stylesheets/active_admin/translate.css.scss index c65ecab..4b0dc9c 100644 --- a/app/assets/stylesheets/active_admin/translate.css.scss +++ b/app/assets/stylesheets/active_admin/translate.css.scss @@ -5,6 +5,7 @@ .activeadmin-translate .locales { overflow: auto; margin-right: 10px; + margin-bottom: -1px; li { @include section-header; @@ -12,10 +13,33 @@ border-top-left-radius: 10px; border-top-right-radius: 10px; - float: right !important; + float: right; + + margin-bottom: 0; + padding-left: 0; + padding-right: 0; + + a { + padding: .5em 1em; + text-decoration: none; + + &:hover,&:active { + text-decoration: underline; + } + box-shadow: none; + border-style: none; + background: inherit; + } &.ui-state-active { background: white; + border-bottom-color: white; + + a { + color: $section-header-text-color; + cursor: default; + text-decoration: none; + } } } } @@ -31,53 +55,4 @@ .activeadmin-translate .ui-tabs-hide { display: none !important; } - - .ui-tabs { - position: relative; - padding: .2em; - zoom: 1; - } - - .ui-tabs .ui-tabs-nav { - margin: 0; - padding: .2em .2em 0; - } - - .ui-tabs .ui-tabs-nav li { - list-style: none; - float: left; - position: relative; - top: 0; - margin: 1px .2em 0 0; - border-bottom: 0; - padding: 0; - white-space: nowrap; - } - - .ui-tabs .ui-tabs-nav li a { - float: left; - padding: .5em 1em; - text-decoration: none; - } - - .ui-tabs .ui-tabs-nav li.ui-tabs-active { - margin-bottom: -1px; - padding-bottom: 1px; - } - - .ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { - cursor: text; - } - - .ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { - cursor: pointer; - } - - .ui-tabs .ui-tabs-panel { - display: block; - border-width: 0; - padding: 1em 1.4em; - background: none; - } - -} +} \ No newline at end of file diff --git a/lib/active_admin/translate/version.rb b/lib/active_admin/translate/version.rb index e5344fc..67bdff7 100644 --- a/lib/active_admin/translate/version.rb +++ b/lib/active_admin/translate/version.rb @@ -1,6 +1,6 @@ module ActiveAdmin module Translate # The current released version - VERSION = '0.2.2' + VERSION = '0.2.3' end end diff --git a/lib/active_admin/views/translate_attributes_table.rb b/lib/active_admin/views/translate_attributes_table.rb index 3aaa7cc..6181880 100644 --- a/lib/active_admin/views/translate_attributes_table.rb +++ b/lib/active_admin/views/translate_attributes_table.rb @@ -3,7 +3,7 @@ module Translate # Adds a builder method `translate_attributes_table_for` to build a # table with translations for a model that has been localized with - # Globalize3. + # Globalize. # class TranslateAttributesTable < ::ActiveAdmin::Views::AttributesTable diff --git a/lib/activeadmin-translate.rb b/lib/activeadmin-translate.rb index 577ae46..3fc324b 100644 --- a/lib/activeadmin-translate.rb +++ b/lib/activeadmin-translate.rb @@ -1,5 +1,5 @@ require 'active_admin' -require 'globalize3' +require 'globalize' require 'active_admin/version' require 'active_admin/translate/engine' From d772c6a5a766ceff58f645f974acebeec0fe9727 Mon Sep 17 00:00:00 2001 From: Ramon Date: Sat, 6 Dec 2014 20:19:30 +0100 Subject: [PATCH 03/13] Fix gem github. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1a7f6aa..a410dad 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ between the locales. Add the gem to your `Gemfile` ```ruby -gem 'activeadmin-translate' +gem 'activeadmin-translate', github: 'rbatllet/activeadmin-globalize' ``` and install it with Bundler: @@ -142,7 +142,7 @@ See the [CHANGELOG](https://github.com/netzpirat/activeadmin-globalize/blob/mast This project has taken some ideas and code from the following projects: -- [activeadmin-globalize3](https://github.com/stefanoverna/activeadmin-globalize3) from [Stefano Verna](https://github.com/stefanoverna) +- [activeadmin-globalize](https://github.com/stefanoverna/activeadmin-globalize) from [Stefano Verna](https://github.com/stefanoverna) - [ActiveAdmin-Globalize3-inputs](https://github.com/mimimi/ActiveAdmin-Globalize3-inputs) from [Dmitrii Soltis](https://github.com/mimimi) ## License From 0fd19eab5a1e43a322cdb34df05501a05e610b70 Mon Sep 17 00:00:00 2001 From: Ramon Date: Sun, 7 Dec 2014 12:12:38 +0100 Subject: [PATCH 04/13] Fix wrong links. --- CONTRIBUTING.md | 5 ++--- README.md | 19 +++++++++---------- activeadmin-translate.gemspec | 4 ++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6512ea5..c4fded7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Contribute to ActiveAdmin Translate File an issue ------------- -You can report bugs and feature requests to [GitHub Issues](https://github.com/netzpirat/activeadmin-globalize/issues). +You can report bugs and feature requests to [GitHub Issues](https://github.com/netzpirat/activeadmin-translate/issues). **Please don't ask question in the issue tracker**, instead ask them at Stackoverflow and use the [activeadmin](http://stackoverflow.com/questions/tagged/activeadmin) tag. @@ -20,8 +20,7 @@ When you file a bug, please try to follow these simple rules if applicable: Development ----------- -* Documentation hosted at [RubyDoc](http://rubydoc.info/github/netzpirat/activeadmin-globalize/master/frames). -* Source hosted at [GitHub](https://github.com/netzpirat/activeadmin-globalize). +* Source hosted at [GitHub](https://github.com/netzpirat/activeadmin-translate). Pull requests are very welcome! Please try to follow these simple rules if applicable: diff --git a/README.md b/README.md index a410dad..28f2947 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ between the locales. Add the gem to your `Gemfile` ```ruby -gem 'activeadmin-translate', github: 'rbatllet/activeadmin-globalize' +gem 'activeadmin-translate', github: 'rbatllet/activeadmin-translate' ``` and install it with Bundler: @@ -42,7 +42,7 @@ You need to import the SASS for styling the tabs to `app/assets/stylesheets/acti ### Make your translations accessible In order to access the translations of your model and be able to write them on save, you need to make attributes -accessible in your model. Globalize3 stores the model translations in a separate table that is accessible as +accessible in your model. Globalize stores the model translations in a separate table that is accessible as `translations` in your model: ```ruby @@ -100,14 +100,14 @@ and add more translations with the registered locale symbol. Developed by Michael Kessler, [FlinkFinger GmbH](http://www.flinkfinger.com). If you like ActiveAdmin Translate, you can watch the repository at -[GitHub](https://github.com/netzpirat/activeadmin-globalize) and follow [@netzpirat](https://twitter.com/#!/netzpirat) +[GitHub](https://github.com/netzpirat/activeadmin-translate) and follow [@netzpirat](https://twitter.com/netzpirat) on Twitter for project updates. ## Contribute to ActiveAdmin Translate ### File an issue -You can report bugs and feature requests to [GitHub Issues](https://github.com/netzpirat/activeadmin-globalize/issues). +You can report bugs and feature requests to [GitHub Issues](https://github.com/netzpirat/activeadmin-translate/issues). **Please don't ask question in the issue tracker**, instead ask them at Stackoverflow and use the [activeadmin](http://stackoverflow.com/questions/tagged/activeadmin) tag. @@ -122,21 +122,20 @@ When you file a bug, please try to follow these simple rules if applicable: ### Development -* Documentation hosted at [RubyDoc](http://rubydoc.info/github/netzpirat/activeadmin-globalize/master/frames). -* Source hosted at [GitHub](https://github.com/netzpirat/activeadmin-globalize). +* Source hosted at [GitHub](https://github.com/netzpirat/activeadmin-translate). Pull requests are very welcome! Please try to follow these simple rules if applicable: * Please create a topic branch for every separate change you make. * Update the [Yard](http://yardoc.org/) documentation. -* Update the [README](https://github.com/netzpirat/activeadmin-globalize/blob/master/README.md). -* Update the [CHANGELOG](https://github.com/netzpirat/activeadmin-globalize/blob/master/CHANGELOG.md) for noteworthy changes. +* Update the [README](https://github.com/netzpirat/activeadmin-translate/blob/master/README.md). +* Update the [CHANGELOG](https://github.com/netzpirat/activeadmin-translate/blob/master/CHANGELOG.md) for noteworthy changes. * Please **do not change** the version number. ## Contributors -See the [CHANGELOG](https://github.com/netzpirat/activeadmin-globalize/blob/master/CHANGELOG.md) and the GitHub list of -[contributors](https://github.com/netzpirat/activeadmin-globalize/contributors). +See the [CHANGELOG](https://github.com/netzpirat/activeadmin-translate/blob/master/CHANGELOG.md) and the GitHub list of +[contributors](https://github.com/netzpirat/activeadmin-translate/contributors). ## Acknowledgment diff --git a/activeadmin-translate.gemspec b/activeadmin-translate.gemspec index ae157a0..804c557 100644 --- a/activeadmin-translate.gemspec +++ b/activeadmin-translate.gemspec @@ -2,11 +2,11 @@ require File.expand_path('../lib/active_admin/translate/version', __FILE__) Gem::Specification.new do |gem| - gem.authors = ['Michael Kessler'] + gem.authors = ['Michael Kessler', 'R. Batlle'] gem.email = %w(michi@flinkfinger.com) gem.summary = %q{Translate models with ActiveAdmin.} gem.description = %q{Translate your models in ActiveAdmin with Globalize.} - gem.homepage = 'https://github.com/netzpirat/activeadmin-translate' + gem.homepage = 'https://github.com/rbatllet/activeadmin-translate' gem.files = Dir['{app,lib,config}/**/*'] + %w(LICENSE README.md CHANGELOG.md CONTRIBUTING.md) gem.name = 'activeadmin-translate' From 1c4c691ab4b6e38de419f50e9a5879451052515f Mon Sep 17 00:00:00 2001 From: Ramon Date: Wed, 14 Jan 2015 18:11:01 +0100 Subject: [PATCH 05/13] Add form_buffers backward compatibility --- lib/active_admin/translate/form_builder.rb | 7 ++++++- lib/active_admin/translate/version.rb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/active_admin/translate/form_builder.rb b/lib/active_admin/translate/form_builder.rb index a43ede9..9ee775e 100644 --- a/lib/active_admin/translate/form_builder.rb +++ b/lib/active_admin/translate/form_builder.rb @@ -11,7 +11,12 @@ module FormBuilder # @param [Proc] block the block for the additional inputs # def translate_inputs(name = :translations, &block) - template.content_tag(:div, :class => "activeadmin-translate #{ translate_id }") do + if self.respond_to?(:form_buffers) + html = form_buffers.last + else + html = "".html_safe + end + html << template.content_tag(:div, :class => "activeadmin-translate #{ translate_id }") do locale_tabs << locale_fields(name, block) << tab_script end end diff --git a/lib/active_admin/translate/version.rb b/lib/active_admin/translate/version.rb index 67bdff7..7424a76 100644 --- a/lib/active_admin/translate/version.rb +++ b/lib/active_admin/translate/version.rb @@ -1,6 +1,6 @@ module ActiveAdmin module Translate # The current released version - VERSION = '0.2.3' + VERSION = '0.2.4' end end From 6aaae8f6a6f23a161abfbc12853622ff613fc672 Mon Sep 17 00:00:00 2001 From: ramon Date: Thu, 19 Mar 2015 10:05:30 +0100 Subject: [PATCH 06/13] Transfer ownership --- README.md | 2 +- activeadmin-translate.gemspec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 28f2947..188e5f1 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ between the locales. Add the gem to your `Gemfile` ```ruby -gem 'activeadmin-translate', github: 'rbatllet/activeadmin-translate' +gem 'activeadmin-translate', github: 'twintags/activeadmin-translate' ``` and install it with Bundler: diff --git a/activeadmin-translate.gemspec b/activeadmin-translate.gemspec index 804c557..6d783e7 100644 --- a/activeadmin-translate.gemspec +++ b/activeadmin-translate.gemspec @@ -2,11 +2,11 @@ require File.expand_path('../lib/active_admin/translate/version', __FILE__) Gem::Specification.new do |gem| - gem.authors = ['Michael Kessler', 'R. Batlle'] + gem.authors = ['Michael Kessler', 'Twintags'] gem.email = %w(michi@flinkfinger.com) gem.summary = %q{Translate models with ActiveAdmin.} gem.description = %q{Translate your models in ActiveAdmin with Globalize.} - gem.homepage = 'https://github.com/rbatllet/activeadmin-translate' + gem.homepage = 'https://github.com/twintags/activeadmin-translate' gem.files = Dir['{app,lib,config}/**/*'] + %w(LICENSE README.md CHANGELOG.md CONTRIBUTING.md) gem.name = 'activeadmin-translate' From b17d54e102abbd4d7f3882979ba130c8e8edef80 Mon Sep 17 00:00:00 2001 From: David Stump Date: Mon, 23 Mar 2015 12:28:15 -0400 Subject: [PATCH 07/13] Updates content_for block to accept record object. --- lib/active_admin/views/translate_attributes_table.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/active_admin/views/translate_attributes_table.rb b/lib/active_admin/views/translate_attributes_table.rb index 6181880..d09851a 100644 --- a/lib/active_admin/views/translate_attributes_table.rb +++ b/lib/active_admin/views/translate_attributes_table.rb @@ -17,9 +17,11 @@ def row(attr, &block) header_content_for(attr) end end - td do - ::I18n.with_locale locale do - content_for(block || attr) + @collection.each do |record| + td do + ::I18n.with_locale locale do + content_for(record, block || attr) + end end end end From 048ec24be98a5db662638b73d41148c75e198250 Mon Sep 17 00:00:00 2001 From: ramon Date: Fri, 27 Mar 2015 19:42:22 +0100 Subject: [PATCH 08/13] Add locales --- config/locales/ca.yml | 9 +++++++++ config/locales/de.yml | 2 ++ config/locales/en.yml | 2 ++ config/locales/es.yml | 9 +++++++++ config/locales/fr.yml | 2 ++ config/locales/it.yml | 6 ++++-- lib/active_admin/translate/version.rb | 2 +- 7 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 config/locales/ca.yml create mode 100644 config/locales/es.yml diff --git a/config/locales/ca.yml b/config/locales/ca.yml new file mode 100644 index 0000000..f8cf581 --- /dev/null +++ b/config/locales/ca.yml @@ -0,0 +1,9 @@ +ca: + active_admin: + translate: + en: 'Anglès' + de: 'Alemany' + fr: 'Francès' + it: 'Italià' + es: 'Espanyol' + ca: 'Català' diff --git a/config/locales/de.yml b/config/locales/de.yml index a1ec551..52edcb4 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -5,3 +5,5 @@ de: de: 'Deutsch' fr: 'Französich' it: 'Italienisch' + es: 'Spanisch' + ca: 'Katalanisch' diff --git a/config/locales/en.yml b/config/locales/en.yml index 1ed8baf..525efc1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5,3 +5,5 @@ en: de: 'German' fr: 'French' it: 'Italian' + es: 'Spanish' + ca: 'Catalan' diff --git a/config/locales/es.yml b/config/locales/es.yml new file mode 100644 index 0000000..6a3afd7 --- /dev/null +++ b/config/locales/es.yml @@ -0,0 +1,9 @@ +en: + active_admin: + translate: + en: 'English' + de: 'German' + fr: 'French' + it: 'Italian' + es: 'Español' + ca: 'Catalán' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index bc607d5..4fa811e 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -5,3 +5,5 @@ fr: de: 'Allemand' fr: 'Français' it: 'Italien' + es: 'Espagnol' + ca: 'Catalan' diff --git a/config/locales/it.yml b/config/locales/it.yml index c31ff99..dbeee5c 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1,7 +1,9 @@ it: active_admin: translate: - en: 'Inglese ' + en: 'Inglese' de: 'Alemanno' - fr: 'Francese ' + fr: 'Francese' it: 'Italiano' + es: 'Spagnolo' + ca: 'Catalano' diff --git a/lib/active_admin/translate/version.rb b/lib/active_admin/translate/version.rb index 7424a76..7800589 100644 --- a/lib/active_admin/translate/version.rb +++ b/lib/active_admin/translate/version.rb @@ -1,6 +1,6 @@ module ActiveAdmin module Translate # The current released version - VERSION = '0.2.4' + VERSION = '0.2.5' end end From e048370113e755093984c16b6d034629f69ca73b Mon Sep 17 00:00:00 2001 From: ramon Date: Fri, 27 Mar 2015 19:48:45 +0100 Subject: [PATCH 09/13] Update Changelog and readme --- CHANGELOG.md | 10 ++++++++++ README.md | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bef7d3..df3ba0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # ActiveAdmin Translate Changelog +## 0.2.5 - March 27, 2015 + +Updates content_for block to accept record object (Thanks David Stump) +Add more locales + +## 0.2.4 - January 14, 2015 + +- Add form_buffers backward compatibility + + ## 0.2.3 - December 6, 2014 - Remove Globalize3 dependency. diff --git a/README.md b/README.md index 188e5f1..ed09013 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ ActiveAdmin Translate takes the available languages from `I18n.available_locales your `application.rb` like ```ruby -config.i18n.available_locales = [:en, :de, :fr, :it] +config.i18n.available_locales = [:en, :de, :fr, :it, :es, :ca] ``` ### Include ActiveAdmin Translate From d9a25631b58456e872172f046dd3534816f23935 Mon Sep 17 00:00:00 2001 From: Pavel Borsky Date: Mon, 23 Nov 2015 13:32:34 +0300 Subject: [PATCH 10/13] Support for template.output_buffer --- lib/active_admin/translate/form_builder.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/active_admin/translate/form_builder.rb b/lib/active_admin/translate/form_builder.rb index 9ee775e..ace7f10 100644 --- a/lib/active_admin/translate/form_builder.rb +++ b/lib/active_admin/translate/form_builder.rb @@ -16,9 +16,13 @@ def translate_inputs(name = :translations, &block) else html = "".html_safe end + html << template.content_tag(:div, :class => "activeadmin-translate #{ translate_id }") do locale_tabs << locale_fields(name, block) << tab_script end + + template.concat(html) if template.output_buffer + html end protected @@ -43,7 +47,7 @@ def locale_fields(name, block) fields = proc do |form| form.input(:locale, :as => :hidden) - block.call(form) + block.call form end inputs_for_nested_attributes(:for => [name, translation], :id => field_id(locale), :class => "inputs locale locale-#{ locale }", &fields) From cd0c0c78651af2ff32f542d7bf61628087a8bfde Mon Sep 17 00:00:00 2001 From: Ramon Batlle Date: Tue, 24 Nov 2015 22:53:07 +0100 Subject: [PATCH 11/13] Update changeling --- CHANGELOG.md | 8 ++++++-- lib/active_admin/translate/version.rb | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df3ba0e..bfc555f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ # ActiveAdmin Translate Changelog +## 0.2.6 - November 24, 2015 + +- Support for has_many translates (Thanks Pavel Borsky) + ## 0.2.5 - March 27, 2015 -Updates content_for block to accept record object (Thanks David Stump) -Add more locales +- Updates content_for block to accept record object (Thanks David Stump) +- Add more locales ## 0.2.4 - January 14, 2015 diff --git a/lib/active_admin/translate/version.rb b/lib/active_admin/translate/version.rb index 7800589..d535698 100644 --- a/lib/active_admin/translate/version.rb +++ b/lib/active_admin/translate/version.rb @@ -1,6 +1,6 @@ module ActiveAdmin module Translate # The current released version - VERSION = '0.2.5' + VERSION = '0.2.6' end end From 4b93398bfb492e196dd0acd94cef33bf611c25c0 Mon Sep 17 00:00:00 2001 From: Pavel Borsky Date: Wed, 23 Dec 2015 21:42:00 +0300 Subject: [PATCH 12/13] Fixed problem when block f.translate_inputs called before f.inputs and only one input field rendered --- lib/active_admin/translate/form_builder.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/active_admin/translate/form_builder.rb b/lib/active_admin/translate/form_builder.rb index ace7f10..03f5c63 100644 --- a/lib/active_admin/translate/form_builder.rb +++ b/lib/active_admin/translate/form_builder.rb @@ -17,6 +17,8 @@ def translate_inputs(name = :translations, &block) html = "".html_safe end + template.assign(has_many_block: true) + html << template.content_tag(:div, :class => "activeadmin-translate #{ translate_id }") do locale_tabs << locale_fields(name, block) << tab_script end From 7b657483040aed497ca609676e01150387b8c9b4 Mon Sep 17 00:00:00 2001 From: Ramon Batlle Date: Wed, 23 Dec 2015 21:19:48 +0100 Subject: [PATCH 13/13] Update changelog and version. --- CHANGELOG.md | 4 ++++ lib/active_admin/translate/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfc555f..74fc86e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # ActiveAdmin Translate Changelog +## 0.2.7 - December 23, 2015 + +- Fixed problem when block f.translate_inputs called before f.inputs and only one input field rendered (Thanks Pavel Borsky) + ## 0.2.6 - November 24, 2015 - Support for has_many translates (Thanks Pavel Borsky) diff --git a/lib/active_admin/translate/version.rb b/lib/active_admin/translate/version.rb index d535698..54760c1 100644 --- a/lib/active_admin/translate/version.rb +++ b/lib/active_admin/translate/version.rb @@ -1,6 +1,6 @@ module ActiveAdmin module Translate # The current released version - VERSION = '0.2.6' + VERSION = '0.2.7' end end