@model Webzine.WebApplication.Areas.Administration.ViewModels.Titre.AdminTitreForm

<div class="container">
    <!-- ARTISTE -->
    <div class="row mb-3 align-items-center">
        <label class="col-md-3 col-form-label">Nom de l'artiste<span class="text-danger">*</span></label>
        <div class="col-md-9">
            <select asp-for="IdArtiste"
                    asp-items="Model.Artistes"
                    class="form-select"></select>
        </div>
    </div>

    <!-- TITRE -->
    <div class="row mb-3 align-items-center">
        <label class="col-md-3 col-form-label">Titre<span class="text-danger">*</span></label>
        <div class="col-md-9">
            <input asp-for="Libelle" class="form-control"/>
        </div>
    </div>

    <!-- ALBUM -->
    <div class="row mb-3 align-items-center">
        <label class="col-md-3 col-form-label">Album<span class="text-danger">*</span></label>
        <div class="col-md-9">
            <input asp-for="Album" class="form-control"/>
        </div>
    </div>

    <!-- CHRONIQUE -->
    <div class="row mb-3">
        <label class="col-md-3 col-form-label">Chronique<span class="text-danger">*</span></label>
        <div class="col-md-9">
            <textarea asp-for="Chronique"
                      class="form-control"
                      rows="5"></textarea>
        </div>
    </div>

    <!-- DATE + DUREE -->
    <div class="row mb-3 align-items-center">
        <label class="col-md-3 col-form-label">Date de sortie<span class="text-danger">*</span></label>
        <div class="col-md-3">
                <input type="text"
                       class="form-control"
                       name="DateSortie"
                       pattern="\d{2}/\d{2}/\d{4}"
                       value="@Model.DateSortie.ToString("d")"/>
        </div>

        <label class="col-md-3 col-form-label">Durée en secondes<span class="text-danger">*</span></label>
        <div class="col-md-3">
            <div class="input-group">
                <input asp-for="Duree"
                       class="form-control"
                       type="number"
                       min="0" />
                <span class="input-group-text text-muted">seconds</span>
            </div>
        </div>
    </div>

    <!-- JAQUETTE -->
    <div class="row mb-3 align-items-center">
        <label class="col-md-3 col-form-label">Jaquette<span class="text-danger">*</span></label>
        <div class="col-md-9">
            <input asp-for="UrlJaquette"
                   class="form-control"/>
        </div>
    </div>

    <!-- URL ECOUTE -->
    <div class="row mb-3 align-items-center">
        <label class="col-md-3 col-form-label">URL d'écoute</label>
        <div class="col-md-9">
            <input asp-for="UrlEcoute"
                   class="form-control"/>
        </div>
    </div>

    <!-- STYLES -->
    <div class="row mb-4">
        <label class="col-md-3 col-form-label">Styles</label>
        <div class="col-md-9">
            <div class="row">
                @foreach (var style in Model.AllStyles)
                {
                    <div class="col-md-4 form-check">
                        <input class="form-check-input"
                               type="checkbox"
                               name="Styles"
                               value="@style.Value"
                               @(Model.Styles.Contains(int.Parse(style.Value)) ? "checked" : "") />

                        <label class="form-check-label">
                            @style.Text
                        </label>
                    </div>
                }
            </div>
        </div>
    </div>

    <!-- LECTURES / LIKES (AFFICHAGE UNIQUEMENT) -->
    <div class="row mb-4 align-items-center">
        <label class="col-md-3 col-form-label">Nb de lectures<span class="text-danger">*</span></label>
        <div class="col-md-3">
            @Model.NbLectures
        </div>
    </div>
    <div class="row mb-4 align-items-center">
        <label class="col-md-3 col-form-label">Nb de likes<span class="text-danger">*</span></label>
        <div class="col-md-3">
            @Model.NbLikes
        </div>
    </div>

    <!-- BOUTONS -->
    <div class="row mt-4">
        <div class="col-md-9 offset-md-3">

            <button type="submit" class="btn btn-primary me-2">
                Sauvegarder
            </button>

        </div>
    </div>

    <br />
    <br />
    <a asp-action="Index"
       class="btn text-primary">
        Retour à l'administration des titres
    </a>
</div>