# HG changeset patch # User Kim Alvefur # Date 1417617338 -3600 # Node ID 8e282eb0c70c605b864c885e6fc1923da17aea6d # Parent 9f6cd252d2338272c061a542e45226e98d35cf2c mod_http_muc_log: Split out template into a configurable file. diff -r 9f6cd252d233 -r 8e282eb0c70c mod_http_muc_log/http_muc_log.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_http_muc_log/http_muc_log.html Wed Dec 03 15:35:38 2014 +0100 @@ -0,0 +1,93 @@ + + + + + +{title} + + + +
+

{title}

+ +
+
+
+ +
    {lines# +
  1. + +{nick} +{verb?} +{body?} +
  2. } +
+
+
+ + + + diff -r 9f6cd252d233 -r 8e282eb0c70c mod_http_muc_log/mod_http_muc_log.lua --- a/mod_http_muc_log/mod_http_muc_log.lua Tue Dec 02 15:12:01 2014 +0100 +++ b/mod_http_muc_log/mod_http_muc_log.lua Wed Dec 03 15:35:38 2014 +0100 @@ -63,102 +63,13 @@ end)); end --- TODO Move template into a file -local template = [=[ - - - - - -{title} - - - -
-

{title}

- -
-
-
- -
    {lines# -
  1. - -{nick} -{verb?} -{body?} -
  2. } -
-
-
- - - - -]=]; +local template = "Could not load template" +do + local template_file = module:get_option_string(module.name .. "_template", module.name .. ".html"); + template_file = assert(module:load_resource(template_file)); + template = template_file:read("*a"); + template_file:close(); +end local base_url = module:http_url() .. '/'; local get_link do