<!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="" metal:fill-slot="main_content_slot">
			<br />&nbsp;
			<!-- search form -->
			<div style="position:absolute; top:50px; margin-left:0px; width:450px">
			<form method="post" action="">
				<input type="hidden" value="1" name="vormist" />
				<x tal:omit-tag="" tal:define="head python:'Adding new users to course '+context.jooksva_kursuse_nimi(request)">
				<h2 i18n:translate="" tal:content="head">Adding new users to course</h2>
				</x>
				<table>
					<tr>
						<td i18n:translate="">Last name:</td>
						<td><input type="text" name="pnimi" value="" tal:attributes="value python:getattr(request,'pnimi','')" /></td>
						<td><input type="submit" value="Search" name="" /></td>
					</tr>
					<tr>
						<td i18n:translate="">First name:</td>
						<td><input type="text" name="enimi" value="" tal:attributes="value python:getattr(request,'enimi','')" /></td>
					</tr>
					<tr>
						<td i18n:translate="">Affiliation:</td>
						<td><span tal:replace="structure python:container.fle_users.erialadeKombo(request, vaikimisiID=getattr(request, 'eriala','-1'))" /></td>
					</tr>
				</table>
			</form>
			</div>
			
			<form action="add_users_form_handler" method="post" tal:define="course python:context.find_coursemanager().get_child(jnr)">
			<input type="hidden" value="" tal:attributes="value jnr" name="course_id" />
			
			<!-- search results -->
			<div class="t1" style="position:absolute; top:190px; margin-left:0px; width:320px" tal:condition="python:getattr(request,'vormist','-1')=='1'">
			<table border="0" cellpadding="2" cellspacing="1" bgcolor="#EEEEEE" width="320">
				<tr>
					<th>IVA Users</th>
				</tr>
				<tr>
					<td class="t1">
				<span tal:omit-tag="" tal:repeat="newuser python:context.filtreeriKasutajad(request, context.get_users_not_on_the_course(jnr, getattr(request, 'jarjestus', ''),getattr(request, 'omadus', ''), getattr(request, 'alates', ''), getattr(request, 'kuni', '')), enimi=getattr(request, 'enimi', ''), pnimi=getattr(request, 'pnimi', ''),org=getattr(request, 'eriala', '') )">
		  			<input type="checkbox" value="" name="users_None" tal:attributes="value newuser/get_id" />
					 <span tal:omit-tag="" tal:content="python:newuser.firstAndLast(newuser.get_uname())" />
					 (<span tal:content="newuser/get_uname" />)
					 <span tal:omit-tag="" tal:content="newuser/get_organization" tal:condition="python:getattr(request, 'eriala','')=='1'" />
					 <br />
				</span>
				</td>
				</tr>
			</table>
			</div>
			<!-- buttons, teacher, participants -->
			<div style="position:absolute; top:190px; margin-left:350px;">
				<!-- buttons -->
				<div>
				<input class="width100" type="submit" value="Add ->" name="None_to_Teacher" />
				<br />
				<input class="width100" type="submit" value="<- Remove" name="Teacher_to_None" />
				</div>
				<!-- teachers -->
				<div style="position:relative; margin-left:120px; margin-top:-50px;width:200">
					<table border="0" cellpadding="2" cellspacing="1" bgcolor="#EEEEEE" width="200">
						<tr>
							<th i18n:translate="">Teachers</th>
						</tr>
						<tr>
							<td class="t1">
								<span tal:omit-tag="" tal:repeat="teacher python:course.get_users_with_role('Teacher')">
									<input type="checkbox" name="users_Teacher" value="" tal:attributes="value teacher/get_id" />
									<span tal:omit-tag="" tal:content="python:teacher.firstAndLast(teacher.get_uname())" />
									<br  />
								</span>
							</td>
				</div>
				<!-- buttons -->
				<div style="position:relative;margin-top:80px">
				<input class="width100" type="submit" value="Add ->" name="None_to_Student" />
				<br />
				<input class="width100" type="submit" value="<- Remove" name="Student_to_None" />
				</div>
				<!-- students -->
				<div style="position:relative;margin-left:120px; margin-top:-52px;width:200">
					<table border="0" cellpadding="2" cellspacing="1" bgcolor="#EEEEEE" width="200">
						<tr>
							<th i18n:translate="">Students</th>
						</tr>
						<tr>
							<td class="t1">
							<span tal:omit-tag="" tal:repeat="stdent python:course.get_users_with_role('Student')">
								<input type="checkbox" value="" name="users_Student" tal:attributes="value stdent/get_id" />
								<span tal:omit-tag="" tal:content="python:stdent.firstAndLast(stdent.get_uname())" />
								(<span tal:omit-tag="" tal:content="stdent/get_uname" />)
								<br />
							</span>
							</td>				
				</div>
			</div>
			</form>

  </span>
</html>
