Changeset 1687

Show
Ignore:
Timestamp:
04/30/08 18:34:35 (2 weeks ago)
Author:
neuro
Message:

Fix a bug with forgotten parent_id

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/admin/pages_controller.rb

    r1686 r1687  
    88 
    99  def list 
    10     conditions = "parent_id = 0" 
     10    conditions = "id > 0" 
    1111 
    1212    if params[:search] 
     
    5858    @page.user_id = current_user.id 
    5959    @page.text_filter ||= this_blog.text_filter 
    60     @page.parent_id ||= 0 
    6160    if request.post?  
    6261      if @page.name.blank? 
  • trunk/app/helpers/admin/pages_helper.rb

    r1686 r1687  
    88  def display_page_row(page) 
    99    result = "<tr alternate_class>\n" 
    10     if page.parent_id == 0 
    11       result << "<td>#{link_to_permalink(page,page.title)}</td>\n" 
    12     else 
    13       result << "<td>–––– #{link_to_permalink(page,page.title)}</td>\n" 
    14     end 
     10    result << "<td>#{link_to_permalink(page,page.title)}</td>\n" 
    1511    result << "<td>/pages/#{page.name}</td>\n" 
    1612    result << "<td>#{page.created_at.strftime('%d/%m/%Y at %H:%M')}</td>\n"