<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html metal:use-macro="container/page_macro/macros/master_page">

<script metal:fill-slot="js_slot" type="text/javascript" src="js/checkAll2"></script>

<span tal:omit-tag="" metal:fill-slot="breadcrumbs">
	&gt; <label tal:omit-tag="" i18n:translate="">Calendar</label>
</span>

<span tal:omit-tag="" metal:fill-slot="main_content_slot">
			<span tal:define="
				global DateTime 	python:modules['DateTime'].DateTime;
				global cal		context/getCalendar;
				global name_value 	string:kustutus:list;
				global form_name	string:eventList_form;
				global showBox 		string:;

				global private		python:test(userLocation=='Organizer', request.get('private', 0), 1);
				global private_set	python:request.set('private', private);
				global ecategory 	python:request.set('ecategory', request.get('ecategory', '2'));
				global sort 		python:request.set('sort', request.get('sort', 'get_start_time'));
				global markAll 		python:request.set('markAll', request.get('markAll', ''));
				
				global showDate		python:request.get('ctime', None);
				global ctime 		python:request.get('ctime', None);
				global s_ctime		python:test(showDate!=None, DateTime(ctime).earliestTime(), None);
				global e_ctime		python:test(showDate!=None, DateTime(ctime).latestTime(), None);
				global ctimestr		string:;
				eventCollection 	python:cal.getEvents(request,
								blocked=request.ecategory,
								sort=request.sort,
								srange=s_ctime,
								erange=e_ctime,
								only_current=private,
							);
				global def_sel_button	python:test(len(eventCollection), 1, 0);
				"><!-- '&ctime='+ctime -->
			<span tal:omit-tag="" tal:condition="ctime">
				<h2 tal:define="global ctimestr python:'&ctime='+ctime">
					<span tal:omit-tag="" i18n:translate="">Date:</span>
					<span tal:omit-tag="" tal:content="string:${e_ctime/day}.${e_ctime/month}.${e_ctime/year}" />
				</h2>
			</span>
			
			<form name="eventList_form" action="events_form_handler" method="post">
			<input type="hidden" value="" name="userLocation" tal:attributes="value userLocation" />
			<h metal:use-macro="container/main_macro/macros/eventFormHeader">
				<img metal:fill-slot="stlink_icon" src="images/add_event" alt="Add new event" />
				<a metal:fill-slot="stlink" href="addEvent" i18n:translate="" tal:attributes="href string:addEvent?userLocation=${userLocation}${ctimestr}" class="link2">Add event</a>
				<img metal:fill-slot="ndlink_icon" tal:omit-tag="" />				
				<a metal:fill-slot="ndlink" tal:omit-tag="" />				
			</h>
			<table 
				width="100%" 
				border="0" 
				cellpadding="2" 
				cellspacing="1" 
				bgcolor="#EEEEEE">
				<events tal:repeat="event eventCollection" tal:omit-tag="">
					<span metal:use-macro="container/main_macro/macros/eventSlot" tal:omit-tag=""></span>
				</events>
				<tr tal:condition="not:eventCollection">
					<td class="t1" i18n:translate="">No events to show!</td>
				</tr>
			</table>
			<span tal:omit-tag="" tal:condition="eventCollection">
				<f metal:use-macro="container/main_macro/macros/eventFormFooter" />			
			</span>
			</form>
		</span>	
</span>
 
</html>

