# HG changeset patch # User Kim Alvefur # Date 1602167959 -7200 # Node ID 1890115b2773b7191224b1f7ccf96ffaf98b4678 # Parent fcc6b92869d46b9d28b607de9e92a3a93a64c7a1 mod_http_muc_log: Move template into a directory to ease packaging There's no LuaRocks directive like `copy_directories` for individual files, short of writing a whole custom installation method. diff -r fcc6b92869d4 -r 1890115b2773 mod_http_muc_log/README.markdown --- a/mod_http_muc_log/README.markdown Thu Oct 08 13:49:08 2020 +0200 +++ b/mod_http_muc_log/README.markdown Thu Oct 08 16:39:19 2020 +0200 @@ -2,6 +2,10 @@ labels: - 'Stage-Beta' summary: Provides a web interface to stored chatroom logs +rockspec: + build: + copy_directories: + - res ... Introduction diff -r fcc6b92869d4 -r 1890115b2773 mod_http_muc_log/http_muc_log.html --- a/mod_http_muc_log/http_muc_log.html Thu Oct 08 13:49:08 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ - - - - - -{date&} -{title?{room.name?{jid_node}}{date& - {date}}} - - - -
-

{title?{room.name?{jid_node}}{date& - {date}}}

- -
-
-
- - -
-{presence_available&
- - -
} -
- -
    {lines# -
  1. - -{item.nick} -{item.verb?} -{item.body?} -{item.oob.url&
    {item.oob.desc?}
    {item.oob.desc?}
    } -
  2. } -
-
-
- - - - diff -r fcc6b92869d4 -r 1890115b2773 mod_http_muc_log/mod_http_muc_log.lua --- a/mod_http_muc_log/mod_http_muc_log.lua Thu Oct 08 13:49:08 2020 +0200 +++ b/mod_http_muc_log/mod_http_muc_log.lua Thu Oct 08 16:39:19 2020 +0200 @@ -34,7 +34,7 @@ local template; do - local template_filename = module:get_option_string(module.name .. "_template", module.name .. ".html"); + local template_filename = module:get_option_string(module.name .. "_template", "res/" .. module.name .. ".html"); local template_file, err = module:load_resource(template_filename); if template_file then template, err = template_file:read("*a"); @@ -418,7 +418,7 @@ jid = room.jid; localpart = localpart; href = get_link(localpart, default_view); - name = room:get_name(); + name = room:get_name() or localpart; lang = room.get_language and room:get_language(); description = room:get_description(); }, i + 1; diff -r fcc6b92869d4 -r 1890115b2773 mod_http_muc_log/res/http_muc_log.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_http_muc_log/res/http_muc_log.html Thu Oct 08 16:39:19 2020 +0200 @@ -0,0 +1,148 @@ + + + + + +{date&} +{title?{room.name?{jid_node}}{date& - {date}}} + + + +
+

{title?{room.name?{jid_node}}{date& - {date}}}

+ +
+
+
+ + +
+{presence_available&
+ + +
} +
+ +
    {lines# +
  1. + +{item.nick} +{item.verb?} +{item.body?} +{item.oob.url&
    {item.oob.desc?}
    {item.oob.desc?}
    } +
  2. } +
+
+
+ + + +