aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/templates
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-13 23:01:45 -0400
committerhistoria <[not public]>2026-07-13 23:01:45 -0400
commit5a6986a8c539364b7a166abdfb608b3cc00ecb3b (patch)
tree0a8a199fa28173df7f97493a209b5642ef7b4817 /internal/admin/templates
parent5ea48c1f91298b42924f6865ffc30810cceec2d3 (diff)
downloadthehouseoficarus-5a6986a8c539364b7a166abdfb608b3cc00ecb3b.tar.gz
feat(admin): convert players page into characters page with basic stats/yaml
Diffstat (limited to 'internal/admin/templates')
-rw-r--r--internal/admin/templates/layout.html4
-rw-r--r--internal/admin/templates/players.html40
2 files changed, 13 insertions, 31 deletions
diff --git a/internal/admin/templates/layout.html b/internal/admin/templates/layout.html
index 2a1ef36..02f8a01 100644
--- a/internal/admin/templates/layout.html
+++ b/internal/admin/templates/layout.html
@@ -20,7 +20,7 @@
<a href="/editor/techs" class="{{if eq .Page "techs"}}active{{end}}">Techs</a>
<a href="/editor/modules" class="{{if eq .Page "modules"}}active{{end}}">Modules</a>
<a href="/editor/triggers" class="{{if eq .Page "triggers"}}active{{end}}">Triggers</a>
- <a href="/editor/players" class="{{if eq .Page "players"}}active{{end}}">Players</a>
+ <a href="/editor/characters" class="{{if eq .Page "characters"}}active{{end}}">Characters</a>
<a href="/editor/dashboard" class="{{if eq .Page "dashboard"}}active{{end}}">Dashboard</a>
<a href="/editor/files" class="{{if eq .Page "files"}}active{{end}}">Files</a>
<div class="undo-bar">
@@ -40,7 +40,7 @@
{{else if eq .Page "techs"}}{{template "body-techs" .}}
{{else if eq .Page "modules"}}{{template "body-modules" .}}
{{else if eq .Page "triggers"}}{{template "body-triggers" .}}
-{{else if eq .Page "players"}}{{template "body-players" .}}
+{{else if eq .Page "characters"}}{{template "body-characters" .}}
{{else if eq .Page "dashboard"}}{{template "body-dashboard" .}}
{{else if eq .Page "files"}}{{template "body-files" .}}
{{else if eq .Page "duplicate-rooms"}}{{template "body-duplicate-rooms" .}}
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}}