選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

96 行
4.2KB

  1. <div class="page-header">
  2. <h1><?= e($territory['name']) ?></h1>
  3. <div class="page-header-actions">
  4. <a class="button button-secondary button-sm" href="/territories/<?= e($territory['id']) ?>/edit">Edit</a>
  5. <form method="POST" action="/territories/<?= e($territory['id']) ?>/delete"
  6. class="inline-form"
  7. onsubmit="return confirm('Delete this territory?')">
  8. <?= csrf_field() ?>
  9. <button class="button button-danger button-sm" type="submit">Delete</button>
  10. </form>
  11. <a class="button button-secondary button-sm" href="/territories">← Back</a>
  12. </div>
  13. </div>
  14. <?php if ($territory['description']): ?>
  15. <div class="section-panel" style="margin-bottom:1.25rem">
  16. <p style="margin:0"><?= e($territory['description']) ?></p>
  17. </div>
  18. <?php endif; ?>
  19. <div class="content-stack">
  20. <div class="section-panel">
  21. <div class="panel-header">
  22. <h2>Streets</h2>
  23. </div>
  24. <?php if (empty($streets)): ?>
  25. <div class="empty-state">
  26. <p>No streets recorded yet. <a href="/households/new?territory_id=<?= e($territory['id']) ?>">Add a household</a> to this territory.</p>
  27. </div>
  28. <?php else: ?>
  29. <div class="street-chips">
  30. <?php foreach ($streets as $street): ?>
  31. <span class="badge badge-success"><?= e($street) ?></span>
  32. <?php endforeach; ?>
  33. </div>
  34. <?php endif; ?>
  35. </div>
  36. <div class="section-panel">
  37. <div class="panel-header" style="display:flex;justify-content:space-between;align-items:center">
  38. <h2 style="margin:0">Households (<?= count($households) ?>)</h2>
  39. <a class="button button-primary button-sm"
  40. href="/households/new?territory_id=<?= e($territory['id']) ?>">+ Add Household</a>
  41. </div>
  42. <?php if (empty($households)): ?>
  43. <div class="empty-state">
  44. <p>No households in this territory yet.</p>
  45. </div>
  46. <?php else: ?>
  47. <div class="table-responsive">
  48. <table class="data-table">
  49. <thead>
  50. <tr>
  51. <th>#</th>
  52. <th>Address</th>
  53. <th>Street</th>
  54. <th>Business</th>
  55. <th>DNC</th>
  56. <th>Actions</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. <?php foreach ($households as $h): ?>
  61. <tr>
  62. <td class="text-secondary"><?= e((string) ($h['street_number'] ?? '')) ?></td>
  63. <td>
  64. <a href="/households/<?= e($h['id']) ?>"><?= e($h['address']) ?></a>
  65. </td>
  66. <td class="text-secondary"><?= e((string) ($h['street_name'] ?? '')) ?></td>
  67. <td>
  68. <?php if ($h['is_business']): ?>
  69. <span class="badge badge-warning">Business</span>
  70. <?php endif; ?>
  71. </td>
  72. <td>
  73. <?php if ($h['do_not_call']): ?>
  74. <span class="badge badge-danger">DNC</span>
  75. <?php endif; ?>
  76. </td>
  77. <td class="table-actions">
  78. <a class="button button-secondary button-sm"
  79. href="/households/<?= e($h['id']) ?>">View</a>
  80. <a class="button button-secondary button-sm"
  81. href="/households/<?= e($h['id']) ?>/edit">Edit</a>
  82. </td>
  83. </tr>
  84. <?php endforeach; ?>
  85. </tbody>
  86. </table>
  87. </div>
  88. <?php endif; ?>
  89. </div>
  90. </div>

Powered by TurnKey Linux.