<%
  info_type = file_info(info, :type)
  typestr = case info_type do
    :directory -> "[Dir]"
    :regular   -> "[File]"
    :symlink   -> "[Link]"
    _ -> "[Unknown]"
  end
  dispmod = case info_type do
    :directory -> "/"
    _ -> ""
  end
  size = case info_type do
    :regular -> to_string(file_info(info, :size))
    _ -> ""
  end
  querystring = case query do
    "" -> ""
    other -> "?sort=" <> other
  end
  uripath = URI.encode(Path.join(basepath, path)) <> querystring
  disppath = Plug.HTML.html_escape(path)

%><tr><td id="filetype"><%= typestr %></td>
<td><a href="<%= uripath %>"><%= disppath %><%= dispmod %></a></td>
<td><%= mtime_to_string(file_info(info, :mtime)) %></td>
<td id="filesize"><%= size %></td>
</tr>
