<commit_before>{% extends "base.html" %}
{% load i18n %}
{% load difftags %}
{% load reviewtags %}
{% load htmlutils %}

{% block title %}{{review_request_details.summary}} | {% trans "Diff Viewer" %}{% endblock %}
{% block extrahead %}
<link rel="stylesheet" type="text/css" href="/css/diffviewer.css" />
<link rel="stylesheet" type="text/css" href="/css/reviews.css" />
<link rel="stylesheet" type="text/css" href="/css/syntax.css" />
<script type="text/javascript" src="/scripts/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="/scripts/yui-ext/yui-ext.js"></script>
<script type="text/javascript" src="/scripts/rb/common.js"></script>
<script type="text/javascript" src="/scripts/rb/dialogs.js"></script>
<script type="text/javascript" src="/scripts/rb/widgets.js"></script>
<script type="text/javascript" src="/scripts/comments.js"></script>
<script type="text/javascript" src="/scripts/diffviewer.js"></script>
<script type="text/javascript" src="/scripts/reviews.js"></script>
<link rel="stylesheet" type="text/css" href="/css/yui-ui.css" />
<script type="text/javascript">
  var gReviewRequestPath = '{{review_request.get_absolute_url}}';
  var gReviewRequestId = '{{review_request.id}}';
  var gRevision = '{{diffset.revision}}';
{% if interdiffset %}
  var gInterdiffRevision = '{{interdiffset.revision}}';
{% else %}
  var gInterdiffRevision = null;
{% endif %}
  var gUserAuthenticated = {{user.is_authenticated|lower}};
</script>
{% endblock %}

{% block content %}
{% if error %}
{% errorbox %}
 <p>{{error}}</p>
 {% if trace %}<pre>{{trace|escape}}</pre>{% endif %}
{% enderrorbox %}
{% else %}

{% ifneatnumber review_request.id %}
{%  box "yay" %}
 <img src="/images/{% if milestone %}trophy{% else %}fish-trophy{% endif %}.png" width="32" height="48" border="0" alt="" />
 <h1>{% firstof review_request.submitter.get_full_name review_request.submitter.username %} got review request #{{review_request.id}}!</h1>
{%  endbox %}
{% endifneatnumber %}

{% box "review-request" %}
<ul id="topcontrols">
 <li><a href="{{review_request.get_absolute_url}}"><img src="/images/reviewrequest.png" width="16" height="16" border="0" alt="" /> View Review Request</a></li>
</ul>
<div class="main">
{% include "reviews/review_request_box.html" %}

<div id="diff-details">
<a name="index_header"></a>
{% with review_request.diffset_history.diffset_set.latest.revision as latest_revision %}
{% with diffset.revision as revision %}
<div class="main">
{%  if interdiffset %}
 <h1>{% blocktrans with interdiffset.revision as interdiff_revision %}Changes between revision {{revision}} and {{interdiff_revision}}{% endblocktrans %}</h1>
{%  else %}
{%   ifequal diffset.revision latest_revision %}
 <h1>{% blocktrans %}Diff revision {{revision}} (Latest){% endblocktrans %}</h1>
{%   else %}
 <h1>{% blocktrans %}Diff revision {{revision}}{% endblocktrans %}</h1>
 <p>
{%    blocktrans with diffset.revision as revision and review_request.get_absolute_url as review_request_url%}
  This is not the most recent revision of the diff. The
  <a href="{{review_request_url}}diff/">latest diff</a> is revision
  {{latest_revision}}.
  <a href="{{review_request_url}}diff/{{revision}}-{{latest_revision}}/">See what's changed.</a>
{%    endblocktrans %}
 </p>
{%   endifequal %}
{%  endif %}
{%  if review|has_comments_in_diffsets_excluding:diffset_pair %}
{%   box "important" %}
 <h1>{% trans "You have unpublished comments on other revisions" %}</h1>
 <p>
  {% trans "Your review consists of comments on the following revisions:" %}
 </p>
 <ul>
{%    for diffset_info in review|diffsets_with_comments:diffset_pair %}
{%     if diffset_info.is_current %}
  <li><b>Revision {{diffset_info.diffset.revision}}</b></li>
{%     else %}
  <li><a href="{{review_request.get_absolute_url}}diff/{{diffset_info.diffset.revision}}/#index_header">Revision {{diffset_info.diffset.revision}}</a></li>
{%     endif %}
{%    endfor %}
{%    for pair in review|interdiffs_with_comments:diffset_pair %}
{%     if pair.is_current %}
  <li><b>Interdiff revision {{pair.diffset.revision}} - {{pair.interdiff.revision}}</b></li>
{%     else %}
  <li><a href="{{review_request.get_absolute_url}}diff/{{pair.diffset.revision}}-{{pair.interdiff.revision}}/">Interdiff revision {{pair.diffset.revision}} - {{pair.interdiff.revision}}</a></li>
{%     endif %}
{%    endfor %}
 </ul>
 {%  endbox %}
{%  endif %}

{%  ifnotequal review_request.diffset_history.diffset_set.count 1 %}
 <table class="revision-selector">
  <tr>
   <th><label for="jump_to_revision">Jump to revision:<label></th>
   <td>
    <div id="jump_to_revision" class="paginator">
{%  for item in review_request.diffset_history|revision_link_list:diffset_pair %}
{%   if item.is_current %}
     <span class="current-page">{{item.revision}}</span>
{%   else %}
     <a href="{{review_request.get_absolute_url}}diff/{{item.revision}}/#index_header">{{item.revision}}</a>
{%   endif %}
{%  endfor %}
    </div>
   </td>
  </tr>
  <tr>
   <th><label for="show_interdiff">Changes between r{{revision}} and:</label></th>
   <td>
    <div id="show_interdiff" class="paginator">
{%  for item in review_request.diffset_history|interdiff_link_list:diffset_pair %}
{%   if item.is_current %}
     <span class="current-page">{{item.revision}}</span>
{%   else %}
     <a href="{{review_request.get_absolute_url}}diff/{{item.path}}/#index_header">{{item.revision}}</a>
{%   endif %}
{%  endfor %}
    </div>
   </td>
  </tr>
 </table>
{% endifnotequal %}

 <p><label>Files Changed:</label></p>
{% include "diffviewer/changeindex.html" %}
  </div>
 </div>
</div>

<ul class="controls">
 <li><a href="#" onClick="showReviewDlg();" id="review-link">{% trans "Review" %}</a></li>
 <li><a href="raw/"> {% trans "Download Patch" %}</a></li>
{% if collapseall %}
 <li><a href=".?expand=1"><img src="/images/expand.png" width="14" height="14" border="0" alt="" /> {% trans "Expand changes" %}</a></li>
{% else %}
 <li><a href=".?collapse=1"><img src="/images/collapse.png" width="14" height="14" border="0" alt="" /> {% trans "Collapse changes" %}</a></li>
{% endif %}
</ul>
{% endwith %}
{% endwith %}
{%  endbox %}

<div id="diffs">
{% for file in files %}
<a name="{{file.index}}"></a>
{{ file.fragment }}
<script type="text/javascript">
  gFileAnchorToId["file{{file.index}}"] = {{file.filediff.id}};
{% if file.interfilediff %}
  gInterdiffFileAnchorToId["file{{file.index}}"] = {{file.interfilediff.id}};
{% endif %}
  addComments("file{{file.index}}", {% commentcounts file.filediff file.interfilediff %});
</script>
{% endfor %}<commit_msg>Completely untested change to remove the Review link if the user isn't logged in.  Bug 299.<commit_after>{% extends "base.html" %}
{% load i18n %}
{% load difftags %}
{% load reviewtags %}
{% load htmlutils %}

