liquid_feedback_frontend
diff app/main/delegation/_action/update.lua @ 529:5ca9de94cb13
Delegation preview when setting delegation, optical enhancements, typos fixed
| author | bsw |
|---|---|
| date | Sun May 20 19:43:01 2012 +0200 (2012-05-20) |
| parents | cb9ccdd024f2 |
| children | 5650f8163a29 |
line diff
1.1 --- a/app/main/delegation/_action/update.lua Fri May 18 21:03:10 2012 +0200 1.2 +++ b/app/main/delegation/_action/update.lua Sun May 20 19:43:01 2012 +0200 1.3 @@ -12,24 +12,23 @@ 1.4 area_id = nil 1.5 end 1.6 1.7 +local preview = param.get("preview") 1.8 + 1.9 +if preview == "1" then 1.10 + request.redirect{ module = "delegation", view = "show", params = { 1.11 + unit_id = unit_id, area_id = area_id, issue_id = issue_id, preview_trustee_id = trustee_id 1.12 + } } 1.13 + return 1.14 +end 1.15 + 1.16 + 1.17 local delegation = Delegation:by_pk(truster_id, unit_id, area_id, issue_id) 1.18 1.19 1.20 if param.get("delete") or trustee_id == -1 then 1.21 1.22 if delegation then 1.23 - 1.24 delegation:destroy() 1.25 - 1.26 ---[[ 1.27 - if issue_id then 1.28 - slot.put_into("notice", _"Your delegation for this issue has been deleted.") 1.29 - elseif area_id then 1.30 - slot.put_into("notice", _"Your delegation for this area has been deleted.") 1.31 - else 1.32 - slot.put_into("notice", _"Your delegation for this unit has been deleted.") 1.33 - end 1.34 ---]] 1.35 end 1.36 1.37 else 1.38 @@ -82,14 +81,6 @@ 1.39 end 1.40 1.41 delegation:save() 1.42 ---[[ 1.43 - if issue_id then 1.44 - slot.put_into("notice", _"Your delegation for this issue has been updated.") 1.45 - elseif area_id then 1.46 - slot.put_into("notice", _"Your delegation for this area has been updated.") 1.47 - else 1.48 - slot.put_into("notice", _"Your delegation for this unit has been updated.") 1.49 - end 1.50 ---]] 1.51 + 1.52 end 1.53