<% if params[:action] == "edit" %>

<%= @page.name %>

<% end %>
<% if params[:action] == "new" %> <%= f.label :name, content_tag(:i, nil, :class => "icons-star") + t(:page)+' ID' %>
<%= f.text_field :page_id, class:"input-xlarge change", data: {"fv-validation" => "required;nospace;pageid_validation;", "fv-messages" => "Cannot be empty.;Cannot have blank spaces.;Page id is already taken.;"} %> <%= t("front_page.name_field_helper") %>
<% end %>
<% @site_in_use_locales.each do |locale| %> <%= f.label :locale, "#{t(:title)} #{t(locale)}" %>
<%= f.fields_for :name_translations do |n| %> <%= n.text_field locale, class:"input-xlarge change", data: {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"}, :value=>@page.name_translations[locale] rescue nil %> <% end %>
<% end %>
<%= f.select(:module, @modules.map{|m| [t('module_name.'+m.key),m.key]},{:include_blank => true},:class=>"module_select input-xlarge change", data: {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"}) %> <%= f.hidden_field :parent_page, value: (params[:parent_page] || @page.parent_page_id) %> <%= f.hidden_field :page_type, value: "page" %>
<% if @module_app and @module_app.key.eql?("member") %>
<%= f.radio_button :member_sort_position, false, checked: !@page.member_sort_position? %> <%= t(:sort_by_role_fields) %>
<%= f.radio_button :member_sort_position, true, checked: @page.member_sort_position?%> <%= t(:sort_manually) %> <%= t(:sort_edit_order) %>
<% end %>
<% if params[:action] == "edit" %>
<% if !@categories.blank? %> <% end %> <% @categories.each do |category| %> <% end %>
<% end %>
<% if params[:action] == "edit" %>
<% if !@tags.blank? %> <% end %> <% @tags.each do |tag| %> <% end %>
<% end %>
<% if params[:action] == "edit" %>
<% if !@roles.blank? %> <% end %> <% @roles.each do |role| %> <% end %>
<% end %>
<% if params[:action] == "edit" && !@layout_types.blank? %>
<% if @layout_types.first.kind_of?(Hash) %> <% else %> <%= f.select(:layout, @layout_types) %> <% end %>
<% end %>
<% if params[:action] == "edit" %> <% if !@module_app.data_count.nil? %>
<% end %> <% end %>
<% @site_in_use_locales.each do |locale| %>
<% end %>