2007-08-11 17:16:21 poll1
( fscript )
  1  #!/usr/bin/fscript
2 (NSBundle bundleWithPath:'/…/TS.bundle') load.
3 page := Page pageWithTitle:'Quick Political Pulse Poll #1'.
4
5 questions := (NSString stringWithContentsOfFile:'polls/poll1.questions') split:'\n'.
6 numberValue := [ :i | { (i stringValue), (questions at:i) } ].
7
8 page setField:'questions' withValues:(numberValue value:@(questions size iota)) forKeys:{'qid', 'question'}.
9 page display.

The code to Poll #1 in the template system used here, and using the following template:
( html )
  1  <div class="blog">
2 <p>Quick survey. Where do you stand, basically, on these issues?</p>
3
4 <form action="poll1r" method="post">
5 <div id="poll1">
6 <table border="0" cellpadding="0" cellspacing="0" align="center">
7 <tr id="header"><th id="issues">Issues</th><th>Support</th><th>Oppose</th><th>Dunno</th></tr>
8 <field: questions>
9 <tr>
10 <td><field: question /></td>
11 <th><input type="radio" name="q<field: qid />" value="1"/></th>
12 <th><input type="radio" name="q<field: qid />" value="0"/></th>
13 <th><input type="radio" name="q<field: qid />" value="2"/></th>
14 </tr>
15 </field: questions>
16 </table>
17 <input style="margin-top:30px" type="submit" value="Submit these answers and compare with candidates!">
18 </div>
19 </form>
20 </div>
  • Jeff (Wed, January 16th, 2008, 2:58am UTC)
    One can even reference stuff in the main blog posting from the discussion thread, both specific spans like this or whole div cross-references like this. But I still need to make a smooth way to let the reader / poster know which reference is which. And should [ crossReference=…] be the tag? It's a bit long to type.

Leave a comment