bsw/jbe@0: local draft = param.get("draft", "table")
bsw/jbe@0: 
bsw/jbe@0: ui.form{
bsw/jbe@0:   attr = { class = "vertical" },
bsw/jbe@0:   record = draft,
bsw/jbe@0:   readonly = true,
bsw/jbe@0:   content = function()
bsw/jbe@0: 
bsw@51:     if app.session.member_id or config.public_access == "pseudonym" then
poelzi@134:       if draft.author then
poelzi@134:         -- ugly workaround for getting html into a replaced string und to the user
poelzi@134:         ui.container{label = _"Last author", label_attr={class="ui_field_label"}, content = function()
poelzi@134:             local str = _("#{author} at #{date}",
poelzi@134:                             {author = string.format('%s',
poelzi@134:                                                     encode.url{
poelzi@134:                                                       module    = "member",
poelzi@134:                                                       view      = "show",
poelzi@134:                                                       id        = draft.author.id,
poelzi@134:                                                     },
poelzi@134:                                                     encode.html(draft.author.name)),
poelzi@134:                              date = encode.html(format.timestamp(draft.created))
poelzi@134:                             }
poelzi@134:                         )
poelzi@134:             slot.put("", str, "")
poelzi@134:           end
poelzi@134:         }
poelzi@134:       else
poelzi@134:         text = _("#{author} at #{date}", {
poelzi@134:           author = encode.html(draft.author_name),
poelzi@134:           date = format.timestamp(draft.created)
poelzi@134:         })
poelzi@134:         ui.field.text{label = _"Last author", value = text }
poelzi@134:       end
bsw@51:     else
bsw@51:       ui.field.text{
bsw@51:         label = _"Last author",
bsw@51:         value = _(
bsw@51:           "#{author} at #{date}", {
bsw@65:             author = _"[not displayed public]",
bsw@51:             date = format.timestamp(draft.created)
bsw@51:           }
bsw@51:         )
bsw@51:       }
bsw@51:     end
bsw@51: 
bsw@2:     ui.container{
bsw/jbe@4:       attr = { class = "draft_content wiki" },
bsw@2:       content = function()
bsw@81:         slot.put(draft:get_content("html"))
bsw@2:       end
bsw@2:     }
bsw/jbe@0:   end
bsw/jbe@0: }