Skip to content

Commit 93e4d74

Browse files
Merge pull request #1 from alittlebit/twintags_fix
Apply twintags fix v.0.2.7
2 parents 2646753 + 12658d1 commit 93e4d74

File tree

15 files changed

+118
-81
lines changed

15 files changed

+118
-81
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# ActiveAdmin Translate Changelog
22

3+
## 0.2.7 - December 23, 2015
4+
5+
- Fixed problem when block f.translate_inputs called before f.inputs and only one input field rendered (Thanks Pavel Borsky)
6+
7+
## 0.2.6 - November 24, 2015
8+
9+
- Support for has_many translates (Thanks Pavel Borsky)
10+
11+
## 0.2.5 - March 27, 2015
12+
13+
- Updates content_for block to accept record object (Thanks David Stump)
14+
- Add more locales
15+
16+
## 0.2.4 - January 14, 2015
17+
18+
- Add form_buffers backward compatibility
19+
20+
21+
## 0.2.3 - December 6, 2014
22+
23+
- Remove Globalize3 dependency.
24+
- Fix UI tab issues.
25+
- Fix compatibility with current ActiveAdmin.
26+
327
## 0.2.2 - November 16, 2012
428

529
- Include SCSS mixins.

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contribute to ActiveAdmin Translate
44
File an issue
55
-------------
66

