scarfacedeb / rails_admin_globalize_field

Tabbed interface and custom field type for globalize translations for Rails_admin
MIT License
50 stars 60 forks source link

handle nested models' translations #4

Closed stream7 closed 10 years ago

stream7 commented 10 years ago

It generates different css classes for each model's localised fields tab so that the bootstrap-tab plugin can select the correct one.

Also avoids invalid html with multiple elements with the same id.

scarfacedeb commented 10 years ago

I'm sorry for the delay. I somehow missed email notification with your pull request.

I can see the benefits of your changes, but I'm curious - is there any reason why it should use classes, instead of ids for bootstrap-tab targets?

IDs shouldn't clash anymore, because you added model names into them. (e.g. .localized-pane-en-category) and it's not going to render tabs for the same locale more, than once. So, it seems to me that we can use IDs, as before. Am I missing something?

stream7 commented 10 years ago

Hi,

I think there was a conflict with ids but I can't be sure cause I don't have that code anymore. I ended up not using this cause I needed a ckeditor'ed localized field which was another story.

In any case, I personally prefer using classes instead of ids for many reasons, especially for library related stuff.

scarfacedeb commented 10 years ago

I see you point. I usually prefer to use classes for styling and ids for javascript, but given the fact that it's a plugin, it's reasonable to use classes in this case.

Thank you!

Tronerta commented 3 years ago

Hello from 2021. The code from this commit was removed, but i believe the problem still exists in 1.0.0. In nested attributes translations, it changes the fields and works properly only for the first associated record, but for others it always shows fields for first locale.