<!DOCTYPE html>
<html lang="fa">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ویرایش نمره</title>
    <!-- لینک بوت‌استرپ -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    <style>
        body {
            font-family: 'IRANSans', Arial, sans-serif;
            direction: rtl;
            text-align: right;
            background-color: #f9f9f9;
            padding: 20px;
        }

        .container {
            max-width: 600px;
            margin: 50px auto;
            background: #fff;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            padding: 20px;
        }

        h1, h2 {
            text-align: center;
            margin-bottom: 20px;
        }

        label {
            font-weight: bold;
        }

        input[type="number"] {
            width: 100%;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-sizing: border-box;
        }

        button {
            width: 100%;
            background-color: #007bff;
            border: none;
            padding: 10px;
            color: white;
            font-size: 16px;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        button:hover {
            background-color: #0056b3;
        }

        a {
            display: block;
            text-align: center;
            margin-top: 20px;
            text-decoration: none;
            color: #007bff;
            font-weight: bold;
        }

        a:hover {
            color: #0056b3;
        }
    </style>
</head>
<body>
    <div class="container animate__animated animate__delay-0.1s animate__fadeIn">
        <h2>نقش: {{ role_name }}</h2>
        <h1>ویرایش نمره: {{ person.user.first_name }} {{ person.user.last_name }}</h1>

        <form method="post">
            {% csrf_token %}
            <div class="mb-3">
                <label for="score">نمره:</label>
                <input type="number" id="score" name="score_{{ person.id }}" value="{{ person.role_score }}" required>
            </div>
            <button type="submit">ذخیره تغییرات</button>
        </form>
        <a href="{% url 'rate_users' role_key %}">بازگشت به لیست کاربران</a>
    </div>
</body>
</html>
