liquid_feedback_frontend

annotate app/main/issue/_sidebar_whatcanido.lua @ 1497:a59dd2ae9cd8

Fixed links
author bsw
date Tue Feb 11 15:29:46 2020 +0100 (2020-02-11)
parents 9d15d509b5f6
children dcbe505ddf24
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 --[[
bsw/jbe@1309 263 ui.container{ attr = { class = "right" }, content = function()
bsw/jbe@1309 264 ui.image{ attr = { class = "right" }, static = "icons/48/eye.png" }
bsw/jbe@1309 265 if issue.member_info.weight and issue.member_info.weight > 1 then
bsw/jbe@1309 266 slot.put("<br />")
bsw/jbe@1309 267 ui.tag{
bsw/jbe@1309 268 attr = { class = "right" },
bsw/jbe@1309 269 content = "+" .. issue.member_info.weight - 1
bsw/jbe@1309 270 }
bsw/jbe@1309 271 end
bsw/jbe@1309 272 end }
bsw/jbe@1309 273 --]]
bsw/jbe@1309 274 ui.tag{ content = _("You are interested in this issue", { id = issue.id }) }
bsw/jbe@1309 275 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 276 if issue.member_info.weight and issue.member_info.weight > 1 then
bsw/jbe@1309 277 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 278 ui.link {
bsw/jbe@1309 279 module = "delegation", view = "show_incoming",
bsw/jbe@1309 280 params = { issue_id = issue.id, member_id = app.session.member_id },
bsw/jbe@1309 281 content = _("you have #{count} incoming delegations", {
bsw/jbe@1309 282 count = issue.member_info.weight - 1
bsw/jbe@1309 283 })
bsw/jbe@1309 284 }
bsw/jbe@1309 285 end }
bsw/jbe@1309 286 end
bsw/jbe@1309 287 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 288 ui.link {
bsw/jbe@1309 289 module = "interest", action = "update",
bsw@1045 290 routing = { default = {
bsw/jbe@1309 291 mode = "redirect", module = view_module, view = "show", id = view_id
bsw@1045 292 } },
bsw/jbe@1309 293 params = { issue_id = issue.id, delete = true },
bsw/jbe@1309 294 text = _"remove my interest"
bsw@1045 295 }
bsw@1045 296 end }
bsw@1045 297 end }
bsw@1045 298 end }
bsw/jbe@1309 299 else
bsw/jbe@1309 300 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 301 ui.tag{ content = _("I want to participate in this issue", { id = issue.id }) }
bsw@1045 302 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 303 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 304 ui.link {
bsw/jbe@1309 305 module = "interest", action = "update",
bsw/jbe@1309 306 params = { issue_id = issue.id },
bsw/jbe@1309 307 routing = { default = {
bsw/jbe@1309 308 mode = "redirect", module = view_module, view = "show", id = view_id
bsw/jbe@1309 309 } },
bsw/jbe@1309 310 text = _"add my interest"
bsw/jbe@1309 311 }
bsw/jbe@1309 312 end }
bsw/jbe@1309 313 ui.tag { tag = "li", content = _"browse through the competing initiatives" }
bsw/jbe@1309 314 end }
bsw/jbe@1309 315 end }
bsw/jbe@1309 316 end
bsw/jbe@1309 317
bsw/jbe@1309 318 if initiative then
bsw/jbe@1309 319
bsw/jbe@1309 320 if not initiative.member_info.supported or active_trustee_id then
bsw/jbe@1309 321 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 322 ui.tag { content = _"I like this initiative and I want to support it" }
bsw/jbe@1309 323 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw@1045 324 ui.tag { tag = "li", content = function ()
bsw@1045 325 ui.link {
bsw/jbe@1309 326 module = "initiative", action = "add_support",
bsw@1045 327 routing = { default = {
bsw@1045 328 mode = "redirect", module = "initiative", view = "show", id = initiative.id
bsw@1045 329 } },
bsw@1045 330 id = initiative.id,
bsw/jbe@1309 331 text = _"add my support"
bsw@1045 332 }
bsw@1045 333 end }
bsw@1045 334 end }
bsw@1045 335 end }
bsw@1045 336
bsw/jbe@1309 337 else -- if not supported
bsw/jbe@1309 338 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 339 --[[
bsw/jbe@1309 340 if initiative.member_info.satisfied then
bsw/jbe@1309 341 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "thumb_up" }
bsw/jbe@1309 342 else
bsw/jbe@1309 343 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "thumb_up" }
bsw/jbe@1309 344 ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "warning" }
bsw@1045 345 end
bsw/jbe@1309 346 --]]
bsw/jbe@1309 347 ui.tag{ content = _"You are supporting this initiative" }
bsw/jbe@1309 348 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 349 if not initiative.member_info.satisfied then
bsw/jbe@1309 350 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 351 ui.tag { content = function ()
bsw/jbe@1309 352 ui.link {
bsw/jbe@1309 353 external = "#suggestions",
bsw/jbe@1309 354 content = _"you restricted your support by rating suggestions as must or must not"
bsw/jbe@1309 355 }
bsw/jbe@1309 356 end }
bsw/jbe@1309 357 end }
bsw/jbe@1309 358 end
bsw@1045 359 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 360 ui.tag { content = function ()
bsw/jbe@1309 361 ui.link {
bsw/jbe@1309 362 xattr = { class = "btn btn-remove" },
bsw/jbe@1309 363 module = "initiative", action = "remove_support",
bsw/jbe@1309 364 routing = { default = {
bsw/jbe@1309 365 mode = "redirect", module = "initiative", view = "show", id = initiative.id
bsw/jbe@1309 366 } },
bsw/jbe@1309 367 id = initiative.id,
bsw/jbe@1309 368 text = _"remove my support"
bsw/jbe@1309 369 }
bsw/jbe@1309 370 end }
bsw@1045 371 end }
bsw/jbe@1309 372 end }
bsw/jbe@1309 373 end }
bsw/jbe@1309 374
bsw/jbe@1309 375 end -- not supported
bsw/jbe@1309 376
bsw/jbe@1309 377 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 378 ui.tag{ content = _"I want to improve this initiative" }
bsw/jbe@1309 379 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 380 if issue.state == "verification" then
bsw/jbe@1309 381 ui.tag { tag = "li", content = _"this issue is in verification phase, therefore the initiative text cannot be updated anymore" }
bsw/jbe@1309 382 elseif issue.state == "voting" then
bsw/jbe@1309 383 ui.tag { tag = "li", content = _"this issue is in voting phase, therefore the initiative text cannot be updated anymore" }
bsw/jbe@1309 384 else
bsw/jbe@1309 385
bsw/jbe@1309 386 if initiative.member_info.initiated then
bsw/jbe@1309 387 ui.tag { tag = "li", content =_"take a look at the suggestions of your supporters" }
bsw/jbe@1309 388 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 389 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 390 end
bsw/jbe@1309 391
bsw/jbe@1309 392 if not initiative.member_info.supported or active_trustee_id then
bsw/jbe@1309 393 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 394 else
bsw/jbe@1309 395 ui.tag { tag = "li", content = _"take a look at the suggestions (see right) and rate them" }
bsw/jbe@1309 396 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 397 ui.link {
bsw/jbe@1309 398 module = "suggestion", view = "new", params = {
bsw/jbe@1309 399 initiative_id = initiative.id
bsw/jbe@1309 400 },
bsw/jbe@1309 401 content = _"write a new suggestion"
bsw/jbe@1309 402 }
bsw/jbe@1309 403 end }
bsw/jbe@1309 404 end
bsw@1045 405 end
bsw/jbe@1309 406 end }
bsw/jbe@1309 407 end }
bsw/jbe@1309 408
bsw/jbe@1309 409 end
bsw/jbe@1309 410
bsw/jbe@1309 411 if
bsw/jbe@1309 412 (issue.state == "admission" or
bsw/jbe@1309 413 issue.state == "discussion" or
bsw/jbe@1309 414 issue.state == "verification")
bsw/jbe@1309 415 then
bsw/jbe@1309 416 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 417 if initiative then
bsw/jbe@1309 418 ui.tag{ content = _"I don't like this initiative and I want to add my opinion or counter proposal" }
bsw/jbe@1309 419 else
bsw/jbe@1309 420 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 421 end
bsw/jbe@1309 422 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 423 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 424 ui.link {
bsw/jbe@1309 425 module = "issue", view = "show", id = issue.id,
bsw/jbe@1309 426 content = _"take a look at the competing initiatives"
bsw/jbe@1309 427 }
bsw/jbe@1309 428 end }
bsw/jbe@1309 429 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 430 ui.link {
bsw@1497 431 module = "draft", view = "new",
bsw/jbe@1309 432 params = { issue_id = issue.id },
bsw/jbe@1309 433 content = _"start a new competing initiative"
bsw/jbe@1309 434 }
bsw/jbe@1309 435 end }
bsw/jbe@1309 436 end }
bsw@1045 437 end }
bsw/jbe@1309 438 end
bsw@1045 439
bsw@1045 440 end
bsw@1045 441
bsw/jbe@1309 442 if not config.disable_delegations and privileged_to_vote and not issue.closed then
bsw/jbe@1309 443
bsw/jbe@1309 444 if not issue.member_info.first_trustee_id then
bsw/jbe@1309 445 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 446 ui.tag{ content = _"I want to delegate this issue" }
bsw/jbe@1309 447
bsw/jbe@1309 448 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 449 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 450 ui.link {
bsw/jbe@1309 451 module = "delegation", view = "show", params = {
bsw/jbe@1309 452 issue_id = issue.id,
bsw/jbe@1309 453 initiative_id = initiative and initiative.id or nil
bsw/jbe@1309 454 },
bsw/jbe@1309 455 content = _"choose issue delegatee"
bsw/jbe@1309 456 }
bsw/jbe@1309 457 end }
bsw/jbe@1309 458 end }
bsw/jbe@1309 459 end }
bsw/jbe@1309 460 end
bsw/jbe@1309 461
bsw/jbe@1309 462 end
bsw/jbe@1309 463
bsw/jbe@1309 464 if initiator and initiator.accepted == false then
bsw/jbe@1309 465 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 466 ui.tag { content = _"You refused to become initiator of this initiative" }
bsw@1045 467 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 468 ui.tag{ tag = "li", content = function ()
bsw/jbe@1309 469 ui.link{
bsw/jbe@1309 470 text = _"allow invitation again",
bsw/jbe@1309 471 module = "initiative",
bsw/jbe@1309 472 action = "remove_initiator",
bsw/jbe@1309 473 params = {
bsw/jbe@1309 474 initiative_id = initiative.id,
bsw/jbe@1309 475 member_id = app.session.member.id
bsw/jbe@1309 476 },
bsw/jbe@1309 477 routing = {
bsw/jbe@1309 478 ok = {
bsw/jbe@1309 479 mode = "redirect",
bsw/jbe@1309 480 module = "initiative",
bsw/jbe@1309 481 view = "show",
bsw/jbe@1309 482 id = initiative.id
bsw/jbe@1309 483 }
bsw/jbe@1309 484 }
bsw@1045 485 }
bsw@1045 486 end }
bsw@1045 487 end }
bsw/jbe@1309 488 end }
bsw/jbe@1309 489 end
bsw@1045 490
bsw/jbe@1309 491
bsw@1045 492
bsw/jbe@1309 493 if privileged_to_vote then
bsw@1045 494
bsw/jbe@1309 495 if initiative and
bsw/jbe@1309 496 (issue.state == "admission" or
bsw/jbe@1309 497 issue.state == "discussion" or
bsw/jbe@1309 498 issue.state == "verification")
bsw/jbe@1309 499 then
bsw/jbe@1309 500
bsw/jbe@1309 501 elseif issue.state == "verification" then
bsw/jbe@1309 502
bsw/jbe@1309 503 elseif issue.state == "voting" then
bsw/jbe@1309 504 if not issue.member_info.direct_voted then
bsw/jbe@1309 505 if not issue.member_info.non_voter then
bsw/jbe@1309 506 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 507 ui.tag{ content = _"I like to vote on this issue:" }
bsw/jbe@1309 508 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 509 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 510 ui.tag { content = function ()
bsw/jbe@1309 511 if not issue.closed then
bsw/jbe@1309 512 ui.link {
bsw/jbe@1309 513 xattr = { class = "btn btn-vote" },
bsw/jbe@1309 514 module = "vote", view = "list",
bsw/jbe@1309 515 params = { issue_id = issue.id },
bsw/jbe@1309 516 text = _"vote now"
bsw/jbe@1309 517 }
bsw/jbe@1309 518 end
bsw/jbe@1309 519 end }
bsw/jbe@1309 520 end }
bsw/jbe@1309 521 end }
bsw/jbe@1309 522 end }
bsw/jbe@1309 523 end
bsw/jbe@1309 524 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 525 if not issue.member_info.non_voter then
bsw/jbe@1309 526 ui.tag{ content = _"I don't like to vote this issue (myself):" }
bsw/jbe@1309 527 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 528 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 529 ui.link{
bsw/jbe@1309 530 content = _"do not notify me about this voting anymore",
bsw/jbe@1309 531 module = "vote",
bsw/jbe@1309 532 action = "non_voter",
bsw/jbe@1309 533 params = { issue_id = issue.id },
bsw/jbe@1309 534 routing = {
bsw/jbe@1309 535 default = {
bsw/jbe@1309 536 mode = "redirect",
bsw/jbe@1309 537 module = request.get_module(),
bsw/jbe@1309 538 view = request.get_view(),
bsw/jbe@1309 539 id = request.get_id_string(),
bsw/jbe@1309 540 params = request.get_param_strings()
bsw/jbe@1309 541 }
bsw/jbe@1309 542 }
bsw/jbe@1309 543 }
bsw/jbe@1309 544 end }
bsw/jbe@1309 545 end }
bsw/jbe@1309 546 else
bsw/jbe@1309 547 ui.tag{ content = _"You do not like to vote this issue (yourself)" }
bsw/jbe@1309 548 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 549 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 550 ui.link{
bsw/jbe@1309 551 in_brackets = true,
bsw/jbe@1309 552 content = _"discard",
bsw/jbe@1309 553 module = "vote",
bsw/jbe@1309 554 action = "non_voter",
bsw/jbe@1309 555 params = { issue_id = issue.id, delete = true },
bsw/jbe@1309 556 routing = {
bsw/jbe@1309 557 default = {
bsw/jbe@1309 558 mode = "redirect",
bsw/jbe@1309 559 module = request.get_module(),
bsw/jbe@1309 560 view = request.get_view(),
bsw/jbe@1309 561 id = request.get_id_string(),
bsw/jbe@1309 562 params = request.get_param_strings()
bsw/jbe@1309 563 }
bsw/jbe@1309 564 }
bsw/jbe@1309 565 }
bsw/jbe@1309 566 end }
bsw/jbe@1309 567 end }
bsw/jbe@1309 568 end
bsw/jbe@1309 569 end }
bsw/jbe@1309 570 else
bsw/jbe@1309 571 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 572 ui.tag{ content = _"I like to change/revoke my vote:" }
bsw@1045 573 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw@1045 574 ui.tag { tag = "li", content = function ()
bsw@1045 575 ui.tag { content = function ()
bsw@1045 576 if not issue.closed then
bsw@1045 577 ui.link {
bsw@1045 578 xattr = { class = "btn btn-vote" },
bsw@1045 579 module = "vote", view = "list",
bsw@1045 580 params = { issue_id = issue.id },
bsw/jbe@1309 581 text = _"change my vote"
bsw/jbe@1309 582 }
bsw/jbe@1309 583 end
bsw/jbe@1309 584 end }
bsw/jbe@1309 585 end }
bsw/jbe@1309 586 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 587 ui.tag { content = function ()
bsw/jbe@1309 588 if not issue.closed then
bsw/jbe@1309 589 ui.link {
bsw/jbe@1309 590 module = "vote", action = "update",
bsw/jbe@1309 591 params = {
bsw/jbe@1309 592 issue_id = issue.id,
bsw/jbe@1309 593 discard = true
bsw/jbe@1309 594 },
bsw/jbe@1309 595 routing = {
bsw/jbe@1309 596 default = {
bsw/jbe@1309 597 mode = "redirect",
bsw/jbe@1309 598 module = "issue",
bsw/jbe@1309 599 view = "show",
bsw/jbe@1309 600 id = issue.id
bsw/jbe@1309 601 }
bsw/jbe@1309 602 },
bsw/jbe@1309 603 text = _"discard my vote"
bsw@1045 604 }
bsw@1045 605 end
bsw@1045 606 end }
bsw@1045 607 end }
bsw/jbe@1309 608 end }
bsw/jbe@1309 609
bsw/jbe@1309 610 end }
bsw/jbe@1309 611
bsw@1045 612 end
bsw/jbe@1309 613 end
bsw/jbe@1309 614 end
bsw/jbe@1309 615
bsw/jbe@1309 616 if not app.session.member or not privileged_to_vote then
bsw/jbe@1309 617 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 618 ui.tag{ content = _"You are not entitled to vote in this unit" }
bsw/jbe@1309 619 ui.tag{ tag = "ul", content = function()
bsw/jbe@1309 620 ui.tag{ tag = "li", content = function()
bsw/jbe@1309 621 ui.link{ module = "index", view = "login", content = _"Login" }
bsw/jbe@1309 622 end }
bsw/jbe@1309 623 end }
bsw/jbe@1309 624 end }
bsw/jbe@1309 625 end
bsw/jbe@1309 626
bsw/jbe@1309 627 if issue.closed then
bsw/jbe@1309 628 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 629 ui.tag { content = _"This issue is closed" }
bsw/jbe@1309 630 end }
bsw/jbe@1309 631 end
bsw/jbe@1309 632
bsw/jbe@1309 633 if initiative and config.tell_others and config.tell_others.initiative then
bsw/jbe@1309 634 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 635
bsw/jbe@1309 636 ui.heading { level = 3, content = _"Tell others about this initiative:" }
bsw/jbe@1309 637 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 638
bsw/jbe@1309 639 for i, link in ipairs (config.tell_others.initiative(initiative)) do
bsw/jbe@1309 640 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 641 ui.link ( link )
bsw@1045 642 end }
bsw@1045 643 end
bsw/jbe@1309 644
bsw@1045 645 end }
bsw/jbe@1309 646 end }
bsw@1045 647 end
bsw/jbe@1309 648 end }
bsw@1045 649
bsw/jbe@1309 650 end }

Impressum / About Us