@using MrCMS.Helpers
@model MrCMS.Web.Apps.Ecommerce.Settings.EcommerceSettings
@{
    ViewBag.Title = "Edit Ecommerce Settings";
    List<SelectListItem> currencyOptions = ViewData["currency-options"] as List<SelectListItem> ?? new List<SelectListItem>();
    List<SelectListItem> defaultSortOptions = ViewData["default-sort-options"] as List<SelectListItem> ?? new List<SelectListItem>();
}
@using (Html.BeginForm("Edit", "EcommerceSettings", FormMethod.Post))
{
    <fieldset>
        <legend>
            Ecommerce Settings
            <span class="btn-group  display-inline  pull-right">
                <input type="submit" class="btn-primary btn" value="Save Settings" />
            </span>
        </legend>
        <div class="row">
            <div class="col-lg-6">
                <div class="form-group">
                    @Html.LabelFor(x => x.CurrencyId)
                    @Html.DropDownListFor(x => x.CurrencyId, currencyOptions, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.CurrencyId)
                </div>
                <div class="form-group">
                    @Html.LabelFor(x => x.DefaultProductSearchSort)
                    @Html.DropDownListFor(x => x.DefaultProductSearchSort, defaultSortOptions, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.DefaultProductSearchSort)
                </div>
                <div class="form-group">
                    @Html.LabelFor(x => x.SearchProductsPerPage)
                    @Html.TextBoxFor(x => x.SearchProductsPerPage, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.SearchProductsPerPage)
                </div>
                <div class="form-group">
                    @Html.LabelFor(x => x.PreviousPriceText)
                    @Html.TextBoxFor(x => x.PreviousPriceText, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.PreviousPriceText)
                </div>
                <div class="form-group">
                    @Html.InlineCheckboxFor(x => x.EnableWishlists, null, null, "Enable wishlists")
                </div>
                @Html.InfoBlock("Heads up!", " You will also need to add the 'Show wishlist' page in order to fully enable wishlists.")
                <div class="form-group">
                    @Html.InlineCheckboxFor(x => x.TermsAndConditionsRequired)
                </div>
                <div class="form-group">
                    @Html.InlineCheckboxFor(x => x.GiftCardsEnabled)
                </div>
                <div class="form-group">
                    @Html.InlineCheckboxFor(x => x.RewardPointsEnabled)
                </div>
                <div class="form-group">
                    @Html.InlineCheckboxFor(x => x.GiftMessageEnabled)
                </div>
                <div class="form-group">
                    @Html.LabelFor(settings => settings.GiftMessageMaxLength)
                    @Html.TextBoxFor(settings => settings.GiftMessageMaxLength, new { @class = "form-control", type = "number" })
                    @Html.ValidationMessageFor(settings => settings.GiftMessageMaxLength)
                </div>
                <div class="form-group">
                    @Html.InlineCheckboxFor(x => x.WarehouseStockEnabled)
                </div>
                <div class="form-group">
                    @Html.LabelFor(x => x.DashboardRevenueDays)
                    @Html.TextBoxFor(x => x.DashboardRevenueDays, new { @class = "form-control", type = "number" })
                    @Html.ValidationMessageFor(x => x.DashboardRevenueDays)
                </div>
                
                <div class="form-group">
                    @Html.LabelFor(x => x.ProductUrl)
                    @Html.TextBoxFor(x => x.ProductUrl, new{@class="form-control"})
                    @Html.ValidationMessageFor(x => x.ProductUrl)
                </div>
                
                <div class="form-group">
                    @Html.LabelFor(x => x.BrandUrl)
                    @Html.TextBoxFor(x => x.BrandUrl, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.BrandUrl)
                </div>
                
                <div class="form-group">
                    @Html.LabelFor(x => x.CategoryUrl)
                    @Html.TextBoxFor(x => x.CategoryUrl, new { @class = "form-control" })
                    @Html.ValidationMessageFor(x => x.CategoryUrl)
                </div>

            </div>
            <div class="col-lg-6">
                <div class="form-group">
                    @Html.LabelFor(x => x.DefaultNoProductImage)<br />
                    @Html.TextBoxFor(x => x.DefaultNoProductImage, new { @class = "media-selector" })
                    @Html.ValidationMessageFor(x => x.DefaultNoProductImage)
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="form-group">
                    @Html.LabelFor(x => x.ReportLogoImage)<br />
                    @Html.TextBoxFor(x => x.ReportLogoImage, new { @class = "media-selector" })
                    @Html.ValidationMessageFor(x => x.ReportLogoImage)
                </div>
                <div class="form-group">
                    @Html.LabelFor(x => x.ReportFooterText)
                    @Html.TextAreaFor(x => x.ReportFooterText, new { @class = "form-control", style = "height:90px" })
                    @Html.ValidationMessageFor(x => x.ReportFooterText)
                </div>
            </div>
        </div>
        

    </fieldset>
}