Created
February 26, 2011 11:51
-
-
Save esneko/845143 to your computer and use it in GitHub Desktop.
Taxon Globalize Accessors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if(Taxon.easy_accessors.blank?) %> | |
<%= f.field_container :name do %> | |
<%= f.label :name, t("name") %> <span class="required">*</span><br /> | |
<%= error_message_on :taxon, :name, :class => 'fullwidth title' %> | |
<%= text_field :taxon, :name %> | |
<% end %> | |
<% else %> | |
<%- Taxon.easy_accessors.each do |locale| %> | |
<% fieldsym = "name_#{locale}".to_sym %> | |
<%= f.field_container fieldsym do %> | |
<%= f.label fieldsym, t(fieldsym.to_s) %> <span class="required">*</span><br /> | |
<%= f.error_message_on fieldsym, :class => 'fullwidth title' %> | |
<%= f.text_field fieldsym %> | |
<% end %> | |
<% end %> | |
<% end %> | |
<%= f.field_container :permalink_part do %> | |
<%= f.label :permalink_part, t("permalink") %><span class="required">*</span><br /> | |
<%= @taxon.permalink.split("/")[0...-1].join("/") + "/" %><%= text_field_tag :permalink_part, @permalink_part %> | |
<% end %> | |
<%= f.field_container :icon do %> | |
<%= f.label :icon, t('icon') %><br /> | |
<%= f.file_field :icon %> | |
<% end %> | |
<%= f.field_container :description do %> | |
<%= f.label :description, t(:description) %><br /> | |
<%= f.text_area :description %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GlobalizeSpreeHooks < Spree::ThemeSupport::HookListener | |
# custom hooks go here | |
replace :admin_product_form_left, 'admin/shared/product_globalize_form_left' | |
replace :admin_inside_taxon_form, 'admin/shared/taxon_globalize_form_inside' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment