Add Page position and parent_page_id
This commit is contained in:
1 parent
96f186a71b
commit
a4c900af4d
6 files changed
+70
-33
No files matched your search
@@ -0,0 +1,19 @@
|
||||
<p>
|
||||
<%= f.label :name, "Name" %>
|
||||
<%= f.text_field :name, :class => 'text' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :layout_name, "Layout Name" %>
|
||||
<%= f.text_field :layout_name, :class => 'text' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :content, "Content" %>
|
||||
<%= f.text_area :content, :size => '100x30' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :is_published, "Is Published" %>
|
||||
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
|
||||
</p>
|
||||
@@ -3,20 +3,7 @@
|
||||
<% form_for @page, :url => admin_page_path(@page) do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<p>
|
||||
<%= f.label :name, "Name" %>
|
||||
<%= f.text_field :name, :class => 'text' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :layout_name, "Layout Name" %>
|
||||
<%= f.text_field :layout_name, :class => 'text' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :content, "Content" %>
|
||||
<%= f.text_area :content, :size => '100x30' %>
|
||||
</p>
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit 'Update' %>
|
||||
|
||||
@@ -2,14 +2,34 @@
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Children</th>
|
||||
<th>Layout</th>
|
||||
<th>Parent</th>
|
||||
<th>Position</th>
|
||||
<th>Published?</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
|
||||
<% @pages.each do |page| %>
|
||||
<tr>
|
||||
<td><%= link_to page.name, admin_page_path(page) %></td>
|
||||
<td><%= link_to 'Edit', edit_admin_page_path(page) %></td>
|
||||
<td><%= link_to 'Destroy', admin_page_path(page), :confirm => 'Are you sure?', :method => :delete %></td>
|
||||
<td><ul>
|
||||
<% page.children.each do |child| %>
|
||||
<li><%= child.name %></li>
|
||||
<% end -%>
|
||||
</td>
|
||||
<td><%= page.layout_name %></th>
|
||||
<td><%= page.parent_page_id %></td>
|
||||
<td><%= page.position %></td>
|
||||
<td><%= page.is_published.to_s %></td>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_admin_page_path(page) %> |
|
||||
<%= link_to 'Add Child', new_admin_page_path( :parent_page_id => page.id ) %> |
|
||||
<%= link_to 'Destroy', admin_page_path(page), :confirm => 'Are you sure?', :method => :delete %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -2,25 +2,14 @@
|
||||
|
||||
<% form_for :page, :url => admin_pages_path do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<p>
|
||||
<%= f.label :name, "Name" %>
|
||||
<%= f.text_field :name, :class => 'text' %>
|
||||
</p>
|
||||
<%= f.hidden_field :parent_page_id %>
|
||||
|
||||
<p>
|
||||
<%= f.label :layout_name, "Layout Name" %>
|
||||
<%= f.text_field :layout_name, :class => 'text' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :content, "Content" %>
|
||||
<%= f.text_area :content, :size => '100x30' %>
|
||||
</p>
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit 'Create' %>
|
||||
</p>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Back', admin_pages_path %>
|
||||
Reference in new issue
Block a user