<commit_before>﻿@using CRP.Controllers.Helpers
@using CRP.Core.Helpers
@using Microsoft.Azure
@model CRP.Controllers.ViewModels.ItemDetailViewModel

@{
    ViewBag.Title = "UC Davis Registration";
    Layout = "~/Views/Shared/_PublicLayout.cshtml";
    ViewBag.OgImage = Url.Action("GetImage", "Item", new { id = Model.Item.Id });
    ViewBag.OgDescription = Model.Item.Summary;
    ViewBag.OgTitle = Model.Item.Name;
}



<div class="main">
    <div class="eventbanner">
        <div class="eventbanner-image">
            <img src="@Url.Action("GetImage", "Item", new {id = Model.Item.Id})" alt="eventbanner-image" />
        </div>
        @{
            var showDiv = Model.HasMapPins ? string.Empty : "style=display:none";
        }
        <div class="eventbanner-map" @showDiv>
            @if (Model.HasMapPins)
            {

                <div id="map" style="margin: 0px 0px 20px;">
                    <div class="gp-map" style="height: 250px; width: 100%;"></div>

                    @foreach (var a in Model.Item.MapPins.OrderByDescending(a => a.IsPrimary))
                    {
                        <div class="gp-coordinate@(a.IsPrimary ? " gp-default" : string.Empty)" data-lat="@a.Latitude" data-lng="@a.Longitude">
                            <dt class="gp-name">@Html.Encode(a.Title)</dt>
                            @if (!string.IsNullOrWhiteSpace(a.Description))
                            {
                                <dd class="gp-description">@Html.Encode(a.Description ?? string.Empty)</dd>
                            }
                        </div>
                    }
                    <div class="eventbanner-mapbuttons">
                        <p>@Html.ActionLink("Full Screen Map", "Map", new { id = Model.Item.Id, usePins = true }, new { target = "_blank" })</p>
                        <p>@Html.ActionLink("Full Screen Map With Directions", "MapDirections", new { id = Model.Item.Id, usePins = true }, new { target = "_blank" })</p>
                    </div>
                </div>
            }
        </div>
    </div>
    <div class="content_wrapper boundary">
        <article>
            <h1>@Model.Item.Name</h1>
            @Html.Raw(Html.HtmlEncode(Model.Item.Description))
            @if (!string.IsNullOrEmpty(Model.Item.Link))
            {
                <h2>Link:</h2>
                <p><a target="_blank" href="@Html.Encode(Model.Item.Link)">@Html.Encode(Model.Item.Link)</a></p>
            }
        </article>
        <aside>
            @if (Model.Item.Expiration >= DateTime.UtcNow.ToPacificTime().Date)
            {
                <div class="registerbtn">
                    <a class="btn btn-register" href="@Url.Action("Checkout", "Transaction", new {id=Model.Item.Id} )">Register</a>
                    <p class="discreet t-center">Register by @Html.Encode(Model.Item.Expiration.Value.ToString("MMM d")) <sup>@Model.Item.Expiration.DaySuffix()</sup></p>
                </div>
            }
            @foreach (var ep in Model.Item.ExtendedPropertyAnswers.Where(a => a.Answer != string.Empty))
            {
                <div class="eventinfo-item">
                    <div class="eventinfo-icon">
                        @if (ep.ExtendedProperty.QuestionType.Name == "Date")
                        {
                            <img src="@Url.Content("~/Images/Media/date_icon.svg")" alt="calendar icon">
                        }
                        else
                        {
                            if (ep.ExtendedProperty.Name.ToLower().Contains("location"))
                            {
                                <img src="@Url.Content("~/Images/Media/location_icon.svg")" alt="Location icon">
                            }
                        }
                    </div>
                    <div class="eventinfo-text">
                        <h4>@Html.Encode(ep.ExtendedProperty.Name):</h4>
                        <p>@Html.Encode(ep.ExtendedProperty.QuestionType.Name == "Text Box" ? ep.Answer : Convert.ToDateTime(ep.Answer).ToString("D"))</p>
                    </div>
                </div>
            }
            <div class="eventinfo-item">
                <div class="eventinfo-icon">
                    <img src="@Url.Content("~/Images/Media/payment_icon.svg")" alt="payment icon">
                </div>
                <div class="eventinfo-text">
                    <h4>Price Per @Html.Encode(Model.Item.QuantityName):</h4>
                    <p>@Html.Encode(String.Format("{0:C}", Model.Item.CostPerItem))</p>
                </div>
            </div>
            <div class="eventinfo-item">
                <div class="eventinfo-icon">
                    <img src="@Url.Content("~/Images/Media/date_icon.svg")" alt="calendar icon">
                </div>
                <div class="eventinfo-text">
                    <h4>Last day to register online:</h4>
                    <p>@Html.Encode(String.Format("{0:D}", Model.Item.Expiration))</p>
                </div>
            </div>

        </aside>
        @*<div class="fullmap"> TODO: Check why this doesn't show
            @if (Model.HasMapPins)
            {
                <div>@Html.ActionLink("Full Screen Map", "Map", new { id = Model.Item.Id, usePins = true }, new { target = "_blank" })</div>
                <div>@Html.ActionLink("Full Screen Map With Directions", "MapDirections", new { id = Model.Item.Id, usePins = true }, new { target = "_blank" })</div>
                <div id="map" style="margin: 0px 0px 20px;">
                    <div class="gp-map" style="height: 450px; width: 100%;"></div>

                    @foreach (var a in Model.Item.MapPins.OrderByDescending(a => a.IsPrimary))
                    {
                        <div class="gp-coordinate@(a.IsPrimary ? " gp-default" : string.Empty)" data-lat="@a.Latitude" data-lng="@a.Longitude">
                            <dt class="gp-name">@Html.Encode(a.Title)</dt>
                            @if (!string.IsNullOrWhiteSpace(a.Description))
                            {
                                <dd class="gp-description">@Html.Encode(a.Description ?? string.Empty)</dd>
                            }
                        </div>
                    }
                </div>
            }
        </div>*@
    </div>
