Diff

mod_http_muc_log/mod_http_muc_log.lua @ 3690:8c0a6d4541d5

mod_http_muc_log: Wrap navigation in unorderded lists (thanks jonas’)
author Kim Alvefur <zash@zash.se>
date Mon, 30 Sep 2019 00:27:25 +0200
parent 3597:da7ec4ed6ddf
child 3692:96c6d9b0969f
line wrap: on
line diff
--- a/mod_http_muc_log/mod_http_muc_log.lua	Sun Sep 29 18:53:00 2019 +0100
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Mon Sep 30 00:27:25 2019 +0200
@@ -359,6 +359,16 @@
 		end
 	end
 
+	local links = {
+		{ href = "./", rel = "up", text = "Calendar" },
+	};
+	if prev_when ~= "" then
+		table.insert(links, { href = prev_when, rel = "prev", text = prev_when});
+	end
+	if next_when ~= "" then
+		table.insert(links, { href = next_when, rel = "next", text = next_when});
+	end
+
 	response.headers.content_type = "text/html; charset=utf-8";
 	return render(template, {
 		title = ("%s - %s"):format(get_room(room):get_name(), date);
@@ -366,11 +376,7 @@
 		hide_presence = hide_presence(request);
 		presence_available = presence_logged;
 		lines = logs;
-		links = {
-			{ href = "./", rel = "up", text = "Calendar" },
-			{ href = prev_when, rel = "prev", text = prev_when},
-			{ href = next_when, rel = "next", text = next_when},
-		};
+		links = links;
 	});
 end