| {% extends "admin/base.html" %} |
|
|
| {% block admin_content %} |
| <div class="admin-header"> |
| <div class="admin-title">Edit Model</div> |
| <a href="{{ url_for('admin.models') }}" class="btn-secondary">Back to Models</a> |
| </div> |
|
|
| <div class="admin-card"> |
| <form method="POST" class="admin-form"> |
| <div class="form-group"> |
| <label for="id">Model ID</label> |
| <input type="text" id="id" name="id" class="form-control" value="{{ model.id }}" readonly> |
| </div> |
| |
| <div class="form-group"> |
| <label for="name">Model Name</label> |
| <input type="text" id="name" name="name" class="form-control" value="{{ model.name }}" required> |
| </div> |
| |
| <div class="form-group"> |
| <label for="model_type">Model Type</label> |
| <input type="text" id="model_type" name="model_type" class="form-control" value="{{ model.model_type }}" readonly> |
| </div> |
| |
| <div class="form-group"> |
| <label for="model_url">Model URL</label> |
| <input type="url" id="model_url" name="model_url" class="form-control" value="{{ model.model_url or '' }}"> |
| <small>Optional: URL to the model's page/repository</small> |
| </div> |
| |
| <div class="form-group"> |
| <label for="current_elo">Current ELO Score</label> |
| <input type="number" id="current_elo" name="current_elo" class="form-control" value="{{ model.current_elo }}" readonly> |
| <small>ELO score is calculated automatically from votes</small> |
| </div> |
| |
| <div class="form-check"> |
| <input type="checkbox" id="is_active" name="is_active" {% if model.is_active %}checked{% endif %}> |
| <span class="checkmark"></span> |
| <label for="is_active">Active (available for voting)</label> |
| </div> |
| |
| <div class="form-check"> |
| <input type="checkbox" id="is_open" name="is_open" {% if model.is_open %}checked{% endif %}> |
| <span class="checkmark"></span> |
| <label for="is_open">Open Source</label> |
| </div> |
| |
| <div class="form-group"> |
| <label>Statistics</label> |
| <div class="user-info"> |
| <p><strong>Matches:</strong> {{ model.match_count }}</p> |
| <p><strong>Wins:</strong> {{ model.win_count }}</p> |
| <p><strong>Win Rate:</strong> {{ model.win_rate|round(2) }}%</p> |
| </div> |
| </div> |
| |
| <button type="submit" class="btn-primary">Save Changes</button> |
| </form> |
| </div> |
| {% endblock %} |