<tal:block define="global current_tab_url string:admin_map_no_coordinates_html" />
<metal:block use-macro="here/admin_pt/macros/page">

<metal:block fill-slot="tab_contents"
		tal:define="skey python:request.get('skey', 'title');
					rkey python:request.get('rkey', '');
					first_letter python:request.get('first_letter', '');">

<p i18n:translate="" class="cleaner">
This page lists the locations that do not have coordinates. The test is made on the following fields: <em i18n:name="location-type" i18n:translate="">location type</em>, <em i18n:name="address" i18n:translate="">address</em>, <em i18n:name="longitude" i18n:translate="">longitude</em> and <em i18n:name="latitude" i18n:translate="">latitude</em>.
<br i18n:name="br"/>Only objects from geo-taggable content types will be shown.
</p>

<br clear="all" />

<form method="post" name="frmDeleteLocations" id="frmDeleteLocations" action="deleteLocations">
	<tal:block define="
			start python:int(request.get('start', '0'));
			step python:int(request.get('step', '50'));
			end python:int(request.get('end', start + step));
			next_start python:end;
			next_end python:end + step;
			prev_start python:start - step;
			prev_end python:end - step;
			map_ob portal_map;
			records python:here.getNoCoordinatesObjects(skey, rkey, first_letter=first_letter);
			records_len python:len(records);
			records python:records[start:end];
			edit_mode python:True;
			sortable python:False">
		<a tal:condition="python:prev_start >=0" tal:attributes="href string:./admin_map_no_coordinates_html?start=${prev_start}&amp;end=${prev_end}&amp;first_letter=${first_letter}" i18n:translate=""><<< Prev 50</a>
		<a tal:condition="python:next_start < records_len" tal:attributes="href string:./admin_map_no_coordinates_html?start=${next_start}&amp;end=${next_end}&amp;first_letter=${first_letter}" i18n:translate="">Next 50 >>></a>
		<tal:block tal:condition="here/can_filter_by_first_letter">
			<br />
			<a tal:attributes="href string:./admin_map_no_coordinates_html" i18n:translate="">List all</a>
			<tal:block tal:repeat="letter python:'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
				<a tal:attributes="href string:./admin_map_no_coordinates_html?first_letter=${letter}" i18n:translate="" tal:content="letter"/>
			</tal:block>
		</tal:block>
		<table width="90%"
			class="datatable">
			<thead>
				<tr>
					<th tal:condition="edit_mode" width="1%">
						<input type="checkbox" onclick="javascript: toggleSelect(this, 'locations:list')" />
					</th>
					<th scope="col" class="scope-col" i18n:translate="Type (translate as a noun)">Type</th>
					<tal:block tal:condition="python:skey=='title'">
						<tal:block tal:condition="python:rkey==''">
							<th scope="col" class="scope-col">
								<a tal:omit-tag="not: sortable" id="title" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=title&amp;rkey=1#title">
									<span i18n:translate="">Title</span>
								</a>
							</th>
						</tal:block>
						<tal:block tal:condition="python:rkey=='1'">
							<th tal:omit-tag="not: sortable" scope="col" class="scope-col">
								<a id="title" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=title#title">
									<span i18n:translate="">Title</span>
								</a>
							</th>
						</tal:block>
					</tal:block>
					<tal:block tal:condition="python:skey!='title'">
						<th scope="col" class="scope-col">
							<a tal:omit-tag="not: sortable" id="title" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=title#title" i18n:translate="">Title</a>
						</th>
					</tal:block>
					<tal:block tal:condition="python:skey=='address'">
						<tal:block tal:condition="python:rkey==''">
							<th scope="col" class="scope-col">
								<a id="address" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=address&amp;rkey=1#address">
									<span i18n:translate="">Address</span>
								</a>
							</th>
						</tal:block>
						<tal:block tal:condition="python:rkey=='1'">
							<th scope="col" class="scope-col">
								<a id="address" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=address#address">
									<span i18n:translate="">Address</span>
								</a>
							</th>
						</tal:block>
					</tal:block>
					<tal:block tal:condition="python:skey!='address'">
						<th scope="col" class="scope-col">
							<a tal:omit-tag="not: sortable" id="address" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=address#address" i18n:translate="">Address</a>
						</th>
					</tal:block>
					<tal:block tal:condition="python:skey=='latitude'">
						<tal:block tal:condition="python:rkey==''">
							<th scope="col" class="scope-col">
								<a id="latitude" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=latitude&amp;rkey=1#latitude">
									<span i18n:translate="">Latitude</span>
								</a>
							</th>
						</tal:block>
						<tal:block tal:condition="python:rkey=='1'">
							<th scope="col" class="scope-col">
								<a id="latitude" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=latitude#latitude">
									<span i18n:translate="">Latitude</span>
								</a>
							</th>
						</tal:block>
					</tal:block>
					<tal:block tal:condition="python:skey!='latitude'">
						<th scope="col" class="scope-col">
							<a tal:omit-tag="not: sortable" id="latitude" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=latitude#latitude" i18n:translate="">Latitude</a>
						</th>
					</tal:block>
					<tal:block tal:condition="python:skey=='longitude'">
						<tal:block tal:condition="python:rkey==''">
							<th scope="col" class="scope-col">
								<a id="longitude" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=longitude&amp;rkey=1#longitude">
									<span i18n:translate="">Longitude</span>
								</a>
							</th>
						</tal:block>
						<tal:block tal:condition="python:rkey=='1'">
							<th scope="col" class="scope-col">
								<a id="longitude" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=longitude#longitude">
									<span i18n:translate="">Longitude</span>
								</a>
							</th>
						</tal:block>
					</tal:block>
					<tal:block tal:condition="python:skey!='longitude'">
						<th scope="col" class="scope-col">
							<a tal:omit-tag="not: sortable" id="longitude" tal:attributes="href string:${request/ACTUAL_URL}?first_letter=${first_letter}&amp;skey=longitude#longitude" i18n:translate="">Longitude</a>
						</th>
					</tal:block>
					<th tal:condition="edit_mode">&nbsp;</th>
				</tr>
			</thead>
			<tbody tal:define="records python:test(records != None, records, map_ob.search_geo_objects());">
				<tr tal:condition="not:records">
					<td colspan="7" i18n:translate="">No locations found</td>
				</tr>
				<tr tal:repeat="record records" tal:condition="records">
					<tal:block tal:define="geo_type record/geo_type | nothing;
											address record/geo_location/address | nothing;
											lat record/geo_location/lat | nothing;
											lon record/geo_location/lon | nothing">
						<td tal:condition="edit_mode"><input type="checkbox" name="locations:list" tal:attributes="value python:record.absolute_url(1)" /></td>
						<td>
							<img tal:attributes="src string:${map_url}/getSymbolPicture?id=${geo_type};
												 alt python:map_ob.getSymbolTitle(geo_type);
												 title python:map_ob.getSymbolTitle(geo_type);" />
						</td>
						<td><a tal:attributes="href string:${record/absolute_url}" tal:content="record/title_or_id" /></td>
						<td tal:content="address" />
						<td tal:content="lat" />
						<td tal:content="lon" />
						<td tal:condition="edit_mode"><a tal:attributes="href string:${record/absolute_url}/edit_html" title="Edit location" i18n:translate="" i18n:attributes="title">edit</a></td>
					</tal:block>
				</tr>
				<tr tal:condition="python: edit_mode and records">
					<td></td>
					<td colspan="7"><input type="submit" name="delete" value="Delete" i18n:attributes="value" /></td>
				</tr>
			</tbody>
		</table>
	</tal:block>
</form>

</metal:block>

</metal:block>

