<% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %><% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/items/page_part" %> <% end %> <%= form_for @part, url: {action: "update"}, :remote=>true, html: { class: "form-horizontal main-forms"} do |f| %> <%= f.error_messages %>
<%= t(:select_one_function) %>
<% @site_in_use_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.select :public_r_tag, LIST[:public_r_tags].collect{|tag| [t(tag), tag]}, {selected: @r_tag}, {rel: reload_r_tag_options_admin_page_part_path(@part), class: "input-xlarge"} %> <% case @r_tag %> <% when 'sub_menu' %> <%= f.hidden_field :public_r_tag_object_id, :value => @part.page.id %> <%#= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %> <% when 'sitemap', 'terms_of_use', 'breadcrumb' %> <% else %> <%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, selected: @part.public_r_tag_object_id) %> <% end %>
<%= f.fields_for :title_translations do |f| %> <% @site_in_use_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) %>
<% 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, (@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 %>
<%= render @partial if @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 %>