liquid_feedback_frontend

diff app/main/member/edit.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents 418b590fa9ed
children 32cc544d5a5b
line diff
     1.1 --- a/app/main/member/edit.lua	Thu Jul 10 01:02:43 2014 +0200
     1.2 +++ b/app/main/member/edit.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -1,6 +1,10 @@
     1.4 -ui.title(_"Edit my profile")
     1.5 +ui.titleMember(_"Edit your profile data")
     1.6  
     1.7 -util.help("member.edit", _"Edit my page")
     1.8 +execute.view {
     1.9 +  module = "member", view = "_sidebar_whatcanido", params = {
    1.10 +    member = app.session.member
    1.11 +  }
    1.12 +}
    1.13  
    1.14  ui.form{
    1.15    record = app.session.member,
    1.16 @@ -16,73 +20,98 @@
    1.17      }
    1.18    },
    1.19    content = function()
    1.20 -    ui.field.text{ label = _"Identification", name = "identification", readonly = true }
    1.21 -    ui.field.text{ label = _"Organizational unit", name = "organizational_unit", readonly = config.locked_profile_fields.organizational_unit }
    1.22 -    ui.field.text{ label = _"Internal posts", name = "internal_posts", readonly = config.locked_profile_fields.internal_posts }
    1.23 -    ui.field.text{ label = _"Real name", name = "realname", readonly = config.locked_profile_fields.realname }
    1.24 -    ui.field.text{ label = _"Birthday" .. " YYYY-MM-DD ", name = "birthday", attr = { id = "profile_birthday" }, readonly = config.locked_profile_fields.birthday }
    1.25 -    ui.script{ static = "gregor.js/gregor.js" }
    1.26 -    util.gregor("profile_birthday", "document.getElementById('timeline_search_date').form.submit();")
    1.27 -    ui.field.text{ label = _"Address", name = "address", multiline = true, readonly = config.locked_profile_fields.address }
    1.28 -    ui.field.text{ label = _"email", name = "email", readonly = config.locked_profile_fields.email }
    1.29 -    ui.field.text{ label = _"xmpp", name = "xmpp_address", readonly = config.locked_profile_fields.xmpp_address }
    1.30 -    ui.field.text{ label = _"Website", name = "website", readonly = config.locked_profile_fields.website }
    1.31 -    ui.field.text{ label = _"Phone", name = "phone", readonly = config.locked_profile_fields.phone }
    1.32 -    ui.field.text{ label = _"Mobile phone", name = "mobile_phone", readonly = config.locked_profile_fields.mobile_phone }
    1.33 -    ui.field.text{ label = _"Profession", name = "profession", readonly = config.locked_profile_fields.profession }
    1.34 -    ui.field.text{ label = _"External memberships", name = "external_memberships", multiline = true, readonly = config.locked_profile_fields.external_memberships }
    1.35 -    ui.field.text{ label = _"External posts", name = "external_posts", multiline = true, readonly = config.locked_profile_fields.external_posts }
    1.36 +  
    1.37 +    ui.section( function()
    1.38 +    
    1.39 +      ui.sectionHead( function()
    1.40 +        ui.heading{ level = 1, content = _"Edit your profile data" }
    1.41 +      end )
    1.42 +      
    1.43 +      ui.sectionRow( _"All fields are optional. Please enter only data which should be published." )
    1.44 +      
    1.45 +      ui.sectionRow( function()
    1.46 +  
    1.47 +        ui.field.text{ label = _"Organizational unit", name = "organizational_unit", readonly = config.locked_profile_fields.organizational_unit }
    1.48 +        ui.field.text{ label = _"Internal posts", name = "internal_posts", readonly = config.locked_profile_fields.internal_posts }
    1.49 +        ui.field.text{ label = _"Real name", name = "realname", readonly = config.locked_profile_fields.realname }
    1.50 +        ui.field.text{ label = _"Birthday" .. " YYYY-MM-DD ", name = "birthday", attr = { id = "profile_birthday" }, readonly = config.locked_profile_fields.birthday }
    1.51 +        ui.script{ static = "gregor.js/gregor.js" }
    1.52 +        util.gregor("profile_birthday", "document.getElementById('timeline_search_date').form.submit();")
    1.53 +        ui.field.text{ label = _"Address", name = "address", multiline = true, readonly = config.locked_profile_fields.address }
    1.54 +        ui.field.text{ label = _"email", name = "email", readonly = config.locked_profile_fields.email }
    1.55 +        ui.field.text{ label = _"xmpp", name = "xmpp_address", readonly = config.locked_profile_fields.xmpp_address }
    1.56 +        ui.field.text{ label = _"Website", name = "website", readonly = config.locked_profile_fields.website }
    1.57 +        ui.field.text{ label = _"Phone", name = "phone", readonly = config.locked_profile_fields.phone }
    1.58 +        ui.field.text{ label = _"Mobile phone", name = "mobile_phone", readonly = config.locked_profile_fields.mobile_phone }
    1.59 +        ui.field.text{ label = _"Profession", name = "profession", readonly = config.locked_profile_fields.profession }
    1.60 +        ui.field.text{ label = _"External memberships", name = "external_memberships", multiline = true, readonly = config.locked_profile_fields.external_memberships }
    1.61 +        ui.field.text{ label = _"External posts", name = "external_posts", multiline = true, readonly = config.locked_profile_fields.external_posts }
    1.62  
    1.63 -    ui.field.select{
    1.64 -      label = _"Wiki engine for statement",
    1.65 -      name = "formatting_engine",
    1.66 -      foreign_records = {
    1.67 -        { id = "rocketwiki", name = "RocketWiki" },
    1.68 -        { id = "compat", name = _"Traditional wiki syntax" }
    1.69 -      },
    1.70 -      attr = {id = "formatting_engine"},
    1.71 -      foreign_id = "id",
    1.72 -      foreign_name = "name",
    1.73 -      value = param.get("formatting_engine")
    1.74 -    }
    1.75 -    ui.tag{
    1.76 -      tag = "div",
    1.77 -      content = function()
    1.78 -        ui.tag{
    1.79 -          tag = "label",
    1.80 -          attr = { class = "ui_field_label" },
    1.81 -          content = function() slot.put(" ") end,
    1.82 +        if not config.enforce_formatting_engine then
    1.83 +          ui.field.select{
    1.84 +            label = _"Wiki engine for statement",
    1.85 +            name = "formatting_engine",
    1.86 +            foreign_records = config.formatting_engines,
    1.87 +            attr = {id = "formatting_engine"},
    1.88 +            foreign_id = "id",
    1.89 +            foreign_name = "name",
    1.90 +            value = param.get("formatting_engine")
    1.91 +          }
    1.92 +          ui.tag{
    1.93 +            tag = "div",
    1.94 +            content = function()
    1.95 +              ui.tag{
    1.96 +                tag = "label",
    1.97 +                attr = { class = "ui_field_label" },
    1.98 +                content = function() slot.put(" ") end,
    1.99 +              }
   1.100 +              ui.tag{
   1.101 +                content = function()
   1.102 +                  ui.link{
   1.103 +                    text = _"Syntax help",
   1.104 +                    module = "help",
   1.105 +                    view = "show",
   1.106 +                    id = "wikisyntax",
   1.107 +                    attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
   1.108 +                  }
   1.109 +                  slot.put(" ")
   1.110 +                  ui.link{
   1.111 +                    text = _"(new window)",
   1.112 +                    module = "help",
   1.113 +                    view = "show",
   1.114 +                    id = "wikisyntax",
   1.115 +                    attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
   1.116 +                  }
   1.117 +                end
   1.118 +              }
   1.119 +            end
   1.120 +          }
   1.121 +        end
   1.122 +        ui.field.text{
   1.123 +          label = _"Statement",
   1.124 +          name = "statement",
   1.125 +          multiline = true, 
   1.126 +          attr = { style = "height: 50ex;" },
   1.127 +          value = param.get("statement")
   1.128          }
   1.129 -        ui.tag{
   1.130 -          content = function()
   1.131 -            ui.link{
   1.132 -              text = _"Syntax help",
   1.133 -              module = "help",
   1.134 -              view = "show",
   1.135 -              id = "wikisyntax",
   1.136 -              attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
   1.137 -            }
   1.138 -            slot.put(" ")
   1.139 -            ui.link{
   1.140 -              text = _"(new window)",
   1.141 -              module = "help",
   1.142 -              view = "show",
   1.143 -              id = "wikisyntax",
   1.144 -              attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
   1.145 -            }
   1.146 -          end
   1.147 -        }
   1.148 -      end
   1.149 -    }
   1.150 -    ui.field.text{
   1.151 -      label = _"Statement",
   1.152 -      name = "statement",
   1.153 -      multiline = true, 
   1.154 -      attr = { style = "height: 50ex;" },
   1.155 -      value = param.get("statement")
   1.156 -    }
   1.157 -
   1.158 -    
   1.159 -    ui.submit{ value = _"Save" }
   1.160 +        slot.put("<br />")
   1.161 +        ui.container{ attr = { class = "actions" }, content = function()
   1.162 +          ui.tag{
   1.163 +            tag = "input",
   1.164 +            attr = {
   1.165 +              type = "submit",
   1.166 +              class = "btn btn-default",
   1.167 +              value = _"publish profile data"
   1.168 +            },
   1.169 +            content = ""
   1.170 +          }
   1.171 +          slot.put("<br /><br /><br />")
   1.172 +          ui.link{
   1.173 +            content = _"cancel",
   1.174 +            module = "member", view = "show", id = app.session.member.id
   1.175 +          }
   1.176 +        end }
   1.177 +      end )
   1.178 +    end )
   1.179    end
   1.180  }
   1.181 \ No newline at end of file

Impressum / About Us