示例#1
0
#	Now for the participants of the battle
#------------------------
teams_dict		= team.get_teams_dict()
army_dict		= army.get_army_dict()
participants	= the_battle.get_participants()

output.append("""
<hr />
<form action="exec.py" method="post" id="add_team_form" accept-charset="utf-8">
	<input type="hidden" name="mode" value="add_team_battle" />
	<input type="hidden" name="battle" id="battle" value="%s" />
	%s
	&nbsp;&nbsp;<input type="submit" value="Add team" />
</form>
<br />""" % (battle_id, team_f.structured_list(include_irs = True, field_name="team", skip=participants)))


#	TEAM DISPLAY
#------------------------
for t, s in participants.items():
	# Styling the public/secret link correctly
	if s:
		public_display	= ""
		secret_display	= "display: none;"
	else:
		public_display	= "display: none;"
		secret_display	= ""
	
	# Outputting the containing div and table header
	output.append("""
示例#2
0
	-->
	
	<td style="padding: 1px;">%(type)s</td>
	<td style="padding: 1px;">%(target)s</td>
	
	<!--
	<td>&nbsp;</td>
	-->
	
	<td style="padding: 0px;" colspan="2"><a class="block_link" href="#" onclick="$('#add_mission_form').submit();">Add</a></td>
	</form>
	%(onload)s
</tr>
""" % {	'row':			(count % 2),
		
		"team":			team_f.structured_list(field_name="team", field_id="new_mission_team"),
		"turn":			common.text_box('turn', text=common.current_turn(), size=5),
		"state":		common.option_box("state", mission.mission_states),
		
		"type":			common.option_box("type",
			elements=city_missions_dict,
			element_order=city_missions_list,
		),
		"target":		common.option_box(
			name='target',
			elements=names,
			element_order=cities_order,
		),
		
		"time_posted":	int(time.time()),
		"onload":		common.onload("$('#new_mission_team').focus();"),
示例#3
0
# If it's not closed then time = 0
if the_mission.time_closed == 0:
	closed_string = "<span class='neg'>Still open</span>"
else:
	closed_string = time.strftime("%A, %d %B %Y", time.localtime(the_mission.time_closed))

# Target stuff
if mission.mission_types[the_mission.type] in mission.city_targets:
	cities_order, cities_dict = city_q.get_live_cities()
	names = {}
	for c in cities_order:
		names[c] = cities_dict[c].name
	
	target_string = common.option_box(name='target', elements=names, element_order=cities_order, selected=the_mission.target)
elif mission.mission_types[the_mission.type] in mission.team_targets:
	target_string = team_f.structured_list(field_name="target", default=the_mission.target)



output.append("""
<form action="exec.py" method="post" accept-charset="utf-8" style="padding:10px;">
	<input type="hidden" name="mode" id="mode" value="edit_mission_commit" />
	<input type="hidden" name="id" id="id" value="%(mission_id)d" />
	
	<input type="hidden" name="requestTime" id="requestTime" value="' . $the_team->requestTime . '" />
	<table border="0" cellspacing="5" cellpadding="5">
		<tr>
			<td><label for="team">Team:</label></td>
			<td style="padding: 1px;">%(team)s</td>
		
			<td>&nbsp;</td>