Sha256: fc137d60902b24edbfaa85a4c922dc3a36d33b7420782aa1c3e50f49039fa445
Contents?: true
Size: 1.14 KB
Versions: 7
Compression:
Stored size: 1.14 KB
Contents
%ul.nav.nav-tabs - uuid = "#{field.name}_#{field.object_id}_unique_id" - I18n.available_locales.each do |locale| %li{ class: ( 'active' if locale == I18n.locale ) } %a{ href: "##{locale}_#{uuid}", data: { toggle: "tab" }, class: uuid }= locale .tab-content = form.fields_for field.translations_field do |localized_field| - I18n.available_locales.each do |locale| - val = form.object.send("#{field.name}_translations").try(:[], locale.to_s) .fields.tab-pane{ style: 'padding:5px; margin: 0;', id: "#{locale}_#{uuid}", class: [( 'active' if locale == I18n.locale ), uuid] } = localized_field.send field_type, locale, html_attributes.reverse_merge({ :value => val }) :javascript var #{field.name}#{field.object_id} = (new Date().getTime()) + Math.floor(Math.random()*100000); $("ul.nav.nav-tabs a.#{uuid}").each(function(e){ this.href = $(this).attr('href').replace('_unique_id', #{field.name}#{field.object_id}); $(this).removeClass('#{uuid}'); }); $(".tab-content .#{uuid}").each(function(e){ this.id = this.id.replace('_unique_id', #{field.name}#{field.object_id}); $(this).removeClass('#{uuid}'); });
Version data entries
7 entries across 7 versions & 2 rubygems