Diff: projectbased/app/Views/matching/index.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php use App\Lib\Url; ?>
2 + <div class="section-title mb-3">
3 + <div>
4 + <h1 class="h4 m-0">Matching</h1>
5 + <div class="muted">1) Projekte für dich · 2) Bedarf → Projektvorschläge (Demo).</div>
6 + </div>
7 + </div>
8 +
9 + <div class="row g-4">
10 + <div class="col-lg-4">
11 + <div class="card p-4">
12 + <h2 class="h6 mb-2">Deine Skills</h2>
13 + <?php if (empty($skills)): ?>
14 + <div class="muted">Noch keine Skills. <a href="<?= Url::route('profile') ?>">Jetzt eintragen</a></div>
15 + <?php else: ?>
16 + <ul class="mb-0">
17 + <?php foreach($skills as $s): ?>
18 + <li><?= htmlspecialchars($s['name']) ?> <span class="muted">(L<?= (int)$s['level'] ?>)</span></li>
19 + <?php endforeach; ?>
20 + </ul>
21 + <?php endif; ?>
22 + <hr>
23 + <div class="muted small">
24 + Tipp: Skills als konkrete Begriffe (z. B. „Pflege“, „Elektrik“, „Logistik“, „Bauleitung“, „PHP“).
25 + </div>
26 + </div>
27 + </div>
28 +
29 + <div class="col-lg-8">
30 + <div class="card p-4">
31 + <h2 class="h6 mb-3">Top Projekte für dich</h2>
32 + <?php if (empty($ranked)): ?>
33 + <div class="muted">Keine Matches gefunden. Trage Skills ein oder starte Projekte mit klaren Keywords.</div>
34 + <?php else: ?>
35 + <div class="table-responsive">
36 + <table class="table table-sm align-middle mb-0">
37 + <thead><tr><th>Projekt</th><th>Score</th><th>Warum</th><th></th></tr></thead>
38 + <tbody>
39 + <?php foreach($ranked as $r): $p=$r['project']; ?>
40 + <tr>
41 + <td><?= htmlspecialchars($p['title']) ?><div class="muted small"><?= htmlspecialchars($p['region']) ?> · <?= htmlspecialchars($p['owner_name']) ?></div></td>
42 + <td><span class="badge badge-soft"><?= (int)$r['score'] ?></span></td>
43 + <td class="muted small"><?= htmlspecialchars(implode(', ', array_slice($r['reasons'],0,4))) ?><?= count($r['reasons'])>4?' …':'' ?></td>
44 + <td><a class="btn btn-sm btn-outline-light" href="<?= Url::route('project_view',['id'=>(int)$p['id']]) ?>">Öffnen</a></td>
45 + </tr>
46 + <?php endforeach; ?>
47 + </tbody>
48 + </table>
49 + </div>
50 + <?php endif; ?>
51 + </div>
52 + </div>
53 + </div>
54 +
55 + <div class="card p-4 mt-4">
56 + <h2 class="h6 mb-3">Bedarf → Projektvorschläge (Demo)</h2>
57 + <div class="table-responsive">
58 + <table class="table table-sm align-middle mb-0">
59 + <thead><tr><th>Bedarf</th><th>Vorschläge</th></tr></thead>
60 + <tbody>
61 + <?php foreach($needRecs as $nr): ?>
62 + <tr>
63 + <td>
64 + <div class="fw-semibold"><?= htmlspecialchars($nr['need']['title']) ?></div>
65 + <div class="muted small"><?= htmlspecialchars($nr['need']['category']) ?> · <?= htmlspecialchars($nr['need']['region']) ?> · Prio <?= (int)$nr['need']['priority'] ?>/5</div>
66 + </td>
67 + <td class="muted small">
68 + <?php if (empty($nr['recs'])): ?>
69 + Keine passenden Projekte.
70 + <?php else: ?>
71 + <?php foreach($nr['recs'] as $c): ?>
72 + <div>
73 + <a href="<?= Url::route('project_view',['id'=>(int)$c['p']['id']]) ?>"><?= htmlspecialchars($c['p']['title']) ?></a>
74 + <span class="muted">(score <?= (int)$c['s'] ?>)</span>
75 + </div>
76 + <?php endforeach; ?>
77 + <?php endif; ?>
78 + </td>
79 + </tr>
80 + <?php endforeach; ?>
81 + </tbody>
82 + </table>
83 + </div>
84 + </div>
85 +