liquid_feedback_frontend
view app/main/draft/show.lua @ 1231:e7fc3fed1593
Refactored password reset functionality
| author | bsw | 
|---|---|
| date | Tue Dec 01 18:12:00 2015 +0100 (2015-12-01) | 
| parents | fede09736f2b | 
| children | 32cc544d5a5b | 
 line source
     1 local draft = Draft:new_selector():add_where{ "id = ?", param.get_id() }:single_object_mode():exec()
     2 local source = param.get("source", atom.boolean)
     4 execute.view{
     5   module = "issue",
     6   view = "_head",
     7   params = { issue = draft.initiative.issue }
     8 }
    10 ui.section( function()
    12   ui.sectionHead( function()
    13     ui.link{
    14       module = "initiative", view = "show", id = draft.initiative.id,
    15       content = function ()
    16         ui.heading { 
    17           level = 1,
    18           content = draft.initiative.display_name
    19         }
    20       end
    21     }
    22     ui.container { attr = { class = "right" }, content = function()
    23       if source then
    24         ui.link{
    25           content = _"Rendered",
    26           module = "draft",
    27           view = "show",
    28           id = param.get_id(),
    29           params = { source = false }
    30         }
    31       else
    32         ui.link{
    33           content = _"Source",
    34           module = "draft",
    35           view = "show",
    36           id = param.get_id(),
    37           params = { source = true }
    38         }
    39       end
    40     end }
    41     ui.heading { level = 2, content = _("Draft revision #{id}", { id = draft.id } ) }
    42   end)
    44   if config.render_external_reference and config.render_external_reference.draft then
    45     config.render_external_reference.draft(draft, function (callback)
    46       ui.sectionRow(callback)
    47     end)
    48   end
    50   ui.sectionRow( function()
    52     execute.view{
    53       module = "draft",
    54       view = "_show",
    55       params = { draft = draft, source = source }
    56     }
    57   end)
    58 end)
