{% load i18n %}
<a href="#{{file.index}}" onclick="return !gotoAnchor('{{file.index}}');">{{file.dest_filename}}</a>
{% if file.dest_filename != file.depot_filename %}
 (was {{file.depot_filename}})
{% endif %}
:
{% if error %}
{%  trans "Diff currently unavailable." %}
{% elif file.binary %}
{%  trans "binary file" %}
{% elif file.deleted %}
{%  trans "deleted" %}
{% else %}
{%  blocktrans count file.num_changes as counter %}
 1  change
{%  plural %}
 {{counter}} changes
{%  endblocktrans %}
{%  if file.chunks|length != 0 %}
 [
{%   if file.chunks|length == 1 %}
    <a href="#{{file.index}}.{{file.chunks.0.index}}" onClick="return !gotoAnchor('{{file.index}}.{{file.chunks.0.index}}');"> {% if file.chunks.0.change == "insert" %}new content{% elif file.chunks.0.change == "delete" %}deleted content{% endif %}</a>
{%   else %}
{%    for chunk_index in file.changed_chunk_indexes %}
     <a href="#{{file.index}}.{{chunk_index}}" onClick="return !gotoAnchor('{{file.index}}.{{chunk_index}}');">{{forloop.counter}}</a>
{%    endfor %}
{%   endif %}
 ]
{%  endif %}
{% endif %}

{% load i18n %}
<a href="#{{file.index}}" onclick="return !gotoAnchor('{{file.index}}');">{{file.dest_filename|force_escape|escapejs}}</a>
{% if file.dest_filename != file.depot_filename %}
 (was {{file.depot_filename}})
{% endif %}
:
{% if error %}
{%  trans "Diff currently unavailable." %}
{% elif file.binary %}
{%  trans "binary file" %}
{% elif file.deleted %}
{%  trans "deleted" %}
{% else %}
{%  blocktrans count file.num_changes as counter %}
 1  change
{%  plural %}
 {{counter}} changes
{%  endblocktrans %}
{%  if file.chunks|length != 0 %}
 [
{%   if file.chunks|length == 1 %}
    <a href="#{{file.index}}.{{file.chunks.0.index}}" onClick="return !gotoAnchor('{{file.index}}.{{file.chunks.0.index}}');"> {% if file.chunks.0.change == "insert" %}new content{% elif file.chunks.0.change == "delete" %}deleted content{% endif %}</a>
{%   else %}
{%    for chunk_index in file.changed_chunk_indexes %}
     <a href="#{{file.index}}.{{chunk_index}}" onClick="return !gotoAnchor('{{file.index}}.{{chunk_index}}');">{{forloop.counter}}</a>
{%    endfor %}
{%   endif %}
 ]
{%  endif %}
{% endif %}

Fix a regression with displaying diff viewer file entries.
Fix a regression with displaying diff viewer file entries.

The "Files Changed" list in the diff viewer broke with Windows-style
paths. A previous change was made to fix a JavaScript injection issue,
but that caused some escaping issues when using backslashes. We now
escape both HTML and JavaScript.
