liquid_feedback_frontend

diff app/main/initiative/_show.lua @ 51:0849be391140

Public read access; Read-only API for initiatives; Prepared integration of OpenID
author bsw
date Sun Apr 04 22:05:11 2010 +0200 (2010-04-04)
parents 53a45356c107
children 733f65c0c0a0
line diff
     1.1 --- a/app/main/initiative/_show.lua	Wed Mar 31 17:50:32 2010 +0200
     1.2 +++ b/app/main/initiative/_show.lua	Sun Apr 04 22:05:11 2010 +0200
     1.3 @@ -120,10 +120,14 @@
     1.4  end
     1.5  
     1.6  
     1.7 -local supporter = app.session.member:get_reference_selector("supporters")
     1.8 -  :add_where{ "initiative_id = ?", initiative.id }
     1.9 -  :optional_object_mode()
    1.10 -  :exec()
    1.11 +local supporter
    1.12 +
    1.13 +if app.session.member_id then
    1.14 +  supporter = app.session.member:get_reference_selector("supporters")
    1.15 +    :add_where{ "initiative_id = ?", initiative.id }
    1.16 +    :optional_object_mode()
    1.17 +    :exec()
    1.18 +end
    1.19  
    1.20  if supporter and not initiative.issue.closed then
    1.21    local old_draft_id = supporter.draft_id
    1.22 @@ -164,21 +168,22 @@
    1.23  end
    1.24  
    1.25  
    1.26 -
    1.27 -ui.container{
    1.28 -  attr = {
    1.29 -    id = "initiative_" .. tostring(initiative.id) .. "_support"
    1.30 -  },
    1.31 -  content = function()
    1.32 -    execute.view{
    1.33 -      module = "initiative",
    1.34 -      view = "show_support",
    1.35 -      params = {
    1.36 -        initiative = initiative
    1.37 +if app.session.member_id then
    1.38 +  ui.container{
    1.39 +    attr = {
    1.40 +      id = "initiative_" .. tostring(initiative.id) .. "_support"
    1.41 +    },
    1.42 +    content = function()
    1.43 +      execute.view{
    1.44 +        module = "initiative",
    1.45 +        view = "show_support",
    1.46 +        params = {
    1.47 +          initiative = initiative
    1.48 +        }
    1.49        }
    1.50 -    }
    1.51 -  end
    1.52 -}
    1.53 +    end
    1.54 +  }
    1.55 +end
    1.56  
    1.57  if (initiative.discussion_url and #initiative.discussion_url > 0)
    1.58    or (initiator and initiator.accepted and not initiative.issue.half_frozen and not initiative.issue.closed and not initiative.revoked) then

Impressum / About Us