diff options
| author | historia <[not public]> | 2026-07-13 23:01:45 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-13 23:01:45 -0400 |
| commit | 5a6986a8c539364b7a166abdfb608b3cc00ecb3b (patch) | |
| tree | 0a8a199fa28173df7f97493a209b5642ef7b4817 /internal/admin/templates/players.html | |
| parent | 5ea48c1f91298b42924f6865ffc30810cceec2d3 (diff) | |
| download | thehouseoficarus-5a6986a8c539364b7a166abdfb608b3cc00ecb3b.tar.gz | |
feat(admin): convert players page into characters page with basic stats/yaml
Diffstat (limited to 'internal/admin/templates/players.html')
| -rw-r--r-- | internal/admin/templates/players.html | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/internal/admin/templates/players.html b/internal/admin/templates/players.html index 22ffc47..2cef9d7 100644 --- a/internal/admin/templates/players.html +++ b/internal/admin/templates/players.html @@ -1,33 +1,15 @@ -{{define "body-players"}} -<div style="padding:20px"> - <h2>Players</h2> - <div class="search-bar" style="max-width:400px"><input type="search" placeholder="Search players..." id="playerSearch" oninput="searchPlayers()"></div> - <table class="table" style="margin-top:12px"> - <thead><tr><th>Name</th><th>Level</th><th>Room</th><th>Account</th></tr></thead> - <tbody id="playerTableBody"></tbody> - </table> +{{define "body-characters"}} +<div class="editor-container"> + <div class="editor-list" id="charList"> + <div class="search-bar"><input type="search" placeholder="Search characters..." oninput="filterCharList(this.value)"></div> + <div id="listEntries"></div> + </div> + <div class="editor-main" id="editorMain"> + <p style="color:#888;text-align:center;margin-top:60px">Select a character to view</p> + </div> </div> +<script src="/static/charactereditor.js"></script> <script> -API.get('/api/players').then(function(r){ - var tbody = $('#playerTableBody'); - var players = r.players || r || []; - window._players = players; - renderPlayerTable(''); -}).catch(function(e){notify('Failed: '+e.message,'error')}); -function searchPlayers(){ - var q = ($('#playerSearch').value||'').toLowerCase(); - renderPlayerTable(q); -} -function renderPlayerTable(q){ - var tbody = $('#playerTableBody'); - var rows = (window._players||[]).filter(function(p){ - var name = (p.name||p.Name||'').toLowerCase(); - return !q || name.indexOf(q) >= 0; - }).map(function(p){ - return '<tr><td>'+esc(p.name||p.Name)+'</td><td>'+esc(p.level||p.Level)+'</td><td>'+esc(p.room||p.Room)+'</td><td>'+esc(p.account||p.Account)+'</td></tr>'; - }); - tbody.innerHTML = rows.join('') || '<tr><td colspan="4" style="color:#888">No players found</td></tr>'; -} -function esc(s) { return String(s || '').replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"'); } +initCharacterEditor(); </script> {{end}} |
