liquid_feedback_frontend
annotate env/ui/titleMember.lua @ 1085:8be69c8d99a8
Fixed error when accessing member profile without being logged in
| author | bsw | 
|---|---|
| date | Sat Aug 02 21:26:53 2014 +0200 (2014-08-02) | 
| parents | 701a5cf6b067 | 
| children | 9ba82d3a9445 | 
| rev | line source | 
|---|---|
| bsw@1045 | 1 function ui.titleMember(title, title2) | 
| bsw@1045 | 2 local member = app.session.member | 
| bsw@1045 | 3 if type(title) == "table" then | 
| bsw@1045 | 4 member = title | 
| bsw@1045 | 5 title = title2 | 
| bsw@1045 | 6 end | 
| bsw@1045 | 7 ui.title(function() | 
| bsw@1045 | 8 if member then | 
| bsw@1045 | 9 ui.link { module = "member", view = "show", id = member.id, content = member.name } | 
| bsw@1045 | 10 end | 
| bsw@1045 | 11 if title then | 
| bsw@1045 | 12 ui.tag { attr = { class = "member" }, content = function() | 
| bsw@1045 | 13 ui.tag{ tag = "span", content = title } | 
| bsw@1045 | 14 end } | 
| bsw@1045 | 15 end | 
| bsw@1045 | 16 end) | 
| bsw@1045 | 17 end |