% 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| %>
<%# #### 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? %>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 #### %>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 %><%= submit_tag "Upload" %> or <%= link_to "Cancel", "#", class: "cancel clear-modal" %>
<% end %>