45 lines
1.6 KiB
HTML
45 lines
1.6 KiB
HTML
{include "admin/layout.html"}
|
|
|
|
{block "content"}
|
|
<h1>{if town.ID}Edit Town: {town.Name}{else}Add New Town{/if}</h1>
|
|
|
|
<form class="standard" method="post">
|
|
{csrf}
|
|
<div>
|
|
<label for="name">Town Name:</label>
|
|
<input type="text" name="name" id="name" value="{town.Name}" required>
|
|
</div>
|
|
<div>
|
|
<label for="x">X Position:</label>
|
|
<input type="number" name="x" id="x" value="{town.X}" required>
|
|
</div>
|
|
<div>
|
|
<label for="y">Y Position:</label>
|
|
<input type="number" name="y" id="y" value="{town.Y}" required>
|
|
</div>
|
|
<div>
|
|
<label for="inn_cost">Inn Cost (gold):</label>
|
|
<input type="number" name="inn_cost" id="inn_cost" value="{town.InnCost}" min="0" required>
|
|
</div>
|
|
<div>
|
|
<label for="map_cost">Map Cost (gold):</label>
|
|
<input type="number" name="map_cost" id="map_cost" value="{town.MapCost}" min="0" required>
|
|
</div>
|
|
<div>
|
|
<label for="tp_cost">Teleport Cost (gold):</label>
|
|
<input type="number" name="tp_cost" id="tp_cost" value="{town.TPCost}" min="0" required>
|
|
</div>
|
|
<div>
|
|
<label for="shop_list">Shop Items (comma-separated item IDs):</label>
|
|
<input type="text" name="shop_list" id="shop_list" value="{town.ShopList}" placeholder="1,2,3">
|
|
<small>Enter item IDs separated by commas (e.g. "1,2,3,4")</small>
|
|
</div>
|
|
<div>
|
|
<a href="/admin/towns"><button type="button" class="btn">Cancel</button></a>
|
|
<button type="submit" class="btn btn-primary">{if town.ID}Update{else}Create{/if} Town</button>
|
|
{if town.ID}
|
|
<button type="submit" name="delete" value="1" class="btn btn-danger" onclick="return confirm('Are you sure you want to delete this town?')">Delete Town</button>
|
|
{/if}
|
|
</div>
|
|
</form>
|
|
{/block} |