Create page.

This commit is contained in:
chris2tof committed 2011-06-01 10:24:14 +08:00
1 parent 2522cde2f5
commit ddc7c74436
21 files changed
+163 -83

No files matched your search

+1 -5
View File
@@ -1,3 +1,4 @@
<%= f.error_messages %>
<%= f.hidden_field :parent_id %>
<p>
@@ -18,11 +19,6 @@
<%= f.select :layout_id, Layout.all.map{ |l| [l.description, l.id] } %>
</p>
<p>
<%= f.label "content", t('admin.content') %>
<%= f.text_area "content", :size => '100x30' %>
</p>
<p>
<%= f.label :is_published, "#{t('admin.is_published')} ?" %>
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
+13
View File
@@ -0,0 +1,13 @@
<h1><%= t('admin.new_page') %></h1>
<%= flash_messages %>
<%= form_for @item, :url => admin_pages_path, :html => { :class => 'form' } do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit t('create') %> <%= link_back %>
</p>
<% end %>
+2
View File
@@ -0,0 +1,2 @@
$('#sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>");
$('#main').html("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>");
+4 -10
View File
@@ -1,11 +1,5 @@
<h1><%= t('admin.new_page') %></h1>
<% content_for :sidebar do %>
<div id='sidebar'><%= render 'admin/items/site_map_left_bar' %></div>
<% end -%>
<%= form_for :page, :url => admin_pages_path do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit t('create') %> <%= link_back %>
</p>
<% end %>
<%= render 'new' %>
+1
View File
@@ -0,0 +1 @@
$('#main').html("<%= escape_javascript(render(:partial => 'admin/pages/new')) %>");