annotate app/main/draft/show.lua @ 1092:5b65ea5c24f5
Fixed free timings in poll mode
 | author | bsw | 
 | date | Fri Oct 17 13:03:31 2014 +0200 (2014-10-17) | 
 | parents | 701a5cf6b067 | 
 | children | fede09736f2b | 
 
 | rev | line source | 
| bsw/jbe@0 | 1 local draft = Draft:new_selector():add_where{ "id = ?", param.get_id() }:single_object_mode():exec() | 
| poelzi@160 | 2 local source = param.get("source", atom.boolean) | 
| poelzi@160 | 3 | 
| poelzi@160 | 4 execute.view{ | 
| bsw@1045 | 5   module = "issue", | 
| poelzi@160 | 6   view = "_head", | 
| bsw@1045 | 7   params = { issue = draft.initiative.issue } | 
| poelzi@160 | 8 } | 
| poelzi@160 | 9 | 
| bsw@1045 | 10 ui.section( function() | 
| bsw@1045 | 11 | 
| bsw@1045 | 12   ui.sectionHead( function() | 
| poelzi@160 | 13     ui.link{ | 
| bsw@1045 | 14       module = "initiative", view = "show", id = draft.initiative.id, | 
| bsw@1045 | 15       content = function () | 
| bsw@1045 | 16         ui.heading { | 
| bsw@1045 | 17           level = 1, | 
| bsw@1045 | 18           content = draft.initiative.display_name | 
| bsw@1045 | 19         } | 
| bsw@1045 | 20       end | 
| poelzi@160 | 21     } | 
| bsw@1045 | 22     ui.container { attr = { class = "right" }, content = function() | 
| bsw@1045 | 23       if source then | 
| bsw@1045 | 24         ui.link{ | 
| bsw@1045 | 25           content = _"Rendered", | 
| bsw@1045 | 26           module = "draft", | 
| bsw@1045 | 27           view = "show", | 
| bsw@1045 | 28           id = param.get_id(), | 
| bsw@1045 | 29           params = { source = false } | 
| bsw@1045 | 30         } | 
| bsw@1045 | 31       else | 
| bsw@1045 | 32         ui.link{ | 
| bsw@1045 | 33           content = _"Source", | 
| bsw@1045 | 34           module = "draft", | 
| bsw@1045 | 35           view = "show", | 
| bsw@1045 | 36           id = param.get_id(), | 
| bsw@1045 | 37           params = { source = true } | 
| bsw@1045 | 38         } | 
| bsw@1045 | 39       end | 
| bsw@1045 | 40     end } | 
| bsw@1045 | 41     ui.heading { level = 2, content = _("Draft revision #{id}", { id = draft.id } ) } | 
| bsw@1045 | 42   end) | 
| bsw@1045 | 43 | 
| bsw@1045 | 44   ui.sectionRow( function() | 
| bsw@1045 | 45 | 
| bsw@1045 | 46     execute.view{ | 
| bsw@1045 | 47       module = "draft", | 
| bsw@1045 | 48       view = "_show", | 
| bsw@1045 | 49       params = { draft = draft, source = source } | 
| bsw@1045 | 50     } | 
| bsw@1045 | 51   end) | 
| bsw@1045 | 52 end) |