well... now we have a better ux in edit_game.html - :D

This commit is contained in:
nocci 2025-05-08 16:54:24 +02:00
parent 08ef5323a6
commit 192d86dbd5
1 changed files with 22 additions and 7 deletions

View File

@ -1927,13 +1927,25 @@ cat <<HTML_END > templates/edit_game.html
<!-- Update Data Form (separate, outside main form, uses POST) -->
<div class="mb-3 text-end">
<form method="POST" action="{{ url_for('update_game_data', game_id=game.id) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="steam_appid_to_update" value="{{ game.steam_appid }}">
<button type="submit" name="update_data" value="1" class="btn btn-secondary">
🔄 {{ _('Update Data') }}
</button>
</form>
<form method="POST" action="{{ url_for('update_game_data', game_id=game.id) }}" id="updateDataForm">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<!-- Ändere die ID für Eindeutigkeit -->
<input type="hidden" name="steam_appid" id="itad_steam_appid" value="{{ game.steam_appid }}">
<button type="submit" class="btn btn-secondary">
🔄 {{ _('Update Data') }}
</button>
</form>
<script>
document.getElementById('updateDataForm').addEventListener('submit', function(e) {
e.preventDefault();
const currentAppId = document.getElementById('game_appid').value;
document.getElementById('itad_steam_appid').value = currentAppId;
this.submit();
});
</script>
</div>
<form method="POST" aria-label="{{ _('Spiel bearbeiten') }}">
@ -1967,6 +1979,9 @@ cat <<HTML_END > templates/edit_game.html
<div class="col-md-6">
<label for="game_appid" class="form-label">{{ _('Steam AppID') }}</label>
<input type="text" id="game_appid" name="steam_appid" class="form-control" value="{{ game.steam_appid or '' }}">
<small class="text-muted">
{{ _('For GOG games: Enter the Steam AppID here to enable price tracking.') }}
</small>
</div>
<div class="col-md-6">
<label for="game_redeem_date" class="form-label">{{ _('Redeem by') }}</label>