annotate env/ui/title.lua @ 1214:5c1e3b23170a
Fixed error when display profile page publically
 | author | 
 bsw | 
 | date | 
 Mon Jul 27 23:27:00 2015 +0200 (2015-07-27) | 
 | parents | 
 701a5cf6b067  | 
 | children | 
 32cc544d5a5b  | 
 
 | rev | 
   line source | 
| 
bsw@1045
 | 
     1 function ui.title ( content )
 | 
| 
bsw@1045
 | 
     2   
 | 
| 
bsw@1045
 | 
     3   slot.select ( "title", function ()
 | 
| 
bsw@1045
 | 
     4     
 | 
| 
bsw@1045
 | 
     5     -- home link
 | 
| 
bsw@1045
 | 
     6     ui.link {
 | 
| 
bsw@1045
 | 
     7       module = "index", view = "index",
 | 
| 
bsw@1045
 | 
     8       attr = { class = "home", title = _"Home" },
 | 
| 
bsw@1045
 | 
     9       content = function ()
 | 
| 
bsw@1045
 | 
    10         ui.image { 
 | 
| 
bsw@1045
 | 
    11           attr = { class = "icon24", alt = title },
 | 
| 
bsw@1045
 | 
    12           static = "icons/48/home.png"
 | 
| 
bsw@1045
 | 
    13         }
 | 
| 
bsw@1045
 | 
    14       end
 | 
| 
bsw@1045
 | 
    15     }
 | 
| 
bsw@1045
 | 
    16   
 | 
| 
bsw@1045
 | 
    17     if content then
 | 
| 
bsw@1045
 | 
    18       ui.tag { attr = { class = "spacer" }, content = function()
 | 
| 
bsw@1045
 | 
    19         slot.put ( " ยป " )
 | 
| 
bsw@1045
 | 
    20       end }
 | 
| 
bsw@1045
 | 
    21       ui.tag { tag = "span", content = content }
 | 
| 
bsw@1045
 | 
    22     else
 | 
| 
bsw@1045
 | 
    23       ui.tag { attr = { class = "spacer" }, content = function()
 | 
| 
bsw@1045
 | 
    24         slot.put ( " " )
 | 
| 
bsw@1045
 | 
    25       end }
 | 
| 
bsw@1045
 | 
    26       ui.tag { tag = "span", content = _"Home" }
 | 
| 
bsw@1045
 | 
    27     end
 | 
| 
bsw@1045
 | 
    28     
 | 
| 
bsw@1045
 | 
    29   end )
 | 
| 
bsw@1045
 | 
    30   
 | 
| 
bsw@1045
 | 
    31 end
 |