diff options
author | bie <bie@blekksprut.net> | 2017-06-29 15:52:34 +0200 |
---|---|---|
committer | bie <bie@blekksprut.net> | 2017-06-29 15:52:34 +0200 |
commit | e1e6b653051119212c4c951096204160f3514f83 (patch) | |
tree | edab6155933d25915e66dc3e4f562d900753980a /blueprints/anmeldelse.lua | |
parent | 61d54a847fe5dd79c945820bba5d42b8e357b4d3 (diff) | |
download | tears-e1e6b653051119212c4c951096204160f3514f83.tar.xz |
LAUNCH LAUNCH...launch?
Diffstat (limited to 'blueprints/anmeldelse.lua')
-rw-r--r-- | blueprints/anmeldelse.lua | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/blueprints/anmeldelse.lua b/blueprints/anmeldelse.lua new file mode 100644 index 0000000..6c449a0 --- /dev/null +++ b/blueprints/anmeldelse.lua @@ -0,0 +1,89 @@ +local artikkel = blueprint("anmeldelse") + +local TERMS = { + ['regissør'] = 'Regissør', + manus = 'Manus', + medvirkende = 'Medvirkende', + sjanger = 'Sjanger', + norgespremiere = 'Norgespremiere', + aldersgrense = 'Aldersgrense' + +} +-- 'medvirkende', +-- 'sjanger', +-- 'norgespremiere', +-- 'aldersgrense' + +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 or "") + return + end + + html.print("<p class=figure>") + html.img{src = data.image} + + html.h2(data.title) + + html.print("<p class=byline>") + if data.portrait then + html.print("<img class='headshot mini' src='%s'>", data.portrait) + end + html.print("<span class=navn>%s for %s</span>", data.author, data.group) + + html.print("<section class=content>") + html.print("<aside>") + if data.portrait then + html.print("<img class='headshot' src='%s'>", data.portrait) + end + + html.dl(data.info) + + html.print("</aside>") + + html.print("<section class=body>") + html.print("<p><b>" .. data.lead .. "</b>") + html.marxup(body) + html.print("</section>") + + html.print("</section>") +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.label{text="Inline-bilde:"} + html.orz{inline = true} + + html.print("<p id=lol>") + html.textarea{name='lead', value=data.lead, rows=3} + + html.p{} + html.textarea{name='text', value=body} + + html.p{} + html.infobox{values=data.info, terms=TERMS} + + html.hidden{name='type', value='anmeldelse'} +end + +return artikkel + |