<%= stylesheet_link_tag "wk-time", :plugin => "redmine_wktime" %>
<%= form_tag({}) do -%>
	<%= hidden_field_tag "back_url", url_for(:controller => params[:controller], :action => params[:action]) %>
	<div class="autoscroll">
		<table class="list time-entries">
			<thead>
				<tr>
					<%= sort_header_tag("start_date", :caption => l(:field_start_date)) %>
					<%= sort_header_tag("user_name", :caption => l(:field_user), class: "lbl-txt-align") %>
					<% if isSupervisorApproval %>
						<%= sort_header_tag("user_name", :caption => l(:label_ftte_supervisor), class: "lbl-txt-align") %>
					<% end %>

					<% headerName = controller.getLabelforSpField == "Hours" ? "hours" : "amount" %>
					<%= sort_header_tag(headerName, :caption => controller.getLabelforSpField) %>
					<%= sort_header_tag("status", :caption => l(:field_status)) %>
					<%= sort_header_tag("modified_by", :caption => l(:field_status_modified_by), class: "lbl-txt-align") %>
					<th></th>
				</tr>
			</thead>
			<tbody>
				<% @entries.each do |entry| -%>
					<%
						url = {action: "edit", startday: entry.spent_on, user_id: entry.user_id, tab: controller.controller_name}
						url = url.merge({id: entry.id, }) if entry&.id.present?
					%>
					<tr class="time-entry <%= cycle("odd", "even") %>">
					<td class="start_date"><%=h format_date(entry.spent_on) %></td>
					<td class="lbl-txt-align"><%=h entry.user.name %></td>
					<%#= call_hook(:view_list_column_data, :entry => entry) %>
					<% if isSupervisorApproval %>
						<td class="lbl-txt-align"><%=h entry.user.supervisor.blank? ? "" : entry.user.supervisor.name %></td>
					<% end %>
					<td ><%= controller.getUnit(entry) %>&nbsp;<%=h html_hours("%.2f" % (entry.hours || entry.amount || 0)) %></td>
					<td class="status"><%=h statusString(entry.status) unless entry.status.blank? %></td>
					<td class="lbl-txt-align"><%=h entry.status_updater %></td>
					<td align="center">
					<%  #if entry.editable_by?(User.current) %>
							<%= link_to image_tag("edit.png"), url,
																								:title => l(:button_edit) %>
						<% if entry.status.blank? || entry.status == "n" || entry.status == "r" %>
							&nbsp;|&nbsp;<%= link_to image_tag("delete.png"), url.merge({action: "destroy"}),
																:data => {:confirm => l(:text_are_you_sure)},
																:method => :delete,
																:title => l(:button_delete) %>
						<% end %>
					<%  #end %>
					</td>
					</tr>
				<% end -%>
			</tbody>
		</table>
	</div>
<% end -%>

<%= context_menu %>
