liquid_feedback_frontend

diff app/main/initiative/show.lua @ 6:8d91bccab0bf

Version beta2

Possibility to browse voters of a closed issue

Registration with invite code

Email confirmation and password recovery

Download function (for database dumps) added

Critical bug solved, which made it impossible to select your opinion on other peoples suggestions

Catching error, when trying to set an opinion on a suggestion which has been meanwhile deleted

Fixed wrong sorting order for "supporters" or "potential supporters"

Added format info for birthday (Error when entering dates in wrong format is NOT fixed in this release)

Strip space characters from certain fields and ensure they contain at least 3 characters

Showing grade in opinion/list as clear text instead of integer value

More information on initiative is displayed while voting

Colored notification box shown on pages of issues or initiatives which are currently in voting state

Changed default filter for issues to "Open"

Back link on suggestion page

Some optical changes

Removed wrong space character in LICENSE file
author bsw/jbe
date Sat Jan 02 12:00:00 2010 +0100 (2010-01-02)
parents afd9f769c7ae
children 72c5e0ee7c98
line diff
     1.1 --- a/app/main/initiative/show.lua	Fri Dec 25 12:00:00 2009 +0100
     1.2 +++ b/app/main/initiative/show.lua	Sat Jan 02 12:00:00 2010 +0100
     1.3 @@ -188,10 +188,19 @@
     1.4  end
     1.5  
     1.6  
     1.7 -ui.tabs{
     1.8 +local current_draft_name = _"Current draft"
     1.9 +if initiative.issue.half_frozen then
    1.10 +  current_draft_name = _"Voting proposal"
    1.11 +end
    1.12 +
    1.13 +if initiative.issue.state == "finished" then
    1.14 +  current_draft_name = _"Voted proposal"
    1.15 +end
    1.16 +
    1.17 +local tabs = {
    1.18    {
    1.19      name = "current_draft",
    1.20 -    label = _"Current draft",
    1.21 +    label = current_draft_name,
    1.22      content = function()
    1.23        if initiator then
    1.24          ui.link{
    1.25 @@ -206,108 +215,136 @@
    1.26        end
    1.27        execute.view{ module = "draft", view = "_show", params = { draft = initiative.current_draft } }
    1.28      end
    1.29 -  },
    1.30 -  {
    1.31 -    name = "suggestion",
    1.32 -    label = _"Suggestions",
    1.33 -    content = function()
    1.34 -      execute.view{
    1.35 -        module = "suggestion",
    1.36 -        view = "_list",
    1.37 -        params = {
    1.38 -          initiative = initiative,
    1.39 -          suggestions_selector = initiative:get_reference_selector("suggestions")
    1.40 -        }
    1.41 -      }
    1.42 -      slot.put("<br />")
    1.43 -      if not initiative.issue.fully_frozen and not initiative.issue.closed then
    1.44 -        ui.link{
    1.45 -          content = function()
    1.46 -            ui.image{ static = "icons/16/comment_add.png" }
    1.47 -            slot.put(_"Add new suggestion")
    1.48 -          end,
    1.49 -          attr = { onclick = "document.getElementById('add_suggestion_form').style.display='block';return(false)" },
    1.50 -          static = "#"
    1.51 -        }
    1.52 -      end
    1.53 -    end
    1.54 -  },
    1.55 -  {
    1.56 -    name = "satisfied_supporter",
    1.57 -    label = _"Supporter",
    1.58 +  }
    1.59 +}
    1.60 +
    1.61 +if initiative.issue.ranks_available then
    1.62 +  tabs[#tabs+1] = {
    1.63 +    name = "voter",
    1.64 +    label = _"Voter",
    1.65      content = function()
    1.66        execute.view{
    1.67          module = "member",
    1.68          view = "_list",
    1.69          params = {
    1.70            initiative = initiative,
    1.71 -          members_selector =  initiative:get_reference_selector("supporting_members_snapshot")
    1.72 -            :join("issue", nil, "issue.id = direct_supporter_snapshot.issue_id")
    1.73 -            :join("direct_interest_snapshot", nil, "direct_interest_snapshot.event = issue.latest_snapshot_event AND direct_interest_snapshot.issue_id = issue.id AND direct_interest_snapshot.member_id = member.id")
    1.74 -            :add_field("direct_interest_snapshot.weight")
    1.75 -            :add_where("direct_supporter_snapshot.event = issue.latest_snapshot_event")
    1.76 -            :add_where("direct_supporter_snapshot.satisfied")
    1.77 -        }
    1.78 -      }
    1.79 -    end
    1.80 -  },
    1.81 -  {
    1.82 -    name = "supporter",
    1.83 -    label = _"Potential supporter",
    1.84 -    content = function()
    1.85 -      execute.view{
    1.86 -        module = "member",
    1.87 -        view = "_list",
    1.88 -        params = {
    1.89 -          initiative = initiative,
    1.90 -          members_selector =  initiative:get_reference_selector("supporting_members_snapshot")
    1.91 -            :join("issue", nil, "issue.id = direct_supporter_snapshot.issue_id")
    1.92 -            :join("direct_interest_snapshot", nil, "direct_interest_snapshot.event = issue.latest_snapshot_event AND direct_interest_snapshot.issue_id = issue.id AND direct_interest_snapshot.member_id = member.id")
    1.93 -            :add_field("direct_interest_snapshot.weight")
    1.94 -            :add_where("direct_supporter_snapshot.event = issue.latest_snapshot_event")
    1.95 -            :add_where("NOT direct_supporter_snapshot.satisfied")
    1.96 +          members_selector =  initiative.issue:get_reference_selector("direct_voters")
    1.97 +            :left_join("vote", nil, { "vote.initiative_id = ? AND vote.member_id = member.id", initiative.id })
    1.98 +            :add_field("direct_voter.weight as voter_weight")
    1.99 +            :add_field("coalesce(vote.grade, 0) as grade")
   1.100          }
   1.101        }
   1.102      end
   1.103 -  },
   1.104 -  {
   1.105 -    name = "initiators",
   1.106 -    label = _"Initiators",
   1.107 -    content = function()
   1.108 -      execute.view{ module = "member", view = "_list", params = { members_selector = initiative:get_reference_selector("initiating_members") } }
   1.109 -    end
   1.110 -  },
   1.111 -  {
   1.112 -    name = "drafts",
   1.113 -    label = _"Old drafts",
   1.114 -    content = function()
   1.115 -      execute.view{ module = "draft", view = "_list", params = { drafts = initiative.drafts } }
   1.116 -    end
   1.117 -  },
   1.118 -  {
   1.119 -    name = "details",
   1.120 -    label = _"Details",
   1.121 -    content = function()
   1.122 -      ui.form{
   1.123 -        attr = { class = "vertical" },
   1.124 -        record = initiative,
   1.125 -        readonly = true,
   1.126 +  }
   1.127 +end
   1.128 +
   1.129 +tabs[#tabs+1] = {
   1.130 +  name = "suggestion",
   1.131 +  label = _"Suggestions",
   1.132 +  content = function()
   1.133 +    execute.view{
   1.134 +      module = "suggestion",
   1.135 +      view = "_list",
   1.136 +      params = {
   1.137 +        initiative = initiative,
   1.138 +        suggestions_selector = initiative:get_reference_selector("suggestions")
   1.139 +      }
   1.140 +    }
   1.141 +    slot.put("<br />")
   1.142 +    if not initiative.issue.fully_frozen and not initiative.issue.closed then
   1.143 +      ui.link{
   1.144          content = function()
   1.145 -          ui.field.text{ label = _"Issue policy", value = initiative.issue.policy.name }
   1.146 -          ui.field.text{
   1.147 -            label = _"Created at",
   1.148 -            value = tostring(initiative.created)
   1.149 -          }
   1.150 -          ui.field.text{
   1.151 -            label = _"Created at",
   1.152 -            value = format.timestamp(initiative.created)
   1.153 -          }
   1.154 -          ui.field.date{ label = _"Revoked at", name = "revoked" }
   1.155 -          ui.field.boolean{ label = _"Admitted", name = "admitted" }
   1.156 -        end
   1.157 +          ui.image{ static = "icons/16/comment_add.png" }
   1.158 +          slot.put(_"Add new suggestion")
   1.159 +        end,
   1.160 +        attr = { onclick = "document.getElementById('add_suggestion_form').style.display='block';return(false)" },
   1.161 +        static = "#"
   1.162        }
   1.163      end
   1.164 -  },
   1.165 +  end
   1.166 +}
   1.167 +
   1.168 +tabs[#tabs+1] = {
   1.169 +  name = "satisfied_supporter",
   1.170 +  label = _"Supporter",
   1.171 +  content = function()
   1.172 +    execute.view{
   1.173 +      module = "member",
   1.174 +      view = "_list",
   1.175 +      params = {
   1.176 +        initiative = initiative,
   1.177 +        members_selector =  initiative:get_reference_selector("supporting_members_snapshot")
   1.178 +          :join("issue", nil, "issue.id = direct_supporter_snapshot.issue_id")
   1.179 +          :join("direct_interest_snapshot", nil, "direct_interest_snapshot.event = issue.latest_snapshot_event AND direct_interest_snapshot.issue_id = issue.id AND direct_interest_snapshot.member_id = member.id")
   1.180 +          :add_field("direct_interest_snapshot.weight")
   1.181 +          :add_where("direct_supporter_snapshot.event = issue.latest_snapshot_event")
   1.182 +          :add_where("direct_supporter_snapshot.satisfied")
   1.183 +      }
   1.184 +    }
   1.185 +  end
   1.186 +}
   1.187 +
   1.188 +tabs[#tabs+1] = {
   1.189 +  name = "supporter",
   1.190 +  label = _"Potential supporter",
   1.191 +  content = function()
   1.192 +    execute.view{
   1.193 +      module = "member",
   1.194 +      view = "_list",
   1.195 +      params = {
   1.196 +        initiative = initiative,
   1.197 +        members_selector =  initiative:get_reference_selector("supporting_members_snapshot")
   1.198 +          :join("issue", nil, "issue.id = direct_supporter_snapshot.issue_id")
   1.199 +          :join("direct_interest_snapshot", nil, "direct_interest_snapshot.event = issue.latest_snapshot_event AND direct_interest_snapshot.issue_id = issue.id AND direct_interest_snapshot.member_id = member.id")
   1.200 +          :add_field("direct_interest_snapshot.weight")
   1.201 +          :add_where("direct_supporter_snapshot.event = issue.latest_snapshot_event")
   1.202 +          :add_where("NOT direct_supporter_snapshot.satisfied")
   1.203 +      }
   1.204 +    }
   1.205 +  end
   1.206 +}
   1.207 +
   1.208 +tabs[#tabs+1] = {
   1.209 +  name = "initiators",
   1.210 +  label = _"Initiators",
   1.211 +  content = function()
   1.212 +    execute.view{ module = "member", view = "_list", params = { members_selector = initiative:get_reference_selector("initiating_members") } }
   1.213 +  end
   1.214 +}
   1.215 +
   1.216 +tabs[#tabs+1] = {
   1.217 +  name = "drafts",
   1.218 +  label = _"Old drafts",
   1.219 +  content = function()
   1.220 +    execute.view{ module = "draft", view = "_list", params = { drafts = initiative.drafts } }
   1.221 +  end
   1.222 +}
   1.223 +
   1.224 +tabs[#tabs+1] = {
   1.225 +  name = "details",
   1.226 +  label = _"Details",
   1.227 +  content = function()
   1.228 +    ui.form{
   1.229 +      attr = { class = "vertical" },
   1.230 +      record = initiative,
   1.231 +      readonly = true,
   1.232 +      content = function()
   1.233 +        ui.field.text{ label = _"Issue policy", value = initiative.issue.policy.name }
   1.234 +        ui.field.text{
   1.235 +          label = _"Created at",
   1.236 +          value = tostring(initiative.created)
   1.237 +        }
   1.238 +        ui.field.text{
   1.239 +          label = _"Created at",
   1.240 +          value = format.timestamp(initiative.created)
   1.241 +        }
   1.242 +        ui.field.date{ label = _"Revoked at", name = "revoked" }
   1.243 +        ui.field.boolean{ label = _"Admitted", name = "admitted" }
   1.244 +      end
   1.245 +    }
   1.246 +  end
   1.247  }
   1.248  
   1.249  
   1.250 +ui.tabs(tabs)
   1.251 +

Impressum / About Us