72 lines
1.5 KiB
HTML

{include "admin/layout.html"}
{block "content"}
<h1>Item Management</h1>
<div style="margin-bottom: 1rem;">
<a href="/admin/items/new" class="btn btn-primary">Add New Item</a>
</div>
<p>
Total items: {#items} | Page {currentPage} of {totalPages}
</p>
{if #items > 0}
<table>
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Type</th>
<th>Value</th>
<th>Attack</th>
<th>Defense</th>
<th>Strength</th>
<th>Dexterity</th>
<th>HP/MP</th>
<th>Special</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{for item in items}
<tr>
<td>{item.ID}</td>
<td>{item.Name}</td>
<td>{item.TypeName}</td>
<td>{item.Value}g</td>
<td>{if item.Attack != 0}{item.Attack}{else}-{/if}</td>
<td>{if item.Defense != 0}{item.Defense}{else}-{/if}</td>
<td>{if item.Strength != 0}{item.Strength}{else}-{/if}</td>
<td>{if item.Dexterity != 0}{item.Dexterity}{else}-{/if}</td>
<td>
{if item.MaxHP != 0}{item.MaxHP}HP{/if}
{if item.MaxMP != 0}{if item.MaxHP != 0}/{/if}{item.MaxMP}MP{/if}
{if item.MaxHP == 0 && item.MaxMP == 0}-{/if}
</td>
<td>{if item.Special}{item.Special}{else}-{/if}</td>
<td>
<a href="/admin/items/{item.ID}">Edit</a>
</td>
</tr>
{/for}
</tbody>
</table>
{if totalPages > 1}
<div class="pagination">
{if hasPrev}
<a href="/admin/items?page={currentPage - 1}">← Previous</a>
{/if}
{if hasNext}
<a href="/admin/items?page={currentPage + 1}">Next →</a>
{/if}
</div>
{/if}
{else}
<div>
No items found.
</div>
{/if}
{/block}