<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}", class: "control-label muted" %>
<%= f.text_field locale, class: 'input-xlarge page_title', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale, :value => (@part.title_translations[locale] rescue nil) %>
<%= f.label :module_app_id, t(:module), class: "control-label muted" %>
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, selected: (@part.module_app_id rescue nil)), {}, {include_blank: true, class: "input-xlarge change"} %>
<%= f.label :widget_path, t('front_page.display_mode'), class: "control-label muted" %>
<%= f.select :widget_path, @widget_paths, {}, selected: (@part.widget_path rescue nil), class: "input-xlarge change" %>
<%= f.label :categories, t(:categories), class: "control-label muted" %>
<%= content_tag :label, class: "checkbox" do %>
<%= check_box_tag nil, nil, (@part.category.size == @module_app_categories.size ? true : false), class: "select_all" %> <%= t(:all) %>
<% end %>
<%= content_tag_for(:label, @module_app_categories, class: "checkbox inline") do |category|%>
<%= check_box_tag("page_part[category][]", category.id, (@part.category.include?(category.id.to_s) rescue false) ) %>
<%= category.title %>
<% end if @module_app_categories %>
<%= f.label :tags, t(:tags), class: "control-label muted" %>
<%= content_tag :label, class: "checkbox" do %>
<%= check_box_tag nil, nil, (@part.tag.size == @module_app_tags.size ? true : false), class: "select_all" %> <%= t(:all) %>
<% end %>
<%= content_tag_for(:label, @module_app_tags, class: "checkbox inline") do |tag|%>
<%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id.to_s) rescue false) ) %>
<%= tag.name %>
<% end if @module_app_tags %>
<%= f.label :widget_data_count, t(:widget_data_count), class: "control-label muted" %>
<%= f.select :widget_data_count, options_for_select(@data_count, @part.widget_data_count), {}, class: "input-mini", id: "page_count" %>