<%= javascript_include_tag 'index', :plugin => "redmine_wktime" %>
<%= stylesheet_link_tag 'wk-time', :plugin => "redmine_wktime" %>
<%= form_tag({:controller => controller_name, :action => 'index', :tab => controller_name}, :method => :get, :id => 'query_form') do %>
	<%= hidden_field_tag "searchlist", controller_name %>
	<fieldset>
		<div style="float:right">
			<%= link_to l(:label_new_account), url_for(:controller => controller_name, :action => 'edit'), :class => 'icon icon-add' %>
		</div>
		<table>
			<tr>
				<%=h hidden_field_tag('tab', controller_name) %>
				<th><label for='location'><%= l(:field_location) %></label></th>
					<td><%=h select_tag("location_id", generic_options_for_select(WkLocation, nil, 'name', 'name', 'id', session[controller_name].try(:[], :location_id), true)) %></td>
				<th><label for='name' style="padding-left: 10px;"><%= controller.getAccountLbl %></label></th>
					<td><%= text_field_tag 'accountname', session[controller_name].try(:[], :accountname), :size => 30 %></td>
				<td><%= submit_tag l(:button_apply), :class => "small", :name => nil %></td>
				<td><%= link_to l(:button_clear), {tab: controller_name, clear: true}, class: 'icon icon-reload' %></td>
			</tr>
		</table>
	</fieldset>
<% end %>

<% if @account_entries.present? %>
	<%= render :partial => 'wkaccount/account_list'%>
	<% other_formats_links do |f| %>
  <%= f.link_to_with_query_parameters 'CSV', {} %>
	<% end %>
<% else %>
	<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>