annotate app/main/admin/member_deactivate.lua @ 1090:5b6082e9bd5c
Added missing files for member deactivation
 | author | bsw | 
 | date | Fri Aug 15 18:55:19 2014 +0200 (2014-08-15) | 
 | parents |  | 
 | children | a17ad625ffbc | 
 
 | rev | line source | 
| bsw@1090 | 1 local id = param.get_id() | 
| bsw@1090 | 2 | 
| bsw@1090 | 3 local member = Member:by_id(id) | 
| bsw@1090 | 4 | 
| bsw@1090 | 5 ui.title(_"Deactivate member") | 
| bsw@1090 | 6 | 
| bsw@1090 | 7 | 
| bsw@1090 | 8 ui.form{ | 
| bsw@1090 | 9   attr = { class = "vertical section" }, | 
| bsw@1090 | 10   module = "admin", | 
| bsw@1090 | 11   action = "member_deactivate", | 
| bsw@1090 | 12   id = member and member.id, | 
| bsw@1090 | 13   record = member, | 
| bsw@1090 | 14   routing = { | 
| bsw@1090 | 15     error = { | 
| bsw@1090 | 16       mode = "forward", | 
| bsw@1090 | 17       module = "admin", view = "member_deactivate", id = id | 
| bsw@1090 | 18     }, | 
| bsw@1090 | 19     default = { | 
| bsw@1090 | 20       mode = "redirect", | 
| bsw@1090 | 21       modules = "admin", view = "index" | 
| bsw@1090 | 22     } | 
| bsw@1090 | 23   }, | 
| bsw@1090 | 24   content = function() | 
| bsw@1090 | 25     ui.sectionHead( function() | 
| bsw@1090 | 26       ui.heading { level = 1, content = member and (member.name or member.id) or _"New member" } | 
| bsw@1090 | 27       if member and member.identification then | 
| bsw@1090 | 28         ui.heading { level = 3, content = member.identification } | 
| bsw@1090 | 29       end | 
| bsw@1090 | 30     end ) | 
| bsw@1090 | 31     ui.sectionRow(function() | 
| bsw@1090 | 32       ui.heading { level = 2, content = _"Do you really want to irrevocably deactive this member?" } | 
| bsw@1090 | 33       ui.tag{ tag = "input", attr = { type = "checkbox", name = "sure", value = "yes" } } | 
| bsw@1090 | 34       ui.tag { content = _"I want to deactive this member irrevocably" } | 
| bsw@1090 | 35       slot.put("<br />") | 
| bsw@1090 | 36       slot.put("<br />") | 
| bsw@1090 | 37       ui.submit{ text = _"Deactivate member" } | 
| bsw@1090 | 38       slot.put(" ") | 
| bsw@1090 | 39       ui.link { module = "admin", view = "member_edit", id = member.id, content = _"cancel" } | 
| bsw@1090 | 40     end) | 
| bsw@1090 | 41   end | 
| bsw@1090 | 42 } | 
| bsw@1090 | 43 |