Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Sorting tables  (Read 6093 times)

fragproof

  • Escaped Lunatic
    • View Profile
Sorting tables
« on: June 12, 2017, 11:42:36 am »

Pages under namespaces for earlier versions allow tables to be sorted, but no pages under the DF2014 namespace allow sorting that I've found.

Edit: Also, why does the search randomly send me to prior namespaces?
« Last Edit: June 12, 2017, 12:15:06 pm by fragproof »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Sorting tables
« Reply #1 on: June 12, 2017, 03:54:13 pm »

Pages under namespaces for earlier versions allow tables to be sorted, but no pages under the DF2014 namespace allow sorting that I've found.

Edit: Also, why does the search randomly send me to prior namespaces?
Can you provide examples (for both)?

Edit: The tables at http://dwarffortresswiki.org/index.php/DF2014:Creature are sortable, at least on my end.
« Last Edit: June 12, 2017, 04:48:15 pm by lethosor »
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Loci

  • Bay Watcher
    • View Profile
Re: Sorting tables
« Reply #2 on: June 25, 2017, 09:43:37 pm »

Pages under namespaces for earlier versions allow tables to be sorted, but no pages under the DF2014 namespace allow sorting that I've found.

Edit: Also, why does the search randomly send me to prior namespaces?
Can you provide examples (for both)?

Edit: The tables at http://dwarffortresswiki.org/index.php/DF2014:Creature are sortable, at least on my end.

The wiki implements table sorting via javascript; browsers with javascript disabled will be unable to sort any of the lists on the site. Beyond that, sorting tables is of questionable value in many cases (try sorting these creatures by child size for an example).


As for bad redirects, here's a comprehensive list:

http://dwarffortresswiki.org/index.php?title=Special:ListRedirects&limit=500&offset=0

Note all the redirects still pointing to v0.34 pages (Agility, Ale, Amulet, etc.)? If you type any of those terms into the search bar you will be (incorrectly) dumped on the v0.34 page. This is a longstanding issue that has been discussed several times but never resolved; it'd be nice to implement a solution before we create another namespace and run into the very same problems again.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Sorting tables
« Reply #3 on: June 25, 2017, 10:34:36 pm »

fragproof implied that the issue with sorting was specific to one namespace, so I don't think it's due to Javascript being turned off. The example you gave is interesting - I think the table sorting script must be determining that the "child size" column isn't numeric because of the "n/a" entries. Sorting by adult size works fine, even though there are commas in the numbers in that column.

I don't know why some redirects are still broken. I was unable to reproduce it locally, which means it's really hard for me to fix without testing and breaking things on the actual wiki. I was looking at this about a week ago and was about to nuke the entire cache, but then I noticed that it was last nuked in 2015 (due to some extension breaking that I don't recall exactly), which was well after the DF2014 namespace was introduced.

Edit: something interesting I just noticed: transcluding those pages seems to work - see the sandbox. The links to "ettins" link to the v0.34 page, but the page that's included is the DF2014 one.

I wasn't able to get much done tonight besides breaking the wiki temporarily while trying to get logging to work, but I will hopefully look at this more this week.
« Last Edit: June 25, 2017, 11:06:12 pm by lethosor »
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Doorkeeper

  • Bay Watcher
    • View Profile
Re: Sorting tables
« Reply #4 on: August 20, 2017, 02:43:14 pm »

I fixed the sorting issue in http://dwarffortresswiki.org/index.php/DF2014:List_of_creatures_by_adult_size. It needed a data-sort-type="number" to sort properly.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Sorting tables
« Reply #5 on: August 21, 2017, 03:11:09 pm »

Cool, thanks for fixing that. I'll keep an eye out for similar pages that I come across.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.