# HG changeset patch # User bsw # Date 1272024788 -7200 # Node ID c553898f64cbe5c72e90dc92d99f2fc0980446c8 # Parent 20186f06e95357bd29c651068083afef9f4cf86a Moved motd from locale/motd/*-files to configuration setting diff -r 20186f06e953 -r c553898f64cb app/main/area/list.lua --- a/app/main/area/list.lua Thu Apr 22 21:01:46 2010 +0200 +++ b/app/main/area/list.lua Fri Apr 23 14:13:08 2010 +0200 @@ -4,20 +4,14 @@ slot.put_into("title", encode.html(config.app_title)) end -local lang = locale.get("lang") -local basepath = request.get_app_basepath() -local file_name = basepath .. "/locale/motd/" .. lang .. "_public.txt" -local file = io.open(file_name) -if file ~= nil then - local help_text = file:read("*a") - if #help_text > 0 then - ui.container{ - attr = { class = "motd wiki" }, - content = function() - slot.put(format.wiki_text(help_text)) - end - } - end +if not app.session.member_id and config.motd_public then + local help_text = config.motd_public + ui.container{ + attr = { class = "wiki motd" }, + content = function() + slot.put(format.wiki_text(help_text)) + end + } end util.help("area.list", _"Area list") diff -r 20186f06e953 -r c553898f64cb app/main/index/_motd.lua --- a/app/main/index/_motd.lua Thu Apr 22 21:01:46 2010 +0200 +++ b/app/main/index/_motd.lua Fri Apr 23 14:13:08 2010 +0200 @@ -1,15 +1,9 @@ -local lang = locale.get("lang") -local basepath = request.get_app_basepath() -local file_name = basepath .. "/locale/motd/" .. lang .. ".txt" -local file = io.open(file_name) -if file ~= nil then - local help_text = file:read("*a") - if #help_text > 0 then - ui.container{ - attr = { class = "wiki" }, - content = function() - slot.put(format.wiki_text(help_text)) - end - } - end +if config.motd_intern then + local help_text = config.motd_intern + ui.container{ + attr = { class = "wiki" }, + content = function() + slot.put(format.wiki_text(help_text)) + end + } end diff -r 20186f06e953 -r c553898f64cb app/main/index/login.lua --- a/app/main/index/login.lua Thu Apr 22 21:01:46 2010 +0200 +++ b/app/main/index/login.lua Fri Apr 23 14:13:08 2010 +0200 @@ -43,6 +43,15 @@ } end) +if config.motd_public then + local help_text = config.motd_public + ui.container{ + attr = { class = "wiki motd" }, + content = function() + slot.put(format.wiki_text(help_text)) + end + } +end ui.tag{ tag = 'p', diff -r 20186f06e953 -r c553898f64cb app/main/member/show_tab.lua --- a/app/main/member/show_tab.lua Thu Apr 22 21:01:46 2010 +0200 +++ b/app/main/member/show_tab.lua Fri Apr 23 14:13:08 2010 +0200 @@ -19,11 +19,7 @@ if show_as_homepage and app.session.member_id == member.id then - local lang = locale.get("lang") - local basepath = request.get_app_basepath() - local file_name = basepath .. "/locale/motd/" .. lang .. ".txt" - local file = io.open(file_name) - if file ~= nil then + if config.motd_intern then tabs[#tabs+1] = { class = "yellow", name = "motd", diff -r 20186f06e953 -r c553898f64cb config/default.lua --- a/config/default.lua Thu Apr 22 21:01:46 2010 +0200 +++ b/config/default.lua Fri Apr 23 14:13:08 2010 +0200 @@ -1,5 +1,5 @@ config.app_name = "LiquidFeedback" -config.app_version = "beta17" +config.app_version = "beta18" config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)" diff -r 20186f06e953 -r c553898f64cb config/development.lua --- a/config/development.lua Thu Apr 22 21:01:46 2010 +0200 +++ b/config/development.lua Fri Apr 23 14:13:08 2010 +0200 @@ -27,4 +27,10 @@ else return false end -end \ No newline at end of file +end + +config.motd_public = "==Public motd==" + +config.motd_intern = "==Internal motd==" + +config.public_access = "anonymous" \ No newline at end of file