<commit_before>@using System.Threading.Tasks
@model  AllReady.Areas.Admin.Models.EventDetailModel
@inject AllReady.Services.ISelectListService SelectListService


@{
    //TODO: Need a better way of identifying Create vs Edit. Suggest not binding directly to model class, create view model instead
    var isEdit = Model.Id != 0;
    string actionTitle;
    string cancelUrl;
    if (isEdit)
    {
        ViewBag.Title = $"Edit Event";
        actionTitle = "Save";
        cancelUrl = Url.Action("Details", "Event", new { id = Model.Id, area = "Admin" });
    }
    else
    {
        ViewBag.Title = "Create Event";
        actionTitle = "Create";
        cancelUrl = Url.Action("Details", "Campaign", new { id = Model.CampaignId, area = "Admin" });
    }
}

<div class="row">
    <div class="col-12">
        <ol class="breadcrumb">
            <li><a asp-controller="Campaign" asp-action="Index" asp-route-area="Admin">Campaigns</a></li>
            <li><a asp-controller="Campaign" asp-action="Details" asp-route-id="@Model.CampaignId" asp-route-area="Admin">@Model.CampaignName</a></li>
            @if (isEdit)
            {
                <li><a asp-controller="Event" asp-action="Details" asp-route-id="@Model.Id" asp-route-area="Admin">@Model.Name</a></li>
                <li>Edit</li>
            }
            else
            {
                <li>Create New Event</li>
            }
            
        </ol>
    </div>
</div>

<h2>@ViewBag.Title</h2>

<form asp-controller="Event" asp-route-area="Admin" method="post" enctype="multipart/form-data">

    <div class="form-horizontal">
        <hr />
        <div class="form-horizontal col-lg-6 pull-left">
            <div asp-validation-summary="ValidationSummary.All" class="text-danger"></div>
            <input asp-for="Id" type="hidden" />
            <input asp-for="CampaignId" type="hidden" />
            <input asp-for="CampaignName" type="hidden" />
            <input asp-for="TimeZoneId" type="hidden" />
            <input asp-for="OrganizationId" type="hidden" />
            <input asp-for="OrganizationName" type="hidden" />
            <div class="form-group">
                <label asp-for="Name" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <input asp-for="Name" class="form-control" />
                    <span asp-validation-for="Name" class="text-danger"></span>
                </div>
            </div>
            <div class="form-group">
                <label asp-for="Description" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <textarea asp-for="Description" class="form-control"></textarea>
                    <span asp-validation-for="Description" class="text-danger"></span>
                </div>
            </div>
            <div class="form-group">
                <label asp-for="EventType" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <select asp-for="EventType" asp-items="Html.GetEnumSelectList<EventTypes>()" class="form-control">
                        <option value="0">-- Select --</option>
                    </select>
                    <span asp-validation-for="EventType" class="text-danger"></span>
                </div>
            </div>
            <div class="form-group">
                <label asp-for="NumberOfVolunteersRequired" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <input asp-for="NumberOfVolunteersRequired" class="form-control" />
                    <span asp-validation-for="NumberOfVolunteersRequired" class="text-danger"></span>
                </div>
            </div>

            <div class="form-group">
                <label asp-for="IsLimitVolunteers" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <input asp-for="IsLimitVolunteers" type="checkbox" class="form-control" />
                    <span asp-validation-for="IsLimitVolunteers" class="text-danger"></span>
                </div>
            </div>

            <!-- Uncomment this code when wait list functionality is completed -->
            @*@{<commit_msg>Renaming EventTypes to EventType in the details view (#831)<commit_after>@using System.Threading.Tasks
@model  AllReady.Areas.Admin.Models.EventDetailModel
@inject AllReady.Services.ISelectListService SelectListService


@{
    //TODO: Need a better way of identifying Create vs Edit. Suggest not binding directly to model class, create view model instead
    var isEdit = Model.Id != 0;
    string actionTitle;
    string cancelUrl;
    if (isEdit)
    {
        ViewBag.Title = $"Edit Event";
        actionTitle = "Save";
        cancelUrl = Url.Action("Details", "Event", new { id = Model.Id, area = "Admin" });
    }
    else
    {
        ViewBag.Title = "Create Event";
        actionTitle = "Create";
        cancelUrl = Url.Action("Details", "Campaign", new { id = Model.CampaignId, area = "Admin" });
    }
}

<div class="row">
    <div class="col-12">
        <ol class="breadcrumb">
            <li><a asp-controller="Campaign" asp-action="Index" asp-route-area="Admin">Campaigns</a></li>
            <li><a asp-controller="Campaign" asp-action="Details" asp-route-id="@Model.CampaignId" asp-route-area="Admin">@Model.CampaignName</a></li>
            @if (isEdit)
            {
                <li><a asp-controller="Event" asp-action="Details" asp-route-id="@Model.Id" asp-route-area="Admin">@Model.Name</a></li>
                <li>Edit</li>
            }
            else
            {
                <li>Create New Event</li>
            }
            
        </ol>
    </div>
</div>

<h2>@ViewBag.Title</h2>

<form asp-controller="Event" asp-route-area="Admin" method="post" enctype="multipart/form-data">

    <div class="form-horizontal">
        <hr />
        <div class="form-horizontal col-lg-6 pull-left">
            <div asp-validation-summary="ValidationSummary.All" class="text-danger"></div>
            <input asp-for="Id" type="hidden" />
            <input asp-for="CampaignId" type="hidden" />
            <input asp-for="CampaignName" type="hidden" />
            <input asp-for="TimeZoneId" type="hidden" />
            <input asp-for="OrganizationId" type="hidden" />
            <input asp-for="OrganizationName" type="hidden" />
            <div class="form-group">
                <label asp-for="Name" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <input asp-for="Name" class="form-control" />
                    <span asp-validation-for="Name" class="text-danger"></span>
                </div>
            </div>
            <div class="form-group">
                <label asp-for="Description" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <textarea asp-for="Description" class="form-control"></textarea>
                    <span asp-validation-for="Description" class="text-danger"></span>
                </div>
            </div>
            <div class="form-group">
                <label asp-for="EventType" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <select asp-for="EventType" asp-items="Html.GetEnumSelectList<EventType>()" class="form-control">
                        <option value="0">-- Select --</option>
                    </select>
                    <span asp-validation-for="EventType" class="text-danger"></span>
                </div>
            </div>
            <div class="form-group">
                <label asp-for="NumberOfVolunteersRequired" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <input asp-for="NumberOfVolunteersRequired" class="form-control" />
                    <span asp-validation-for="NumberOfVolunteersRequired" class="text-danger"></span>
                </div>
            </div>

            <div class="form-group">
                <label asp-for="IsLimitVolunteers" class="control-label col-md-2"></label>
                <div class="col-md-10">
                    <input asp-for="IsLimitVolunteers" type="checkbox" class="form-control" />
                    <span asp-validation-for="IsLimitVolunteers" class="text-danger"></span>
                </div>
            </div>

            <!-- Uncomment this code when wait list functionality is completed -->
            @*@{
{'fraction_non_alphanumeric': 0.15806715806715807, 'fraction_numerical': 0.005499005499005499, 'mean_word_length': 1.9404884760921912, 'pattern_counts': {'":': 0, '<': 177, '<?xml version=': 0, '>': 177, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7150064', 'n_tokens_mistral': 2506, 'n_tokens_neox': 2403, 'n_words': 458}