output.append(""" <tr class="row%(count)s"> <td>%(name)s</td> <td> </td> <td style="padding:0;"><a class="block_link" href="exec.py?mode=remove_army_from_battle&army=%(army_id)s&battle=%(battle_id)s">Remove</a></td> <!--<td style="padding:0;"><a class="block_link" href="#" onclick="">Edit</a></td>--> </tr> """ % { "count": count%2, "name": army_dict[a], "army_id": a, "battle_id": battle_id, }) # And armies yet to be involved armies_order, armies_dict_c = army_q.get_armies_from_team(t, True) army_select = [] for a in armies_order: if a in armies_list: continue army_select.append('<option value="%s">%s</option>' % (a, army_dict[a])) if army_select != []: count += 1 output.append(""" <tr class="row%(count)s"> <form action="exec.py" id="add_army_form_%(t)s" method="post" accept-charset="utf-8"> <td style="padding:1px;"> <input type="hidden" name="mode" value="add_army_to_battle" /> <input type="hidden" name="team" value="%(t)s" /> <input type="hidden" name="battle" value="%(battle_id)s" />