liquid_feedback_frontend

changeset 880:fe39c1fb541b

Do not save voting comment changed timestamp if issue is still in voting
author bsw
date Mon Aug 20 01:06:20 2012 +0200 (2012-08-20)
parents ea3d3757ddc3
children 23e12fe721d4
files app/main/vote/_action/update.lua app/main/vote/list.lua
line diff
     1.1 --- a/app/main/vote/_action/update.lua	Mon Aug 20 01:00:09 2012 +0200
     1.2 +++ b/app/main/vote/_action/update.lua	Mon Aug 20 01:06:20 2012 +0200
     1.3 @@ -73,12 +73,16 @@
     1.4        if #comment > 0 then
     1.5          direct_voter.formatting_engine = formatting_engine
     1.6          direct_voter.comment = comment
     1.7 -        direct_voter.comment_changed = 'now'
     1.8 +        if issue.closed then
     1.9 +          direct_voter.comment_changed = 'now'
    1.10 +        end
    1.11          direct_voter:render_content(true)
    1.12        else
    1.13          direct_voter.formatting_engine = null
    1.14          direct_voter.comment = null
    1.15 -        direct_voter.comment_changed = 'now'
    1.16 +        if issue.closed then
    1.17 +          direct_voter.comment_changed = 'now'
    1.18 +        end
    1.19        end
    1.20      end
    1.21      direct_voter:save()
     2.1 --- a/app/main/vote/list.lua	Mon Aug 20 01:00:09 2012 +0200
     2.2 +++ b/app/main/vote/list.lua	Mon Aug 20 01:06:20 2012 +0200
     2.3 @@ -47,7 +47,7 @@
     2.4                                            encode.html(tostring(issue.id)))
     2.5                    }
     2.6                )
     2.7 -  ui.title(str)
     2.8 +  ui.raw_title(str)
     2.9  else
    2.10    member = app.session.member
    2.11  
    2.12 @@ -435,7 +435,14 @@
    2.13        slot.put(rendered_comment)
    2.14      end
    2.15      if (readonly or direct_voter.comment) and not preview then
    2.16 -      ui.heading{ level = "2", content = _("Voting comment (last updated: #{timestamp})", { timestamp = format.timestamp(direct_voter.comment_changed) }) }
    2.17 +      local text
    2.18 +      if direct_voter.comment_changed then
    2.19 +        text = _("Voting comment (last updated: #{timestamp})", { timestamp = format.timestamp(direct_voter.comment_changed) })
    2.20 +      else
    2.21 +        text = _"Voting comment"
    2.22 +      end
    2.23 +        ui.heading{ level = "2", content = text }
    2.24 +        
    2.25        if direct_voter.comment then
    2.26          local rendered_comment = direct_voter:get_content('html')
    2.27          ui.container{ attr = { class = "member_statement" }, content = function()

Impressum / About Us