Renaming checks for a name collision first (characters.char_name has no unique constraint in the schema, so this has to be enforced at the application level to avoid two characters silently sharing a name), and also updates list_friend.namefriend for any rows referencing this character's id -- that column is a denormalized display-name cache in other players' friend lists and would otherwise go stale on rename. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
46 lines
2.0 KiB
HTML
46 lines
2.0 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}{{ char.char_name }} - ROSS Admin{% endblock %}
|
|
{% block content %}
|
|
<div class="card" style="max-width:600px;">
|
|
<h2 style="margin-top:0;">Charakter: {{ char.char_name }} <span class="badge ok">Account: {{ char.account_name }}</span></h2>
|
|
<form method="post">
|
|
<label>Charaktername</label>
|
|
<input type="text" name="char_name" value="{{ char.char_name }}" required>
|
|
|
|
<label>Standort (wirkt beim nächsten Login)</label>
|
|
<select name="respawnid">
|
|
<option value="{{ char.respawnid }}">-- aktuell: Zone #{{ char.respawnid }} --</option>
|
|
{% for map, zones in zones_by_map.items() %}
|
|
<optgroup label="Map {{ map }}">
|
|
{% for z in zones %}
|
|
<option value="{{ z.id }}">Map {{ z.map }} - Zone #{{ z.id }} ({{ '%.0f' % z.x }}, {{ '%.0f' % z.y }})</option>
|
|
{% endfor %}
|
|
</optgroup>
|
|
{% endfor %}
|
|
</select>
|
|
|
|
<div class="grid" style="margin-top:12px;">
|
|
{% for field in stat_fields %}
|
|
<div>
|
|
<label>{{ field.lstrip('_') }}</label>
|
|
<input type="number" name="{{ field }}" value="{{ char[field] }}">
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
<label style="margin-top:16px;"><input type="checkbox" name="isgm" style="width:auto;" {% if char.isgm %}checked{% endif %}> GM</label>
|
|
<label><input type="checkbox" name="isdev" style="width:auto;" {% if char.isdev %}checked{% endif %}> Dev (Debugmode-fähig)</label>
|
|
<div style="margin-top:20px;">
|
|
<button type="submit">Speichern</button>
|
|
<a class="btn secondary" href="{{ url_for('characters') }}">Zurück</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="card" style="max-width:600px;border-color:#5a2530;">
|
|
<h3 style="margin-top:0;color:var(--danger);">Gefahrenzone</h3>
|
|
<form method="post" action="{{ url_for('delete_character', char_id=char.id) }}"
|
|
onsubmit="return confirm('Charakter {{ char.char_name }} wirklich unwiderruflich löschen?');">
|
|
<button type="submit" style="background:var(--danger);">Charakter löschen</button>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|