a73x

src/server/http/templates/patch_detail.html

Ref:   Size: 4.6 KiB   History

{% extends "repo_base.html" %}

{% block title %}{{ patch.title }} — {{ repo_name }} — {{ site_title }}{% endblock %}

{% block content %}
<h2>{{ patch.title }}</h2>
<p>
  <span class="status-{{ patch.status }}">{{ patch.status }}</span>
  &nbsp; by <strong>{{ patch.author }}</strong>
  &nbsp; <span class="mono" style="color: #666;">{{ patch.branch }} → {{ patch.base_ref }}</span>
</p>
<p><a href="/{{ repo_name }}/patches/{{ patch.id }}/diff">Files changed</a></p>
{% if let Some(merge_commit) = patch.merge_commit %}
{# The link resolves the full oid; the text matches the Revisions table below.
   See issue b2a57996. #}
<p>Merged in <a class="mono" href="/{{ repo_name }}/diff/{{ merge_commit }}" title="{{ merge_commit }}">{% if let Some(short) = patch.short_merge_commit %}{{ short }}{% else %}{{ merge_commit }}{% endif %}</a></p>
{% endif %}
{% if !patch.labels.is_empty() %}
<p style="color: #666;">Labels: {{ patch.labels }}</p>
{% endif %}
{% if !patch.body.is_empty() %}
<pre style="background: #f8f8f8; padding: 12px; border-radius: 4px; white-space: pre-wrap;">{{ patch.body }}</pre>
{% endif %}

<h3>Revisions</h3>
{% if patch.revisions.is_empty() %}
<p style="color: #666;">No revisions.</p>
{% else %}
<div class="table-scroll">
<table>
  <thead>
    <tr>
      <th>#</th>
      <th>Commit</th>
      <th>Date</th>
      <th>Notes</th>
    </tr>
  </thead>
  <tbody>
    {% for rev in patch.revisions %}
    <tr>
      <td>{{ rev.number }}</td>
      <td class="mono">{% if let Some(short) = rev.short_commit %}<a href="/{{ repo_name }}/diff/{{ rev.commit }}">{{ short }}</a>{% else %}<span style="color: #666;">unknown</span>{% endif %}</td>
      <td class="mono timestamp" style="color: #666;" title="{{ rev.timestamp.full }}">{{ rev.timestamp.short }}</td>
      <td>{% if let Some(body) = rev.body %}{{ body }}{% endif %}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>
</div>
{% endif %}

{% if !patch.reviews.is_empty() %}
<h3>Reviews</h3>
{% for review in patch.reviews %}
<div style="border: 1px solid #ddd; border-radius: 4px; padding: 12px; margin-bottom: 12px;">
  <p style="margin: 0 0 8px 0;">
    <strong>{{ review.author }}</strong>
    &nbsp; <span class="status-{{ review.verdict }}">{{ review.verdict }}</span>
    &nbsp; <span class="mono timestamp" style="color: #666; font-size: 0.85em;" title="{{ review.timestamp.full }}">{{ review.timestamp.short }}</span>
    {% if let Some(rev) = review.revision %}&nbsp; rev {{ rev }}{% endif %}
    {% if review.edited %}&nbsp; <span style="color: #666; font-size: 0.85em;">(edited)</span>{% endif %}
  </p>
  {% if !review.body.is_empty() %}
  <pre style="margin: 0; white-space: pre-wrap;">{{ review.body }}</pre>
  {% endif %}
</div>
{% endfor %}
{% endif %}

{% if !patch.inline_comments.is_empty() %}
<h3>Inline Comments</h3>
{% for ic in patch.inline_comments %}
<div style="border: 1px solid #ddd; border-radius: 4px; padding: 12px; margin-bottom: 12px;">
  <p style="margin: 0 0 8px 0;">
    <strong>{{ ic.author }}</strong>
    &nbsp; <span class="mono" style="color: #666;">{{ ic.file }}:{{ ic.line }}</span>
    &nbsp; <span class="mono timestamp" style="color: #666; font-size: 0.85em;" title="{{ ic.timestamp.full }}">{{ ic.timestamp.short }}</span>
    {% if let Some(rev) = ic.revision %}&nbsp; rev {{ rev }}{% endif %}
    {% if ic.edited %}&nbsp; <span style="color: #666; font-size: 0.85em;">(edited)</span>{% endif %}
    {% if ic.non_blocking %}&nbsp; <span style="color: #666; font-size: 0.85em;">[non-blocking]</span>{% endif %}
    {% if let Some(by) = ic.resolved_by %}&nbsp; <span style="color: #2a7; font-size: 0.85em;">resolved by {{ by }}{% if let Some(at) = ic.resolved_at %} at r{{ at }}{% endif %}</span>{% endif %}
  </p>
  {% if ic.deleted %}
  <p style="margin: 0; color: #666; font-style: italic;">[deleted]</p>
  {% else %}
  <pre style="margin: 0; white-space: pre-wrap;">{{ ic.body }}</pre>
  {% endif %}
</div>
{% endfor %}
{% endif %}

{% if !patch.comments.is_empty() %}
<h3>Comments</h3>
{% for comment in patch.comments %}
<div style="border: 1px solid #ddd; border-radius: 4px; padding: 12px; margin-bottom: 12px;">
  <p style="margin: 0 0 8px 0;">
    <strong>{{ comment.author }}</strong>
    &nbsp; <span class="mono timestamp" style="color: #666; font-size: 0.85em;" title="{{ comment.timestamp.full }}">{{ comment.timestamp.short }}</span>
    {% if comment.edited %}&nbsp; <span style="color: #666; font-size: 0.85em;">(edited)</span>{% endif %}
  </p>
  {% if comment.deleted %}
  <p style="margin: 0; color: #666; font-style: italic;">[deleted]</p>
  {% else %}
  <pre style="margin: 0; white-space: pre-wrap;">{{ comment.body }}</pre>
  {% endif %}
</div>
{% endfor %}
{% endif %}
{% endblock %}