70 lines
		
	
	
	
		
			2.9 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
	
		
			2.9 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{% extends "base.html" %}
 | 
						|
{% block content %}
 | 
						|
<div class="d-flex justify-content-between align-items-center mb-4">
 | 
						|
    <h1>{{ _('My Games') }}</h1>
 | 
						|
    <a href="{{ url_for('add_game') }}" class="btn btn-primary">
 | 
						|
        + {{ _('Add New Game') }}
 | 
						|
    </a>
 | 
						|
</div>
 | 
						|
 | 
						|
{% if games %}
 | 
						|
<div class="table-responsive">
 | 
						|
    <table class="table table-hover align-middle">
 | 
						|
        <thead class="table-dark">
 | 
						|
            <tr>
 | 
						|
                <th>{{ _('Cover') }}</th>
 | 
						|
                <th>{{ _('Name') }}</th>
 | 
						|
                <th>{{ _('Key') }}</th>
 | 
						|
                <th>{{ _('Status') }}</th>
 | 
						|
                <th>{{ _('Created') }}</th>
 | 
						|
                <th>{{ _('Redeem by') }}</th>
 | 
						|
                <th>{{ _('Shop') }}</th>
 | 
						|
                <th>{{ _('Actions') }}</th>
 | 
						|
            </tr>
 | 
						|
        </thead>
 | 
						|
        <tbody>
 | 
						|
            {% for game in games %}
 | 
						|
            <tr>
 | 
						|
                <td>
 | 
						|
                {% if game.steam_appid %}
 | 
						|
                <img src="https://cdn.cloudflare.steamstatic.com/steam/apps/{{ game.steam_appid }}/header.jpg"
 | 
						|
                     alt="Steam Header" style="height:64px;max-width:120px;object-fit:cover;">
 | 
						|
                {% endif %}
 | 
						|
                </td>
 | 
						|
                <td>{{ game.name }}</td>
 | 
						|
                <td class="font-monospace">{{ game.steam_key }}</td>
 | 
						|
                <td>
 | 
						|
                    {% if game.status == 'nicht eingelöst' %}
 | 
						|
                        <span class="badge bg-warning text-dark">{{ _('Not redeemed') }}</span>
 | 
						|
                    {% elif game.status == 'verschenkt' %}
 | 
						|
                        <span class="badge bg-success">{{ _('Gifted') }}</span>
 | 
						|
                    {% elif game.status == 'eingelöst' %}
 | 
						|
                        <span class="badge bg-secondary">{{ _('Redeemed') }}</span>
 | 
						|
                    {% endif %}
 | 
						|
                </td>
 | 
						|
                <td>{{ format_date(game.created_at) }}</td>
 | 
						|
                <td>
 | 
						|
                    {% if game.redeem_date %}
 | 
						|
                        <span class="badge bg-danger">{{ format_date(game.redeem_date) }}</span>
 | 
						|
                    {% endif %}
 | 
						|
                </td>
 | 
						|
                <td>
 | 
						|
                    {% if game.url %}
 | 
						|
                        <a href="{{ game.url }}" target="_blank" class="btn btn-sm btn-outline-info">🔗 {{ _('Shop') }}</a>
 | 
						|
                    {% endif %}
 | 
						|
                </td>
 | 
						|
                <td class="text-nowrap">
 | 
						|
                    <a href="{{ url_for('edit_game', game_id=game.id) }}" class="btn btn-sm btn-warning">✏️</a>
 | 
						|
                    <form method="POST" action="{{ url_for('delete_game', game_id=game.id) }}" class="d-inline">
 | 
						|
                        <button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('{{ _('Really delete?') }}')">🗑️</button>
 | 
						|
                    </form>
 | 
						|
                </td>
 | 
						|
            </tr>
 | 
						|
            {% endfor %}
 | 
						|
        </tbody>
 | 
						|
    </table>
 | 
						|
</div>
 | 
						|
{% else %}
 | 
						|
<div class="alert alert-info">{{ _('No games yet') }}</div>
 | 
						|
{% endif %}
 | 
						|
{% endblock %}
 |