Compare commits

..

2 commits

Author SHA1 Message Date
192d86dbd5 well... now we have a better ux in edit_game.html - :D 2025-05-08 16:54:24 +02:00
08ef5323a6 better ux in edit_game.html 2025-05-08 16:20:49 +02:00

View file

@ -1904,7 +1904,6 @@ cat <<HTML_END > templates/change_password.html
HTML_END HTML_END
# Edit Game Template # Edit Game Template
cat <<HTML_END > templates/edit_game.html cat <<HTML_END > templates/edit_game.html
{% extends "base.html" %} {% extends "base.html" %}
@ -1926,6 +1925,29 @@ cat <<HTML_END > templates/edit_game.html
{% endif %} {% endif %}
{% endwith %} {% endwith %}
<!-- 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) }}" 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') }}"> <form method="POST" aria-label="{{ _('Spiel bearbeiten') }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="row g-3"> <div class="row g-3">
@ -1957,6 +1979,9 @@ cat <<HTML_END > templates/edit_game.html
<div class="col-md-6"> <div class="col-md-6">
<label for="game_appid" class="form-label">{{ _('Steam AppID') }}</label> <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 '' }}"> <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>
<div class="col-md-6"> <div class="col-md-6">
<label for="game_redeem_date" class="form-label">{{ _('Redeem by') }}</label> <label for="game_redeem_date" class="form-label">{{ _('Redeem by') }}</label>
@ -1975,14 +2000,11 @@ cat <<HTML_END > templates/edit_game.html
<textarea id="game_notes" name="notes" class="form-control" rows="3">{{ game.notes }}</textarea> <textarea id="game_notes" name="notes" class="form-control" rows="3">{{ game.notes }}</textarea>
</div> </div>
<!-- Externe Daten Card --> <!-- Externe Daten Anzeige -->
<div class="col-12"> <div class="col-12">
<div class="card mb-4"> <div class="card mb-4">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header">
<span>🔄 {{ _('Externe Daten') }}</span> <span>🔄 {{ _('Externe Daten') }}</span>
<a href="{{ url_for('update_game_data', game_id=game.id) }}" class="btn btn-secondary">
Update Data
</a>
</div> </div>
<div class="card-body"> <div class="card-body">
{% if game.release_date %} {% if game.release_date %}
@ -2068,6 +2090,7 @@ document.querySelectorAll('.copy-btn').forEach(btn => {
</script> </script>
{% endblock %} {% endblock %}
HTML_END HTML_END
cat <<HTML_END > templates/add_game.html cat <<HTML_END > templates/add_game.html