alternating table row classes. importing inside the template probably to slow?
This commit is contained in:
parent
ee7950ce7a
commit
4be46a339d
1 changed files with 6 additions and 2 deletions
|
@ -35,11 +35,15 @@
|
|||
<h2>Previous submissions</h2>
|
||||
<table py:if="poll.get_num_of_submissions() > 0">
|
||||
<tr><th>Submitter</th><th>Content</th><th>Timestamp</th></tr>
|
||||
<tr py:for="one_submission in poll.get_submissions()">
|
||||
<td>${one_submission.submitter}</td>
|
||||
<?python
|
||||
from itertools import cycle
|
||||
cls=cycle(('rowA','rowB')) ?>
|
||||
<tr py:for="one_submission in poll.get_submissions()" class="${cls.next()}">
|
||||
<td>${one_submission.submitter} </td>
|
||||
<td>${one_submission.get_markup_content()}</td>
|
||||
<td>${one_submission.get_creation_time_string()}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<span py:if="poll.get_submissions().count() == 0">No submissions posted</span>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue