liquid_feedback_frontend

annotate app/main/index/login.lua @ 11:77d58efe99fd

Version beta7

Important security fixes:
- Added missing HTML encoding to postal address of member
- Link to discussion URL only if it starts with http(s)://

Other bugfixes:
- Fixed wrong display of 2nd level delegating voters for an initiative
- Do not display invited initiators as initiators while voting
- Added missing translation

New features:
- Public message of the day
- Both direct and indirect supporter count is shown in tab heads
- Support shown in initiative lists

Language chooser at the login page has been added (again)
author bsw
date Fri Jan 22 12:00:00 2010 +0100 (2010-01-22)
parents afd9f769c7ae
children a3ac899559de
rev   line source
bsw/jbe@5 1 local warning_text = _"Some JavaScript based functions (voting in particular) will not work.\nFor this beta, please use a current version of Firefox, Safari, Opera(?), Konqueror or another (more) standard compliant browser.\nAlternative access without JavaScript will be available soon."
bsw/jbe@5 2
bsw/jbe@5 3 ui.script{ static = "js/browser_warning.js" }
bsw/jbe@5 4 ui.script{ script = "checkBrowser(" .. encode.json(_"Your web browser is not fully supported yet." .. " " .. warning_text:gsub("\n", "\n\n")) .. ");" }
bsw/jbe@5 5
bsw/jbe@5 6 ui.tag{
bsw/jbe@5 7 tag = "noscript",
bsw/jbe@5 8 content = function()
bsw/jbe@5 9 slot.put(_"JavaScript is disabled or not available." .. " " .. encode.html_newlines(warning_text))
bsw/jbe@5 10 end
bsw/jbe@5 11 }
bsw/jbe@5 12
bsw/jbe@0 13 slot.put_into("title", encode.html(config.app_title))
bsw/jbe@0 14
bsw@11 15 slot.select("title", function()
bsw@11 16 ui.container{
bsw@11 17 attr = { class = "lang_chooser" },
bsw@11 18 content = function()
bsw@11 19 for i, lang in ipairs{"en", "de"} do
bsw@11 20 ui.link{
bsw@11 21 content = function()
bsw@11 22 ui.image{
bsw@11 23 static = "lang/" .. lang .. ".png",
bsw@11 24 attr = { style = "margin-left: 0.5em;", alt = lang }
bsw@11 25 }
bsw@11 26 end,
bsw@11 27 module = "index",
bsw@11 28 action = "set_lang",
bsw@11 29 params = { lang = lang },
bsw@11 30 routing = {
bsw@11 31 default = {
bsw@11 32 mode = "redirect",
bsw@11 33 module = request.get_module(),
bsw@11 34 view = request.get_view(),
bsw@11 35 id = param.get_id_cgi(),
bsw@11 36 params = param.get_all_cgi()
bsw@11 37 }
bsw@11 38 }
bsw@11 39 }
bsw@11 40 end
bsw@11 41 end
bsw@11 42 }
bsw@11 43 end)
bsw@11 44
bsw@11 45
bsw@11 46 local lang = locale.get("lang")
bsw@11 47 local basepath = request.get_app_basepath()
bsw@11 48 local file_name = basepath .. "/locale/motd/" .. lang .. "_public.txt"
bsw@11 49 local file = io.open(file_name)
bsw@11 50 if file ~= nil then
bsw@11 51 local help_text = file:read("*a")
bsw@11 52 if #help_text > 0 then
bsw@11 53 ui.container{
bsw@11 54 attr = { class = "motd wiki" },
bsw@11 55 content = function()
bsw@11 56 slot.put(format.wiki_text(help_text))
bsw@11 57 end
bsw@11 58 }
bsw@11 59 end
bsw@11 60 end
bsw@11 61
bsw@11 62
bsw@11 63
bsw/jbe@0 64 ui.tag{
bsw/jbe@0 65 tag = 'p',
bsw@3 66 content = _'You need to be logged in, to use this system.'
bsw/jbe@0 67 }
bsw/jbe@0 68
bsw/jbe@0 69 ui.form{
bsw/jbe@0 70 attr = { class = "login" },
bsw/jbe@0 71 module = 'index',
bsw/jbe@0 72 action = 'login',
bsw/jbe@0 73 routing = {
bsw/jbe@0 74 ok = {
bsw/jbe@0 75 mode = 'redirect',
bsw/jbe@0 76 module = 'index',
bsw/jbe@0 77 view = 'index'
bsw/jbe@0 78 },
bsw/jbe@0 79 error = {
bsw/jbe@0 80 mode = 'forward',
bsw/jbe@0 81 module = 'index',
bsw/jbe@0 82 view = 'login',
bsw/jbe@0 83 }
bsw/jbe@0 84 },
bsw/jbe@0 85 content = function()
bsw/jbe@0 86 ui.field.text{
bsw/jbe@0 87 attr = { id = "username_field" },
bsw/jbe@5 88 label = _'login name',
bsw/jbe@0 89 html_name = 'login',
bsw/jbe@0 90 value = ''
bsw/jbe@0 91 }
bsw/jbe@0 92 ui.script{ script = 'document.getElementById("username_field").focus();' }
bsw/jbe@0 93 ui.field.password{
bsw/jbe@0 94 label = _'Password',
bsw/jbe@0 95 html_name = 'password',
bsw/jbe@0 96 value = ''
bsw/jbe@0 97 }
bsw/jbe@0 98 ui.submit{
bsw/jbe@0 99 text = _'Login'
bsw/jbe@0 100 }
bsw/jbe@0 101 end
bsw/jbe@0 102 }
bsw@11 103

Impressum / About Us