From 0c756c425ffee05c1a31ba20d904cb5e38ad61b2 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Fri, 29 Aug 2025 07:43:37 -0500 Subject: [PATCH] add spells and items panels --- data/dk.db | Bin 98304 -> 98304 bytes internal/routes/admin.go | 399 ++++++++++++++++++++++++++++++ templates/admin/spells/edit.html | 47 ++++ templates/admin/spells/index.html | 60 +++++ templates/admin/towns/edit.html | 45 ++++ templates/admin/towns/index.html | 62 +++++ 6 files changed, 613 insertions(+) create mode 100644 templates/admin/spells/edit.html create mode 100644 templates/admin/spells/index.html create mode 100644 templates/admin/towns/edit.html create mode 100644 templates/admin/towns/index.html diff --git a/data/dk.db b/data/dk.db index 3682e659fdb6f321935dbbb74276325bc7cb2ea0..fa290bb7001040c5484cdcbb0db929330a21de40 100644 GIT binary patch delta 347 zcmZo@U~6b#+c3pmT7rRrfr~ROGd-h(kCR!E5zLCu$xkoNoV?y%o{?+wd3(?anVV~5*l8n?M1;?V? z{31ggqfH-J9GE3|5~s5pFzPe$Bm&Kr;W06i5N6=i1rdy#jH+OogOLLWI2pw`IT;yQ zSlGCk(h_ruQ`y-wHqQ6~!rMD+7;BiBGdZ}YvpX=J=HPJT(B+Wl;0Bs#$nGta$xOkf(sIhvVjVJ LZV&TdTxAXbB9B%6 delta 194 zcmZo@U~6b#+c3pmTAYD_fr~ROGd-h(kCR!E5zLCu$xkm%oxI*&o{?kod3(Ul95`Z;8>KKUu3xH1B(N*I8VoPb^}IzpsB7ryhh@} n40^gif|HSxaeIdiV+}KNDo5CKb_d4OKou?Q+rvB{if spell.ID}Edit Spell: {spell.Name}{else}Add New Spell{/if} + +
+ {csrf} +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + Optional icon filename or path +
+
+ + +
+
+ + + {if spell.ID} + + {/if} +
+
+{/block} \ No newline at end of file diff --git a/templates/admin/spells/index.html b/templates/admin/spells/index.html new file mode 100644 index 0000000..d0943d7 --- /dev/null +++ b/templates/admin/spells/index.html @@ -0,0 +1,60 @@ +{include "admin/layout.html"} + +{block "content"} +

Spell Management

+ + + +

+ Total spells: {#spells} | Page {currentPage} of {totalPages} +

+ +{if #spells > 0} + + + + + + + + + + + + + + {for spell in spells} + + + + + + + + + + {/for} + +
IDNameTypeMP CostPowerIconActions
{spell.ID}{spell.Name}{spell.TypeName}{spell.MP}{spell.Power}{if spell.Icon}{spell.Icon}{else}-{/if} + Edit +
+ +{if totalPages > 1} + +{/if} + +{else} +
+ No spells found. +
+{/if} +{/block} \ No newline at end of file diff --git a/templates/admin/towns/edit.html b/templates/admin/towns/edit.html new file mode 100644 index 0000000..10953e0 --- /dev/null +++ b/templates/admin/towns/edit.html @@ -0,0 +1,45 @@ +{include "admin/layout.html"} + +{block "content"} +

{if town.ID}Edit Town: {town.Name}{else}Add New Town{/if}

+ +
+ {csrf} +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + Enter item IDs separated by commas (e.g. "1,2,3,4") +
+
+ + + {if town.ID} + + {/if} +
+
+{/block} \ No newline at end of file diff --git a/templates/admin/towns/index.html b/templates/admin/towns/index.html new file mode 100644 index 0000000..b0acbda --- /dev/null +++ b/templates/admin/towns/index.html @@ -0,0 +1,62 @@ +{include "admin/layout.html"} + +{block "content"} +

Town Management

+ + + +

+ Total towns: {#towns} | Page {currentPage} of {totalPages} +

+ +{if #towns > 0} + + + + + + + + + + + + + + + {for town in towns} + + + + + + + + + + + {/for} + +
IDNamePositionInn CostMap CostTP CostShop ItemsActions
{town.ID}{town.Name}({town.X}, {town.Y}){town.InnCost}g{town.MapCost}g{town.TPCost}g{town.ShopItemCount} + Edit +
+ +{if totalPages > 1} + +{/if} + +{else} +
+ No towns found. +
+{/if} +{/block} \ No newline at end of file