</div>

@section AdditionalScripts
{
    @Scripts.Render("~/bundles/qtip")
    <script src="https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=@CloudConfigurationManager.GetSetting("MapsApi")" type="text/javascript"></script>
    
    @Scripts.Render("~/bundles/map")


    <script type="text/javascript">
        $(function() {
            $("#map").gPositions({ helpIcon: '@Url.Content("~/Images/question_blue.png")' });
            $(".gp-sidecontainer-title img").attr("title", "");
            //$(".gp-sidecontainer-title img").bt("To view Locations on the map, click on the tabs below", { positions: 'top' });
            $(".gp-sidecontainer-title img").qtip({ // Grab some elements to apply the tooltip to
                content: {
                    text: 'To view Locations on the map, click on the tabs below'
                },
                position: {
                    my: 'bottom left',
                    at: 'right top'
                },
                style: {
                    classes: 'qtip-bootstrap'
                }
            });
        });
    </script>
}
@section AdditionalStyles
{
    @Styles.Render("~/Content/gPositions")
    @Styles.Render("~/Content/qtipcss")
}
<commit_msg>map at the bottom for phone width<commit_after>﻿@using CRP.Controllers.Helpers
@using CRP.Core.Helpers
@using Microsoft.Azure
@model CRP.Controllers.ViewModels.ItemDetailViewModel

@{
    ViewBag.Title = "UC Davis Registration";
    Layout = "~/Views/Shared/_PublicLayout.cshtml";
    ViewBag.OgImage = Url.Action("GetImage", "Item", new { id = Model.Item.Id });
    ViewBag.OgDescription = Model.Item.Summary;
    ViewBag.OgTitle = Model.Item.Name;
}



