{% load djblets_deco djblets_utils gravatars i18n reviewtags tz %}

<div class="changedesc">
 <a name="changedesc{{entry.changedesc.id}}"></a>
 <div class="box-statuses">
  <div class="box-status">
   <div class="gravatar-container">
{% if siteconfig_settings.integration_gravatars %}
    {% gravatar review_request.submitter 48 %}
{% endif %}
   </div>
  </div>
 </div>

{% definevar "boxclass" %}changedesc {{entry.class}}{% enddefinevar %}
{% box boxclass %}
 <div class="box-main">
  <div class="header">
   <div class="collapse-button btn"><div class="rb-icon {% if entry.collapsed %}rb-icon-expand-review{% else %}rb-icon-collapse-review{% endif %}"></div></div>
   <div class="header-details">
    <div class="reviewer"><strong>{% trans "Review request changed" %}</strong></div>
    <div class="posted_time">{% localtime on %}{% blocktrans with entry.changedesc.timestamp as timestamp and entry.changedesc.timestamp|date:"c" as timestamp_raw %}<time class="timesince" datetime="{{timestamp_raw}}">{{timestamp}}</time>{% endblocktrans %}{% endlocaltime %}</div>
   </div>
  </div>
  <div class="body">
{%  if entry.new_status %}
   <h3 class="status">
    {% trans "Status:" %}
    <span class="value">
{%   if entry.new_status == 'submitted' %}
    {% trans "Closed (submitted)" %}
{%   elif entry.new_status == 'discarded' %}
    {% trans "Discarded" %}
{%   elif entry.new_status == 'pending' %}
    {% trans "Re-opened" %}
{%   endif %}
    </span>
   </h3>
{%  endif %}

{%  if entry.changedesc.text %}
   <h3>{% trans "Change Summary:" %}</h3>
   <pre class="changedesc-text {% rich_text_classname entry.changedesc.rich_text %}">{{entry.changedesc.text|render_markdown:entry.changedesc.rich_text}}</pre>
{%  endif %}

{%  for group in entry.fields_changed_groups %}
{%   if group.inline %}
   <table class="secondary-fields">
{%  for fieldinfo in group.fields %}
{%   if fieldinfo.rendered_html %}
    <tr>
     <th><h3>{{fieldinfo.title}}:</h3></th>
     <td>
      {{fieldinfo.rendered_html}}
     </td>
    </tr>
{%   endif %}
{%  endfor %}
   </table>
{%   else %}
   <ul class="primary-fields">
{%    for fieldinfo in group.fields %}
{%     if fieldinfo.rendered_html %}
    <li class="clearfix">
     <h3>{{fieldinfo.title}}:</h3>
     {{fieldinfo.rendered_html}}
    </li>
{%     endif %}
{%    endfor %}
   </ul>
{%   endif %}
{%  endfor %}

  </div>
 </div>
{% endbox %}
</div>
