liquid_feedback_frontend
diff app/main/member/history.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/history.lua Thu Jul 10 01:02:43 2014 +0200 1.2 +++ b/app/main/member/history.lua Thu Jul 10 01:19:48 2014 +0200 1.3 @@ -1,76 +1,72 @@ 1.4 local member = Member:by_id(param.get_id()) 1.5 1.6 -slot.select("head", function() 1.7 - ui.container{ 1.8 - attr = { class = "title" }, 1.9 - content = _("Member name history for '#{name}'", { name = member.name }) 1.10 - } 1.11 - ui.container{ attr = { class = "actions" }, content = function() 1.12 - ui.link{ 1.13 +ui.titleMember(member) 1.14 + 1.15 +ui.section( function() 1.16 + 1.17 + ui.sectionHead( function() 1.18 + ui.heading{ level = 1, content = _"Account history" } 1.19 + end) 1.20 + 1.21 + ui.sectionRow( function() 1.22 + ui.form{ 1.23 + attr = { class = "vertical" }, 1.24 content = function() 1.25 - ui.image{ static = "icons/16/cancel.png" } 1.26 - slot.put(_"Back") 1.27 - end, 1.28 - module = "member", 1.29 - view = "show", 1.30 - id = member.id 1.31 + ui.field.text{ label = _"Current name", value = member.name } 1.32 + ui.field.text{ label = _"Current status", value = member.active and _'activated' or _'deactivated' } 1.33 + end 1.34 } 1.35 - end } 1.36 -end) 1.37 - 1.38 -ui.form{ 1.39 - attr = { class = "vertical" }, 1.40 - content = function() 1.41 - ui.field.text{ label = _"Current name", value = member.name } 1.42 - ui.field.text{ label = _"Current status", value = member.active and _'activated' or _'deactivated' } 1.43 - end 1.44 -} 1.45 1.46 1.47 -local entries = member:get_reference_selector("history_entries"):add_order_by("id DESC"):exec() 1.48 - 1.49 -ui.tag{ 1.50 - tag = "table", 1.51 - content = function() 1.52 - ui.tag{ 1.53 - tag = "tr", 1.54 - content = function() 1.55 - ui.tag{ 1.56 - tag = "th", 1.57 - content = _("Name") 1.58 - } 1.59 - ui.tag{ 1.60 - tag = "th", 1.61 - content = _("Status") 1.62 - } 1.63 - ui.tag{ 1.64 - tag = "th", 1.65 - content = _("until") 1.66 - } 1.67 - end 1.68 - } 1.69 - for i, entry in ipairs(entries) do 1.70 + local entries = member:get_reference_selector("history_entries"):add_order_by("id DESC"):exec() 1.71 + 1.72 + if #entries > 0 then 1.73 ui.tag{ 1.74 - tag = "tr", 1.75 + tag = "table", 1.76 content = function() 1.77 ui.tag{ 1.78 - tag = "td", 1.79 - content = entry.name 1.80 + tag = "tr", 1.81 + content = function() 1.82 + ui.tag{ 1.83 + tag = "th", 1.84 + content = _("Name") 1.85 + } 1.86 + ui.tag{ 1.87 + tag = "th", 1.88 + content = _("Status") 1.89 + } 1.90 + ui.tag{ 1.91 + tag = "th", 1.92 + content = _("until") 1.93 + } 1.94 + end 1.95 } 1.96 - ui.tag{ 1.97 - tag = "td", 1.98 - content = entry.active and _'activated' or _'deactivated', 1.99 - } 1.100 - ui.tag{ 1.101 - tag = "td", 1.102 - content = format.timestamp(entry["until"]) 1.103 - } 1.104 + for i, entry in ipairs(entries) do 1.105 + ui.tag{ 1.106 + tag = "tr", 1.107 + content = function() 1.108 + ui.tag{ 1.109 + tag = "td", 1.110 + content = entry.name 1.111 + } 1.112 + ui.tag{ 1.113 + tag = "td", 1.114 + content = entry.active and _'activated' or _'deactivated', 1.115 + } 1.116 + ui.tag{ 1.117 + tag = "td", 1.118 + content = format.timestamp(entry["until"]) 1.119 + } 1.120 + end 1.121 + } 1.122 + end 1.123 end 1.124 } 1.125 end 1.126 - end 1.127 -} 1.128 -slot.put("<br />") 1.129 -ui.container{ 1.130 - content = _("This member account has been created at #{created}", { created = format.timestamp(member.activated)}) 1.131 -} 1.132 + slot.put("<br />") 1.133 + ui.container{ 1.134 + content = _("This member account has been created at #{created}", { created = format.timestamp(member.activated)}) 1.135 + } 1.136 + end) 1.137 + 1.138 +end) 1.139 \ No newline at end of file