<% self.page_title = "Editing “" + @page.name.to_s + "”" self.page_description = "Editing " + [@page.ancestors.reverse,@page].flatten.map{|page| link_to((page.name rescue "(Untitled)"), edit_admin_page_path(@locale, page))}.join(" » ") if PagesCore.config.localizations? self.page_description_links = 'In ' + PagesCore.config.locales.map{ |l, n| link_to_unless_current n, edit_admin_page_path(l, @page) }.join(link_separator) end %> <%# #### SIDEBAR ########################################################### %> <% content_for :sidebar do %> <%= form_for(@page, url: admin_page_url(@locale, @page), html: {class: :edit_page, id: 'page-form-sidebar'}) do |f| %> <%= render partial: 'edit_options', locals: {f: f} %> <% end %> <% end %> <%# #### EDIT AREA ######################################################### %> <%= form_for(@page, url: admin_page_url(@locale, @page), html: { class: :edit_page, id: 'page-form', method: :put, multipart: true }, builder: PagesCore::FormBuilder ) do |f| %>
<%= render partial: 'edit_options', locals: {f: f} %>
<%# #### CONTENT #### %> <%= content_tab "Content" do %> <%= render partial: 'edit_content', locals: {f: f} %> <% end %> <%# #### IMAGES #### %> <% if @page.template_config.value(:images) || @page.template_config.value(:image) %> <%= content_tab "Images" do %> <%= render partial: 'edit_images', locals: {f: f} %> <% end %> <% end %> <%# #### FILES #### %> <% if @page.template_config.value(:files) %> <%= content_tab "Files" do %> <% if @page.files.any? %> <% else %>

No files added yet.

<% end %>

<% end %> <% end %> <%# #### COMMENTS #### %> <% if @page.template_config.value(:comments) %> <% if @page.comments.count > 0 %> <%= content_tab "Comments" do %> <%= render partial: 'edit_comments', locals: {f: f} %> <% end %> <% else %> <%= content_tab "Comments", {disabled: true} do %>

No comments added.

<% end %> <% end %> <% end %> <%# #### METADATA #### %> <%= content_tab "Metadata" do %> <%= render partial: 'edit_metadata', locals: {f: f} %> <% end %>
<% end %> <%# #### UPLOAD IMAGE #### %>

Upload images

<%= form_for(@page.page_images.new, url: admin_page_images_url(@locale, @page), html: {multipart: true}) do |f| %> <% 10.times do |i| %> <% end %>
File Caption
<%= file_field_tag("page_images[#{i}][image]") %> <%= text_field_tag("page_images[#{i}][image_attributes][caption]", '', size: 48) %>

<%= submit_tag "Upload" %> or <%= link_to "Cancel", "#", class: "cancel clear-modal" %>

<% end %>
<%# #### UPLOAD FILE #### %> <% if @page.template_config.value(:files) %>

Upload new file

<%= form_for((@new_file = PageFile.new), url: admin_page_files_path(@locale, @page), html: {multipart: true}) do |f| %> <%= labelled_field f.text_field( :name, size: 48 ), "Name", errors: @new_file.errors[:name] %> <%= labelled_field f.text_field( :description, size: 48 ), "Description", errors: @new_file.errors[:name] %> <%= labelled_field f.file_field( :file ), "File", errors: @new_file.errors[:file] %>

<%= submit_tag "Upload" %> or <%= link_to "Cancel", "#", class: "cancel clear-modal" %>

<% end %>
<% end %>