<%= title l(:field_location) %>
<%= render partial: "wkcrmenumeration/render_settings_tabs" %>

<%= form_tag({:controller => "wklocation", :action => 'index'}, :method => :get, :id => 'query_form') do %>
<%= hidden_field_tag "searchlist", controller_name %>
<%=h hidden_field_tag('tab', "wklocation") %>
<%	locName = session[controller_name].try(:[], :location_name) %>
<%	locType = session[controller_name].try(:[], :location_type) %>
<%	showOnMap = session[controller_name].try(:[], :show_on_map) %>
<fieldset>
	<div style="float:right">
		<%= link_to l(:label_new_location), url_for(:controller => controller_name, :action => 'edit'), :class => 'icon icon-add' %>
	</div>
	<table>
			<th><label for='name' style="float:left;"><%= l(:field_name)%></label></th>
				<td><%= text_field_tag 'location_name', locName, :size => 30, :style=> "float: left;" %></td>
			<th><label style="float:left;padding-left: 10px;"><%= l(:field_type) %></label></th>
				<td><%=h select_tag('location_type', options_for_select(options_for_enum_select('LT', locType, true)), :style=> "float: left;") %></td>
			<td><%= submit_tag l(:button_apply), :class => "small", :style=>"float:left;", :name => nil %></td>
			<td><%= link_to l(:button_clear), {:tab => controller_name, clear: true}, :class => 'icon icon-reload', :style=>"float:left; " %></td>
			<% if isChecked('te_save_geo_location') %>
				<td>
					<label style="padding-left:5px"><%= check_box_tag('show_on_map', true, showOnMap, onclick: '$("#query_form").submit(); return false;') %><%= l(:label_show_on_map) %></label>
				</td>
			<% end %>
	</table>
</fieldset>
<% end %>

<% if @locationObj.present? %>
	<%= render :partial => 'wklocation/location_list'%>
	<span class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></span>
	<% other_formats_links do |f| %>
		<%= f.link_to_with_query_parameters 'CSV', {} %>
	<% end %>
<% else %>
	<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>