liquid_feedback_frontend

changeset 490:abebe5e9ff78

Do not show ignore initiative for closed issues closes #1179
author bsw
date Thu Mar 15 20:56:13 2012 +0100 (2012-03-15)
parents 4ef069c88daf
children 1dd1f2c2112c
files app/main/supporter/_show_box.lua
line diff
     1.1 --- a/app/main/supporter/_show_box.lua	Thu Mar 15 15:52:43 2012 +0100
     1.2 +++ b/app/main/supporter/_show_box.lua	Thu Mar 15 20:56:13 2012 +0100
     1.3 @@ -130,47 +130,48 @@
     1.4            }
     1.5          end
     1.6          
     1.7 -        local ignored_initiative = IgnoredInitiative:by_pk(app.session.member.id, initiative.id)
     1.8 -        if ignored_initiative then
     1.9 -          ui.container{
    1.10 -            attr = { class = "interest" },
    1.11 -            content = _"You have ignored this initiative"
    1.12 -          }
    1.13 -          ui.link{
    1.14 -            text   = _"Stop ignoring initiative",
    1.15 -            module = "initiative",
    1.16 -            action = "update_ignore",
    1.17 -            id     = initiative.id,
    1.18 -            params = { delete = true },
    1.19 -            routing = {
    1.20 -              default = {
    1.21 -                mode = "redirect",
    1.22 -                module = request.get_module(),
    1.23 -                view = request.get_view(),
    1.24 -                id = param.get_id_cgi(),
    1.25 -                params = param.get_all_cgi()
    1.26 +        if not initiative.issue.closed then
    1.27 +          local ignored_initiative = IgnoredInitiative:by_pk(app.session.member.id, initiative.id)
    1.28 +          if ignored_initiative then
    1.29 +            ui.container{
    1.30 +              attr = { class = "interest" },
    1.31 +              content = _"You have ignored this initiative"
    1.32 +            }
    1.33 +            ui.link{
    1.34 +              text   = _"Stop ignoring initiative",
    1.35 +              module = "initiative",
    1.36 +              action = "update_ignore",
    1.37 +              id     = initiative.id,
    1.38 +              params = { delete = true },
    1.39 +              routing = {
    1.40 +                default = {
    1.41 +                  mode = "redirect",
    1.42 +                  module = request.get_module(),
    1.43 +                  view = request.get_view(),
    1.44 +                  id = param.get_id_cgi(),
    1.45 +                  params = param.get_all_cgi()
    1.46 +                }
    1.47                }
    1.48              }
    1.49 -          }
    1.50 -        else
    1.51 -          ui.link{
    1.52 -            attr = { class = "interest" },
    1.53 -            text    = _"Ignore initiative",
    1.54 -            module  = "initiative",
    1.55 -            action  = "update_ignore",
    1.56 -            id      = initiative.id,
    1.57 -            routing = {
    1.58 -              default = {
    1.59 -                mode = "redirect",
    1.60 -                module = request.get_module(),
    1.61 -                view = request.get_view(),
    1.62 -                id = param.get_id_cgi(),
    1.63 -                params = param.get_all_cgi()
    1.64 +          else
    1.65 +            ui.link{
    1.66 +              attr = { class = "interest" },
    1.67 +              text    = _"Ignore initiative",
    1.68 +              module  = "initiative",
    1.69 +              action  = "update_ignore",
    1.70 +              id      = initiative.id,
    1.71 +              routing = {
    1.72 +                default = {
    1.73 +                  mode = "redirect",
    1.74 +                  module = request.get_module(),
    1.75 +                  view = request.get_view(),
    1.76 +                  id = param.get_id_cgi(),
    1.77 +                  params = param.get_all_cgi()
    1.78 +                }
    1.79                }
    1.80              }
    1.81 -          }
    1.82 +          end
    1.83          end
    1.84 -
    1.85          
    1.86        end
    1.87      }

Impressum / About Us