File size: 2,605 Bytes
f1a0148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{% 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 %}