@model EditShowListFileViewModel
@inject UserManager<User> userManager
@inject IUserLimitService UserLimitService

@{
    ViewData["Title"] = "Show list";
    ViewData["Message"] = $"Edit your '{Model.Name}' list";

    var user = await userManager.GetUserAsync(User);
    var userLimitConfiguration = UserLimitService.Get(user.Level);
}

<partial name="_LimitNotification" />

@if (!userLimitConfiguration.ListsFromNames)
{
    <partial name="_PreviewDonorOnlyPartial" />
}

<div class="row">
    <div class="col-md-12">
        <form asp-action="EditShowListFile" method="post">

            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">List settings</h5>
                    <h6 class="card-subtitle mb-2 text-muted">All information that is needed to create a list</h6>

                    <hr />

                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <input asp-for="Name" class="form-control" />
                                <small class="form-text text-muted">* Give your list a name that makes it easier to find after creating.</small>
                                <span asp-validation-for="Name" class="text-danger"></span>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="alert alert-info" role="alert">
                                Please stick to the pattern as shown below to minimize false positives. Everything that is not this pattern will be ignored.
                            </div>
                            <textarea asp-for="ItemList" class="form-control" rows="12" placeholder="Game of Thrones (2011)
Breaking Bad (2008)
The Walking Dead (2010)
The Big Bang Theory (2007)
Sherlock (2010)
House (2004)
Homeland (2011)
Stranger Things (2016)
Suits (2011)"></textarea>
                            <span asp-validation-for="ItemList" class="text-danger"></span>
                            <small class="form-text text-muted">Example of how your list should look like</small>
                        </div>

                        <div class="col-md-6">
                            <div class="alert alert-info" role="alert">
                                This is the report to show which show matched to which show in the trakt.tv database.
                            </div>
                            <textarea asp-for="Report" class="form-control" rows="12" disabled></textarea>
                            <span asp-validation-for="Report" class="text-danger"></span>
                        </div>
                    </div>
                </div>
            </div>

            <hr />

            @if (userLimitConfiguration.ListsFromNames)
            {
                <button type="submit" class="btn btn-primary float-right">Submit</button>
            }
        </form>
    </div>
</div>