liquid_feedback_frontend
annotate app/main/index/index.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
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 | 0ee1e0c42d4c |
rev | line source |
---|---|
bsw/jbe@0 | 1 slot.select("title", function() |
bsw/jbe@4 | 2 execute.view{ |
bsw/jbe@4 | 3 module = "member_image", |
bsw/jbe@4 | 4 view = "_show", |
bsw/jbe@4 | 5 params = { |
bsw/jbe@4 | 6 member = app.session.member, |
bsw/jbe@4 | 7 image_type = "avatar" |
bsw/jbe@4 | 8 } |
bsw/jbe@0 | 9 } |
bsw/jbe@0 | 10 end) |
bsw/jbe@0 | 11 |
bsw/jbe@0 | 12 slot.select("title", function() |
bsw/jbe@0 | 13 ui.container{ |
bsw/jbe@0 | 14 attr = { class = "lang_chooser" }, |
bsw/jbe@0 | 15 content = function() |
bsw/jbe@0 | 16 for i, lang in ipairs{"en", "de"} do |
bsw/jbe@0 | 17 ui.link{ |
bsw/jbe@0 | 18 content = function() |
bsw/jbe@0 | 19 ui.image{ |
bsw/jbe@0 | 20 static = "lang/" .. lang .. ".png", |
bsw/jbe@0 | 21 attr = { style = "margin-left: 0.5em;", alt = lang } |
bsw/jbe@0 | 22 } |
bsw/jbe@0 | 23 end, |
bsw/jbe@0 | 24 module = "index", |
bsw/jbe@0 | 25 action = "set_lang", |
bsw/jbe@0 | 26 params = { lang = lang }, |
bsw/jbe@0 | 27 routing = { |
bsw/jbe@0 | 28 default = { |
bsw/jbe@0 | 29 mode = "redirect", |
bsw/jbe@0 | 30 module = request.get_module(), |
bsw/jbe@0 | 31 view = request.get_view(), |
bsw/jbe@0 | 32 id = param.get_id_cgi(), |
bsw/jbe@0 | 33 params = param.get_all_cgi() |
bsw/jbe@0 | 34 } |
bsw/jbe@0 | 35 } |
bsw/jbe@0 | 36 } |
bsw/jbe@0 | 37 end |
bsw/jbe@0 | 38 end |
bsw/jbe@0 | 39 } |
bsw/jbe@0 | 40 end) |
bsw/jbe@0 | 41 |
bsw/jbe@0 | 42 slot.put_into("title", encode.html(config.app_title)) |
bsw/jbe@0 | 43 |
bsw/jbe@0 | 44 slot.select("actions", function() |
bsw/jbe@4 | 45 |
bsw/jbe@4 | 46 ui.link{ |
bsw/jbe@4 | 47 content = function() |
bsw/jbe@4 | 48 ui.image{ static = "icons/16/application_form.png" } |
bsw/jbe@4 | 49 slot.put(_"Edit my profile") |
bsw/jbe@4 | 50 end, |
bsw/jbe@4 | 51 module = "member", |
bsw/jbe@4 | 52 view = "edit" |
bsw/jbe@4 | 53 } |
bsw/jbe@0 | 54 |
bsw/jbe@0 | 55 ui.link{ |
bsw/jbe@0 | 56 content = function() |
bsw/jbe@0 | 57 ui.image{ static = "icons/16/user_gray.png" } |
bsw/jbe@4 | 58 slot.put(_"Upload images") |
bsw/jbe@0 | 59 end, |
bsw/jbe@0 | 60 module = "member", |
bsw/jbe@4 | 61 view = "edit_images" |
bsw/jbe@0 | 62 } |
bsw/jbe@0 | 63 |
bsw/jbe@4 | 64 execute.view{ |
bsw/jbe@4 | 65 module = "delegation", |
bsw/jbe@4 | 66 view = "_show_box" |
bsw/jbe@0 | 67 } |
bsw/jbe@0 | 68 |
bsw/jbe@0 | 69 ui.link{ |
bsw/jbe@0 | 70 content = function() |
bsw/jbe@0 | 71 ui.image{ static = "icons/16/key.png" } |
bsw/jbe@0 | 72 slot.put(_"Change password") |
bsw/jbe@0 | 73 end, |
bsw/jbe@0 | 74 module = "index", |
bsw/jbe@0 | 75 view = "change_password" |
bsw/jbe@0 | 76 } |
bsw/jbe@4 | 77 |
bsw/jbe@6 | 78 if config.download_dir then |
bsw/jbe@6 | 79 ui.link{ |
bsw/jbe@6 | 80 content = function() |
bsw/jbe@6 | 81 ui.image{ static = "icons/16/database_save.png" } |
bsw/jbe@6 | 82 slot.put(_"Download") |
bsw/jbe@6 | 83 end, |
bsw/jbe@6 | 84 module = "index", |
bsw/jbe@6 | 85 view = "download" |
bsw/jbe@6 | 86 } |
bsw/jbe@6 | 87 end |
bsw/jbe@0 | 88 end) |
bsw/jbe@0 | 89 |
bsw/jbe@4 | 90 local lang = locale.get("lang") |
bsw/jbe@4 | 91 local basepath = request.get_app_basepath() |
bsw/jbe@4 | 92 local file_name = basepath .. "/locale/motd/" .. lang .. ".txt" |
bsw/jbe@4 | 93 local file = io.open(file_name) |
bsw/jbe@4 | 94 if file ~= nil then |
bsw/jbe@4 | 95 local help_text = file:read("*a") |
bsw/jbe@4 | 96 if #help_text > 0 then |
bsw/jbe@4 | 97 ui.container{ |
bsw/jbe@4 | 98 attr = { class = "motd wiki" }, |
bsw/jbe@4 | 99 content = function() |
bsw/jbe@4 | 100 slot.put(format.wiki_text(help_text)) |
bsw/jbe@4 | 101 end |
bsw/jbe@4 | 102 } |
bsw/jbe@4 | 103 end |
bsw/jbe@4 | 104 end |
bsw/jbe@4 | 105 |
bsw/jbe@4 | 106 |
bsw/jbe@4 | 107 util.help("index.index", _"Home") |
bsw/jbe@4 | 108 |
bsw/jbe@5 | 109 |
bsw/jbe@5 | 110 local selector = Area:new_selector() |
bsw/jbe@5 | 111 :reset_fields() |
bsw/jbe@5 | 112 :add_field("area.id", nil, { "grouped" }) |
bsw/jbe@5 | 113 :add_field("area.name", nil, { "grouped" }) |
bsw/jbe@5 | 114 :add_field("membership.member_id NOTNULL", "is_member", { "grouped" }) |
bsw/jbe@5 | 115 :add_field("count(issue.id)", "issues_to_vote_count") |
bsw/jbe@5 | 116 :add_field("count(interest.member_id)", "interested_issues_to_vote_count") |
bsw/jbe@5 | 117 :join("issue", nil, "issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL") |
bsw/jbe@5 | 118 :left_join("direct_voter", nil, { "direct_voter.issue_id = issue.id AND direct_voter.member_id = ?", app.session.member.id }) |
bsw/jbe@5 | 119 :add_where{ "direct_voter.member_id ISNULL" } |
bsw/jbe@5 | 120 :left_join("interest", nil, { "interest.issue_id = issue.id AND interest.member_id = ?", app.session.member.id }) |
bsw/jbe@5 | 121 :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ? ", app.session.member.id }) |
bsw/jbe@5 | 122 |
bsw/jbe@5 | 123 local areas = {} |
bsw/jbe@5 | 124 for i, area in ipairs(selector:exec()) do |
bsw/jbe@5 | 125 if area.is_member or area.interested_issues_to_vote_count > 0 then |
bsw/jbe@5 | 126 areas[#areas+1] = area |
bsw/jbe@5 | 127 end |
bsw/jbe@5 | 128 end |
bsw/jbe@5 | 129 |
bsw/jbe@5 | 130 if #areas > 0 then |
bsw/jbe@5 | 131 ui.container{ |
bsw/jbe@5 | 132 attr = { style = "font-weight: bold;" }, |
bsw/jbe@5 | 133 content = _"Current votings in areas you are member of and issues you are interested in:" |
bsw/jbe@5 | 134 } |
bsw/jbe@5 | 135 |
bsw/jbe@5 | 136 ui.list{ |
bsw/jbe@5 | 137 records = areas, |
bsw/jbe@5 | 138 columns = { |
bsw/jbe@5 | 139 { |
bsw/jbe@5 | 140 name = "name" |
bsw/jbe@5 | 141 }, |
bsw/jbe@5 | 142 { |
bsw/jbe@5 | 143 content = function(record) |
bsw/jbe@5 | 144 if record.is_member and record.issues_to_vote_count > 0 then |
bsw/jbe@5 | 145 ui.link{ |
bsw/jbe@5 | 146 content = function() |
bsw/jbe@5 | 147 if record.issues_to_vote_count > 1 then |
bsw/jbe@5 | 148 slot.put(_("#{issues_to_vote_count} issue(s)", { issues_to_vote_count = record.issues_to_vote_count })) |
bsw/jbe@5 | 149 else |
bsw/jbe@5 | 150 slot.put(_("One issue")) |
bsw/jbe@5 | 151 end |
bsw/jbe@5 | 152 end, |
bsw/jbe@5 | 153 module = "area", |
bsw/jbe@5 | 154 view = "show", |
bsw/jbe@5 | 155 id = record.id, |
bsw/jbe@5 | 156 params = { |
bsw/jbe@5 | 157 filter = "frozen", |
bsw/jbe@5 | 158 filter_voting = "not_voted" |
bsw/jbe@5 | 159 } |
bsw/jbe@5 | 160 } |
bsw/jbe@5 | 161 else |
bsw/jbe@5 | 162 slot.put(_"Not a member") |
bsw/jbe@5 | 163 end |
bsw/jbe@5 | 164 end |
bsw/jbe@5 | 165 }, |
bsw/jbe@5 | 166 { |
bsw/jbe@5 | 167 content = function(record) |
bsw/jbe@5 | 168 if record.interested_issues_to_vote_count > 0 then |
bsw/jbe@5 | 169 ui.link{ |
bsw/jbe@5 | 170 content = function() |
bsw/jbe@5 | 171 if record.interested_issues_to_vote_count > 1 then |
bsw/jbe@5 | 172 slot.put(_("#{interested_issues_to_vote_count} issue(s) you are interested in", { interested_issues_to_vote_count = record.interested_issues_to_vote_count })) |
bsw/jbe@5 | 173 else |
bsw/jbe@5 | 174 slot.put(_"One issue you are interested in") |
bsw/jbe@5 | 175 end |
bsw/jbe@5 | 176 end, |
bsw/jbe@5 | 177 module = "area", |
bsw/jbe@5 | 178 view = "show", |
bsw/jbe@5 | 179 id = record.id, |
bsw/jbe@5 | 180 params = { |
bsw/jbe@5 | 181 filter = "frozen", |
bsw/jbe@5 | 182 filter_interest = "my", |
bsw/jbe@5 | 183 filter_voting = "not_voted" |
bsw/jbe@5 | 184 } |
bsw/jbe@5 | 185 } |
bsw/jbe@5 | 186 end |
bsw/jbe@5 | 187 end |
bsw/jbe@5 | 188 }, |
bsw/jbe@5 | 189 } |
bsw/jbe@5 | 190 } |
bsw/jbe@5 | 191 end |
bsw/jbe@5 | 192 |
bsw/jbe@0 | 193 execute.view{ |
bsw/jbe@0 | 194 module = "member", |
bsw/jbe@0 | 195 view = "_show", |
bsw/jbe@0 | 196 params = { member = app.session.member } |
bsw/jbe@0 | 197 } |
bsw/jbe@0 | 198 |