Files
server-manager/views/teams/index.php
Agent 88f3c1f964 refactor: extract inline CSS/JS from views into separate asset files (20+ files)
Phase A — HTML removed from PHP files:
- RateLimitMiddleware.php: heredoc moved to views/errors/429.php
- public/index.php: inline HTML replaced with View::error()
- AuthMiddleware.php: <script> redirect replaced with <meta refresh>

Phase B — Inline CSS/JS extracted from views:
- CSS: landing.css (459 lines), legal.css (shared by terms+privacy)
- JS: 17 new files extracted from ~20 view files
  - main.js (layout sidebar + notifications)
  - dashboard-chart.js, server-show.js, server-services.js
  - nginx-manager.js, database-manager.js
  - terminal.js, team-show.js, team-index.js
  - server-list.js, server-permissions.js (shared by edit+create)
  - server-ssl.js, server-processes.js, system-users.js
  - admin-users.js, audit-log.js, admin-notifications.js, admin-security.js
  - notifications.js

Total: -3264 lines from views, +288 lines in new assets
2026-06-14 08:04:01 -04:00

75 lines
3.3 KiB
PHP

<?php $teams = $teams ?? []; $search = $search ?? ''; ?>
<div class="page-header">
<div class="page-header-left">
<h1 class="page-title">Teams</h1>
<p class="page-subtitle">Create and manage work teams with server access</p>
</div>
<div class="page-header-right">
<a href="/teams/create" class="btn btn-primary">
<i class="fas fa-plus"></i> Create Team
</a>
</div>
</div>
<div class="teams-toolbar">
<div class="teams-search">
<i class="fas fa-search teams-search-icon"></i>
<input type="text" id="teamSearch" class="form-input teams-search-input"
placeholder="Search teams..." value="<?= htmlspecialchars($search) ?>">
<button class="teams-search-clear" id="searchClear" onclick="filterTeams('')" style="display:none">&times;</button>
</div>
</div>
<div id="teamsContainer">
<?php if (empty($teams)): ?>
<div class="empty-state" id="emptyState">
<i class="fas fa-users-cog"></i>
<p id="emptyText">No teams created yet.</p>
<a href="/teams/create" class="btn btn-primary">Create Your First Team</a>
</div>
<?php else: ?>
<div class="teams-grid" id="teamsGrid">
<?php foreach ($teams as $team): ?>
<div class="team-card" data-name="<?= htmlspecialchars(mb_strtolower($team['name'] ?? '')) ?>"
data-desc="<?= htmlspecialchars(mb_strtolower($team['description'] ?? '')) ?>">
<div class="team-card-header">
<div class="team-card-icon">
<i class="fas fa-users"></i>
</div>
<h3 class="team-card-title">
<a href="/teams/<?= $team['id'] ?>"><?= htmlspecialchars($team['name']) ?></a>
</h3>
</div>
<p class="team-card-desc">
<?= htmlspecialchars(mb_substr($team['description'] ?? 'No description', 0, 100)) ?>
</p>
<div class="team-card-stats">
<span class="team-stat">
<i class="fas fa-user"></i> <?= (int) ($team['member_count'] ?? 0) ?> members
</span>
<span class="team-stat">
<i class="fas fa-server"></i> <?= (int) ($team['server_count'] ?? 0) ?> servers
</span>
</div>
<div class="team-card-actions">
<a href="/teams/<?= $team['id'] ?>" class="btn btn-sm btn-primary">
<i class="fas fa-cog"></i> Manage
</a>
<button class="btn btn-sm btn-danger" title="Delete"
onclick="deleteTeam(<?= $team['id'] ?>, '<?= htmlspecialchars(addslashes($team['name'])) ?>')">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<form id="deleteForm" method="POST" style="display:none">
<input type="hidden" name="_csrf_token" value="<?= $this->csrfToken() ?>">
</form>
<script src="/assets/js/team-index.js"></script>