7-
You can report bugs and feature requests to [GitHub Issues](https://github.com/netzpirat/activeadmin-globalize/issues).
7+
You can report bugs and feature requests to [GitHub Issues](https://github.com/netzpirat/activeadmin-translate/issues).
88

99
**Please don't ask question in the issue tracker**, instead ask them at Stackoverflow and use the
1010
[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:
2020
Development
2121
-----------
2222

23-
* Documentation hosted at [RubyDoc](http://rubydoc.info/github/netzpirat/activeadmin-globalize/master/frames).
24-
* Source hosted at [GitHub](https://github.com/netzpirat/activeadmin-globalize).
23+
* Source hosted at [GitHub](https://github.com/netzpirat/activeadmin-translate).
2524

2625
Pull requests are very welcome! Please try to follow these simple rules if applicable:
2726

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# ActiveAdmin Translate
22

3-
Translate your [Globalize3](https://github.com/svenfuchs/globalize3) ActiveModel translations in
4-
[ActiveAdmin](https://github.com/gregbell/active_admin), using [jQueryUI tabs](http://jqueryui.com/tabs/) to switch
3+
Translate your [Globalize](https://github.com/globalize/globalize) ActiveModel translations in
4+
[ActiveAdmin](https://github.com/activeadmin/activeadmin), using [jQueryUI tabs](http://jqueryui.com/tabs/) to switch
55
between the locales.
66

77
## Installation
88

99
Add the gem to your `Gemfile`
1010

1111
```ruby
12-
gem 'activeadmin-translate'
12+
gem 'activeadmin-translate', github: 'alittlebit/activeadmin-translate'
1313
```
1414

1515
and install it with Bundler:
@@ -26,7 +26,7 @@ ActiveAdmin Translate takes the available languages from `I18n.available_locales
2626
your `application.rb` like
2727

2828
```ruby
29-
config.i18n.available_locales = [:en, :de, :fr, :it]
29+
config.i18n.available_locales = [:en, :de, :fr, :it, :es, :ca]
3030
```
3131

3232
### Include ActiveAdmin Translate
@@ -42,7 +42,7 @@ You need to import the SASS for styling the tabs to `app/assets/stylesheets/acti
4242
### Make your translations accessible
4343

4444
In order to access the translations of your model and be able to write them on save, you need to make attributes
45-
accessible in your model. Globalize3 stores the model translations in a separate table that is accessible as
45+
accessible in your model. Globalize stores the model translations in a separate table that is accessible as
4646
`translations` in your model:
4747

4848
```ruby
@@ -100,14 +100,14 @@ and add more translations with the registered locale symbol.
100100
Developed by Michael Kessler, [FlinkFinger GmbH](http://www.flinkfinger.com).
101101
102102
If you like ActiveAdmin Translate, you can watch the repository at
103-
[GitHub](https://github.com/netzpirat/activeadmin-globalize) and follow [@netzpirat](https://twitter.com/#!/netzpirat)
103+
[GitHub](https://github.com/netzpirat/activeadmin-translate) and follow [@netzpirat](https://twitter.com/netzpirat)
104104
on Twitter for project updates.
105105
106106
## Contribute to ActiveAdmin Translate
107107
108108
### File an issue
109109
110-
You can report bugs and feature requests to [GitHub Issues](https://github.com/netzpirat/activeadmin-globalize/issues).
110+
You can report bugs and feature requests to [GitHub Issues](https://github.com/netzpirat/activeadmin-translate/issues).
111111
112112
**Please don't ask question in the issue tracker**, instead ask them at Stackoverflow and use the
113113
[activeadmin](http://stackoverflow.com/questions/tagged/activeadmin) tag.
@@ -122,27 +122,26 @@ When you file a bug, please try to follow these simple rules if applicable:
122122
123123
### Development
124124
125-
* Documentation hosted at [RubyDoc](http://rubydoc.info/github/netzpirat/activeadmin-globalize/master/frames).
126-
* Source hosted at [GitHub](https://github.com/netzpirat/activeadmin-globalize).
125+
* Source hosted at [GitHub](https://github.com/netzpirat/activeadmin-translate).
127126
128127
Pull requests are very welcome! Please try to follow these simple rules if applicable:
129128
130129
* Please create a topic branch for every separate change you make.
131130
* Update the [Yard](http://yardoc.org/) documentation.
132-
* Update the [README](https://github.com/netzpirat/activeadmin-globalize/blob/master/README.md).
133-
* Update the [CHANGELOG](https://github.com/netzpirat/activeadmin-globalize/blob/master/CHANGELOG.md) for noteworthy changes.
131+
* Update the [README](https://github.com/netzpirat/activeadmin-translate/blob/master/README.md).
132+
* Update the [CHANGELOG](https://github.com/netzpirat/activeadmin-translate/blob/master/CHANGELOG.md) for noteworthy changes.
134133
* Please **do not change** the version number.
135134
136135
## Contributors
137136
138-
See the [CHANGELOG](https://github.com/netzpirat/activeadmin-globalize/blob/master/CHANGELOG.md) and the GitHub list of
139-
[contributors](https://github.com/netzpirat/activeadmin-globalize/contributors).
137+
See the [CHANGELOG](https://github.com/netzpirat/activeadmin-translate/blob/master/CHANGELOG.md) and the GitHub list of
138+
[contributors](https://github.com/netzpirat/activeadmin-translate/contributors).
140139
141140
## Acknowledgment
142141
143142
This project has taken some ideas and code from the following projects:
144143
145-
- [activeadmin-globalize3](https://github.com/stefanoverna/activeadmin-globalize3) from [Stefano Verna](https://github.com/stefanoverna)
144+
- [activeadmin-globalize](https://github.com/stefanoverna/activeadmin-globalize) from [Stefano Verna](https://github.com/stefanoverna)
146145
- [ActiveAdmin-Globalize3-inputs](https://github.com/mimimi/ActiveAdmin-Globalize3-inputs) from [Dmitrii Soltis](https://github.com/mimimi)
147146
148147
## License

activeadmin-translate.gemspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
require File.expand_path('../lib/active_admin/translate/version', __FILE__)
33

44
Gem::Specification.new do |gem|
5-
gem.authors = ['Michael Kessler']
5+
gem.authors = ['Michael Kessler', 'Twintags']
66
gem.email = %w(michi@flinkfinger.com)
77
gem.summary = %q{Translate models with ActiveAdmin.}
8-
gem.description = %q{Translate your models in ActiveAdmin with Globalize3.}
9-
gem.homepage = 'https://github.com/netzpirat/activeadmin-translate'
8+
gem.description = %q{Translate your models in ActiveAdmin with Globalize.}
9+
gem.homepage = 'https://github.com/twintags/activeadmin-translate'
1010

1111
gem.files = Dir['{app,lib,config}/**/*'] + %w(LICENSE README.md CHANGELOG.md CONTRIBUTING.md)
1212
gem.name = 'activeadmin-translate'
1313
gem.require_paths = %w(lib)
1414
gem.version = ActiveAdmin::Translate::VERSION
15+
gem.license = 'MIT'
1516

1617
gem.add_dependency 'activeadmin'
17-
gem.add_dependency 'globalize3'
18+
gem.add_dependency 'globalize'
1819
gem.add_dependency 'railties'
1920
end

app/assets/stylesheets/active_admin/translate.css.scss

Lines changed: 25 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,41 @@
55
.activeadmin-translate .locales {
66
overflow: auto;
77
margin-right: 10px;
8+
margin-bottom: -1px;
89

910
li {
1011
@include section-header;
1112

1213
border-top-left-radius: 10px;
1314
border-top-right-radius: 10px;
1415

15-
float: right !important;
16+
float: right;
17+
18+
margin-bottom: 0;
19+
padding-left: 0;
20+
padding-right: 0;
21+
22+
a {
23+
padding: .5em 1em;
24+
text-decoration: none;
25+
26+
&:hover,&:active {
27+
text-decoration: underline;
28+
}
29+
box-shadow: none;
30+
border-style: none;
31+
background: inherit;
32+
}
1633

1734
&.ui-state-active {
1835
background: white;
36+
border-bottom-color: white;
37+
38+
a {
39+
color: $section-header-text-color;
40+
cursor: default;
41+
text-decoration: none;
42+
}
1943
}
2044
}
2145
}
@@ -31,53 +55,4 @@
3155
.activeadmin-translate .ui-tabs-hide {
3256
display: none !important;
3357
}
34-
35-
.ui-tabs {
36-
position: relative;
37-
padding: .2em;
38-
zoom: 1;
39-
}
40-
41-
.ui-tabs .ui-tabs-nav {
42-
margin: 0;
43-
padding: .2em .2em 0;
44-
}
45-
46-
.ui-tabs .ui-tabs-nav li {
47-
list-style: none;
48-
float: left;
49-
position: relative;
50-
top: 0;
51-
margin: 1px .2em 0 0;
52-
border-bottom: 0;
53-
padding: 0;
54-
white-space: nowrap;
55-
}
56-
57-
.ui-tabs .ui-tabs-nav li a {
58-
float: left;
59-
padding: .5em 1em;
60-
text-decoration: none;
61-
}
62-
63-
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
64-
margin-bottom: -1px;
65-
padding-bottom: 1px;
66-
}
67-
68-
.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 {
69-
cursor: text;
70-
}
71-
72-
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
73-
cursor: pointer;
74-
}
75-
76-
.ui-tabs .ui-tabs-panel {
77-
display: block;
78-
border-width: 0;
79-
padding: 1em 1.4em;
80-
background: none;
81-
}
82-
8358
}

config/locales/ca.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ca:
2+
active_admin:
3+
translate:
4+
en: 'Anglès'
5+
de: 'Alemany'
6+
fr: 'Francès'
7+
it: 'Italià'
8+
es: 'Espanyol'
9+
ca: 'Català'

config/locales/de.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ de:
55
de: 'Deutsch'
66
fr: 'Französich'
77
it: 'Italienisch'
8+
es: 'Spanisch'
9+
ca: 'Katalanisch'

config/locales/en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ en:
55
de: 'German'
66
fr: 'French'
77
it: 'Italian'
8+
es: 'Spanish'
9+
ca: 'Catalan'

config/locales/es.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
es:
2+
active_admin:
3+
translate:
4+
en: 'English'
5+
de: 'German'
6+
fr: 'French'
7+
it: 'Italian'
8+
es: 'Español'
9+
ca: 'Catalán'

config/locales/fr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ fr:
55
de: 'Allemand'
66
fr: 'Français'
77
it: 'Italien'
8+
es: 'Espagnol'
9+
ca: 'Catalan'

0 commit comments

Comments
 (0)