aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/templates/players.html
diff options
context:
space:
mode:
Diffstat (limited to 'internal/admin/templates/players.html')
-rw-r--r--internal/admin/templates/players.html40
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,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;'); }
+initCharacterEditor();
</script>
{{end}}