Browse Source

HUE-542. File browser sorting by size inconsistent.

Somewhere along the line, the JFrame HTMLTable filter
changed from data-sort-number to data-sort-numeric.
It was easier to change the template than
updating the JFrame filter.

Manual testing with 3 files sorted either
29.0KB, 7.3KB, 17bytes or the other way.
Before that, it was 17, 7, and 29, which was
alphabetic.

While I was here, I made data sorting correct too.
Philip Zeyliger 14 years ago
parent
commit
8f68ebd7d3

+ 3 - 3
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -116,15 +116,15 @@ from desktop.lib.django_util import reverse_with_get
           %>
           <td class="fb-filesize">
             % if "dir" == file['type']:
-              <span data-sort-number="${sortValue}">~</span>
+              <span data-sort-numeric="${sortValue}">~</span>
             % else:
-              <span data-sort-number="${sortValue}">${file['stats']['size']|filesizeformat}</span>
+              <span data-sort-numeric="${sortValue}">${file['stats']['size']|filesizeformat}</span>
             % endif
           </td>
           <td class="fb-user">${file['stats']['user']}</td>
           <td class="fb-group">${file['stats']['group']}</td>
           <td class="fb-perm">${file['rwx']}</td>
-          <td class="fb-date">${date(datetime.datetime.fromtimestamp(file['stats']['mtime']))} ${time(datetime.datetime.fromtimestamp(file['stats']['mtime']))}</td>
+          <td class="fb-date"><span data-sort-numeric="${file['stats']['mtime']}">${date(datetime.datetime.fromtimestamp(file['stats']['mtime']))} ${time(datetime.datetime.fromtimestamp(file['stats']['mtime']))}</span></td>
           <td class="fb-option-links">
             % if ".." != file['name']:
               <a class="fb-item-options">options</a>