From 3e11337b3b4c36df20d5565d60d05995b0314363 Mon Sep 17 00:00:00 2001
From: Julius Härtl <jus@bitgrid.net>
Date: Thu, 8 Nov 2018 13:30:39 +0100
Subject: Allow sorting in the file picker
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
---
 core/templates/filepicker.html | 42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)

(limited to 'core/templates')

diff --git a/core/templates/filepicker.html b/core/templates/filepicker.html
index 4c66dfc707b..090e6bce773 100644
--- a/core/templates/filepicker.html
+++ b/core/templates/filepicker.html
@@ -8,17 +8,39 @@
 			<h2>{emptytext}</h2>
 		</div>
 		<table id="filestable" class="filelist list-container view-grid">
+			<thead>
+				<tr>
+					<th id="headerName" class="column-name">
+						<div id="headerName-container">
+							<a class="name sort columntitle" data-sort="name">
+								<span>Name</span>
+								<span class="sort-indicator hidden icon-triangle-n"></span>
+							</a>
+						</div>
+					</th>
+					<th id="headerSize" class="column-size">
+						<a class="size sort columntitle" data-sort="size">
+							<span>Size</span>
+							<span class="sort-indicator hidden icon-triangle-n"></span></a>
+					</th>
+					<th id="headerDate" class="column-mtime">
+						<a id="modified" class="columntitle" data-sort="mtime">
+							<span>Modified</span>
+							<span class="sort-indicator hidden icon-triangle-n"></span></a>
+					</th>
+				</tr>
+			</thead>
 			<tbody>
-			<tr data-entryname="{filename}" data-type="{type}">
-				<td class="filename"
-					style="background-image:url({icon})">{filename}
-				</td>
-				<td class="filesize"
-					style="color:rgb({sizeColor}, {sizeColor}, {sizeColor})">
-					{size}
-				</td>
-				<td class="date">{date}</td>
-			</tr>
+				<tr data-entryname="{filename}" data-type="{type}">
+					<td class="filename"
+						style="background-image:url({icon})">{filename}
+					</td>
+					<td class="filesize"
+						style="color:rgb({sizeColor}, {sizeColor}, {sizeColor})">
+						{size}
+					</td>
+					<td class="date">{date}</td>
+				</tr>
 			</tbody>
 		</table>
 	</div>
-- 
cgit v1.2.3