fix issue #175 + the liquid template of content types (back-office) were broken

This commit is contained in:
did 2011-08-26 00:30:34 +02:00
parent bb48552b51
commit 265525c1a7
2 changed files with 3 additions and 5 deletions

View File

@ -7,7 +7,7 @@ module Admin::ContentTypesHelper
@content_types = current_site.content_types.ordered.
limit(:contents => Locomotive.config.lastest_items_nb).
only(:site_id, :name, :slug, :highlighted_field_name, :content_custom_fields_version, :order_by, :serialized_item_template).to_a
only(:site_id, :name, :slug, :highlighted_field_name, :content_custom_fields_version, :order_by, :serialized_item_template, :raw_item_template).to_a
if @content_type && @content_type.persisted? && @content_types.index(@content_type) >= MAX_DISPLAYED_CONTENTS
@content_types.delete(@content_type)

View File

@ -22,7 +22,7 @@ module Admin::CustomFieldsHelper
def options_for_highlighted_field(content_type, collection_name)
custom_fields_collection_name = "ordered_#{collection_name.singularize}_custom_fields".to_sym
collection = content_type.send(custom_fields_collection_name)
collection.delete_if { |f| f.label == 'field name' || f.kind == 'file' }
collection.delete_if { |f| f.label == 'field name' || %w(file has_one has_many).include?(f.kind) }
collection.map { |field| [field.label, field._name] }
end
@ -40,9 +40,7 @@ module Admin::CustomFieldsHelper
end
def options_for_association_target
current_site.content_types.collect do |c|
c.persisted? ? [c.name, c.content_klass.to_s] : nil
end.compact
current_site.reload.content_types.collect { |c| [c.name, c.content_klass.to_s] }
end
def options_for_reverse_lookups(my_content_type)