<div class="main">
    <div class="eventbanner">
        <div class="eventbanner-image">
            <img src="@Url.Action("GetImage", "Item", new {id = Model.Item.Id})" alt="eventbanner-image" />
        </div>
        @{
            var showDiv = Model.HasMapPins ? string.Empty : "style=display:none";
        }
        <div class="eventbanner-map" @showDiv>
            @if (Model.HasMapPins)
            {

                <div id="map" style="margin: 0px 0px 20px;">
                    <div class="gp-map" style="height: 250px; width: 100%;"></div>

                    @foreach (var a in Model.Item.MapPins.OrderByDescending(a => a.IsPrimary))
                    {
                        <div class="gp-coordinate@(a.IsPrimary ? " gp-default" : string.Empty)" data-lat="@a.Latitude" data-lng="@a.Longitude">
                            <dt class="gp-name">@Html.Encode(a.Title)</dt>
                            @if (!string.IsNullOrWhiteSpace(a.Description))
                            {
                                <dd class="gp-description">@Html.Encode(a.Description ?? string.Empty)</dd>
                            }
                        </div>
                    }
                    <div class="eventbanner-mapbuttons">
                        <p>@Html.ActionLink("Full Screen Map", "Map", new { id = Model.Item.Id, usePins = true }, new { target = "_blank" })</p>
                        <p>@Html.ActionLink("Full Screen Map With Directions", "MapDirections", new { id = Model.Item.Id, usePins = true }, new { target = "_blank" })</p>
                    </div>
                </div>
            }
        </div>
    </div>
    <div class="content_wrapper boundary">
        <article>
            <h1>@Model.Item.Name</h1>
            @Html.Raw(Html.HtmlEncode(Model.Item.Description))
            @if (!string.IsNullOrEmpty(Model.Item.Link))
            {
                <h2>Link:</h2>
                <p><a target="_blank" href="@Html.Encode(Model.Item.Link)">@Html.Encode(Model.Item.Link)</a></p>
            }
        </article>
        <aside>
            @if (Model.Item.Expiration >= DateTime.UtcNow.ToPacificTime().Date)
            {
                <div class="registerbtn">
                    <a class="btn btn-register" href="@Url.Action("Checkout", "Transaction", new {id=Model.Item.Id} )">Register</a>
                    <p class="discreet t-center">Register by @Html.Encode(Model.Item.Expiration.Value.ToString("MMM d")) <sup>@Model.Item.Expiration.DaySuffix()</sup></p>
                </div>
            }
            @foreach (var ep in Model.Item.ExtendedPropertyAnswers.Where(a => a.Answer != string.Empty))
            {
                <div class="eventinfo-item">
                    <div class="eventinfo-icon">
                        @if (ep.ExtendedProperty.QuestionType.Name == "Date")
                        {
                            <img src="@Url.Content("~/Images/Media/date_icon.svg")" alt="calendar icon">
                        }
                        else
                        {
                            if (ep.ExtendedProperty.Name.ToLower().Contains("location"))
                            {
                                <img src="@Url.Content("~/Images/Media/location_icon.svg")" alt="Location icon">
                            }
                        }
                    </div>
                    <div class="eventinfo-text">
                        <h4>@Html.Encode(ep.ExtendedProperty.Name):</h4>
                        <p>@Html.Encode(ep.ExtendedProperty.QuestionType.Name == "Text Box" ? ep.Answer : Convert.ToDateTime(ep.Answer).ToString("D"))</p>
                    </div>
                </div>
            }
            <div class="eventinfo-item">
                <div class="eventinfo-icon">
                    <img src="@Url.Content("~/Images/Media/payment_icon.svg")" alt="payment icon">
                </div>
                <div class="eventinfo-text">
                    <h4>Price Per @Html.Encode(Model.Item.QuantityName):</h4>
                    <p>@Html.Encode(String.Format("{0:C}", Model.Item.CostPerItem))</p>
                </div>
            </div>
            <div class="eventinfo-item">
                <div class="eventinfo-icon">
                    <img src="@Url.Content("~/Images/Media/date_icon.svg")" alt="calendar icon">
                </div>
                <div class="eventinfo-text">
                    <h4>Last day to register online:</h4>
                    <p>@Html.Encode(String.Format("{0:D}", Model.Item.Expiration))</p>
                </div>
            </div>

        </aside>
        <div class="fullmap" @showDiv> 

                @if (Model.HasMapPins)
            {

                    <div id="map2" style="margin: 0px 0px 20px;">
                        <div class="gp-map" style="height: 250px; width: 100%;"></div>

                        @foreach (var a in Model.Item.MapPins.OrderByDescending(a => a.IsPrimary))
                        {
                            <div class="gp-coordinate@(a.IsPrimary ? " gp-default" : string.Empty)" data-lat="@a.Latitude" data-lng="@a.Longitude">
                                <dt class="gp-name">@Html.Encode(a.Title)</dt>
                                @if (!string.IsNullOrWhiteSpace(a.Description))
                                {
                                    <dd class="gp-description">@Html.Encode(a.Description ?? string.Empty)</dd>
                                }
                            </div>
                        }
                        <div class="eventbanner-mapbuttons">
                            <p>@Html.ActionLink("Full Screen Map", "Map", new { id = Model.Item.Id, usePins = true }, new { target = "_blank" })</p>
                            <p>@Html.ActionLink("Full Screen Map With Directions", "MapDirections", new { id = Model.Item.Id, usePins = true }, new { target = "_blank" })</p>
                        </div>
                    </div>
                }

        </div>
    </div>
</div>

@section AdditionalScripts
{
    @Scripts.Render("~/bundles/qtip")
    <script src="https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=@CloudConfigurationManager.GetSetting("MapsApi")" type="text/javascript"></script>
    
    @Scripts.Render("~/bundles/map")


    <script type="text/javascript">
        $(function() {
            $("#map").gPositions({ helpIcon: '@Url.Content("~/Images/question_blue.png")' });
            $("#map2").gPositions({ helpIcon: '@Url.Content("~/Images/question_blue.png")' });
            $(".gp-sidecontainer-title img").attr("title", "");
            //$(".gp-sidecontainer-title img").bt("To view Locations on the map, click on the tabs below", { positions: 'top' });
            $(".gp-sidecontainer-title img").qtip({ // Grab some elements to apply the tooltip to
                content: {
                    text: 'To view Locations on the map, click on the tabs below'
                },
                position: {
                    my: 'bottom left',
                    at: 'right top'
                },
                style: {
                    classes: 'qtip-bootstrap'
                }
            });
        });
    </script>
}
@section AdditionalStyles
{
    @Styles.Render("~/Content/gPositions")
    @Styles.Render("~/Content/qtipcss")
}

{'fraction_non_alphanumeric': 0.15080527086383602, 'fraction_numerical': 0.004328728754217328, 'mean_word_length': 1.4333952912019827, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 0, '>': 215, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1058365', 'n_tokens_mistral': 4550, 'n_tokens_neox': 4257, 'n_words': 737}