liquid_feedback_frontend

annotate app/main/vote/list.lua @ 879:ea3d3757ddc3

Added support for voting comments
author bsw
date Mon Aug 20 01:00:09 2012 +0200 (2012-08-20)
parents c4144daf6906
children fe39c1fb541b
rev   line source
bsw/jbe@19 1 local issue = Issue:by_id(param.get("issue_id"), atom.integer)
bsw/jbe@19 2
bsw/jbe@19 3 local member_id = param.get("member_id", atom.integer)
bsw/jbe@19 4 local member
bsw/jbe@19 5
bsw@879 6 local preview = param.get("preview") or param.get("preview2") == "1" and true or false
poelzi@156 7
bsw/jbe@19 8 if member_id then
bsw/jbe@19 9 if not issue.closed then
bsw/jbe@19 10 error("access denied")
bsw/jbe@19 11 end
bsw/jbe@19 12 member = Member:by_id(member_id)
bsw/jbe@19 13 readonly = true
bsw/jbe@19 14 end
bsw/jbe@19 15
poelzi@138 16 if issue.closed then
poelzi@156 17 if not member then
poelzi@158 18 member = app.session.member
poelzi@158 19 end
poelzi@156 20 readonly = true
poelzi@138 21 end
poelzi@138 22
bsw@879 23 local submit_button_text = _"Finish voting"
bsw@879 24
bsw@879 25 if issue.closed then
bsw@879 26 submit_button_text = _"Update voting comment"
bsw@879 27 end
bsw@879 28
bsw@879 29 local direct_voter
bsw@879 30
bsw/jbe@19 31 if member then
bsw@879 32 direct_voter = DirectVoter:by_pk(issue.id, member.id)
poelzi@156 33 local str = _("Ballot of '#{member_name}' for issue ##{issue_id}",
poelzi@156 34 {member_name = string.format('<a href="%s">%s</a>',
poelzi@156 35 encode.url{
poelzi@156 36 module = "member",
poelzi@156 37 view = "show",
poelzi@156 38 id = member.id,
poelzi@156 39 },
poelzi@156 40 encode.html(member.name)),
poelzi@156 41 issue_id = string.format('<a href="%s">%s</a>',
poelzi@156 42 encode.url{
poelzi@156 43 module = "issue",
poelzi@156 44 view = "show",
poelzi@156 45 id = issue.id,
poelzi@156 46 },
poelzi@156 47 encode.html(tostring(issue.id)))
poelzi@156 48 }
poelzi@156 49 )
bsw@604 50 ui.title(str)
bsw/jbe@19 51 else
bsw/jbe@19 52 member = app.session.member
bsw@879 53
bsw@879 54 direct_voter = DirectVoter:by_pk(issue.id, member.id)
bsw@879 55
bsw@604 56 ui.title(_"Voting")
bsw/jbe@19 57
bsw@604 58 ui.actions(function()
bsw/jbe@19 59 ui.link{
bsw@604 60 text = _"Cancel",
bsw/jbe@19 61 module = "issue",
bsw/jbe@19 62 view = "show",
bsw/jbe@19 63 id = issue.id
bsw/jbe@19 64 }
bsw@879 65 if direct_voter then
bsw@879 66 slot.put(" &middot; ")
bsw@879 67 ui.link{
bsw@879 68 text = _"Discard voting",
bsw@879 69 module = "vote",
bsw@879 70 action = "update",
bsw@879 71 params = {
bsw@879 72 issue_id = issue.id,
bsw@879 73 discard = true
bsw@879 74 },
bsw@879 75 routing = {
bsw@879 76 default = {
bsw@879 77 mode = "redirect",
bsw@879 78 module = "issue",
bsw@879 79 view = "show",
bsw@879 80 id = issue.id
bsw@879 81 }
bsw@26 82 }
bsw@26 83 }
bsw@879 84 end
bsw/jbe@19 85 end)
bsw/jbe@19 86 end
bsw/jbe@19 87
bsw/jbe@19 88
bsw@879 89
bsw/jbe@19 90 local tempvoting_string = param.get("scoring")
bsw/jbe@19 91
bsw/jbe@19 92 local tempvotings = {}
bsw/jbe@19 93 if tempvoting_string then
bsw/jbe@19 94 for match in tempvoting_string:gmatch("([^;]+)") do
bsw/jbe@19 95 for initiative_id, grade in match:gmatch("([^:;]+):([^:;]+)") do
bsw/jbe@19 96 tempvotings[tonumber(initiative_id)] = tonumber(grade)
bsw/jbe@19 97 end
bsw/jbe@5 98 end
bsw/jbe@19 99 end
bsw/jbe@5 100
bsw@95 101 local initiatives = issue:get_reference_selector("initiatives"):add_where("initiative.admitted"):add_order_by("initiative.satisfied_supporter_count DESC"):exec()
bsw/jbe@5 102
bsw/jbe@5 103 local min_grade = -1;
bsw/jbe@5 104 local max_grade = 1;
bsw/jbe@5 105
bsw/jbe@5 106 for i, initiative in ipairs(initiatives) do
bsw/jbe@5 107 -- TODO performance
bsw/jbe@19 108 initiative.vote = Vote:by_pk(initiative.id, member.id)
bsw/jbe@19 109 if tempvotings[initiative.id] then
bsw/jbe@19 110 initiative.vote = {}
bsw/jbe@19 111 initiative.vote.grade = tempvotings[initiative.id]
bsw/jbe@19 112 end
bsw/jbe@5 113 if initiative.vote then
bsw/jbe@5 114 if initiative.vote.grade > max_grade then
bsw/jbe@5 115 max_grade = initiative.vote.grade
bsw/jbe@5 116 end
bsw/jbe@5 117 if initiative.vote.grade < min_grade then
bsw/jbe@5 118 min_grade = initiative.vote.grade
bsw/jbe@5 119 end
bsw/jbe@5 120 end
bsw/jbe@5 121 end
bsw/jbe@5 122
bsw/jbe@5 123 local sections = {}
bsw/jbe@5 124 for i = min_grade, max_grade do
bsw/jbe@5 125 sections[i] = {}
bsw/jbe@5 126 for j, initiative in ipairs(initiatives) do
bsw/jbe@5 127 if (initiative.vote and initiative.vote.grade == i) or (not initiative.vote and i == 0) then
bsw/jbe@5 128 sections[i][#(sections[i])+1] = initiative
bsw/jbe@5 129 end
bsw/jbe@5 130 end
bsw/jbe@5 131 end
bsw/jbe@5 132
bsw/jbe@19 133 local approval_count, disapproval_count = 0, 0
bsw/jbe@19 134 for i = min_grade, -1 do
bsw/jbe@19 135 if #sections[i] > 0 then
bsw/jbe@19 136 disapproval_count = disapproval_count + 1
bsw/jbe@19 137 end
bsw/jbe@19 138 end
bsw/jbe@19 139 local approval_count = 0
bsw/jbe@19 140 for i = 1, max_grade do
bsw/jbe@19 141 if #sections[i] > 0 then
bsw/jbe@19 142 approval_count = approval_count + 1
bsw/jbe@19 143 end
bsw/jbe@19 144 end
bsw/jbe@5 145
bsw/jbe@5 146
bsw/jbe@5 147
bsw/jbe@19 148 if not readonly then
bsw/jbe@19 149 util.help("vote.list", _"Voting")
bsw/jbe@19 150 slot.put('<script src="' .. request.get_relative_baseurl() .. 'static/js/dragdrop.js"></script>')
bsw/jbe@19 151 slot.put('<script src="' .. request.get_relative_baseurl() .. 'static/js/voting.js"></script>')
bsw/jbe@19 152 end
bsw/jbe@19 153
bsw/jbe@19 154 ui.script{
bsw/jbe@19 155 script = function()
bsw/jbe@19 156 slot.put(
bsw/jbe@19 157 "voting_text_approval_single = ", encode.json(_"Approval [single entry]"), ";\n",
bsw/jbe@19 158 "voting_text_approval_multi = ", encode.json(_"Approval [many entries]"), ";\n",
bsw/jbe@19 159 "voting_text_first_preference_single = ", encode.json(_"Approval (first preference) [single entry]"), ";\n",
bsw/jbe@19 160 "voting_text_first_preference_multi = ", encode.json(_"Approval (first preference) [many entries]"), ";\n",
bsw/jbe@19 161 "voting_text_second_preference_single = ", encode.json(_"Approval (second preference) [single entry]"), ";\n",
bsw/jbe@19 162 "voting_text_second_preference_multi = ", encode.json(_"Approval (second preference) [many entries]"), ";\n",
bsw/jbe@19 163 "voting_text_third_preference_single = ", encode.json(_"Approval (third preference) [single entry]"), ";\n",
bsw/jbe@19 164 "voting_text_third_preference_multi = ", encode.json(_"Approval (third preference) [many entries]"), ";\n",
bsw/jbe@19 165 "voting_text_numeric_preference_single = ", encode.json(_"Approval (#th preference) [single entry]"), ";\n",
bsw/jbe@19 166 "voting_text_numeric_preference_multi = ", encode.json(_"Approval (#th preference) [many entries]"), ";\n",
bsw/jbe@19 167 "voting_text_abstention_single = ", encode.json(_"Abstention [single entry]"), ";\n",
bsw/jbe@19 168 "voting_text_abstention_multi = ", encode.json(_"Abstention [many entries]"), ";\n",
bsw/jbe@19 169 "voting_text_disapproval_above_one_single = ", encode.json(_"Disapproval (prefer to lower block) [single entry]"), ";\n",
bsw/jbe@19 170 "voting_text_disapproval_above_one_multi = ", encode.json(_"Disapproval (prefer to lower block) [many entries]"), ";\n",
bsw/jbe@19 171 "voting_text_disapproval_above_many_single = ", encode.json(_"Disapproval (prefer to lower blocks) [single entry]"), ";\n",
bsw/jbe@19 172 "voting_text_disapproval_above_many_multi = ", encode.json(_"Disapproval (prefer to lower blocks) [many entries]"), ";\n",
bsw/jbe@19 173 "voting_text_disapproval_above_last_single = ", encode.json(_"Disapproval (prefer to last block) [single entry]"), ";\n",
bsw/jbe@19 174 "voting_text_disapproval_above_last_multi = ", encode.json(_"Disapproval (prefer to last block) [many entries]"), ";\n",
bsw/jbe@19 175 "voting_text_disapproval_single = ", encode.json(_"Disapproval [single entry]"), ";\n",
bsw/jbe@19 176 "voting_text_disapproval_multi = ", encode.json(_"Disapproval [many entries]"), ";\n"
bsw/jbe@19 177 )
bsw/jbe@19 178 end
bsw/jbe@19 179 }
bsw/jbe@5 180
bsw/jbe@5 181 ui.form{
bsw@879 182 record = direct_voter,
bsw/jbe@19 183 attr = {
bsw/jbe@19 184 id = "voting_form",
bsw/jbe@19 185 class = readonly and "voting_form_readonly" or "voting_form_active"
bsw/jbe@19 186 },
bsw/jbe@5 187 module = "vote",
bsw/jbe@5 188 action = "update",
bsw/jbe@5 189 params = { issue_id = issue.id },
bsw/jbe@5 190 content = function()
bsw@879 191 if not readonly or preview then
bsw/jbe@19 192 local scoring = param.get("scoring")
bsw/jbe@19 193 if not scoring then
bsw/jbe@19 194 for i, initiative in ipairs(initiatives) do
bsw/jbe@19 195 local vote = initiative.vote
bsw/jbe@19 196 if vote then
bsw/jbe@19 197 tempvotings[initiative.id] = vote.grade
bsw@522 198 else
bsw@522 199 tempvotings[initiative.id] = 0
bsw/jbe@19 200 end
bsw/jbe@19 201 end
bsw/jbe@19 202 local tempvotings_list = {}
bsw/jbe@19 203 for key, val in pairs(tempvotings) do
bsw/jbe@19 204 tempvotings_list[#tempvotings_list+1] = tostring(key) .. ":" .. tostring(val)
bsw/jbe@19 205 end
bsw/jbe@19 206 if #tempvotings_list > 0 then
bsw/jbe@19 207 scoring = table.concat(tempvotings_list, ";")
bsw/jbe@19 208 else
bsw/jbe@19 209 scoring = ""
bsw/jbe@19 210 end
bsw/jbe@19 211 end
bsw/jbe@19 212 slot.put('<input type="hidden" name="scoring" value="' .. scoring .. '"/>')
bsw/jbe@19 213 -- TODO abstrahieren
bsw/jbe@19 214 ui.tag{
bsw/jbe@19 215 tag = "input",
bsw/jbe@19 216 attr = {
bsw@86 217 type = "submit",
bsw@879 218 class = "voting_done1",
bsw@879 219 value = submit_button_text
bsw/jbe@19 220 }
bsw/jbe@5 221 }
bsw/jbe@19 222 end
bsw/jbe@5 223 ui.container{
bsw/jbe@5 224 attr = { id = "voting" },
bsw/jbe@5 225 content = function()
bsw/jbe@19 226 local approval_index, disapproval_index = 0, 0
bsw/jbe@5 227 for grade = max_grade, min_grade, -1 do
bsw/jbe@19 228 local entries = sections[grade]
bsw/jbe@5 229 local class
bsw/jbe@5 230 if grade > 0 then
bsw/jbe@5 231 class = "approval"
bsw/jbe@5 232 elseif grade < 0 then
bsw/jbe@5 233 class = "disapproval"
bsw/jbe@5 234 else
bsw/jbe@5 235 class = "abstention"
bsw/jbe@5 236 end
bsw/jbe@19 237 if
bsw/jbe@19 238 #entries > 0 or
bsw/jbe@19 239 (grade == 1 and not approval_used) or
bsw/jbe@19 240 (grade == -1 and not disapproval_used) or
bsw/jbe@19 241 grade == 0
bsw/jbe@19 242 then
bsw/jbe@19 243 ui.container{
bsw/jbe@19 244 attr = { class = class },
bsw/jbe@19 245 content = function()
bsw/jbe@19 246 local heading
bsw/jbe@19 247 if class == "approval" then
bsw/jbe@19 248 approval_used = true
bsw/jbe@19 249 approval_index = approval_index + 1
bsw/jbe@19 250 if approval_count > 1 then
bsw/jbe@19 251 if approval_index == 1 then
bsw/jbe@19 252 if #entries == 1 then
bsw/jbe@19 253 heading = _"Approval (first preference) [single entry]"
bsw/jbe@19 254 else
bsw/jbe@19 255 heading = _"Approval (first preference) [many entries]"
bsw/jbe@19 256 end
bsw/jbe@19 257 elseif approval_index == 2 then
bsw/jbe@19 258 if #entries == 1 then
bsw/jbe@19 259 heading = _"Approval (second preference) [single entry]"
bsw/jbe@19 260 else
bsw/jbe@19 261 heading = _"Approval (second preference) [many entries]"
bsw/jbe@19 262 end
bsw/jbe@19 263 elseif approval_index == 3 then
bsw/jbe@19 264 if #entries == 1 then
bsw/jbe@19 265 heading = _"Approval (third preference) [single entry]"
bsw/jbe@19 266 else
bsw/jbe@19 267 heading = _"Approval (third preference) [many entries]"
bsw/jbe@19 268 end
bsw/jbe@19 269 else
bsw/jbe@19 270 if #entries == 1 then
bsw/jbe@19 271 heading = _"Approval (#th preference) [single entry]"
bsw/jbe@19 272 else
bsw/jbe@19 273 heading = _"Approval (#th preference) [many entries]"
bsw/jbe@19 274 end
bsw/jbe@19 275 end
bsw/jbe@19 276 else
bsw/jbe@19 277 if #entries == 1 then
bsw/jbe@19 278 heading = _"Approval [single entry]"
bsw/jbe@19 279 else
bsw/jbe@19 280 heading = _"Approval [many entries]"
bsw/jbe@19 281 end
bsw/jbe@19 282 end
bsw/jbe@19 283 elseif class == "abstention" then
bsw/jbe@19 284 if #entries == 1 then
bsw/jbe@19 285 heading = _"Abstention [single entry]"
bsw/jbe@19 286 else
bsw/jbe@19 287 heading = _"Abstention [many entries]"
bsw/jbe@19 288 end
bsw/jbe@19 289 elseif class == "disapproval" then
bsw/jbe@19 290 disapproval_used = true
bsw/jbe@19 291 disapproval_index = disapproval_index + 1
bsw/jbe@19 292 if disapproval_count > disapproval_index + 1 then
bsw/jbe@19 293 if #entries == 1 then
bsw/jbe@19 294 heading = _"Disapproval (prefer to lower blocks) [single entry]"
bsw/jbe@19 295 else
bsw/jbe@19 296 heading = _"Disapproval (prefer to lower blocks) [many entries]"
bsw/jbe@19 297 end
bsw/jbe@19 298 elseif disapproval_count == 2 and disapproval_index == 1 then
bsw/jbe@19 299 if #entries == 1 then
bsw/jbe@19 300 heading = _"Disapproval (prefer to lower block) [single entry]"
bsw/jbe@19 301 else
bsw/jbe@19 302 heading = _"Disapproval (prefer to lower block) [many entries]"
bsw/jbe@19 303 end
bsw/jbe@19 304 elseif disapproval_index == disapproval_count - 1 then
bsw/jbe@19 305 if #entries == 1 then
bsw/jbe@19 306 heading = _"Disapproval (prefer to last block) [single entry]"
bsw/jbe@19 307 else
bsw/jbe@19 308 heading = _"Disapproval (prefer to last block) [many entries]"
bsw/jbe@19 309 end
bsw/jbe@19 310 else
bsw/jbe@19 311 if #entries == 1 then
bsw/jbe@19 312 heading = _"Disapproval [single entry]"
bsw/jbe@19 313 else
bsw/jbe@19 314 heading = _"Disapproval [many entries]"
bsw/jbe@6 315 end
bsw/jbe@19 316 end
bsw/jbe@19 317 end
bsw/jbe@19 318 ui.tag {
bsw/jbe@19 319 tag = "div",
bsw/jbe@19 320 attr = { class = "cathead" },
bsw/jbe@19 321 content = heading
bsw/jbe@19 322 }
bsw/jbe@19 323 for i, initiative in ipairs(entries) do
bsw/jbe@19 324 ui.container{
bsw/jbe@19 325 attr = {
bsw/jbe@19 326 class = "movable",
bsw/jbe@19 327 id = "entry_" .. tostring(initiative.id)
bsw/jbe@19 328 },
bsw/jbe@19 329 content = function()
bsw/jbe@19 330 local initiators_selector = initiative:get_reference_selector("initiating_members")
bsw/jbe@19 331 :add_where("accepted")
bsw/jbe@19 332 local initiators = initiators_selector:exec()
bsw/jbe@19 333 local initiator_names = {}
bsw/jbe@19 334 for i, initiator in ipairs(initiators) do
bsw/jbe@19 335 initiator_names[#initiator_names+1] = initiator.name
bsw/jbe@19 336 end
bsw/jbe@19 337 local initiator_names_string = table.concat(initiator_names, ", ")
bsw/jbe@19 338 ui.container{
bsw@519 339 attr = { style = "float: right; position: relative;" },
bsw/jbe@19 340 content = function()
bsw/jbe@19 341 ui.link{
bsw/jbe@19 342 attr = { class = "clickable" },
bsw/jbe@19 343 content = _"Show",
bsw/jbe@19 344 module = "initiative",
bsw/jbe@19 345 view = "show",
bsw/jbe@19 346 id = initiative.id
bsw/jbe@19 347 }
bsw/jbe@19 348 slot.put(" ")
bsw/jbe@19 349 ui.link{
bsw/jbe@19 350 attr = { class = "clickable", target = "_blank" },
bsw/jbe@19 351 content = _"(new window)",
bsw/jbe@19 352 module = "initiative",
bsw/jbe@19 353 view = "show",
bsw/jbe@19 354 id = initiative.id
bsw/jbe@19 355 }
bsw/jbe@19 356 if not readonly then
bsw/jbe@19 357 slot.put(" ")
bsw/jbe@19 358 ui.image{ attr = { class = "grabber" }, static = "icons/grabber.png" }
bsw/jbe@19 359 end
bsw/jbe@19 360 end
bsw/jbe@19 361 }
bsw/jbe@19 362 if not readonly then
bsw/jbe@19 363 ui.container{
bsw@519 364 attr = { style = "float: left; position: relative;" },
bsw/jbe@19 365 content = function()
bsw/jbe@19 366 ui.tag{
bsw/jbe@19 367 tag = "input",
bsw/jbe@19 368 attr = {
bsw@519 369 onclick = "if (jsFail) return true; voting_moveUp(this.parentNode.parentNode); return(false);",
bsw@519 370 name = "move_up_" .. tostring(initiative.id),
bsw/jbe@19 371 class = not disabled and "clickable" or nil,
bsw/jbe@19 372 type = "image",
bsw/jbe@19 373 src = encode.url{ static = "icons/move_up.png" },
bsw/jbe@19 374 alt = _"Move up"
bsw/jbe@19 375 }
bsw/jbe@19 376 }
bsw/jbe@19 377 slot.put("&nbsp;")
bsw/jbe@19 378 ui.tag{
bsw/jbe@19 379 tag = "input",
bsw/jbe@19 380 attr = {
bsw@519 381 onclick = "if (jsFail) return true; voting_moveDown(this.parentNode.parentNode); return(false);",
bsw@519 382 name = "move_down_" .. tostring(initiative.id),
bsw/jbe@19 383 class = not disabled and "clickable" or nil,
bsw/jbe@19 384 type = "image",
bsw/jbe@19 385 src = encode.url{ static = "icons/move_down.png" },
bsw/jbe@19 386 alt = _"Move down"
bsw/jbe@19 387 }
bsw/jbe@19 388 }
bsw/jbe@19 389 slot.put("&nbsp;")
bsw/jbe@19 390 end
bsw/jbe@6 391 }
bsw/jbe@6 392 end
bsw/jbe@6 393 ui.container{
bsw/jbe@19 394 content = function()
bsw@285 395 ui.tag{ content = "i" .. initiative.id .. ": " }
bsw@285 396 ui.tag{ content = initiative.shortened_name }
bsw@286 397 slot.put("<br />")
bsw@286 398 for i, initiator in ipairs(initiators) do
bsw@286 399 ui.link{
bsw@286 400 attr = { class = "clickable" },
bsw@286 401 content = function ()
bsw@286 402 execute.view{
bsw@286 403 module = "member_image",
bsw@286 404 view = "_show",
bsw@286 405 params = {
bsw@286 406 member = initiator,
bsw@286 407 image_type = "avatar",
bsw@286 408 show_dummy = true,
bsw@286 409 class = "micro_avatar",
bsw@286 410 popup_text = text
bsw@286 411 }
bsw@286 412 }
bsw@286 413 end,
bsw@286 414 module = "member", view = "show", id = initiator.id
bsw/jbe@19 415 }
bsw@286 416 slot.put(" ")
bsw@290 417 ui.tag{ content = initiator.name }
bsw@286 418 slot.put(" ")
bsw/jbe@19 419 end
bsw/jbe@19 420 end
bsw/jbe@6 421 }
bsw/jbe@6 422 end
bsw/jbe@19 423 }
bsw/jbe@19 424 end
bsw/jbe@5 425 end
bsw/jbe@19 426 }
bsw/jbe@19 427 end
bsw/jbe@5 428 end
bsw/jbe@5 429 end
bsw/jbe@5 430 }
bsw@879 431 if app.session.member_id and preview then
bsw@879 432 local formatting_engine = param.get("formatting_engine")
bsw@879 433 local comment = param.get("comment")
bsw@879 434 local rendered_comment = format.wiki_text(comment, formatting_engine)
bsw@879 435 slot.put(rendered_comment)
bsw@879 436 end
bsw@879 437 if (readonly or direct_voter.comment) and not preview then
bsw@879 438 ui.heading{ level = "2", content = _("Voting comment (last updated: #{timestamp})", { timestamp = format.timestamp(direct_voter.comment_changed) }) }
bsw@879 439 if direct_voter.comment then
bsw@879 440 local rendered_comment = direct_voter:get_content('html')
bsw@879 441 ui.container{ attr = { class = "member_statement" }, content = function()
bsw@879 442 slot.put(rendered_comment)
bsw@879 443 end }
bsw@879 444 slot.put("<br />")
bsw@879 445 end
bsw@879 446 end
bsw@879 447 if app.session.member_id and app.session.member_id == member.id then
bsw@879 448 if not readonly or direct_voter then
bsw@879 449 ui.field.hidden{ name = "update_comment", value = param.get("update_comment") or issue.closed and "1" }
bsw@879 450 ui.field.select{
bsw@879 451 label = _"Wiki engine for statement",
bsw@879 452 name = "formatting_engine",
bsw@879 453 foreign_records = {
bsw@879 454 { id = "rocketwiki", name = "RocketWiki" },
bsw@879 455 { id = "compat", name = _"Traditional wiki syntax" }
bsw@879 456 },
bsw@879 457 attr = {id = "formatting_engine"},
bsw@879 458 foreign_id = "id",
bsw@879 459 foreign_name = "name",
bsw@879 460 value = param.get("formatting_engine") or direct_voter and direct_voter.formatting_engine
bsw/jbe@19 461 }
bsw@879 462 ui.field.text{
bsw@879 463 label = _"Voting comment (optional)",
bsw@879 464 name = "comment",
bsw@879 465 multiline = true,
bsw@879 466 value = param.get("comment") or direct_voter and direct_voter.comment,
bsw@879 467 attr = { style = "height: 20ex;" },
bsw@879 468 }
bsw@879 469 ui.field.hidden{ name = "preview2", attr = { id = "preview2" }, value = "0" }
bsw@879 470 ui.submit{
bsw@879 471 name = "preview",
bsw@879 472 value = _"Preview voting comment",
bsw@879 473 attr = { class = "preview" }
bsw@879 474 }
bsw@879 475 end
bsw@879 476 if not readonly or preview or direct_voter then
bsw@879 477 slot.put(" ")
bsw@879 478 ui.tag{
bsw@879 479 tag = "input",
bsw@879 480 attr = {
bsw@879 481 type = "submit",
bsw@879 482 class = "voting_done2",
bsw@879 483 value = submit_button_text
bsw@879 484 }
bsw@879 485 }
bsw@879 486 end
bsw/jbe@19 487 end
bsw/jbe@5 488 end
bsw/jbe@5 489 }
bsw/jbe@5 490
bsw/jbe@5 491

Impressum / About Us