import jet.websites.jeffandmere as jeffandmere



def get_date_row(date):
	text =  '  <tr>\n'
	text += '    <td width="240" align="left" valign="top">\n'
	text += '      <p><b>' + date + '</b></p>\n'
	text += '    </td>\n'
	text += '    <td>\n'
	text += '      <table width=8></table>\n'
	text += '    </td>\n'
	text += '    <td valign="top">\n'
	text += '    </td>\n'
	text += '  </tr>\n'
	return text



def get_schedule_row(time, event):
	text =  '  <tr>\n'
	text += '    <td valign="top">\n'
	if time:
		text += '      <p class="right">' + time + ':</p>\n'
	text += '    </td>\n'
	text += '    <td>\n'
	text += '      <table width=8></table>\n'
	text += '    </td>\n'
	text += '    <td valign="top">\n'
	text += '      <p class="left">' + event + '</p>\n'
	text += '    </td>\n'
	text += '  </tr>\n'
	return text



def yield_data(psp_directory, **kwargs):
	relative_root = jeffandmere.get_relative_root(**kwargs)
	text =  '<table valign="top">\n'
	text += get_date_row('Sunday, December 25')
	text += get_schedule_row('~5:00 P.M.', 'Arrive in Aruba.')
	text += get_schedule_row('~8:00 P.M.',
	                         'Eat at ' + jeffandmere.get_link(relative_root, 'http://www.theoldcunucuhouse.com/',
	                                                          'The Old Cunucu House') + '.**')
	text += get_date_row('Monday, December 26')
	text += get_schedule_row('', 'TBD')
	text += get_date_row('Tuesday, December 27')
	text += get_schedule_row('Sunrise', '9 holes of golf, location TBD.**')
	text += get_schedule_row('5:00 P.M.', 'Grilled dinner at \n' + \
	                           jeffandmere.get_link(relative_root, 'http://www.yemanja-aruba.com/', 'Yemanja') + '.**')
	text += get_date_row('Wednesday, December 28')
	text += get_schedule_row('8:30 A.M. to 12:30 P.M.',
	                         'Rent ATVs from\n' + \
	                           jeffandmere.get_link(relative_root, 'http://www.georgecycles.com/', 'George\'s') + \
	                                 '; tour the back side of the island; take a dip in the\n' + \
	                           jeffandmere.get_link(relative_root, 'http://www.aruba-travelguide.com/sights/natural_pool.html',
	                                                'Natural Pool') + '.**\n')
	text += get_schedule_row('1 P.M. to 4:00 P.M.',
	                         'Kite and Wind Surfing at ' + \
	                         jeffandmere.get_link(relative_root, 'http://www.kitesurfingaruba.com/', 'Armondo\'s Kite Shack') + \
	                               '.**')
	text += get_schedule_row('10:00 P.M. to Midnight',
	                         'Drinks at ' + jeffandmere.get_link(relative_root, 'http://moombabeach.com/', 'Moomba') + '.')
	text += get_schedule_row('Midnight to 4 A.M.',
	                         'Poker at the ' + \
	                         jeffandmere.get_link(relative_root, 'http://www.excelsiorcasino.com/', 'Excelcior Casino') + '.')
	text += get_date_row('Thursday, December 29')
	text += get_schedule_row('1:30 P.M. to 5:00 P.M.',
	                         jeffandmere.get_link(relative_root, 'http://www.depalmtours.com/palm-pleasure-afternoon-delight',
	                                              'De Palm Snorkeling Catamaran Tour') + '.**')
	text += get_schedule_row('5:00 P.M. to 10:00 P.M.',
	                         'Welcome BBQ - ' + \
	                         jeffandmere.get_link(relative_root, 'http://www.kitesurfingaruba.com/', 'Armondo\'s Kite Shack') + \
	                               '.**')
	text += get_date_row('Friday, December 30')
	text += get_schedule_row('Noon to 3:00 P.M.',
	                         'Lunch and Beach Time at ' + \
	                         jeffandmere.get_link(relative_root, 'http://www.manchebo.com/', 'Manchebo') + '.')
	text += get_schedule_row('5:00 P.M. to 11:30 P.M.',
	                         'Wedding, Pictures, Cocktails and Reception at ' + \
	                         jeffandmere.get_link(relative_root, 'http://www.manchebo.com/', 'Manchebo') + '.')
	text += get_schedule_row('Midnight to Close', 'After-Party - Location TBD.')
	text += get_date_row('Saturday, December 31')
	text += get_schedule_row('Wake-Up to Sunset',
	                         'Beach Time at ' + \
	                         jeffandmere.get_link(relative_root, 'http://www.manchebo.com/', 'Manchebo') + '.')
	text += get_schedule_row('7:00 P.M. to 1:00 A.M.',
	                         'New Years Party TBD **. (The Boat we were hoping to ' + \
	                         'party on was sold and moved to the Black Sea.)')
	text += get_date_row('Sunday, January 1')
	text += get_schedule_row('Noon to 3:00 P.M.',
	                         'Kite and Wind Surfing at ' + \
	                         jeffandmere.get_link(relative_root, 'http://www.kitesurfingaruba.com/', 'Armondo\'s Kite Shack') + \
	                               '.**')
	text += get_schedule_row('1:00 P.M. to 4:00 P.M.',
	                         'Watch the Patriots-Bills game at ' + \
	                         jeffandmere.get_link(relative_root, 'http://www.aruba.com/thingstodo/restaurants/champions_sports_bar_restaurant.aspx',
	                                              'Champions ') + '. ' + \
	                                              'This is the alternate activity if we do not feel up for kiting.')
	text += get_schedule_row('5:00 P.M. to 7:00 P.M.',
	                         'Watch the sunset at ' + \
	                         jeffandmere.get_link(relative_root, 'http://www.manchebo.com/', 'Manchebo') + ' Beach.')
	text += get_schedule_row('8:00 P.M.', 'Dinner out, location TBD.**')
	text += get_date_row('After Sunday')
	text += get_schedule_row('', 'TBD')


	text += '</table><br>\n'
	text += '<p class="center">**Please contact Jeff or Meredith if you are interested\n'
	text += 'in these activities.</p>\n'


	for data in jeffandmere.yield_page(
			'Our Schedule', jeffandmere.yield_standard_page, text=text, page_height=1160, **kwargs):
		yield data


