annotate app/main/member/_menu.lua @ 525:63d6549cc00b
Delegation chain preview improved, better visualisation of current context, code cleanup
 | author | 
 bsw | 
 | date | 
 Fri May 18 19:07:07 2012 +0200 (2012-05-18) | 
 | parents | 
  | 
 | children | 
 a06634d17718  | 
 
 | rev | 
   line source | 
| 
bsw@525
 | 
     1 ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@525
 | 
     2   
 | 
| 
bsw@525
 | 
     3   ui.tag{ tag = "li", content = function()
 | 
| 
bsw@525
 | 
     4 
 | 
| 
bsw@525
 | 
     5     ui.link{
 | 
| 
bsw@525
 | 
     6       text = _"Show profile",
 | 
| 
bsw@525
 | 
     7       module = "member",
 | 
| 
bsw@525
 | 
     8       view = "show",
 | 
| 
bsw@525
 | 
     9       id = app.session.member_id
 | 
| 
bsw@525
 | 
    10     }
 | 
| 
bsw@525
 | 
    11     
 | 
| 
bsw@525
 | 
    12   end }
 | 
| 
bsw@525
 | 
    13    
 | 
| 
bsw@525
 | 
    14   ui.tag{ tag = "li", content = function()
 | 
| 
bsw@525
 | 
    15 
 | 
| 
bsw@525
 | 
    16     ui.link{
 | 
| 
bsw@525
 | 
    17       content = function()
 | 
| 
bsw@525
 | 
    18           slot.put(_"Edit profile")
 | 
| 
bsw@525
 | 
    19       end,
 | 
| 
bsw@525
 | 
    20       module = "member",
 | 
| 
bsw@525
 | 
    21       view = "edit"
 | 
| 
bsw@525
 | 
    22     }
 | 
| 
bsw@525
 | 
    23 
 | 
| 
bsw@525
 | 
    24   end }
 | 
| 
bsw@525
 | 
    25    
 | 
| 
bsw@525
 | 
    26   ui.tag{ tag = "li", content = function()
 | 
| 
bsw@525
 | 
    27 
 | 
| 
bsw@525
 | 
    28     ui.link{
 | 
| 
bsw@525
 | 
    29       content = function()
 | 
| 
bsw@525
 | 
    30           slot.put(_"Upload avatar/photo")
 | 
| 
bsw@525
 | 
    31       end,
 | 
| 
bsw@525
 | 
    32       module = "member",
 | 
| 
bsw@525
 | 
    33       view = "edit_images"
 | 
| 
bsw@525
 | 
    34     }
 | 
| 
bsw@525
 | 
    35 
 | 
| 
bsw@525
 | 
    36   end }
 | 
| 
bsw@525
 | 
    37     
 | 
| 
bsw@525
 | 
    38   ui.tag{ tag = "li", content = function()
 | 
| 
bsw@525
 | 
    39 
 | 
| 
bsw@525
 | 
    40     ui.link{
 | 
| 
bsw@525
 | 
    41       content = _"Contacts",
 | 
| 
bsw@525
 | 
    42       module = 'contact',
 | 
| 
bsw@525
 | 
    43       view   = 'list'
 | 
| 
bsw@525
 | 
    44     }
 | 
| 
bsw@525
 | 
    45 
 | 
| 
bsw@525
 | 
    46   end }
 | 
| 
bsw@525
 | 
    47    
 | 
| 
bsw@525
 | 
    48   ui.tag{ tag = "li", content = function()
 | 
| 
bsw@525
 | 
    49 
 | 
| 
bsw@525
 | 
    50     ui.link{
 | 
| 
bsw@525
 | 
    51       text   = _"Settings",
 | 
| 
bsw@525
 | 
    52       module = "member",
 | 
| 
bsw@525
 | 
    53       view = "settings"
 | 
| 
bsw@525
 | 
    54     }
 | 
| 
bsw@525
 | 
    55 
 | 
| 
bsw@525
 | 
    56   end }
 | 
| 
bsw@525
 | 
    57    
 | 
| 
bsw@525
 | 
    58   ui.tag{ tag = "li", content = function()
 | 
| 
bsw@525
 | 
    59 
 | 
| 
bsw@525
 | 
    60     ui.link{
 | 
| 
bsw@525
 | 
    61       text   = _"Logout",
 | 
| 
bsw@525
 | 
    62       module = 'index',
 | 
| 
bsw@525
 | 
    63       action = 'logout',
 | 
| 
bsw@525
 | 
    64       routing = {
 | 
| 
bsw@525
 | 
    65         default = {
 | 
| 
bsw@525
 | 
    66           mode = "redirect",
 | 
| 
bsw@525
 | 
    67           module = "index",
 | 
| 
bsw@525
 | 
    68           view = "index"
 | 
| 
bsw@525
 | 
    69         }
 | 
| 
bsw@525
 | 
    70       }
 | 
| 
bsw@525
 | 
    71     }
 | 
| 
bsw@525
 | 
    72   end }
 | 
| 
bsw@525
 | 
    73 
 | 
| 
bsw@525
 | 
    74   ui.tag{ tag = "li", content = function()
 | 
| 
bsw@525
 | 
    75     ui.tag{ tag = "span", content = _"Select language" }
 | 
| 
bsw@525
 | 
    76   end }
 | 
| 
bsw@525
 | 
    77 
 | 
| 
bsw@525
 | 
    78   for i, lang in ipairs{"en", "de", "eo"} do
 | 
| 
bsw@525
 | 
    79     ui.tag{ tag = "li", content = function()
 | 
| 
bsw@525
 | 
    80       ui.link{
 | 
| 
bsw@525
 | 
    81         content = function()
 | 
| 
bsw@525
 | 
    82           ui.image{
 | 
| 
bsw@525
 | 
    83             static = "lang/" .. lang .. ".png",
 | 
| 
bsw@525
 | 
    84           }
 | 
| 
bsw@525
 | 
    85           ui.tag{ content = _('Select language "#{langcode}"', { langcode = lang }) }
 | 
| 
bsw@525
 | 
    86         end,
 | 
| 
bsw@525
 | 
    87         module = "index",
 | 
| 
bsw@525
 | 
    88         action = "set_lang",
 | 
| 
bsw@525
 | 
    89         params = { lang = lang },
 | 
| 
bsw@525
 | 
    90         routing = {
 | 
| 
bsw@525
 | 
    91           default = {
 | 
| 
bsw@525
 | 
    92             mode = "redirect",
 | 
| 
bsw@525
 | 
    93             module = request.get_module(),
 | 
| 
bsw@525
 | 
    94             view = request.get_view(),
 | 
| 
bsw@525
 | 
    95             id = param.get_id_cgi(),
 | 
| 
bsw@525
 | 
    96             params = param.get_all_cgi()
 | 
| 
bsw@525
 | 
    97           }
 | 
| 
bsw@525
 | 
    98         }
 | 
| 
bsw@525
 | 
    99       }
 | 
| 
bsw@525
 | 
   100     end }
 | 
| 
bsw@525
 | 
   101   end
 | 
| 
bsw@525
 | 
   102 
 | 
| 
bsw@525
 | 
   103 end }
 | 
| 
bsw@525
 | 
   104 
 |