liquid_feedback_frontend
view app/main/suggestion/show.lua @ 172:165f4bd02cf3
don't show the first draft of a new initiative as a new draft event in the timeline
new draft should only show changes of drafts drafts of new initiatives as they are handled by the new initiative event
new draft should only show changes of drafts drafts of new initiatives as they are handled by the new initiative event
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Sun Oct 10 19:40:32 2010 +0200 (2010-10-10) |
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 }