<div class="autoscroll">
	<table class="list time-entries">
		<thead>
			<tr>
				<%= sort_header_tag('contract_number', :caption => l(:label_contract_number), class: "lbl-txt-align") %>
				<%= sort_header_tag('type', :caption => l(:field_type), class: "lbl-txt-align") %>
				<%= sort_header_tag('name', :caption => l(:field_name), class: "lbl-txt-align") %>
				<%= sort_header_tag('project', :caption => l(:label_project), class: "lbl-txt-align") %>
				<%= sort_header_tag('start_date', :caption => l(:label_start_date), class: "lbl-txt-align") %>
				<%= sort_header_tag('end_date', :caption => l(:label_end_date), class: "lbl-txt-align") %>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<% @contract_entries.each do |entry| %>
				<tr>
					  <td class="lbl-txt-align"><%=h entry.contract_number %></td>
					  <td class="lbl-txt-align"><%=h entry.parent_type == 'WkAccount' ? 'Account' : 'Contact' %></td>
					  <td class="lbl-txt-align"><%=h entry.parent && entry.parent.name %></td>
					  <td class="lbl-txt-align"><%=h entry.project.blank? ? "" : entry.project.name %></td>
					  <td class="lbl-txt-align"><%=h entry.start_date %></td>
					  <td class="lbl-txt-align"><%=h entry.end_date %></td>
					  <td align="center">
						  <%= link_to image_tag('edit.png'), {:controller => controller.controller_name, :action => 'edit', :contract_id => entry.id, id: entry.id}, :title => l(:button_edit) %> <%= link_to image_tag('delete.png'), {:controller => controller.controller_name, :action => 'destroy', :contract_id => entry.id, id: entry.id, :tab => controller.controller_name},  :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
					  </td>
				</tr>
			<% end %>
		</tbody>
	</table>
</div>

<span class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></span>
