poll

NAML documentation   Watch a video
   Usages of this macro
... in poll.naml
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
<macro name="poll" requires="node">
    <n.comment
Macro
Parameters: text
.>
        Builds the poll interface. Since some options depend on the current visitor, we use javascript
        to set up some fields. Please look at the "poll_js" macro in order to understand how this poll UI is updated.
    </n.comment.>
    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.has_poll
Binary
Namespace: NodeNamespaceExt
Parameters: do
>
        <then>
            <form method="POST" id="poll_form[n.id
Binary
Namespace: NodeNamespace
/]" onsubmit="return Nabble.vote([n.id
Binary
Namespace: NodeNamespace
/],[n.poll_max_choices
Binary
Namespace: NodeNamespaceExt
Parameters: do
/]);" accept-charset="UTF-8" >
                <input type="hidden" name="node" value="[n.id
Binary
Namespace: NodeNamespace
/]" />
 
                <div class="medium-border-color border2 rounded" style="margin-top:1em;padding:1em">
                    <div class="big-title second-font">
                        <n.encode
Binary
Namespace: BasicNamespace
Parameters: text
.poll_question
Binary
Namespace: NodeNamespaceExt
Parameters: do
/>
                    </div>
                    <n.explain_poll_max_choices
Macro
/>
 
                    <n.poll_option_list
Binary
Namespace: NodeNamespaceExt
Parameters: do
.loop
Macro
Requires: sequence
Parameters: by, do
.>
                        <div style="margin:.4em 0 0 1em">
                            <span id="poll-option-input[n.option_id
Binary
Namespace: PollOptionList
/]"></span>
                            <label for="option[n.option_id
Binary
Namespace: PollOptionList
/]"><n.encode
Binary
Namespace: BasicNamespace
Parameters: text
.current_string
Binary
Namespace: StringList
/></label>
                            <span id="poll-vote-count[n.option_id
Binary
Namespace: PollOptionList
/]" class="weak-color" style="font-size:80%"></span>
                        </div>
                    </n.poll_option_list.loop.>
 
                    <div style="margin-top:.7em">
                        <n.poll_submit_button
Macro
Requires: node
/>
                        &nbsp;&nbsp;
                        <n.poll_total_votes
Macro
Requires: node
/>
                    </div>
                    <n.poll_description_lines
Macro
/>
                </div>
            </form>
            <n.call_later
Binary
Namespace: NabbleNamespace
Parameters: param, value
 value="[n.id
Binary
Namespace: NodeNamespace
/]" param="poll_node_id"/>
        </then>
    </n.if.has_poll>
</macro>