liquid_feedback_frontend
diff app/main/draft/show.lua @ 160:cc7650c7053f
better title for draft/show
add source view mode into show draft fixes bug #298
add source view mode into show draft fixes bug #298
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Sat Oct 09 04:25:11 2010 +0200 (2010-10-09) |
parents | 3bfb2fcf7ab9 |
children | 99852ec8ee37 |
line diff
1.1 --- a/app/main/draft/show.lua Sat Oct 09 03:42:48 2010 +0200 1.2 +++ b/app/main/draft/show.lua Sat Oct 09 04:25:11 2010 +0200 1.3 @@ -1,7 +1,40 @@ 1.4 local draft = Draft:new_selector():add_where{ "id = ?", param.get_id() }:single_object_mode():exec() 1.5 +local source = param.get("source", atom.boolean) 1.6 + 1.7 +execute.view{ 1.8 + module = "draft", 1.9 + view = "_head", 1.10 + params = { draft = draft} 1.11 +} 1.12 + 1.13 +slot.put_into("title", " · " .. _"History") 1.14 + 1.15 +if source then 1.16 + slot.select("actions", function() 1.17 + ui.link{ 1.18 + content = _"Rendered", 1.19 + module = "draft", 1.20 + view = "show", 1.21 + id = param.get_id(), 1.22 + params = { source = false } 1.23 + } 1.24 + end 1.25 + ) 1.26 +else 1.27 + slot.select("actions", function() 1.28 + ui.link{ 1.29 + content = _"Source", 1.30 + module = "draft", 1.31 + view = "show", 1.32 + id = param.get_id(), 1.33 + params = { source = true } 1.34 + } 1.35 + end 1.36 + ) 1.37 +end 1.38 1.39 execute.view{ 1.40 module = "draft", 1.41 view = "_show", 1.42 - params = { draft = draft } 1.43 + params = { draft = draft, source = source } 1.44 } 1.45 \ No newline at end of file