Compare commits
2 Commits
3b3e43d9af
...
192d86dbd5
Author | SHA1 | Date |
---|---|---|
|
192d86dbd5 | |
|
08ef5323a6 |
59
setup.sh
59
setup.sh
|
@ -1904,7 +1904,6 @@ cat <<HTML_END > templates/change_password.html
|
|||
|
||||
HTML_END
|
||||
|
||||
|
||||
# Edit Game Template
|
||||
cat <<HTML_END > templates/edit_game.html
|
||||
{% extends "base.html" %}
|
||||
|
@ -1926,6 +1925,29 @@ 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">
|
||||
|
@ -1957,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>
|
||||
|
@ -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>
|
||||
</div>
|
||||
|
||||
<!-- Externe Daten Card -->
|
||||
<!-- Externe Daten Anzeige -->
|
||||
<div class="col-12">
|
||||
<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>
|
||||
<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 %}
|
||||
|
@ -2052,22 +2074,23 @@ 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
|
||||
|
|
Loading…
Reference in New Issue