{% block title %}{{review_request_details.summary}} | {% trans "Diff Viewer" %}{% endblock %}
{% block extrahead %}
<link rel="stylesheet" type="text/css" href="/css/diffviewer.css" />
<link rel="stylesheet" type="text/css" href="/css/reviews.css" />
<link rel="stylesheet" type="text/css" href="/css/syntax.css" />
<script type="text/javascript" src="/scripts/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="/scripts/yui-ext/yui-ext.js"></script>
<script type="text/javascript" src="/scripts/rb/common.js"></script>
<script type="text/javascript" src="/scripts/rb/dialogs.js"></script>
<script type="text/javascript" src="/scripts/rb/widgets.js"></script>
<script type="text/javascript" src="/scripts/comments.js"></script>
<script type="text/javascript" src="/scripts/diffviewer.js"></script>
<script type="text/javascript" src="/scripts/reviews.js"></script>
<link rel="stylesheet" type="text/css" href="/css/yui-ui.css" />
<script type="text/javascript">
  var gReviewRequestPath = '{{review_request.get_absolute_url}}';
  var gReviewRequestId = '{{review_request.id}}';
  var gRevision = '{{diffset.revision}}';
{% if interdiffset %}
  var gInterdiffRevision = '{{interdiffset.revision}}';
{% else %}
  var gInterdiffRevision = null;
{% endif %}
  var gUserAuthenticated = {{user.is_authenticated|lower}};
</script>
{% endblock %}

{% block content %}
{% if error %}
{% errorbox %}
 <p>{{error}}</p>
 {% if trace %}<pre>{{trace|escape}}</pre>{% endif %}
{% enderrorbox %}
{% else %}

{% ifneatnumber review_request.id %}
{%  box "yay" %}
 <img src="/images/{% if milestone %}trophy{% else %}fish-trophy{% endif %}.png" width="32" height="48" border="0" alt="" />
 <h1>{% firstof review_request.submitter.get_full_name review_request.submitter.username %} got review request #{{review_request.id}}!</h1>
{%  endbox %}
{% endifneatnumber %}

{% box "review-request" %}
<ul id="topcontrols">
 <li><a href="{{review_request.get_absolute_url}}"><img src="/images/reviewrequest.png" width="16" height="16" border="0" alt="" /> View Review Request</a></li>
</ul>
<div class="main">
{% include "reviews/review_request_box.html" %}

<div id="diff-details">
<a name="index_header"></a>
{% with review_request.diffset_history.diffset_set.latest.revision as latest_revision %}
{% with diffset.revision as revision %}
<div class="main">
{%  if interdiffset %}
 <h1>{% blocktrans with interdiffset.revision as interdiff_revision %}Changes between revision {{revision}} and {{interdiff_revision}}{% endblocktrans %}</h1>
{%  else %}
{%   ifequal diffset.revision latest_revision %}
 <h1>{% blocktrans %}Diff revision {{revision}} (Latest){% endblocktrans %}</h1>
{%   else %}
 <h1>{% blocktrans %}Diff revision {{revision}}{% endblocktrans %}</h1>
 <p>
{%    blocktrans with diffset.revision as revision and review_request.get_absolute_url as review_request_url%}
  This is not the most recent revision of the diff. The
  <a href="{{review_request_url}}diff/">latest diff</a> is revision
  {{latest_revision}}.
  <a href="{{review_request_url}}diff/{{revision}}-{{latest_revision}}/">See what's changed.</a>
{%    endblocktrans %}
 </p>
{%   endifequal %}
{%  endif %}
{%  if review|has_comments_in_diffsets_excluding:diffset_pair %}
{%   box "important" %}
 <h1>{% trans "You have unpublished comments on other revisions" %}</h1>
 <p>
  {% trans "Your review consists of comments on the following revisions:" %}
 </p>
 <ul>
{%    for diffset_info in review|diffsets_with_comments:diffset_pair %}
{%     if diffset_info.is_current %}
  <li><b>Revision {{diffset_info.diffset.revision}}</b></li>
{%     else %}
  <li><a href="{{review_request.get_absolute_url}}diff/{{diffset_info.diffset.revision}}/#index_header">Revision {{diffset_info.diffset.revision}}</a></li>
{%     endif %}
{%    endfor %}
{%    for pair in review|interdiffs_with_comments:diffset_pair %}
{%     if pair.is_current %}
  <li><b>Interdiff revision {{pair.diffset.revision}} - {{pair.interdiff.revision}}</b></li>
{%     else %}
  <li><a href="{{review_request.get_absolute_url}}diff/{{pair.diffset.revision}}-{{pair.interdiff.revision}}/">Interdiff revision {{pair.diffset.revision}} - {{pair.interdiff.revision}}</a></li>
{%     endif %}
{%    endfor %}
 </ul>
 {%  endbox %}
{%  endif %}

