It’s surprisingly easy to add “Change Parent” functionality to Radiant
0.5.2(as requested in
http://dev.radiantcms.org/radiant/ticket/47). I just added these lines
at
line 78 of views/page/new.rhtml:
<tr>
<td><label for="page_parent_id">Parent</label></td>
<td class="field"><%= select "page", "parent_id",
(Page.find(:all,
:order => “title ASC”).map { |s| [s.title, s.id] }) -
[@page.title,@page.id]
%>
This really isn’t enough for release. Ideally the page list would be
nested
and the order identical to that of the index. I’d like to clean this up
and
make it a patch, but since I may never get around to it and so it’s out
there here it is. If you want to be able to change parents quick without
going into the DB, this seems like a pretty straightforward solution.
Any
ideas on how best to display the names nested? (I guess really this
means
prefixing each name with a number of “-” characters equal to the number
of
parents it has…)
Ethan
DIFF:
77a78,81
<tr> <td><label for="page_parent_id">Parent</label></td> <td class="field"><%= select "page", "parent_id", (Page.find(:all,
:order => “title ASC”).map { |s| [s.title, s.id] }) -
[@page.title,@page.id]
%>