liquid_feedback_frontend
view app/main/suggestion/show.lua @ 873:5f681205dd44
Added agument check again for public access
| author | bsw | 
|---|---|
| date | Sat Aug 18 22:59:00 2012 +0200 (2012-08-18) | 
| parents | cc64a4fc6ab6 | 
| children | f03fbffc1800 | 
 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 ui.title(_"Suggestion for initiative: '#{name}'":gsub("#{name}", suggestion.initiative.name))
    26 ui.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 }