{%  ifnotequal review_request.diffset_history.diffset_set.count 1 %}
 <table class="revision-selector">
  <tr>
   <th><label for="jump_to_revision">Jump to revision:<label></th>
   <td>
    <div id="jump_to_revision" class="paginator">
{%  for item in review_request.diffset_history|revision_link_list:diffset_pair %}
{%   if item.is_current %}
     <span class="current-page">{{item.revision}}</span>
{%   else %}
     <a href="{{review_request.get_absolute_url}}diff/{{item.revision}}/#index_header">{{item.revision}}</a>
{%   endif %}
{%  endfor %}
    </div>
   </td>
  </tr>
  <tr>
   <th><label for="show_interdiff">Changes between r{{revision}} and:</label></th>
   <td>
    <div id="show_interdiff" class="paginator">
{%  for item in review_request.diffset_history|interdiff_link_list:diffset_pair %}
{%   if item.is_current %}
     <span class="current-page">{{item.revision}}</span>
{%   else %}
     <a href="{{review_request.get_absolute_url}}diff/{{item.path}}/#index_header">{{item.revision}}</a>
{%   endif %}
{%  endfor %}
    </div>
   </td>
  </tr>
 </table>
{% endifnotequal %}

 <p><label>Files Changed:</label></p>
{% include "diffviewer/changeindex.html" %}
  </div>
 </div>
</div>

<ul class="controls">
{% user.is_authenticated %}<li><a href="#" onClick="showReviewDlg();" id="review-link">{% trans "Review" %}</a></li>{% endif %}
 <li><a href="raw/"> {% trans "Download Patch" %}</a></li>
{% if collapseall %}
 <li><a href=".?expand=1"><img src="/images/expand.png" width="14" height="14" border="0" alt="" /> {% trans "Expand changes" %}</a></li>
{% else %}
 <li><a href=".?collapse=1"><img src="/images/collapse.png" width="14" height="14" border="0" alt="" /> {% trans "Collapse changes" %}</a></li>
{% endif %}
</ul>
{% endwith %}
{% endwith %}
{%  endbox %}

<div id="diffs">
{% for file in files %}
<a name="{{file.index}}"></a>
{{ file.fragment }}
<script type="text/javascript">
  gFileAnchorToId["file{{file.index}}"] = {{file.filediff.id}};
{% if file.interfilediff %}
  gInterdiffFileAnchorToId["file{{file.index}}"] = {{file.interfilediff.id}};
{% endif %}
  addComments("file{{file.index}}", {% commentcounts file.filediff file.interfilediff %});
</script>
{% endfor %}
{'fraction_non_alphanumeric': 0.21233340862886832, 'fraction_numerical': 0.005496574053158647, 'mean_word_length': 5.26805096743747, 'pattern_counts': {'":': 0, '<': 277, '<?xml version=': 0, '>': 277, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5090666', 'n_tokens_mistral': 4944, 'n_tokens_neox': 4480, 'n_words': 867}