100 lines
3.2 KiB
HTML
100 lines
3.2 KiB
HTML
{% extends 'base.html' %}
|
|
|
|
{% block title %}Admin Search - Game Tracker{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="admin-header">
|
|
<div class="admin-title">
|
|
<h1>Admin Game Search</h1>
|
|
<p class="subtitle">Find games to add to the tracking list</p>
|
|
</div>
|
|
<div class="admin-actions">
|
|
<a href="{{ url_for('main.admin_dashboard') }}" class="btn btn-secondary">
|
|
<i class="fas fa-arrow-left"></i> Back to Dashboard
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="search-container">
|
|
<form action="{{ url_for('main.admin_search') }}" method="POST" class="search-form">
|
|
<div class="search-input">
|
|
<input type="text" name="query" placeholder="Enter game name..." value="{{ query }}" required>
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="fas fa-search"></i> Search
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
{% if results %}
|
|
<div class="results-info">
|
|
<h2>Search Results</h2>
|
|
<p>Found {{ results|length }} games matching "{{ query }}"</p>
|
|
</div>
|
|
|
|
<div class="search-results">
|
|
{% for game in results %}
|
|
<div class="search-result-card">
|
|
<div class="game-cover">
|
|
{% if game.cover_url %}
|
|
<img src="{{ game.cover_url }}" alt="{{ game.name }} cover">
|
|
{% else %}
|
|
<div class="no-cover">
|
|
<i class="fas fa-gamepad"></i>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="game-info">
|
|
<h3>{{ game.name }}</h3>
|
|
|
|
<div class="game-meta">
|
|
{% if game.release_date %}
|
|
<span><i class="fas fa-calendar-alt"></i> {{ game.release_date }}</span>
|
|
{% endif %}
|
|
|
|
{% if game.platforms %}
|
|
<span><i class="fas fa-desktop"></i>
|
|
{% if game.platforms|length > 2 %}
|
|
{{ game.platforms[0] }} + {{ game.platforms|length - 1 }} more
|
|
{% else %}
|
|
{{ game.platforms|join(', ') }}
|
|
{% endif %}
|
|
</span>
|
|
{% endif %}
|
|
|
|
{% if game.developer %}
|
|
<span><i class="fas fa-code"></i> {{ game.developer }}</span>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if game.description %}
|
|
<div class="game-description">
|
|
<p>{{ game.description|truncate(150) }}</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="search-actions">
|
|
<form action="{{ url_for('main.admin_add_game', igdb_id=game.id) }}" method="POST">
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="fas fa-plus"></i> Add to Tracking List
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% elif query %}
|
|
<div class="empty-search">
|
|
<div class="empty-icon">
|
|
<i class="fas fa-search"></i>
|
|
</div>
|
|
<h2>No games found</h2>
|
|
<p>We couldn't find any games matching "{{ query }}"</p>
|
|
<p>Try a different search term!</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|