better ux in edit_game.html
This commit is contained in:
parent
3b3e43d9af
commit
08ef5323a6
44
setup.sh
44
setup.sh
|
@ -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,17 @@ 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) }}">
|
||||||
|
<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>
|
||||||
|
</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">
|
||||||
|
@ -1975,14 +1985,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 %}
|
||||||
|
@ -2052,22 +2059,23 @@ cat <<HTML_END > templates/edit_game.html
|
||||||
|
|
||||||
<!-- Copy-JavaScript -->
|
<!-- Copy-JavaScript -->
|
||||||
<script>
|
<script>
|
||||||
document.querySelectorAll('.copy-btn').forEach(btn => {
|
document.querySelectorAll('.copy-btn').forEach(btn => {
|
||||||
btn.addEventListener('click', async function() {
|
btn.addEventListener('click', async function() {
|
||||||
const input = document.querySelector(this.dataset.clipboardTarget);
|
const input = document.querySelector(this.dataset.clipboardTarget);
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(input.value);
|
await navigator.clipboard.writeText(input.value);
|
||||||
this.innerHTML = '✅ {{ _("Copied!") }}';
|
this.innerHTML = '✅ {{ _("Copied!") }}';
|
||||||
setTimeout(() => this.innerHTML = '{{ _("Copy") }}', 2000);
|
setTimeout(() => this.innerHTML = '{{ _("Copy") }}', 2000);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.innerHTML = '❌ {{ _("Error") }}';
|
this.innerHTML = '❌ {{ _("Error") }}';
|
||||||
setTimeout(() => this.innerHTML = '{{ _("Copy") }}', 2000);
|
setTimeout(() => this.innerHTML = '{{ _("Copy") }}', 2000);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
HTML_END
|
HTML_END
|
||||||
|
|
||||||
cat <<HTML_END > templates/add_game.html
|
cat <<HTML_END > templates/add_game.html
|
||||||
|
|
Loading…
Reference in New Issue