liquid_feedback_frontend

diff app/main/index/login.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents 5a712ec1a7f1
children 904f6807f7fa
line diff
     1.1 --- a/app/main/index/login.lua	Thu Jul 10 01:02:43 2014 +0200
     1.2 +++ b/app/main/index/login.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -5,32 +5,47 @@
     1.4    end
     1.5  }
     1.6  
     1.7 -ui.actions()
     1.8 -
     1.9  ui.title(_"Login")
    1.10  app.html_title.title = _"Login"
    1.11  
    1.12 -if config.motd_public then
    1.13 -  local help_text = config.motd_public
    1.14 -  ui.container{
    1.15 -    attr = { class = "wiki motd" },
    1.16 -    content = function()
    1.17 -      slot.put(format.wiki_text(help_text))
    1.18 -    end
    1.19 -  }
    1.20 -end
    1.21 +execute.view{ module = "index", view = "_sidebar_motd_public" }
    1.22 +
    1.23 +ui.section(function() 
    1.24 +
    1.25 +ui.sectionHead(function()
    1.26 +  ui.heading{ level = 1, content = _"Login" }
    1.27 +  ui.container { attr = { class = "right" }, content = function()
    1.28 +    for i, lang in ipairs(config.enabled_languages) do
    1.29  
    1.30 -if app.session:has_access("anonymous") then
    1.31 -  ui.tag{
    1.32 -    tag = 'p',
    1.33 -    content = _'You need to be logged in, to use all features of this system.'
    1.34 -  }
    1.35 -else
    1.36 -  ui.tag{ tag = "p", content = _"Closed user group, please login to participate." }
    1.37 -end
    1.38 -
    1.39 +      locale.do_with({ lang = lang }, function()
    1.40 +        langcode = _("[Name of Language]")
    1.41 +      end)
    1.42 +      
    1.43 +      if i > 1 then
    1.44 +        slot.put(" | ")
    1.45 +      end
    1.46 +      
    1.47 +      ui.link{
    1.48 +        content = function()
    1.49 +          ui.tag{ content = langcode }
    1.50 +        end,
    1.51 +        module = "index",
    1.52 +        action = "set_lang",
    1.53 +        params = { lang = lang },
    1.54 +        routing = {
    1.55 +          default = {
    1.56 +            mode = "redirect",
    1.57 +            module = request.get_module(),
    1.58 +            view = request.get_view(),
    1.59 +            id = param.get_id_cgi(),
    1.60 +            params = param.get_all_cgi()
    1.61 +          }
    1.62 +        }
    1.63 +      }
    1.64 +    end
    1.65 +  end }
    1.66 +end)
    1.67  ui.form{
    1.68 -  attr = { class = "login" },
    1.69    module = 'index',
    1.70    action = 'login',
    1.71    routing = {
    1.72 @@ -47,22 +62,36 @@
    1.73      }
    1.74    },
    1.75    content = function()
    1.76 -    ui.field.text{
    1.77 -      attr = { id = "username_field" },
    1.78 -      label     = _'login name',
    1.79 -      html_name = 'login',
    1.80 -      value     = ''
    1.81 -    }
    1.82 -    ui.script{ script = 'document.getElementById("username_field").focus();' }
    1.83 -    ui.field.password{
    1.84 -      label     = _'Password',
    1.85 -      html_name = 'password',
    1.86 -      value     = ''
    1.87 -    }
    1.88 -    ui.submit{
    1.89 -      text = _'Login'
    1.90 -    }
    1.91 -    slot.put("  ")
    1.92 -    ui.link{ module = "index", view = "reset_password", text = _"Forgot password?" }
    1.93 +    ui.sectionRow(function()
    1.94 +      ui.field.text{
    1.95 +        attr = { id = "username_field" },
    1.96 +        label     = _'Login name',
    1.97 +        name = 'login',
    1.98 +        value     = ''
    1.99 +      }
   1.100 +      ui.script{ script = 'document.getElementById("username_field").focus();' }
   1.101 +      ui.field.password{
   1.102 +        label     = _'Password',
   1.103 +        name = 'password',
   1.104 +        value     = ''
   1.105 +      }
   1.106 +      ui.container { attr = { class = "actions" }, content = function()
   1.107 +        ui.tag{
   1.108 +          tag = "input",
   1.109 +          attr = {
   1.110 +            type = "submit",
   1.111 +            class = "btn btn-default",
   1.112 +            value = _'Login'
   1.113 +          },
   1.114 +          content = ""
   1.115 +        }
   1.116 +        slot.put("<br />")
   1.117 +        slot.put("<br />")
   1.118 +        ui.link{ module = "index", view = "reset_password", text = _"Forgot password?" }
   1.119 +        slot.put("&nbsp;&nbsp;")
   1.120 +        ui.link{ module = "index", view = "send_login", text = _"Forgot login name?" }
   1.121 +      end }
   1.122 +    end )
   1.123    end
   1.124  }
   1.125 +end )
   1.126 \ No newline at end of file

Impressum / About Us