changeset 3715:f03a023cd523

mod_http_muc_log: Compose page title from room data More flexible than composing the title from name and date in the controller. Also opens the door to using other room data fields.
author Kim Alvefur <zash@zash.se>
date Sun, 13 Oct 2019 16:16:14 +0200
parents 04ff0de40ba9
children 3db27b8f1cb0
files mod_http_muc_log/http_muc_log.html mod_http_muc_log/mod_http_muc_log.lua
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_muc_log/http_muc_log.html	Sun Oct 13 16:00:16 2019 +0200
+++ b/mod_http_muc_log/http_muc_log.html	Sun Oct 13 16:16:14 2019 +0200
@@ -4,7 +4,7 @@
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1">
 {date&<meta name="dcterms.date" content="{date}">}
-<title>{title}</title>
+<title>{title?{room.name?{jid_node}}{date& - {date}}}</title>
 <style>
 :link,:visited{color:#3465a4;text-decoration:none;}
 :link:hover,:visited:hover{color:#6197df;}
@@ -46,7 +46,7 @@
 </head>
 <body>
 <header>
-<h1 {lang&lang="{lang}"} title="xmpp:{jid?}">{title}</h1>
+<h1 {lang&lang="{lang}"} title="xmpp:{jid?}">{title?{room.name?{jid_node}}{date& - {date}}}</h1>
 <nav>
 <ul>
 {jid_node&
--- a/mod_http_muc_log/mod_http_muc_log.lua	Sun Oct 13 16:00:16 2019 +0200
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Sun Oct 13 16:16:14 2019 +0200
@@ -240,7 +240,7 @@
 
 	response.headers.content_type = "text/html; charset=utf-8";
 	return render(template, {
-		title = get_room(room):get_name();
+		room = get_room(room)._data;
 		jid = get_room(room).jid;
 		jid_node = jid_split(get_room(room).jid);
 		hide_presence = hide_presence(request);
@@ -376,8 +376,8 @@
 
 	response.headers.content_type = "text/html; charset=utf-8";
 	return render(template, {
-		title = ("%s - %s"):format(get_room(room):get_name(), date);
 		date = date;
+		room = get_room(room)._data;
 		jid = get_room(room).jid;
 		jid_node = jid_split(get_room(room).jid);
 		hide_presence = hide_presence(request);