# (yet another) sorting patch

**URL:** <https://www.ruby-forum.com/t/yet-another-sorting-patch/101321>\
**Category:** Radiant CMS\
**Created:** [August 4, 2006, 8:13am UTC](https://www.ruby-forum.com/t/yet-another-sorting-patch/101321 "2006-08-04T08:13:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bodhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/49beb7/32.png) [@bodhi](https://www.ruby-forum.com/u/bodhi)\
**Post date:** [August 4, 2006, 8:13am UTC](https://www.ruby-forum.com/t/yet-another-sorting-patch/101321/1 "2006-08-04T08:13:59Z")

</div>

Hi All,

Sorry to step on your toes Erik, but I was halfway through this when  
you posted your patch (which I haven’t had a chance to look at just  
yet). I converted the page list from tables to lists, and used  
scriptaculous to order pages. It doesnt do reparenting, so only allows  
you to sort children, not move children to different sections.

It’s a pretty invasive patch, but I did get to remove most of the  
javascript from admin/pages/index.rhtml (I enjoy deleting code 🙂 ). If  
anyone could take a look at it and see how it works for them, it would  
be much appreciated:

[http://dev.radiantcms.org/radiant/ticket/199](http://dev.radiantcms.org/radiant/ticket/199)

It breaks a few of the unit tests (due to the sorting) and I haven’t  
tested it on Internet Explorer yet.

Bodhi

---

<div class="post-metadata">

**Author:** ![bodhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/49beb7/32.png) [@bodhi](https://www.ruby-forum.com/u/bodhi)\
**Post date:** [August 4, 2006, 5:33pm UTC](https://www.ruby-forum.com/t/yet-another-sorting-patch/101321/2 "2006-08-04T17:33:35Z")

</div>

I thought about doing the list convertion, it would have been  
cleaner. I decided to skip the AJAX for and do the page refresh as I  
did not want ot bite off more that I could chew. It does have a  
speed issue going this route. It feels a little slow one one site  
with 132 pages.

Since you have implemented the page to use lists I should be able to  
convert my re-parenting stuff to make use of that and avoid the  
refresh issue. Would you be interested in a patch on your patch that  
does that?

---

<div class="post-metadata">

**Author:** ![bodhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/49beb7/32.png) [@bodhi](https://www.ruby-forum.com/u/bodhi)\
**Post date:** [August 4, 2006, 9:37pm UTC](https://www.ruby-forum.com/t/yet-another-sorting-patch/101321/3 "2006-08-04T21:37:07Z")

</div>

Here is a patch that has your stuff and that adds re-parenting. It  
needs the icons from [http://dev.radiantcms.org:9007/radiant/ticket/](http://dev.radiantcms.org:9007/radiant/ticket/)  
179 that are ugly. I have not done the dynamic ajax update. Need  
to figure out a few thing about how you are doing the depth stuff.

[http://pink.evergreen.edu/sort\_pages.2\_reparent\_1.diff](http://pink.evergreen.edu/sort_pages.2_reparent_1.diff)

---

<div class="post-metadata">

**Author:** ![bodhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/49beb7/32.png) [@bodhi](https://www.ruby-forum.com/u/bodhi)\
**Post date:** [August 8, 2006, 7:54pm UTC](https://www.ruby-forum.com/t/yet-another-sorting-patch/101321/4 "2006-08-08T19:54:24Z")

</div>

Since bodhi’s code it much nicer than mine I used his as a base to  
add the reparenting code on to. His code also has the benefit of  
using a lists and spans for layout which is much nicer to work with  
the tables in the present version of the page’s page.

This patch has been added to the [http://dev.radiantcms.org/radiant/](http://dev.radiantcms.org/radiant/)  
ticket/199 ticket.
