<% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/items/page_part" %> <% end %> <%= form_for @part, url: admin_page_part_path(@part), html: { class: "form-horizontal main-forms"} do |f| %>
<%= t(:select_one_function) %>
<% @site_valid_locales.each_with_index do |locale, i| %>
<%= f.fields_for :content_translations do |f| %> <%= f.text_area locale, class: "ckeditor input-block-level", value: (@part.content_translations[locale] rescue nil) %> <% end %>
<% end %>
<%= 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 %>
<% end %> <% end %>
<%= 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, true, class: "select_all" %> <%= t(:all) %> <% end %>
<%= content_tag_for(:label, @module_app_categories, class: "checkbox") do |category|%> <%= check_box_tag("page_part[tag][]", category.id, (@part.category.include?(category.id) rescue false) ) %> <%= category.title %> <% end if @module_app_tags %>
<%= f.label :tags, t(:tags), class: "control-label muted" %>
<%= content_tag :label, class: "checkbox" do %> <%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %> <% end %>
<%= content_tag_for(:label, @module_app_tags, class: "checkbox") do |tag|%> <%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id) rescue false) ) %> <%= tag.name %> <% end if @module_app_tags %>
<%= render @partial %>
<%= 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" %>
<%= f.submit t(:update_), class: "btn btn-primary" %>
<% end %>