Compare commits

..

No commits in common. "192d86dbd51e2aa6ce57b47cb1cf3a21fda2b597" and "3b3e43d9afcb1b7809c648dd80fbca3c802cb0a7" have entirely different histories.

View file

@ -1904,6 +1904,7 @@ cat <<HTML_END > templates/change_password.html
HTML_END
# Edit Game Template
cat <<HTML_END > templates/edit_game.html
{% extends "base.html" %}
@ -1925,29 +1926,6 @@ cat <<HTML_END > templates/edit_game.html
{% endif %}
{% 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') }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="row g-3">
@ -1979,9 +1957,6 @@ 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>
@ -2000,11 +1975,14 @@ cat <<HTML_END > templates/edit_game.html
<textarea id="game_notes" name="notes" class="form-control" rows="3">{{ game.notes }}</textarea>
</div>
<!-- Externe Daten Anzeige -->
<!-- Externe Daten Card -->
<div class="col-12">
<div class="card mb-4">
<div class="card-header">
<div class="card-header d-flex justify-content-between align-items-center">
<span>🔄 {{ _('Externe Daten') }}</span>
<a href="{{ url_for('update_game_data', game_id=game.id) }}" class="btn btn-secondary">
Update Data
</a>
</div>
<div class="card-body">
{% if game.release_date %}
@ -2074,23 +2052,22 @@ cat <<HTML_END > templates/edit_game.html
<!-- Copy-JavaScript -->
<script>
document.querySelectorAll('.copy-btn').forEach(btn => {
btn.addEventListener('click', async function() {
const input = document.querySelector(this.dataset.clipboardTarget);
try {
await navigator.clipboard.writeText(input.value);
this.innerHTML = '✅ {{ _("Copied!") }}';
setTimeout(() => this.innerHTML = '{{ _("Copy") }}', 2000);
} catch (err) {
this.innerHTML = '❌ {{ _("Error") }}';
setTimeout(() => this.innerHTML = '{{ _("Copy") }}', 2000);
}
});
document.querySelectorAll('.copy-btn').forEach(btn => {
btn.addEventListener('click', async function() {
const input = document.querySelector(this.dataset.clipboardTarget);
try {
await navigator.clipboard.writeText(input.value);
this.innerHTML = '✅ {{ _("Copied!") }}';
setTimeout(() => this.innerHTML = '{{ _("Copy") }}', 2000);
} catch (err) {
this.innerHTML = '❌ {{ _("Error") }}';
setTimeout(() => this.innerHTML = '{{ _("Copy") }}', 2000);
}
});
});
</script>
{% endblock %}
HTML_END
cat <<HTML_END > templates/add_game.html