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

<%= form_tag({:controller => "wkcrmenumeration", :action => 'index'}, :method => :get, :id => 'query_form') do %>
	<%= hidden_field_tag "searchlist", controller_name %>
	<%= hidden_field_tag('tab', "wkcrmenumeration") %>
	<%	enumerationName = session[controller_name].try(:[], :enumname) %>
	<%	enumerationType = session[controller_name].try(:[], :enumType) %>
	<fieldset>
		<div style="float:right">
			<%= link_to l(:label_new_enumeration), url_for(:controller => controller_name, :action => 'edit', :enum_id => ""), :class => 'icon icon-add' %>
		</div>
		<table>
			<tr>
				<th><label for='name' style="float:left;"><%= l(:field_name)   %></label></th>
					<td><%= text_field_tag 'enumname', enumerationName, :size => 30, :style=> "float: left;" %></td>
				<th><label style="float:left; padding-left: 10px;"><%= l(:field_type) %></label></th>
					<td><%=h select_tag('enumType', options_for_select(enumType.invert,  :selected => enumerationType.nil? ? "" : enumerationType ), :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>
			</tr>
		</table>
	</fieldset>
<% end %>

<% if @crmenum.present? %>
	<%= render :partial => 'wkcrmenumeration/enum_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 %>