liquid_feedback_frontend

diff app/main/interest/_show_box.lua @ 173:ca006681befc

Support added for changed autoreject feature in upcoming core release
author bsw
date Sun Oct 31 00:22:39 2010 +0200 (2010-10-31)
parents 00d1004545f1
children 3f179402127f
line diff
     1.1 --- a/app/main/interest/_show_box.lua	Sun Oct 10 19:40:32 2010 +0200
     1.2 +++ b/app/main/interest/_show_box.lua	Sun Oct 31 00:22:39 2010 +0200
     1.3 @@ -2,6 +2,7 @@
     1.4  local issue = param.get("issue", "table")
     1.5  
     1.6  local interest = Interest:by_pk(issue.id, app.session.member.id)
     1.7 +local membership = Membership:by_pk(issue.area_id, app.session.member_id)
     1.8  
     1.9  if interest then
    1.10    slot.select("actions", function()
    1.11 @@ -20,12 +21,20 @@
    1.12              }
    1.13              slot.put(_"Your are interested")
    1.14  
    1.15 -            if interest.autoreject then
    1.16 +            if interest.autoreject == true or
    1.17 +              (interest.autoreject == nil and membership.autoreject == true)
    1.18 +            then
    1.19                ui.image{
    1.20                  static = "icons/16/thumb_down_red.png"
    1.21                }
    1.22              end
    1.23  
    1.24 +            if interest.autoreject == false then
    1.25 +              ui.image{
    1.26 +                static = "icons/16/thumb_down_red_crossed.png"
    1.27 +              }
    1.28 +            end
    1.29 +
    1.30              ui.image{
    1.31                static = "icons/16/dropdown.png"
    1.32              }
    1.33 @@ -56,22 +65,65 @@
    1.34                slot.put("<br />")
    1.35                slot.put("<br />")
    1.36              end
    1.37 -            if interest.autoreject then
    1.38 -              ui.field.text{ value = _"Autoreject is on." }
    1.39 +            if interest.autoreject == nil then
    1.40 +              if membership then
    1.41 +                if membership.autoreject then
    1.42 +                  ui.field.text{ value = _"Autoreject is inherited from area. (Currently turned on)" }
    1.43 +                else
    1.44 +                  ui.field.text{ value = _"Autoreject is inherited from area. (Currently turned off)" }
    1.45 +                end
    1.46 +              else
    1.47 +                ui.field.text{ value = _"Autoreject is inherited from area. (No member of this area)" }
    1.48 +              end
    1.49 +              slot.put("<br />")
    1.50                if issue.state ~= "finished" and issue.state ~= "cancelled" then
    1.51                  ui.link{
    1.52 -                  text    = _"Remove autoreject",
    1.53 +                  text    = _"Turn on autoreject for issue",
    1.54 +                  module  = "interest",
    1.55 +                  action  = "update",
    1.56 +                  params  = { issue_id = issue.id, autoreject = true },
    1.57 +                  routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    1.58 +                }
    1.59 +                ui.link{
    1.60 +                  text    = _"Turn off autoreject for issue",
    1.61                    module  = "interest",
    1.62                    action  = "update",
    1.63                    params  = { issue_id = issue.id, autoreject = false },
    1.64                    routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    1.65                  }
    1.66                end
    1.67 -            else
    1.68 -              ui.field.text{ value = _"Autoreject is off." }
    1.69 +            elseif interest.autoreject == true then
    1.70 +              ui.field.text{ value = _"Autoreject for this issue is turned on." }
    1.71 +              slot.put("<br />")
    1.72                if issue.state ~= "finished" and issue.state ~= "cancelled" then
    1.73                  ui.link{
    1.74 -                  text    = _"Set autoreject",
    1.75 +                  text    = _"Inherit autoreject from area",
    1.76 +                  module  = "interest",
    1.77 +                  action  = "update",
    1.78 +                  params  = { issue_id = issue.id, autoreject = nil },
    1.79 +                  routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    1.80 +                }
    1.81 +                ui.link{
    1.82 +                  text    = _"Turn off autoreject for issue",
    1.83 +                  module  = "interest",
    1.84 +                  action  = "update",
    1.85 +                  params  = { issue_id = issue.id, autoreject = false },
    1.86 +                  routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    1.87 +                }
    1.88 +              end
    1.89 +            elseif interest.autoreject == false then
    1.90 +              ui.field.text{ value = _"Autoreject for this issue is turned off." }
    1.91 +              slot.put("<br />")
    1.92 +              if issue.state ~= "finished" and issue.state ~= "cancelled" then
    1.93 +                ui.link{
    1.94 +                  text    = _"Inherit autoreject from area",
    1.95 +                  module  = "interest",
    1.96 +                  action  = "update",
    1.97 +                  params  = { issue_id = issue.id, autoreject = nil },
    1.98 +                  routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    1.99 +                }
   1.100 +                ui.link{
   1.101 +                  text    = _"Turn on autoreject for issue",
   1.102                    module  = "interest",
   1.103                    action  = "update",
   1.104                    params  = { issue_id = issue.id, autoreject = true },

Impressum / About Us