<!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">

<span tal:omit-tag="" tal:define="global use3rd string:yes;global rs_1 string:1" metal:fill-slot="js_slot" />

<span metal:fill-slot="main_content_slot" tal:omit-tag="">
    <h2 i18n:translate="">Active courses</h2>
    	<table tal:define="user_courses python:curUser.user_courses(filter_dead=1)">
			<tr tal:condition="user_courses">
    		<span tal:repeat="okur user_courses" tal:omit-tag="">
    			<td width="5%" tal:condition="okur/hasLogo"><img src="" tal:attributes="src okur/getLogoURL" width="40" alt="" /></td>
    			<td width="5%" tal:condition="not:okur/hasLogo"><img src="images/course_default" width="40" alt="" /></td>
    			<td width="45%">
   				<a href="" tal:attributes="href string:courses/change_course?course_nr=${okur/get_id}" tal:content="okur/get_name" />
    			</td>
				<span tal:condition="not:repeat/okur/end" tal:omit-tag="">
					<span tal:define="t repeat/okur/odd" tal:condition="python:int(t)==1" tal:replace="structure string:</tr><tr>" tal:omit-tag="" />
				</span>
    		</span>
			</tr>
			<tr tal:condition="not:user_courses">
				<td i18n:translate="">You have no active courses</td>
			</tr>
    	</table>
</span>

<span tal:omit-tag="" metal:fill-slot="third_slot">
</span>

<span tal:omit-tag="" metal:fill-slot="fourth_slot" tal:define="timeLimit python:int(DateTime().timeTime())+604800">
			<!-- events -->
			<span tal:define="
                                global DateTime         python:modules['DateTime'].DateTime;
                                global cal              curUser/getCalendar;
                                global name_value       string:hide;
                                global showBox          string:1;

                                global private          python:request.get('private',0 );
                                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', ''));

				ev_limit         curUser/get_event_limit;
                                s_ctime          python:DateTime().earliestTime()-(7*ev_limit);
                                e_ctime          python:DateTime().latestTime()+(7*ev_limit);
				events		 python:cal.getEvents(
								request,
								blocked=request.ecategory,
								srange=s_ctime,
								erange=e_ctime,
								sort=request.get('sort')
							);	
                                ">

			<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#EEEEEE">
				<tr tal:condition="events">
					<th><img src="transparent.gif" border="0" height="20" width="20" alt="" /></th>
					<th><a href="?sort=getName" i18n:translate="">Name</a></th>
					<th><a href="?sort=get_start_time" i18n:translate="">Time</a></th>
					<th><a href="?sort=asukohaNimi" i18n:translate="">Location</a></th>
				</tr>
				<events tal:repeat="event events" tal:omit-tag="">	
					<span metal:use-macro="container/main_macro/macros/eventSlot" tal:omit-tag="">
						<span tal:omit-tag="" metal:fill-slot="checkColumn" />
					</span>
				</events>
			</table>
			<x tal:omit-tag="" tal:condition="python:str(request.ecategory)=='1'"><y tal:omit-tag="" tal:define="global locationName string:logpage_events;global subName string:Show" /></x>
			<x tal:omit-tag="" tal:condition="python:str(request.ecategory)=='0'"><y tal:omit-tag="" tal:define="global locationName string:hidden_events;global subName string:Hide" /></x>
			</span>

</span>
</html>

