<commit_before>@using System.Threading.Tasks
@using AllReady.Constants
@model AllReady.Areas.Admin.ViewModels.Event.EventEditViewModel
@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 = AreaNames.Admin });
    }
    else
    {
        ViewBag.Title = "Create Event";
        actionTitle = "Create";
        cancelUrl = Url.Action("Details", "Campaign", new { id = Model.CampaignId, area = AreaNames.Admin });
    }
}

@section styles{
    @if (isEdit)
    {
        <link href="~/css/Admin/Event/Edit.css" rel="stylesheet" />
    }
}

<div class="row">
    <div class="col-12">
        <ol class="breadcrumb">
            <li><a asp-controller="Campaign" asp-action="Index" asp-area="@AreaNames.Admin">Campaigns</a></li>
            <li><a asp-controller="Campaign" asp-action="Details" asp-route-id="@Model.CampaignId" asp-area="@AreaNames.Admin">@Model.CampaignName</a></li>
            @if (isEdit)
            {
                <li><a asp-controller="Event" asp-action="Details" asp-route-id="@Model.Id" asp-area="@AreaNames.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-area="@AreaNames.Admin" method="post" enctype="multipart/form-data">

    <div class="form-horizontal row">
        <hr />
        <div class="form-horizontal col-lg-6 pull-left">
            <div asp-validation-summary="All" class="text-danger"></div>
            @if (isEdit)
            {
                <input type="hidden" asp-for="Id" />
                <input type="hidden" asp-for="ImageUrl" id="image-url-input" />
            }
            <input asp-for="CampaignId" type="hidden" />
            <input asp-for="CampaignName" 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><commit_msg>Create Event - Form changes (Part 2) #2225 Add required field classes (these will be picked up by changes in other PRs)<commit_after>@using System.Threading.Tasks
@using AllReady.Constants
@model AllReady.Areas.Admin.ViewModels.Event.EventEditViewModel
@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 = AreaNames.Admin });
    }
    else
    {
        ViewBag.Title = "Create Event";
        actionTitle = "Create";
        cancelUrl = Url.Action("Details", "Campaign", new { id = Model.CampaignId, area = AreaNames.Admin });
    }
}

@section styles{
    @if (isEdit)
    {
        <link href="~/css/Admin/Event/Edit.css" rel="stylesheet" />
    }
}

<div class="row">
    <div class="col-12">
        <ol class="breadcrumb">
            <li><a asp-controller="Campaign" asp-action="Index" asp-area="@AreaNames.Admin">Campaigns</a></li>
            <li><a asp-controller="Campaign" asp-action="Details" asp-route-id="@Model.CampaignId" asp-area="@AreaNames.Admin">@Model.CampaignName</a></li>
            @if (isEdit)
            {
                <li><a asp-controller="Event" asp-action="Details" asp-route-id="@Model.Id" asp-area="@AreaNames.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-area="@AreaNames.Admin" method="post" enctype="multipart/form-data">
    <p>Fields marked with * are required</p>
    <div class="form-horizontal row">
        <hr />
        <div class="form-horizontal col-lg-6 pull-left">
            <div asp-validation-summary="All" class="text-danger"></div>
            @if (isEdit)
            {
                <input type="hidden" asp-for="Id" />
                <input type="hidden" asp-for="ImageUrl" id="image-url-input" />
            }
            <input asp-for="CampaignId" type="hidden" />
            <input asp-for="CampaignName" 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>
{'fraction_non_alphanumeric': 0.15799765350019554, 'fraction_numerical': 0.0037152913570590537, 'mean_word_length': 2.36734693877551, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 85, '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': '3108611', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1554, 'n_words': 320}