<% content_for :header do %> <%= javascript_include_tag 'lightwindow' %> <%= stylesheet_link_tag 'lightwindow' %> <% end -%>

<%= @page.new_record? ? 'New' : 'Editing a' %> Page

<% form_for([:admin, @page], :html => { :id => 'has-assets-form' }) do |f| %> <%= f.error_messages %> <%= f.hidden_field :parent_id %> <% if @page.lock_level < Page::LOCK_LEVEL_TITLE %>

<%= f.label :title, 'Title*' %>
<%= f.text_field :title, :class => 'title' %>

<% else %>

<%= f.label :title %>
<%= @page.title %> (locked)

<% end %>

<%= f.label :body, 'Body*' %>
<%= f.text_area 'body', :class => 'editor' %>

<%= f.label :description, "Description*" %>
<%= f.text_area :description, "rows" => 4 %>

<% if @page.lock_level < Page::LOCK_LEVEL_PERMALINK %>

<%= f.label :permalink, "URL" %>
<%= page_url('') %><%= f.text_field :permalink %>

URLs are most efficient if they closely reflect the title or main subject of this content. Changing the permalink will make search engines think it is a different page resulting in a loss of page rank, only change if very necessary. Leave blank to use the title.

<% else %>

<%= f.label :permalink, "URL" %>
<%= page_url(@page.permalink) %> (locked)

<% end %>

<%= f.label :tag_list, "Keywords (used by search engines) & Tags - comma separated*" %>
<%= f.text_field :tag_list, :class => 'long' %>

<% if @page.lock_level < Page::LOCK_LEVEL_TEMPLATE %>

<%= f.label :template %> <%= f.select :template, get_template_names.collect{|t| [ t.titleize, t ] } %>

<% else %>

<%= f.label :template %> <%= @page.template.titleize %> (locked)

<% end %> <%= publish_select(f) if @page.lock_level < Page::LOCK_LEVEL_PERMALINK %>

<%= preview_link(@page) %> <%= f.submit 'Publish', :name => 'page[publish]' %> <%= f.submit 'Save as draft', :name => 'page[hide]' if @page.lock_level < Page::LOCK_LEVEL_PERMALINK %> or <%= link_to 'Cancel', admin_pages_path %>

<% end %> <% content_for :sub_content do %> <%= asset_list(@page) %>

File Library

<%= asset_browser(true) %>

File Upload

<%= asset_upload_form %> <%= flickr_select %> <% end %>