liquid_feedback_frontend
view app/main/draft/_show.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 | de6b80867eb7 | 
| children | cc7650c7053f | 
 line source
     1 local draft = param.get("draft", "table")
     3 ui.form{
     4   attr = { class = "vertical" },
     5   record = draft,
     6   readonly = true,
     7   content = function()
     9     if app.session.member_id or config.public_access == "pseudonym" then
    10       if draft.author then
    11         -- ugly workaround for getting html into a replaced string und to the user
    12         ui.container{label = _"Last author", label_attr={class="ui_field_label"}, content = function()
    13             local str = _("#{author} at #{date}",
    14                             {author = string.format('<a href="%s">%s</a>',
    15                                                     encode.url{
    16                                                       module    = "member",
    17                                                       view      = "show",
    18                                                       id        = draft.author.id,
    19                                                     },
    20                                                     encode.html(draft.author.name)),
    21                              date = encode.html(format.timestamp(draft.created))
    22                             }
    23                         )
    24             slot.put("<span>", str, "</span>")
    25           end
    26         }
    27       else
    28         text = _("#{author} at #{date}", {
    29           author = encode.html(draft.author_name),
    30           date = format.timestamp(draft.created)
    31         })
    32         ui.field.text{label = _"Last author", value = text }
    33       end
    34     else
    35       ui.field.text{
    36         label = _"Last author",
    37         value = _(
    38           "#{author} at #{date}", {
    39             author = _"[not displayed public]",
    40             date = format.timestamp(draft.created)
    41           }
    42         )
    43       }
    44     end
    46     ui.container{
    47       attr = { class = "draft_content wiki" },
    48       content = function()
    49         slot.put(draft:get_content("html"))
    50       end
    51     }
    52   end
    53 }
