local artikkel = blueprint("default") function artikkel.env(data) data.image = os.getenv("POST_image") data.published = os.getenv("POST_published") data.lead = os.getenv("POST_lead") end function artikkel.html(body, data) if data.mode == "title" then html.h2(data.title) return end if data.mode == "short" then html.p() html.print(body) return end html.print("

") html.img(data.image) html.h2(data.title) html.print("

") if data.portrait then html.print("", data.portrait) end html.print("") html.print("%s", data.author, data.author) html.print(" for ") html.print("%s", data.group, data.group) html.print("") html.print("

") html.print("") html.print("
") html.print("

" .. data.lead .. "") html.marxup(body or "") html.print("

") html.print("
") end function artikkel.form(body, data) html.p{} html.label{text="Overskrift:"} html.text{name='title', value=data.title, size=32} html.p{} html.label{text="Bilde:"} html.orz{name = "image", value = data.image} html.p{} html.textarea{name='lead', value=data.lead, rows=3} html.p{} html.textarea{name='text', value=body} end return artikkel