# HG changeset patch # User Kim Alvefur # Date 1416388791 -3600 # Node ID 1aa894db35851c244011d0c0a73cef9447cdc31d # Parent eed7db9f3157c3341fd065279576b72e9ad3bb7f mod_register_web: Add option for specifying path to templates diff -r eed7db9f3157 -r 1aa894db3585 mod_register_web/mod_register_web.lua --- a/mod_register_web/mod_register_web.lua Tue Nov 18 13:59:39 2014 +0100 +++ b/mod_register_web/mod_register_web.lua Wed Nov 19 10:19:51 2014 +0100 @@ -12,13 +12,14 @@ phone = true; url = true; date = true; } +local template_path = module:get_option_string("register_web_template", "templates"); function template(data) -- Like util.template, but deals with plain text return { apply = function(values) return (data:gsub("{([^}]+)}", values)); end } end local function get_template(name) - local fh = assert(module:load_resource("templates"..path_sep..name..".html")); + local fh = assert(module:load_resource(template_path..path_sep..name..".html")); local data = assert(fh:read("*a")); fh:close(); return template(data);