liquid_feedback_frontend

annotate app/main/index/index.lua @ 386:9109900edad6

Show message of the day at public index page in closed user group mode
author bsw
date Mon Mar 05 14:03:04 2012 +0100 (2012-03-05)
parents 5a0d5369b21d
children 699b9fa7bc36
rev   line source
bsw/jbe@0 1 slot.select("title", function()
bsw@10 2 if app.session.member then
bsw@10 3 execute.view{
bsw@10 4 module = "member_image",
bsw@10 5 view = "_show",
bsw@10 6 params = {
bsw@10 7 member = app.session.member,
bsw@10 8 image_type = "avatar"
bsw@10 9 }
bsw/jbe@4 10 }
bsw@10 11 end
bsw/jbe@0 12 end)
bsw/jbe@0 13
bsw/jbe@0 14 slot.select("title", function()
bsw/jbe@0 15 ui.container{
bsw/jbe@0 16 attr = { class = "lang_chooser" },
bsw/jbe@0 17 content = function()
bsw@15 18 for i, lang in ipairs{"en", "de", "eo"} do
bsw/jbe@0 19 ui.link{
bsw/jbe@0 20 content = function()
bsw/jbe@0 21 ui.image{
bsw/jbe@0 22 static = "lang/" .. lang .. ".png",
bsw/jbe@0 23 attr = { style = "margin-left: 0.5em;", alt = lang }
bsw/jbe@0 24 }
bsw/jbe@0 25 end,
bsw/jbe@19 26 text = _('Select language "#{langcode}"', { langcode = lang }),
bsw/jbe@0 27 module = "index",
bsw/jbe@0 28 action = "set_lang",
bsw/jbe@0 29 params = { lang = lang },
bsw/jbe@0 30 routing = {
bsw/jbe@0 31 default = {
bsw/jbe@0 32 mode = "redirect",
bsw/jbe@0 33 module = request.get_module(),
bsw/jbe@0 34 view = request.get_view(),
bsw/jbe@0 35 id = param.get_id_cgi(),
bsw/jbe@0 36 params = param.get_all_cgi()
bsw/jbe@0 37 }
bsw/jbe@0 38 }
bsw/jbe@0 39 }
bsw/jbe@0 40 end
bsw/jbe@0 41 end
bsw/jbe@0 42 }
bsw/jbe@0 43 end)
bsw/jbe@0 44
bsw/jbe@0 45 slot.put_into("title", encode.html(config.app_title))
bsw/jbe@0 46
bsw@276 47 if app.session.member_id then
bsw@276 48 util.help("index.index", _"Home")
bsw@276 49
bsw@276 50 execute.view{
bsw@276 51 module = "member",
bsw@276 52 view = "_show",
bsw@276 53 params = {
bsw@276 54 member = app.session.member,
bsw@276 55 show_as_homepage = true
bsw@276 56 }
bsw@276 57 }
bsw@276 58
bsw@276 59 elseif config.public_access then
bsw@276 60 if config.motd_public then
bsw@276 61 local help_text = config.motd_public
bsw@276 62 ui.container{
bsw@276 63 attr = { class = "wiki motd" },
bsw@276 64 content = function()
bsw@276 65 slot.put(format.wiki_text(help_text))
bsw@276 66 end
bsw@276 67 }
bsw@276 68 end
bsw@276 69
bsw@276 70 execute.view{ module = "unit", view = "_list" }
bsw@276 71
bsw@276 72 else
bsw@276 73
bsw@386 74 if config.motd_public then
bsw@386 75 local help_text = config.motd_public
bsw@386 76 ui.container{
bsw@386 77 attr = { class = "wiki motd" },
bsw@386 78 content = function()
bsw@386 79 slot.put(format.wiki_text(help_text))
bsw@386 80 end
bsw@386 81 }
bsw@386 82 end
bsw@386 83
bsw@367 84 ui.tag{ tag = "p", content = _"Closed user group, please login to participate." }
bsw@276 85
bsw@369 86 ui.form{
bsw@369 87 attr = { class = "login" },
bsw@369 88 module = 'index',
bsw@369 89 action = 'login',
bsw@369 90 routing = {
bsw@369 91 ok = {
bsw@369 92 mode = 'redirect',
bsw@369 93 module = param.get("redirect_module") or "index",
bsw@369 94 view = param.get("redirect_view") or "index",
bsw@369 95 id = param.get("redirect_id"),
bsw@369 96 },
bsw@369 97 error = {
bsw@369 98 mode = 'forward',
bsw@369 99 module = 'index',
bsw@369 100 view = 'login',
bsw@369 101 }
bsw@369 102 },
bsw@369 103 content = function()
bsw@369 104 ui.field.text{
bsw@369 105 attr = { id = "username_field" },
bsw@369 106 label = _'login name',
bsw@369 107 html_name = 'login',
bsw@369 108 value = ''
bsw@369 109 }
bsw@369 110 ui.script{ script = 'document.getElementById("username_field").focus();' }
bsw@369 111 ui.field.password{
bsw@369 112 label = _'Password',
bsw@369 113 html_name = 'password',
bsw@369 114 value = ''
bsw@369 115 }
bsw@369 116 ui.submit{
bsw@369 117 text = _'Login'
bsw@369 118 }
bsw@369 119 end
bsw@369 120 }
bsw@369 121
jorges@103 122 end
jorges@103 123

Impressum / About Us