{% extends "admin/base_site.html" %}
{% load i18n static %}

{% block title %}Редактирование отеля{% endblock %}

{% block content %}
<div class="container-fluid">
    <h3 class="text-dark mb-4">Редактирование отеля</h3>

    <form method="post" action="{% url 'admin:save_edited_hotel' hotel.id %}">
        {% csrf_token %}
        <div class="form-group mb-3">
            <label for="display_name" class="form-label">Отображаемое имя</label>
            <input class="form-control" type="text" id="display_name" name="display_name" value="{{ hotel.display_name }}" required>
        </div>
        <div class="form-group mb-3">
            <label for="original_name" class="form-label">Оригинальное имя</label>
            <input class="form-control" type="text" id="original_name" name="original_name" value="{{ hotel.name }}" required>
        </div>
        <div class="form-group mb-3">
            <label for="imported" class="form-label">Импортирован</label>
            <select class="form-select" id="imported" name="imported">
                <option value="True" {% if hotel.imported %} selected {% endif %}>Да</option>
                <option value="False" {% if not hotel.imported %} selected {% endif %}>Нет</option>
            </select>
        </div>
        <div class="form-group mb-3">
            <button type="submit" class="btn btn-primary">Сохранить изменения</button>
            <a href="{% url 'admin:hotel_list' %}" class="btn btn-secondary">Назад</a>
        </div>
    </form>
</div>
{% endblock %}
