liquid_feedback_frontend
view app/main/index/index.lua @ 10:72c5e0ee7c98
Version beta6
Bugfixes:
- Security fix: Every user was able to change the discussion URL of an initiative
- Creation of new issues in areas without default policies is now possible
- Members can now be sorted in different ways
- No error when trying to compare a draft with itself
- Added missing local statement to variable initialization in app/main/delegation/new.lua
- CSS flaw in initiative action bar fixed
New features:
- Possiblity to invite other users to become initiator
- Revokation of initiatives implemented
- Number of suggestions, supporters, etc. is shown on corresponding tabs of initiative view
- Members can now be sorted by account creation (default sorting is "newest first")
- Configuration option to create an automatic discussion link for all issues
- First draft of global timeline feature (not accessible via link yet)
- Custom stylesheet URL for users marked as developers
In area listing the number of closed issues is shown too
Renamed "author" field of initiative to "last author"
Removed wrongly included file app/main/member/_show_thumb.lua.orig in the distribution
Help texts updated
Bugfixes:
- Security fix: Every user was able to change the discussion URL of an initiative
- Creation of new issues in areas without default policies is now possible
- Members can now be sorted in different ways
- No error when trying to compare a draft with itself
- Added missing local statement to variable initialization in app/main/delegation/new.lua
- CSS flaw in initiative action bar fixed
New features:
- Possiblity to invite other users to become initiator
- Revokation of initiatives implemented
- Number of suggestions, supporters, etc. is shown on corresponding tabs of initiative view
- Members can now be sorted by account creation (default sorting is "newest first")
- Configuration option to create an automatic discussion link for all issues
- First draft of global timeline feature (not accessible via link yet)
- Custom stylesheet URL for users marked as developers
In area listing the number of closed issues is shown too
Renamed "author" field of initiative to "last author"
Removed wrongly included file app/main/member/_show_thumb.lua.orig in the distribution
Help texts updated
author | bsw |
---|---|
date | Sun Jan 10 12:00:00 2010 +0100 (2010-01-10) |
parents | 0ee1e0c42d4c |
children | a3ac899559de |
line source
1 slot.select("title", function()
2 if app.session.member then
3 execute.view{
4 module = "member_image",
5 view = "_show",
6 params = {
7 member = app.session.member,
8 image_type = "avatar"
9 }
10 }
11 end
12 end)
14 slot.select("title", function()
15 ui.container{
16 attr = { class = "lang_chooser" },
17 content = function()
18 for i, lang in ipairs{"en", "de"} do
19 ui.link{
20 content = function()
21 ui.image{
22 static = "lang/" .. lang .. ".png",
23 attr = { style = "margin-left: 0.5em;", alt = lang }
24 }
25 end,
26 module = "index",
27 action = "set_lang",
28 params = { lang = lang },
29 routing = {
30 default = {
31 mode = "redirect",
32 module = request.get_module(),
33 view = request.get_view(),
34 id = param.get_id_cgi(),
35 params = param.get_all_cgi()
36 }
37 }
38 }
39 end
40 end
41 }
42 end)
44 slot.put_into("title", encode.html(config.app_title))
46 slot.select("actions", function()
48 if app.session.member then
49 ui.link{
50 content = function()
51 ui.image{ static = "icons/16/application_form.png" }
52 slot.put(_"Edit my profile")
53 end,
54 module = "member",
55 view = "edit"
56 }
58 ui.link{
59 content = function()
60 ui.image{ static = "icons/16/user_gray.png" }
61 slot.put(_"Upload images")
62 end,
63 module = "member",
64 view = "edit_images"
65 }
67 execute.view{
68 module = "delegation",
69 view = "_show_box"
70 }
72 ui.link{
73 content = function()
74 ui.image{ static = "icons/16/wrench.png" }
75 slot.put(_"Settings")
76 end,
77 module = "member",
78 view = "settings"
79 }
81 if config.download_dir then
82 ui.link{
83 content = function()
84 ui.image{ static = "icons/16/database_save.png" }
85 slot.put(_"Download")
86 end,
87 module = "index",
88 view = "download"
89 }
90 end
91 end
92 end)
94 local lang = locale.get("lang")
95 local basepath = request.get_app_basepath()
96 local file_name = basepath .. "/locale/motd/" .. lang .. ".txt"
97 local file = io.open(file_name)
98 if file ~= nil then
99 local help_text = file:read("*a")
100 if #help_text > 0 then
101 ui.container{
102 attr = { class = "motd wiki" },
103 content = function()
104 slot.put(format.wiki_text(help_text))
105 end
106 }
107 end
108 end
111 util.help("index.index", _"Home")
113 local areas = {}
114 if app.session.member then
115 local selector = Area:new_selector()
116 :reset_fields()
117 :add_field("area.id", nil, { "grouped" })
118 :add_field("area.name", nil, { "grouped" })
119 :add_field("membership.member_id NOTNULL", "is_member", { "grouped" })
120 :add_field("count(issue.id)", "issues_to_vote_count")
121 :add_field("count(interest.member_id)", "interested_issues_to_vote_count")
122 :join("issue", nil, "issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL")
123 :left_join("direct_voter", nil, { "direct_voter.issue_id = issue.id AND direct_voter.member_id = ?", app.session.member.id })
124 :add_where{ "direct_voter.member_id ISNULL" }
125 :left_join("interest", nil, { "interest.issue_id = issue.id AND interest.member_id = ?", app.session.member.id })
126 :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ? ", app.session.member.id })
128 for i, area in ipairs(selector:exec()) do
129 if area.is_member or area.interested_issues_to_vote_count > 0 then
130 areas[#areas+1] = area
131 end
132 end
133 end
135 if #areas > 0 then
136 ui.container{
137 attr = { style = "font-weight: bold;" },
138 content = _"Current votings in areas you are member of and issues you are interested in:"
139 }
141 ui.list{
142 records = areas,
143 columns = {
144 {
145 name = "name"
146 },
147 {
148 content = function(record)
149 if record.is_member and record.issues_to_vote_count > 0 then
150 ui.link{
151 content = function()
152 if record.issues_to_vote_count > 1 then
153 slot.put(_("#{issues_to_vote_count} issue(s)", { issues_to_vote_count = record.issues_to_vote_count }))
154 else
155 slot.put(_("One issue"))
156 end
157 end,
158 module = "area",
159 view = "show",
160 id = record.id,
161 params = {
162 filter = "frozen",
163 filter_voting = "not_voted"
164 }
165 }
166 else
167 slot.put(_"Not a member")
168 end
169 end
170 },
171 {
172 content = function(record)
173 if record.interested_issues_to_vote_count > 0 then
174 ui.link{
175 content = function()
176 if record.interested_issues_to_vote_count > 1 then
177 slot.put(_("#{interested_issues_to_vote_count} issue(s) you are interested in", { interested_issues_to_vote_count = record.interested_issues_to_vote_count }))
178 else
179 slot.put(_"One issue you are interested in")
180 end
181 end,
182 module = "area",
183 view = "show",
184 id = record.id,
185 params = {
186 filter = "frozen",
187 filter_interest = "my",
188 filter_voting = "not_voted"
189 }
190 }
191 end
192 end
193 },
194 }
195 }
196 end
198 local initiatives_selector = Initiative:new_selector()
199 :join("initiator", nil, { "initiator.initiative_id = initiative.id AND initiator.member_id = ? AND initiator.accepted ISNULL", app.session.member.id })
201 if initiatives_selector:count() > 0 then
202 ui.container{
203 attr = { style = "font-weight: bold;" },
204 content = _"Initiatives that invited you to become initiator:"
205 }
207 execute.view{
208 module = "initiative",
209 view = "_list",
210 params = { initiatives_selector = initiatives_selector }
211 }
212 end
215 if app.session.member then
216 execute.view{
217 module = "member",
218 view = "_show",
219 params = { member = app.session.member }
220 }
221 end