liquid_feedback_frontend
view app/main/suggestion/show.lua @ 157:24e47baf5f9b
strip html from fallback title
if the slot is used for title, make sure the html is stripped from it
if the slot is used for title, make sure the html is stripped from it
| author | Daniel Poelzleithner <poelzi@poelzi.org> |
|---|---|
| date | Fri Oct 08 20:31:09 2010 +0200 (2010-10-08) |
| parents | 44ba79952610 |
| children | cc64a4fc6ab6 |
line source
1 local suggestion = Suggestion:by_id(param.get_id())
3 -- redirect to initiative if suggestion does not exist anymore
4 if not suggestion then
5 local initiative_id = param.get('initiative_id', atom.integer)
6 if initiative_id then
7 slot.reset_all{except={"notice", "error"}}
8 request.redirect{
9 module='initiative',
10 view='show',
11 id=initiative_id,
12 params = { tab = "suggestions" }
13 }
14 else
15 slot.put_into('error', _"Suggestion does not exist anymore")
16 end
17 return
18 end
21 app.html_title.title = suggestion.name
22 app.html_title.subtitle = _("Suggestion ##{id}", { id = suggestion.id })
24 slot.put_into("title", encode.html(_"Suggestion for initiative: '#{name}'":gsub("#{name}", suggestion.initiative.name) ))
26 slot.select("actions", function()
27 ui.link{
28 content = function()
29 ui.image{ static = "icons/16/resultset_previous.png" }
30 slot.put(_"Back")
31 end,
32 module = "initiative",
33 view = "show",
34 id = suggestion.initiative.id,
35 params = { tab = "suggestions" }
36 }
37 end)
39 execute.view{
40 module = "suggestion",
41 view = "show_tab",
42 params = {
43 suggestion = suggestion
44 }
45 }
