liquid_feedback_frontend

annotate app/main/issue/_sidebar_whatcanido.lua @ 1767:a21703957c8f

Fixed syntax error
author bsw
date Mon Oct 18 16:02:57 2021 +0200 (2021-10-18)
parents 0a3cce889a75
children b27b327be05e
rev   line source
bsw@1045 1 local issue = param.get("issue", "table")
bsw@1045 2 local initiative = param.get("initiative", "table")
bsw@1045 3 local member = param.get("member", "table") or app.session.member
bsw@1045 4
bsw@1045 5 if initiative then
bsw@1045 6 issue = initiative.issue
bsw@1045 7 end
bsw@1045 8
bsw@1045 9 local privileged_to_vote = app.session.member and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id)
bsw@1045 10
bsw@1045 11 local active_trustee_id
bsw@1045 12 if member then
bsw@1045 13 if not issue.member_info.own_participation then
bsw@1045 14 if issue.member_info.first_trustee_participation then
bsw@1045 15 active_trustee_id = issue.member_info.first_trustee_id
bsw@1045 16 elseif issue.member_info.other_trustee_participation then
bsw@1045 17 active_trustee_id = issue.member_info.other_trustee_id
bsw@1045 18 end
bsw@1045 19 end
bsw@1045 20 end
bsw@1045 21
bsw/jbe@1309 22 local supporter
bsw@1045 23
bsw/jbe@1309 24 if initiative and app.session.member_id then
bsw/jbe@1309 25 supporter = app.session.member:get_reference_selector("supporters")
bsw/jbe@1309 26 :add_where{ "initiative_id = ?", initiative.id }
bsw/jbe@1309 27 :optional_object_mode()
bsw/jbe@1309 28 :exec()
bsw/jbe@1309 29 end
bsw/jbe@1309 30
bsw/jbe@1309 31 local view_module
bsw/jbe@1309 32 local view_id
bsw@1045 33
bsw/jbe@1309 34 if initiative then
bsw/jbe@1309 35 issue = issue
bsw/jbe@1309 36 view_module = "initiative"
bsw/jbe@1309 37 view_id = initiative.id
bsw/jbe@1309 38 else
bsw/jbe@1309 39 view_module = "issue"
bsw/jbe@1309 40 view_id = issue.id
bsw/jbe@1309 41 end
bsw@1045 42
bsw/jbe@1309 43 local initiator
bsw/jbe@1309 44 if initiative and app.session.member_id then
bsw/jbe@1309 45 initiator = Initiator:by_pk(initiative.id, app.session.member.id)
bsw/jbe@1309 46 end
bsw/jbe@1309 47
bsw/jbe@1309 48 local initiators
bsw@1045 49
bsw/jbe@1309 50 if initiative then
bsw/jbe@1309 51 local initiators_members_selector = initiative:get_reference_selector("initiating_members")
bsw/jbe@1309 52 :add_field("initiator.accepted", "accepted")
bsw/jbe@1309 53 :add_order_by("member.name")
bsw/jbe@1309 54 if initiator and initiator.accepted then
bsw/jbe@1309 55 initiators_members_selector:add_where("initiator.accepted ISNULL OR initiator.accepted")
bsw@1045 56 else
bsw/jbe@1309 57 initiators_members_selector:add_where("initiator.accepted")
bsw@1045 58 end
bsw@1045 59
bsw/jbe@1309 60 initiators = initiators_members_selector:exec()
bsw/jbe@1309 61 end
bsw@1045 62
bsw/jbe@1309 63 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw/jbe@1309 64 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
bsw/jbe@1309 65 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"What can I do here?" }
bsw/jbe@1309 66 end }
bsw/jbe@1309 67 ui.container{ attr = { class = "what-can-i-do-here" }, content = function()
bsw/jbe@1309 68
bsw/jbe@1309 69 if initiator and
bsw/jbe@1309 70 initiator.accepted and
bsw/jbe@1309 71 not issue.fully_frozen and
bsw/jbe@1309 72 not issue.closed and
bsw/jbe@1309 73 not initiative.revoked
bsw/jbe@1309 74 then
bsw@1045 75
bsw/jbe@1309 76 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw@1045 77 ui.tag { content = _"You are initiator of this initiative" }
bsw/jbe@1309 78 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 79 if issue.half_frozen then
bsw/jbe@1309 80 ui.tag { tag = "li", content = _"this issue is in verification phase, therefore the initiative text cannot be updated anymore" }
bsw/jbe@1309 81 else
bsw@1135 82 ui.tag { tag = "li", content = function ()
bsw@1135 83 ui.link{
bsw/jbe@1309 84 module = "draft", view = "new",
bsw/jbe@1309 85 params = { initiative_id = initiative.id },
bsw/jbe@1309 86 content = _"edit proposal and/or reasons"
bsw/jbe@1309 87 }
bsw/jbe@1309 88 end }
bsw/jbe@1309 89 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 90 ui.link{
bsw/jbe@1309 91 attr = { class = "action" },
bsw/jbe@1309 92 module = "initiative", view = "add_initiator",
bsw@1135 93 params = { initiative_id = initiative.id },
bsw/jbe@1309 94 content = _"invite another initiator"
bsw/jbe@1309 95 }
bsw/jbe@1309 96 end }
bsw/jbe@1309 97 if #initiative.initiators > 1 then
bsw/jbe@1309 98 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 99 ui.link{
bsw/jbe@1309 100 module = "initiative", view = "remove_initiator",
bsw/jbe@1309 101 params = { initiative_id = initiative.id },
bsw/jbe@1309 102 content = _"remove an initiator"
bsw/jbe@1309 103 }
bsw/jbe@1309 104 end }
bsw/jbe@1309 105 end
bsw/jbe@1309 106 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 107 ui.link{
bsw/jbe@1309 108 module = "initiative", view = "revoke", id = initiative.id,
bsw/jbe@1309 109 content = _"revoke initiative"
bsw@1135 110 }
bsw@1135 111 end }
bsw@1135 112 end
bsw/jbe@1309 113 end }
bsw/jbe@1309 114 end }
bsw/jbe@1309 115 end
bsw/jbe@1309 116
bsw/jbe@1309 117 -- invited as initiator
bsw/jbe@1309 118 if initiator and initiator.accepted == nil and not initiative.issue.half_frozen and not initiative.issue.closed then
bsw/jbe@1309 119 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 120 ui.tag { content = _"You are invited to become initiator of this initiative" }
bsw/jbe@1309 121 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 122 ui.tag{ tag = "li", content = function ()
bsw@1135 123 ui.link{
bsw/jbe@1309 124 content = _"accept invitation",
bsw/jbe@1309 125 module = "initiative",
bsw/jbe@1309 126 action = "accept_invitation",
bsw/jbe@1309 127 id = initiative.id,
bsw/jbe@1309 128 routing = {
bsw/jbe@1309 129 default = {
bsw/jbe@1309 130 mode = "redirect",
bsw/jbe@1309 131 module = request.get_module(),
bsw/jbe@1309 132 view = request.get_view(),
bsw/jbe@1309 133 id = request.get_id_string(),
bsw/jbe@1309 134 params = request.get_param_strings()
bsw/jbe@1309 135 }
bsw/jbe@1309 136 }
bsw@1045 137 }
bsw@1045 138 end }
bsw/jbe@1309 139
bsw/jbe@1309 140 ui.tag{ tag = "li", content = function ()
bsw/jbe@1309 141 ui.link{
bsw/jbe@1309 142 content = _"refuse invitation",
bsw/jbe@1309 143 module = "initiative",
bsw/jbe@1309 144 action = "reject_initiator_invitation",
bsw/jbe@1309 145 params = {
bsw/jbe@1309 146 initiative_id = initiative.id,
bsw/jbe@1309 147 member_id = app.session.member.id
bsw/jbe@1309 148 },
bsw/jbe@1309 149 routing = {
bsw/jbe@1309 150 default = {
bsw/jbe@1309 151 mode = "redirect",
bsw/jbe@1309 152 module = request.get_module(),
bsw/jbe@1309 153 view = request.get_view(),
bsw/jbe@1309 154 id = request.get_id_string(),
bsw/jbe@1309 155 params = request.get_param_strings()
bsw/jbe@1309 156 }
bsw@1045 157 }
bsw@1045 158 }
bsw/jbe@1309 159 end }
bsw@1045 160 end }
bsw/jbe@1309 161 end }
bsw/jbe@1309 162 end
bsw/jbe@1309 163
bsw/jbe@1309 164
bsw/jbe@1309 165 if privileged_to_vote and issue.member_info.first_trustee_id then
bsw/jbe@1309 166 local member = Member:by_id(issue.member_info.first_trustee_id)
bsw/jbe@1309 167 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 168 --[[
bsw/jbe@1309 169 ui.container { attr = { class = "right" }, content = function()
bsw/jbe@1309 170 execute.view{
bsw/jbe@1309 171 module = "member_image",
bsw/jbe@1309 172 view = "_show",
bsw@1045 173 params = {
bsw/jbe@1309 174 member = member,
bsw/jbe@1309 175 image_type = "avatar",
bsw/jbe@1309 176 show_dummy = true
bsw@1045 177 }
bsw@1045 178 }
bsw@1045 179 end }
bsw/jbe@1309 180 --]]
bsw@1045 181 if issue.member_info.own_delegation_scope == "unit" then
bsw/jbe@1309 182 ui.tag{ content = _"You delegated this organizational unit" }
bsw@1045 183 elseif issue.member_info.own_delegation_scope == "area" then
bsw/jbe@1309 184 ui.tag{ content = _"You delegated this subject area" }
bsw@1045 185 elseif issue.member_info.own_delegation_scope == "issue" then
bsw/jbe@1309 186 ui.tag{ content = _"You delegated this issue" }
bsw@1045 187 end
bsw/jbe@1309 188
bsw@1045 189 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 190 if issue.member_info.own_delegation_scope == "area" or
bsw/jbe@1309 191 issue.member_info.own_delegation_scope == "unit" then
bsw@1045 192 ui.tag { tag = "li", content = function ()
bsw@1045 193 ui.link {
bsw/jbe@1309 194 module = "delegation", view = "show", params = {
bsw/jbe@1309 195 issue_id = issue.id,
bsw/jbe@1309 196 initiative_id = initiative and initiative.id or nil
bsw/jbe@1309 197 },
bsw/jbe@1309 198 content = _"change/revoke delegation only for this issue"
bsw/jbe@1309 199 }
bsw/jbe@1309 200 end }
bsw/jbe@1309 201 end
bsw/jbe@1309 202 if issue.member_info.own_delegation_scope == "unit" then
bsw/jbe@1309 203 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 204 ui.link {
bsw/jbe@1309 205 module = "delegation", view = "show", params = {
bsw/jbe@1309 206 unit_id = issue.area.unit_id,
bsw/jbe@1309 207 },
bsw/jbe@1309 208 content = _("change/revoke delegation of organizational unit", {
bsw/jbe@1309 209 unit_name = issue.area.unit.name
bsw@1045 210 })
bsw@1045 211 }
bsw@1045 212 end }
bsw/jbe@1309 213 elseif issue.member_info.own_delegation_scope == "area" then
bsw/jbe@1309 214 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 215 ui.link {
bsw/jbe@1309 216 module = "delegation", view = "show", params = {
bsw/jbe@1309 217 area_id = issue.area_id,
bsw/jbe@1309 218 },
bsw/jbe@1309 219 content = _"change/revoke delegation of subject area"
bsw/jbe@1309 220 }
bsw/jbe@1309 221 end }
bsw@1045 222 end
bsw/jbe@1309 223 if issue.member_info.own_delegation_scope == nil then
bsw/jbe@1309 224 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 225 ui.link {
bsw/jbe@1309 226 module = "delegation", view = "show", params = {
bsw/jbe@1309 227 issue_id = issue.id,
bsw/jbe@1309 228 initiative_id = initiative and initiative.id or nil
bsw/jbe@1309 229 },
bsw/jbe@1309 230 content = _"choose issue delegatee"
bsw/jbe@1309 231 }
bsw/jbe@1309 232 end }
bsw/jbe@1309 233 elseif issue.member_info.own_delegation_scope == "issue" then
bsw@1045 234 ui.tag { tag = "li", content = function ()
bsw@1045 235 ui.link {
bsw/jbe@1309 236 module = "delegation", view = "show", params = {
bsw/jbe@1309 237 issue_id = issue.id,
bsw/jbe@1309 238 initiative_id = initiative and initiative.id or nil
bsw/jbe@1309 239 },
bsw/jbe@1309 240 content = _"change/revoke issue delegation"
bsw/jbe@1309 241 }
bsw/jbe@1309 242 end }
bsw/jbe@1309 243 end
bsw/jbe@1309 244 if issue.member_info.first_trustee_id and issue.member_info.own_participation then
bsw/jbe@1309 245 local text = _"As long as you are interested in this issue yourself, the delegation is suspended for this issue, but it will be applied again in the voting phase unless you vote yourself."
bsw/jbe@1309 246 if issue.state == "voting" then
bsw/jbe@1309 247 text = _"This delegation is suspended, because you voted yourself."
bsw/jbe@1309 248 end
bsw/jbe@1309 249 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 250 ui.container { content = text }
bsw/jbe@1309 251 end }
bsw/jbe@1309 252 end
bsw/jbe@1309 253
bsw/jbe@1309 254 end }
bsw/jbe@1309 255
bsw/jbe@1309 256 end }
bsw/jbe@1309 257 end
bsw/jbe@1309 258
bsw@1437 259 if privileged_to_vote and not issue.closed and not issue.fully_frozen then
bsw/jbe@1309 260 if issue.member_info.own_participation then
bsw/jbe@1309 261 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 262 ui.tag{ content = _("You are interested in this issue", { id = issue.id }) }
bsw/jbe@1309 263 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 264 if issue.member_info.weight and issue.member_info.weight > 1 then
bsw/jbe@1309 265 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 266 ui.link {
bsw@1624 267 module = "interest", view = "show_incoming",
bsw/jbe@1309 268 params = { issue_id = issue.id, member_id = app.session.member_id },
bsw/jbe@1309 269 content = _("you have #{count} incoming delegations", {
bsw/jbe@1309 270 count = issue.member_info.weight - 1
bsw/jbe@1309 271 })
bsw/jbe@1309 272 }
bsw/jbe@1309 273 end }
bsw/jbe@1309 274 end
bsw/jbe@1309 275 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 276 ui.link {
bsw/jbe@1309 277 module = "interest", action = "update",
bsw@1045 278 routing = { default = {
bsw/jbe@1309 279 mode = "redirect", module = view_module, view = "show", id = view_id
bsw@1045 280 } },
bsw@1618 281 params = { issue_id = issue.id, interested = false },
bsw/jbe@1309 282 text = _"remove my interest"
bsw@1045 283 }
bsw@1045 284 end }
bsw@1045 285 end }
bsw@1045 286 end }
bsw/jbe@1309 287 else
bsw/jbe@1309 288 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 289 ui.tag{ content = _("I want to participate in this issue", { id = issue.id }) }
bsw@1045 290 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 291 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 292 ui.link {
bsw/jbe@1309 293 module = "interest", action = "update",
bsw@1618 294 params = { issue_id = issue.id, interested = true },
bsw/jbe@1309 295 routing = { default = {
bsw/jbe@1309 296 mode = "redirect", module = view_module, view = "show", id = view_id
bsw/jbe@1309 297 } },
bsw/jbe@1309 298 text = _"add my interest"
bsw/jbe@1309 299 }
bsw/jbe@1309 300 end }
bsw/jbe@1309 301 ui.tag { tag = "li", content = _"browse through the competing initiatives" }
bsw/jbe@1309 302 end }
bsw/jbe@1309 303 end }
bsw/jbe@1309 304 end
bsw/jbe@1309 305
bsw/jbe@1309 306 if initiative then
bsw/jbe@1309 307
bsw/jbe@1309 308 if not initiative.member_info.supported or active_trustee_id then
bsw/jbe@1309 309 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 310 ui.tag { content = _"I like this initiative and I want to support it" }
bsw/jbe@1309 311 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw@1045 312 ui.tag { tag = "li", content = function ()
bsw@1045 313 ui.link {
bsw/jbe@1309 314 module = "initiative", action = "add_support",
bsw@1045 315 routing = { default = {
bsw@1045 316 mode = "redirect", module = "initiative", view = "show", id = initiative.id
bsw@1045 317 } },
bsw@1045 318 id = initiative.id,
bsw/jbe@1309 319 text = _"add my support"
bsw@1045 320 }
bsw@1045 321 end }
bsw@1045 322 end }
bsw@1045 323 end }
bsw@1045 324
bsw/jbe@1309 325 else -- if not supported
bsw/jbe@1309 326 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 327 --[[
bsw/jbe@1309 328 if initiative.member_info.satisfied then
bsw/jbe@1309 329 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "thumb_up" }
bsw/jbe@1309 330 else
bsw/jbe@1309 331 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "thumb_up" }
bsw/jbe@1309 332 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "warning" }
bsw@1045 333 end
bsw/jbe@1309 334 --]]
bsw/jbe@1309 335 ui.tag{ content = _"You are supporting this initiative" }
bsw/jbe@1309 336 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 337 if not initiative.member_info.satisfied then
bsw/jbe@1309 338 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 339 ui.tag { content = function ()
bsw/jbe@1309 340 ui.link {
bsw/jbe@1309 341 external = "#suggestions",
bsw/jbe@1309 342 content = _"you restricted your support by rating suggestions as must or must not"
bsw/jbe@1309 343 }
bsw/jbe@1309 344 end }
bsw/jbe@1309 345 end }
bsw/jbe@1309 346 end
bsw@1045 347 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 348 ui.tag { content = function ()
bsw/jbe@1309 349 ui.link {
bsw/jbe@1309 350 xattr = { class = "btn btn-remove" },
bsw/jbe@1309 351 module = "initiative", action = "remove_support",
bsw/jbe@1309 352 routing = { default = {
bsw/jbe@1309 353 mode = "redirect", module = "initiative", view = "show", id = initiative.id
bsw/jbe@1309 354 } },
bsw/jbe@1309 355 id = initiative.id,
bsw/jbe@1309 356 text = _"remove my support"
bsw/jbe@1309 357 }
bsw/jbe@1309 358 end }
bsw@1045 359 end }
bsw/jbe@1309 360 end }
bsw/jbe@1309 361 end }
bsw/jbe@1309 362
bsw/jbe@1309 363 end -- not supported
bsw/jbe@1309 364
bsw/jbe@1309 365 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 366 ui.tag{ content = _"I want to improve this initiative" }
bsw/jbe@1309 367 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 368 if issue.state == "verification" then
bsw/jbe@1309 369 ui.tag { tag = "li", content = _"this issue is in verification phase, therefore the initiative text cannot be updated anymore" }
bsw/jbe@1309 370 elseif issue.state == "voting" then
bsw/jbe@1309 371 ui.tag { tag = "li", content = _"this issue is in voting phase, therefore the initiative text cannot be updated anymore" }
bsw/jbe@1309 372 else
bsw/jbe@1309 373
bsw/jbe@1309 374 if initiative.member_info.initiated then
bsw/jbe@1309 375 ui.tag { tag = "li", content =_"take a look at the suggestions of your supporters" }
bsw/jbe@1309 376 ui.tag { tag = "li", content =_"if you like to implement a suggestion in your proposal and/or reasons, update your initiative draft" }
bsw/jbe@1309 377 ui.tag { tag = "li", content =_"to argue about suggestions, just add your arguments to your reasons in the initiative draft, so your supporters can learn about your opinion" }
bsw/jbe@1309 378 end
bsw/jbe@1309 379
bsw/jbe@1309 380 if not initiative.member_info.supported or active_trustee_id then
bsw/jbe@1309 381 ui.tag { tag = "li", content =_"add your support (see above) and rate or write new suggestions (and thereby restrict your support to certain conditions if necessary)" }
bsw/jbe@1309 382 else
bsw/jbe@1309 383 ui.tag { tag = "li", content = _"take a look at the suggestions (see right) and rate them" }
bsw/jbe@1309 384 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 385 ui.link {
bsw/jbe@1309 386 module = "suggestion", view = "new", params = {
bsw/jbe@1309 387 initiative_id = initiative.id
bsw/jbe@1309 388 },
bsw/jbe@1309 389 content = _"write a new suggestion"
bsw/jbe@1309 390 }
bsw/jbe@1309 391 end }
bsw/jbe@1309 392 end
bsw@1045 393 end
bsw/jbe@1309 394 end }
bsw/jbe@1309 395 end }
bsw/jbe@1309 396
bsw/jbe@1309 397 end
bsw/jbe@1309 398
bsw/jbe@1309 399 if
bsw/jbe@1309 400 (issue.state == "admission" or
bsw/jbe@1309 401 issue.state == "discussion" or
bsw/jbe@1309 402 issue.state == "verification")
bsw/jbe@1309 403 then
bsw/jbe@1309 404 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 405 if initiative then
bsw/jbe@1309 406 ui.tag{ content = _"I don't like this initiative and I want to add my opinion or counter proposal" }
bsw/jbe@1309 407 else
bsw/jbe@1309 408 ui.tag{ content = _"I don't like any of the initiative in this issue and I want to add my opinion or counter proposal" }
bsw@1045 409 end
bsw/jbe@1309 410 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 411 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 412 ui.link {
bsw/jbe@1309 413 module = "issue", view = "show", id = issue.id,
bsw/jbe@1309 414 content = _"take a look at the competing initiatives"
bsw/jbe@1309 415 }
bsw/jbe@1309 416 end }
bsw/jbe@1309 417 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 418 ui.link {
bsw@1497 419 module = "draft", view = "new",
bsw/jbe@1309 420 params = { issue_id = issue.id },
bsw/jbe@1309 421 content = _"start a new competing initiative"
bsw/jbe@1309 422 }
bsw/jbe@1309 423 end }
bsw/jbe@1309 424 end }
bsw@1045 425 end }
bsw/jbe@1309 426 end
bsw@1045 427
bsw@1045 428 end
bsw@1045 429
bsw/jbe@1309 430 if not config.disable_delegations and privileged_to_vote and not issue.closed then
bsw/jbe@1309 431
bsw/jbe@1309 432 if not issue.member_info.first_trustee_id then
bsw/jbe@1309 433 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 434 ui.tag{ content = _"I want to delegate this issue" }
bsw/jbe@1309 435
bsw/jbe@1309 436 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 437 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 438 ui.link {
bsw/jbe@1309 439 module = "delegation", view = "show", params = {
bsw/jbe@1309 440 issue_id = issue.id,
bsw/jbe@1309 441 initiative_id = initiative and initiative.id or nil
bsw/jbe@1309 442 },
bsw/jbe@1309 443 content = _"choose issue delegatee"
bsw/jbe@1309 444 }
bsw/jbe@1309 445 end }
bsw/jbe@1309 446 end }
bsw/jbe@1309 447 end }
bsw/jbe@1309 448 end
bsw/jbe@1309 449
bsw/jbe@1309 450 end
bsw/jbe@1309 451
bsw/jbe@1309 452 if initiator and initiator.accepted == false then
bsw/jbe@1309 453 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 454 ui.tag { content = _"You refused to become initiator of this initiative" }
bsw@1045 455 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 456 ui.tag{ tag = "li", content = function ()
bsw/jbe@1309 457 ui.link{
bsw/jbe@1309 458 text = _"allow invitation again",
bsw/jbe@1309 459 module = "initiative",
bsw/jbe@1309 460 action = "remove_initiator",
bsw/jbe@1309 461 params = {
bsw/jbe@1309 462 initiative_id = initiative.id,
bsw/jbe@1309 463 member_id = app.session.member.id
bsw/jbe@1309 464 },
bsw/jbe@1309 465 routing = {
bsw/jbe@1309 466 ok = {
bsw/jbe@1309 467 mode = "redirect",
bsw/jbe@1309 468 module = "initiative",
bsw/jbe@1309 469 view = "show",
bsw/jbe@1309 470 id = initiative.id
bsw/jbe@1309 471 }
bsw/jbe@1309 472 }
bsw@1045 473 }
bsw@1045 474 end }
bsw@1045 475 end }
bsw/jbe@1309 476 end }
bsw/jbe@1309 477 end
bsw@1045 478
bsw/jbe@1309 479
bsw@1045 480
bsw/jbe@1309 481 if privileged_to_vote then
bsw@1045 482
bsw/jbe@1309 483 if initiative and
bsw/jbe@1309 484 (issue.state == "admission" or
bsw/jbe@1309 485 issue.state == "discussion" or
bsw/jbe@1309 486 issue.state == "verification")
bsw/jbe@1309 487 then
bsw/jbe@1309 488
bsw/jbe@1309 489 elseif issue.state == "verification" then
bsw/jbe@1309 490
bsw/jbe@1309 491 elseif issue.state == "voting" then
bsw/jbe@1309 492 if not issue.member_info.direct_voted then
bsw/jbe@1309 493 if not issue.member_info.non_voter then
bsw/jbe@1309 494 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 495 ui.tag{ content = _"I like to vote on this issue:" }
bsw/jbe@1309 496 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 497 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 498 ui.tag { content = function ()
bsw/jbe@1309 499 if not issue.closed then
bsw/jbe@1309 500 ui.link {
bsw/jbe@1309 501 xattr = { class = "btn btn-vote" },
bsw/jbe@1309 502 module = "vote", view = "list",
bsw/jbe@1309 503 params = { issue_id = issue.id },
bsw/jbe@1309 504 text = _"vote now"
bsw/jbe@1309 505 }
bsw/jbe@1309 506 end
bsw/jbe@1309 507 end }
bsw/jbe@1309 508 end }
bsw/jbe@1309 509 end }
bsw/jbe@1309 510 end }
bsw/jbe@1309 511 end
bsw/jbe@1309 512 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 513 if not issue.member_info.non_voter then
bsw/jbe@1309 514 ui.tag{ content = _"I don't like to vote this issue (myself):" }
bsw/jbe@1309 515 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 516 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 517 ui.link{
bsw/jbe@1309 518 content = _"do not notify me about this voting anymore",
bsw/jbe@1309 519 module = "vote",
bsw/jbe@1309 520 action = "non_voter",
bsw/jbe@1309 521 params = { issue_id = issue.id },
bsw/jbe@1309 522 routing = {
bsw/jbe@1309 523 default = {
bsw/jbe@1309 524 mode = "redirect",
bsw/jbe@1309 525 module = request.get_module(),
bsw/jbe@1309 526 view = request.get_view(),
bsw/jbe@1309 527 id = request.get_id_string(),
bsw/jbe@1309 528 params = request.get_param_strings()
bsw/jbe@1309 529 }
bsw/jbe@1309 530 }
bsw/jbe@1309 531 }
bsw/jbe@1309 532 end }
bsw/jbe@1309 533 end }
bsw/jbe@1309 534 else
bsw/jbe@1309 535 ui.tag{ content = _"You do not like to vote this issue (yourself)" }
bsw/jbe@1309 536 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 537 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 538 ui.link{
bsw/jbe@1309 539 in_brackets = true,
bsw/jbe@1309 540 content = _"discard",
bsw/jbe@1309 541 module = "vote",
bsw/jbe@1309 542 action = "non_voter",
bsw/jbe@1309 543 params = { issue_id = issue.id, delete = true },
bsw/jbe@1309 544 routing = {
bsw/jbe@1309 545 default = {
bsw/jbe@1309 546 mode = "redirect",
bsw/jbe@1309 547 module = request.get_module(),
bsw/jbe@1309 548 view = request.get_view(),
bsw/jbe@1309 549 id = request.get_id_string(),
bsw/jbe@1309 550 params = request.get_param_strings()
bsw/jbe@1309 551 }
bsw/jbe@1309 552 }
bsw/jbe@1309 553 }
bsw/jbe@1309 554 end }
bsw/jbe@1309 555 end }
bsw/jbe@1309 556 end
bsw/jbe@1309 557 end }
bsw/jbe@1309 558 else
bsw/jbe@1309 559 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 560 ui.tag{ content = _"I like to change/revoke my vote:" }
bsw@1045 561 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw@1045 562 ui.tag { tag = "li", content = function ()
bsw@1045 563 ui.tag { content = function ()
bsw@1045 564 if not issue.closed then
bsw@1045 565 ui.link {
bsw@1045 566 xattr = { class = "btn btn-vote" },
bsw@1045 567 module = "vote", view = "list",
bsw@1045 568 params = { issue_id = issue.id },
bsw/jbe@1309 569 text = _"change my vote"
bsw/jbe@1309 570 }
bsw/jbe@1309 571 end
bsw/jbe@1309 572 end }
bsw/jbe@1309 573 end }
bsw/jbe@1309 574 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 575 ui.tag { content = function ()
bsw/jbe@1309 576 if not issue.closed then
bsw/jbe@1309 577 ui.link {
bsw/jbe@1309 578 module = "vote", action = "update",
bsw/jbe@1309 579 params = {
bsw/jbe@1309 580 issue_id = issue.id,
bsw/jbe@1309 581 discard = true
bsw/jbe@1309 582 },
bsw/jbe@1309 583 routing = {
bsw/jbe@1309 584 default = {
bsw/jbe@1309 585 mode = "redirect",
bsw/jbe@1309 586 module = "issue",
bsw/jbe@1309 587 view = "show",
bsw/jbe@1309 588 id = issue.id
bsw/jbe@1309 589 }
bsw/jbe@1309 590 },
bsw/jbe@1309 591 text = _"discard my vote"
bsw@1045 592 }
bsw@1045 593 end
bsw@1045 594 end }
bsw@1045 595 end }
bsw/jbe@1309 596 end }
bsw/jbe@1309 597
bsw/jbe@1309 598 end }
bsw/jbe@1309 599
bsw@1045 600 end
bsw/jbe@1309 601 end
bsw/jbe@1309 602 end
bsw/jbe@1309 603
bsw/jbe@1309 604 if not app.session.member or not privileged_to_vote then
bsw/jbe@1309 605 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw@1716 606 if not app.session.member_id then
bsw@1716 607 ui.tag{ content = _"Login to participate" }
bsw@1716 608 ui.tag{ tag = "ul", content = function()
bsw@1716 609 ui.tag{ tag = "li", content = function()
bsw@1716 610 ui.link{ module = "index", view = "login", content = _"Login" }
bsw@1716 611 end }
bsw/jbe@1309 612 end }
bsw@1716 613 else
bsw@1716 614 ui.tag{ content = _"You are not entitled to vote in this unit" }
bsw@1716 615 end
bsw/jbe@1309 616 end }
bsw/jbe@1309 617 end
bsw/jbe@1309 618
bsw/jbe@1309 619 if issue.closed then
bsw/jbe@1309 620 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 621 ui.tag { content = _"This issue is closed" }
bsw/jbe@1309 622 end }
bsw/jbe@1309 623 end
bsw/jbe@1309 624
bsw/jbe@1309 625 if initiative and config.tell_others and config.tell_others.initiative then
bsw/jbe@1309 626 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 627
bsw/jbe@1309 628 ui.heading { level = 3, content = _"Tell others about this initiative:" }
bsw/jbe@1309 629 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 630
bsw/jbe@1309 631 for i, link in ipairs (config.tell_others.initiative(initiative)) do
bsw/jbe@1309 632 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 633 ui.link ( link )
bsw@1045 634 end }
bsw@1045 635 end
bsw/jbe@1309 636
bsw@1045 637 end }
bsw/jbe@1309 638 end }
bsw@1045 639 end
bsw/jbe@1309 640 end }
bsw@1045 641
bsw/jbe@1309 642 end }

Impressum / About Us