← Back
mainapp/views/pulls/list.php
<?php require __DIR__ . '/../layout/header.php'; ?>

<div class="d-flex justify-content-between align-items-center mb-3">
  <h4 class="m-0"><?= e($repo['owner_username']) ?>/<?= e($repo['name']) ?> • Pull Requests</h4>
  <div class="d-flex gap-2">
    <?php if ($canWrite): ?>
      <a class="btn btn-dark btn-sm" href="/r/<?= (int)$repo['id'] ?>/pulls/new">New PR</a>
    <?php endif; ?>
    <a class="btn btn-outline-dark btn-sm" href="/r/<?= (int)$repo['id'] ?>">Back</a>
  </div>
</div>

<div class="card p-2">
  <div class="list-group list-group-flush">
    <?php if (!$prs): ?>
      <div class="p-3 text-muted">No pull requests yet.</div>
    <?php endif; ?>

    <?php foreach ($prs as $pr): ?>
      <a class="list-group-item list-group-item-action"
         href="/r/<?= (int)$repo['id'] ?>/pulls/<?= (int)$pr['number'] ?>">
        <div class="d-flex justify-content-between">
          <div class="fw-bold">#<?= (int)$pr['number'] ?> <?= e($pr['title']) ?></div>
          <span class="badge bg-secondary"><?= e($pr['state']) ?></span>
        </div>
        <div class="small text-muted mono"><?= e($pr['source_branch']) ?> → <?= e($pr['target_branch']) ?> • by <?= e($pr['author_name']) ?></div>
      </a>
    <?php endforeach; ?>
  </div>
</div>

<?php require __DIR__ . '/../layout/footer.php'; ?>