Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

2.8 KB
Raw Blame
@using System.Globalization
@model ProductDetailsModel
@inject SeoSettings seoSettings
<div>
    @if (Model.Parameters.Any())
    {
        <div class="container" style="margin-left:-15px">
            <label for="parameterDropdown" class="col-form-label">@Loc["Products.AdditionalParameter"]:</label>
            <select class="form-select form-control" name="parameterDropdown" id="parameterDropdown">
                @foreach (var parameter in Model.Parameters)
                {
                    <option value="@parameter.Value">@parameter.Text</option>
                }
            </select>
        </div>
    }

    @if (Model.IntervalUnit == IntervalUnit.Day)
    {
        <div>
            <h5>@Loc["Products.Reservation.DateFrom"]:</h5>
            <input name="reservationDatepickerFrom" id="reservationDatepickerFrom" class="form-control datepicker"/>
        </div>
        <div>
            <h5>@Loc["Products.Reservation.DateTo"]:</h5>
            <input name="reservationDatepickerTo" id="reservationDatepickerTo" class="form-control datepicker"/>
        </div>
    }
    else
    {
        <div>
            <h5>@Loc["Products.Reservation.Date"]:</h5>
            <input id="reservationDatepicker" class="form-control datepicker"/>
        </div>
        <div>
            <h5 style="margin-top:10px">@Loc["Products.Reservation.Hour"]:</h5>
            <div id="hoursDiv" class="d-inline-flex flex-wrap" data-bs-toggle="buttons"></div>
        </div>
    }
</div>

<script type="application/json" data-grand-vm="reservationInfo">@Json.Serialize(new {
                                                                    productId = Model.Id,
                                                                    start = new {
                                                                        date = Model.StartDate.ToString("d", CultureInfo.CreateSpecificCulture("en-US")),
                                                                        year = Model.StartDate.Year,
                                                                        month = Model.StartDate.Month
                                                                    },
                                                                    routes = new {
                                                                        datesForMonth = Url.Action("GetDatesForMonth", "Product"),
                                                                        attributeChange = Url.Action("productdetails_attributechange", "product", new { productId = Model.Id })
                                                                    },
                                                                    res = new { noAvailableReservations = Loc["Products.Noavailablereservations"].ToString() }
                                                                })</script>