liquid_feedback_frontend

changeset 69:c553898f64cb beta18

Moved motd from locale/motd/*-files to configuration setting
author bsw
date Fri Apr 23 14:13:08 2010 +0200 (2010-04-23)
parents 20186f06e953
children a934d06661b1
files app/main/area/list.lua app/main/index/_motd.lua app/main/index/login.lua app/main/member/show_tab.lua config/default.lua config/development.lua
line diff
     1.1 --- a/app/main/area/list.lua	Thu Apr 22 21:01:46 2010 +0200
     1.2 +++ b/app/main/area/list.lua	Fri Apr 23 14:13:08 2010 +0200
     1.3 @@ -4,20 +4,14 @@
     1.4    slot.put_into("title", encode.html(config.app_title))
     1.5  end
     1.6  
     1.7 -local lang = locale.get("lang")
     1.8 -local basepath = request.get_app_basepath() 
     1.9 -local file_name = basepath .. "/locale/motd/" .. lang .. "_public.txt"
    1.10 -local file = io.open(file_name)
    1.11 -if file ~= nil then
    1.12 -  local help_text = file:read("*a")
    1.13 -  if #help_text > 0 then
    1.14 -    ui.container{
    1.15 -      attr = { class = "motd wiki" },
    1.16 -      content = function()
    1.17 -        slot.put(format.wiki_text(help_text))
    1.18 -      end
    1.19 -    }
    1.20 -  end
    1.21 +if not app.session.member_id and config.motd_public then
    1.22 +  local help_text = config.motd_public
    1.23 +  ui.container{
    1.24 +    attr = { class = "wiki motd" },
    1.25 +    content = function()
    1.26 +      slot.put(format.wiki_text(help_text))
    1.27 +    end
    1.28 +  }
    1.29  end
    1.30  
    1.31  util.help("area.list", _"Area list")
     2.1 --- a/app/main/index/_motd.lua	Thu Apr 22 21:01:46 2010 +0200
     2.2 +++ b/app/main/index/_motd.lua	Fri Apr 23 14:13:08 2010 +0200
     2.3 @@ -1,15 +1,9 @@
     2.4 -local lang = locale.get("lang")
     2.5 -local basepath = request.get_app_basepath() 
     2.6 -local file_name = basepath .. "/locale/motd/" .. lang .. ".txt"
     2.7 -local file = io.open(file_name)
     2.8 -if file ~= nil then
     2.9 -  local help_text = file:read("*a")
    2.10 -  if #help_text > 0 then
    2.11 -    ui.container{
    2.12 -      attr = { class = "wiki" },
    2.13 -      content = function()
    2.14 -        slot.put(format.wiki_text(help_text))
    2.15 -      end
    2.16 -    }
    2.17 -  end
    2.18 +if config.motd_intern then
    2.19 +  local help_text = config.motd_intern
    2.20 +  ui.container{
    2.21 +    attr = { class = "wiki" },
    2.22 +    content = function()
    2.23 +      slot.put(format.wiki_text(help_text))
    2.24 +    end
    2.25 +  }
    2.26  end
     3.1 --- a/app/main/index/login.lua	Thu Apr 22 21:01:46 2010 +0200
     3.2 +++ b/app/main/index/login.lua	Fri Apr 23 14:13:08 2010 +0200
     3.3 @@ -43,6 +43,15 @@
     3.4    }
     3.5  end)
     3.6  
     3.7 +if config.motd_public then
     3.8 +  local help_text = config.motd_public
     3.9 +  ui.container{
    3.10 +    attr = { class = "wiki motd" },
    3.11 +    content = function()
    3.12 +      slot.put(format.wiki_text(help_text))
    3.13 +    end
    3.14 +  }
    3.15 +end
    3.16  
    3.17  ui.tag{
    3.18    tag = 'p',
     4.1 --- a/app/main/member/show_tab.lua	Thu Apr 22 21:01:46 2010 +0200
     4.2 +++ b/app/main/member/show_tab.lua	Fri Apr 23 14:13:08 2010 +0200
     4.3 @@ -19,11 +19,7 @@
     4.4  
     4.5  if show_as_homepage and app.session.member_id == member.id then
     4.6  
     4.7 -  local lang = locale.get("lang")
     4.8 -  local basepath = request.get_app_basepath() 
     4.9 -  local file_name = basepath .. "/locale/motd/" .. lang .. ".txt"
    4.10 -  local file = io.open(file_name)
    4.11 -  if file ~= nil then
    4.12 +  if config.motd_intern then
    4.13      tabs[#tabs+1] = {
    4.14        class = "yellow",
    4.15        name = "motd",
     5.1 --- a/config/default.lua	Thu Apr 22 21:01:46 2010 +0200
     5.2 +++ b/config/default.lua	Fri Apr 23 14:13:08 2010 +0200
     5.3 @@ -1,5 +1,5 @@
     5.4  config.app_name = "LiquidFeedback"
     5.5 -config.app_version = "beta17"
     5.6 +config.app_version = "beta18"
     5.7  
     5.8  config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
     5.9  
     6.1 --- a/config/development.lua	Thu Apr 22 21:01:46 2010 +0200
     6.2 +++ b/config/development.lua	Fri Apr 23 14:13:08 2010 +0200
     6.3 @@ -27,4 +27,10 @@
     6.4    else
     6.5      return false
     6.6    end
     6.7 -end
     6.8 \ No newline at end of file
     6.9 +end
    6.10 +
    6.11 +config.motd_public = "==Public motd=="
    6.12 +
    6.13 +config.motd_intern = "==Internal motd=="
    6.14 +
    6.15 +config.public_access = "anonymous"
    6.16 \ No newline at end of file

Impressum / About Us