liquid_feedback_frontend
annotate app/main/member/history.lua @ 154:6b6c82f9ca9f
speedup member image loading when non set
we can add the location of the default file directy instead of going through another slow request
we can add the location of the default file directy instead of going through another slow request
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Fri Oct 08 15:25:10 2010 +0200 (2010-10-08) |
parents | 6a12fb7e4963 |
children | 3e76be965ebb |
rev | line source |
---|---|
bsw@9 | 1 local member = Member:by_id(param.get_id()) |
bsw@9 | 2 |
bsw@46 | 3 slot.put_into("title", encode.html(_("Member name history for '#{name}'", { name = member.name }))) |
bsw@9 | 4 |
bsw@9 | 5 slot.select("actions", function() |
bsw@9 | 6 ui.link{ |
bsw@9 | 7 content = function() |
bsw@9 | 8 ui.image{ static = "icons/16/cancel.png" } |
bsw@9 | 9 slot.put(_"Back") |
bsw@9 | 10 end, |
bsw@9 | 11 module = "member", |
bsw@9 | 12 view = "show", |
bsw@9 | 13 id = member.id |
bsw@9 | 14 } |
bsw@9 | 15 end) |
bsw@9 | 16 |
bsw@77 | 17 ui.form{ |
bsw@77 | 18 attr = { class = "vertical" }, |
bsw@77 | 19 content = function() |
bsw@77 | 20 ui.field.text{ label = _"Current name", value = member.name } |
bsw@77 | 21 ui.field.text{ label = _"Current status", value = member.active and _'activated' or _'deactivated' } |
bsw@77 | 22 end |
bsw@77 | 23 } |
bsw@77 | 24 |
bsw@77 | 25 |
bsw@9 | 26 local entries = member:get_reference_selector("history_entries"):add_order_by("id DESC"):exec() |
bsw@9 | 27 |
bsw@9 | 28 ui.tag{ |
bsw@9 | 29 tag = "table", |
bsw@9 | 30 content = function() |
bsw@9 | 31 ui.tag{ |
bsw@9 | 32 tag = "tr", |
bsw@9 | 33 content = function() |
bsw@9 | 34 ui.tag{ |
bsw@9 | 35 tag = "th", |
bsw@9 | 36 content = _("Name") |
bsw@9 | 37 } |
bsw@9 | 38 ui.tag{ |
bsw@9 | 39 tag = "th", |
bsw@77 | 40 content = _("Status") |
bsw@9 | 41 } |
bsw@9 | 42 ui.tag{ |
bsw@77 | 43 tag = "th", |
bsw@77 | 44 content = _("until") |
bsw@9 | 45 } |
bsw@9 | 46 end |
bsw@9 | 47 } |
bsw@9 | 48 for i, entry in ipairs(entries) do |
bsw@77 | 49 ui.tag{ |
bsw@77 | 50 tag = "tr", |
bsw@77 | 51 content = function() |
bsw@77 | 52 ui.tag{ |
bsw@77 | 53 tag = "td", |
bsw@77 | 54 content = entry.name |
bsw@77 | 55 } |
bsw@77 | 56 ui.tag{ |
bsw@77 | 57 tag = "td", |
bsw@95 | 58 content = entry.active and _'activated' or _'deactivated', |
bsw@77 | 59 } |
bsw@77 | 60 ui.tag{ |
bsw@77 | 61 tag = "td", |
bsw@77 | 62 content = format.timestamp(entry["until"]) |
bsw@77 | 63 } |
bsw@9 | 64 end |
bsw@77 | 65 } |
bsw@9 | 66 end |
bsw@9 | 67 end |
bsw@9 | 68 } |
bsw@9 | 69 slot.put("<br />") |
bsw@9 | 70 ui.container{ |
bsw@9 | 71 content = _("This member account has been created at #{created}", { created = format.timestamp(member.created)}) |
bsw@9 | 72 } |