liquid_feedback_frontend
view app/main/member/settings.lua @ 30:abcac05b1091
Added tag beta11 for changeset b195682957dc
| author | jbe | 
|---|---|
| date | Sun Feb 21 17:34:37 2010 +0100 (2010-02-21) | 
| parents | 00d1004545f1 | 
| children | 0849be391140 | 
 line source
     2 slot.put_into("title", _"Settings")
     4 slot.select("actions", function()
     5   ui.link{
     6     content = function()
     7         ui.image{ static = "icons/16/cancel.png" }
     8         slot.put(_"Cancel")
     9     end,
    10     module = "index",
    11     view = "index"
    12   }
    14   local setting_key = "liquidfeedback_frontend_developer_features"
    15   local setting = Setting:by_pk(app.session.member.id, setting_key)
    17   if setting then
    18     ui.link{
    19       content = function()
    20           ui.image{ static = "icons/16/wrench.png" }
    21           slot.put(_"Developer features")
    22       end,
    23       module = "member",
    24       view = "developer_settings"
    25     }
    26   end
    27 end)
    29 ui.heading{ content = _"Display settings" }
    30 util.help("member.settings.display", _"Display settings")
    32 ui.form{
    33   attr = { class = "vertical" },
    34   module = "member",
    35   action = "update_display",
    36   routing = {
    37     ok = {
    38       mode = "redirect",
    39       module = "index",
    40       view = "index"
    41     }
    42   },
    43   content = function()
    44     ui.field.select{
    45       label = _"Type of tabs",
    46       foreign_records = {
    47         { id = "tabs",                     name = _"Tabs" },
    48         { id = "accordeon",                name = _"Accordion (none expanded)" .. " === " .. _"EXPERIMENTAL FEATURE" .. " ===" },
    49         { id = "accordeon_first_expanded", name = _"Accordion (first expanded)" .. " === " .. _"EXPERIMENTAL FEATURE" .. " ===" },
    50 --        { id = "accordeon_all_expanded",   name = _"Accordion (all expanded)" }
    51       },
    52       foreign_id = "id",
    53       foreign_name = "name",
    54       name = "tab_mode",
    55       value = app.session.member:get_setting_value("tab_mode")
    56     }
    57     ui.field.select{
    58       label = _"Number of initiatives to preview",
    59       foreign_records = {
    60         { id =  3, name = "3" },
    61         { id =  4, name = "4" },
    62         { id =  5, name = "5" },
    63         { id =  6, name = "6" },
    64         { id =  7, name = "7" },
    65         { id =  8, name = "8" },
    66         { id =  9, name = "9" },
    67         { id = 10, name = "10" },
    68       },
    69       foreign_id = "id",
    70       foreign_name = "name",
    71       name = "initiatives_preview_limit",
    72       value = app.session.member:get_setting_value("initiatives_preview_limit")
    73     }
    74     ui.submit{ value = _"Change display settings" }
    75   end
    76 }
    78 ui.heading{ content = _"Change your name" }
    79 util.help("member.settings.name", _"Change name")
    81 ui.form{
    82   attr = { class = "vertical" },
    83   module = "member",
    84   action = "update_name",
    85   routing = {
    86     ok = {
    87       mode = "redirect",
    88       module = "index",
    89       view = "index"
    90     }
    91   },
    92   content = function()
    93     ui.field.text{ label = _"Name", name = "name", value = app.session.member.name }
    94     ui.submit{ value = _"Change name" }
    95   end
    96 }
    98 ui.heading{ content = _"Change your login" }
    99 util.help("member.settings.login", _"Change login")
   101 ui.form{
   102   attr = { class = "vertical" },
   103   module = "member",
   104   action = "update_login",
   105   routing = {
   106     ok = {
   107       mode = "redirect",
   108       module = "index",
   109       view = "index"
   110     }
   111   },
   112   content = function()
   113     ui.field.text{ label = _"Login", name = "login", value = app.session.member.login }
   114     ui.submit{ value = _"Change login" }
   115   end
   116 }
   118 ui.heading{ content = _"Change your password" }
   119 util.help("member.settings.password", _"Change password")
   121 ui.form{
   122   attr = { class = "vertical" },
   123   module = "member",
   124   action = "update_password",
   125   routing = {
   126     ok = {
   127       mode = "redirect",
   128       module = "index",
   129       view = "index"
   130     }
   131   },
   132   content = function()
   133     ui.field.password{ label = _"Old password", name = "old_password" }
   134     ui.field.password{ label = _"New password", name = "new_password1" }
   135     ui.field.password{ label = _"Repeat new password", name = "new_password2" }
   136     ui.submit{ value = _"Change password" }
   137   end
   138 }
