@model GeneralCommonSettingsModel
@inject Grand.Business.Core.Interfaces.Common.Security.IPermissionService permissionService
@using Grand.Business.Core.Utilities.Common.Security;
@{
    var canUpload = await permissionService.Authorize(StandardPermission.ManagePlugins);
}

<script>
    $(document).ready(function () {
        $("#@Html.IdFor(model => model.StoreInformationSettings.DisplayCookieInformation)").click(togglePreferenceField);

        togglePreferenceField();
    });

    function togglePreferenceField() {
        if ($('#@Html.IdFor(model => model.StoreInformationSettings.DisplayCookieInformation)').is(':checked')) {
            $('#DisplayPrivacyPreference').show();
        }
        else {
            $('#DisplayPrivacyPreference').hide();
        }
    }
</script>

<div class="form-horizontal">
    <div class="form-body">
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="DateTimeSettings.DefaultStoreTimeZoneId" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <admin-select asp-for="DateTimeSettings.DefaultStoreTimeZoneId" asp-items="Model.DateTimeSettings.AvailableTimeZones" />
                <span asp-validation-for="DateTimeSettings.DefaultStoreTimeZoneId"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.StoreClosed" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="StoreInformationSettings.StoreClosed" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="StoreInformationSettings.StoreClosed"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.DefaultStoreTheme" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <div class="row">
                    <ul class="clearer" style="list-style: none;" id="theme-selection-block">
                        @foreach (var theme in Model.StoreInformationSettings.AvailableStoreThemes)
                        {
                            <li style="float: left; width: 210px;">
                                <p style="float: left; padding-top: 55px;">
                                    <input type="radio" name="@Html.NameFor(x => x.StoreInformationSettings.DefaultStoreTheme)" value="@theme.ThemeName" id="id_image_@theme.ThemeName"
                                           @if (theme.ThemeName == Model.StoreInformationSettings.DefaultStoreTheme) { <text> checked="checked" </text> }>
                                </p>
                                <p style="float: left;">
                                    <label for="id_image_@theme.ThemeName">
                                        <img src="@Url.Content(theme.PreviewImageUrl)" alt="@theme.PreviewText" title="@theme.PreviewText" width="175">
                                        <br />
                                        <label style="text-align:center;font-weight:bold;width:170px;">@theme.ThemeTitle (@theme.ThemeVersion)</label>
                                    </label>
                                </p>
                            </li>
                        }
                    </ul>
                </div>
                <span asp-validation-for="StoreInformationSettings.DefaultStoreTheme"></span>
                @if (canUpload)
                {
                    <div class="note note-info">@Loc["Admin.Settings.GeneralCommon.DefaultStoreTheme.GetMore"] <a href="http://www.grandnode.com/extensions?category=4&utm_source=admin-panel&utm_medium=theme-settings&utm_campaign=admin-panel" target="_blank">http://www.grandnode.com/extensions</a></div>
                    <input type="button" id="importfile" class="btn yellow" value="@Loc["Admin.Configuration.Themes.Upload"]" />
                }
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <label class="control-label">
                    @Loc["Admin.Settings.GeneralCommon.PremiumThemes"]
                    <i class="help icon-question" data-container="body" data-placement="top" data-toggle="tooltip" title="" data-original-title="You can download themes from the extensions page at www.grandnode.com."></i>
                </label>
            </div>
            <div class="col-4 col-md-8 col-sm-8" id="premium_themes">
                <script>
                    $.getJSON("https://grandnode.com/themes.json", function (data) {
                        var items = [];
                        $.each(data, function (key, value) {
                            items.push("<li id='theme-" + key + "'><a href='" + value.Url + "' target='_blank' ><img src='" + value.PictureUrl + "' /><span>" + value.Name + "<span></a></li>");
                        });

                        $("<ul/>", {
                            "class": "premium-list",
                            html: items.join("")
                        }).appendTo("#premium_themes");
                    });
                </script>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.AllowCustomerToSelectTheme" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="StoreInformationSettings.AllowCustomerToSelectTheme" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="StoreInformationSettings.AllowCustomerToSelectTheme"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.AllowToSelectAdminTheme" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="StoreInformationSettings.AllowToSelectAdminTheme" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="StoreInformationSettings.AllowToSelectAdminTheme"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.LogoPictureId" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <admin-input asp-for="StoreInformationSettings.LogoPictureId" />
                <span asp-validation-for="StoreInformationSettings.LogoPictureId"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.DisplayCookieInformation" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="StoreInformationSettings.DisplayCookieInformation" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="StoreInformationSettings.DisplayCookieInformation"></span>
            </div>
        </div>
        <div class="form-group" id="DisplayPrivacyPreference">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.DisplayPrivacyPreference" class="control-label" />
            </div>
            <div class="col-xs-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="StoreInformationSettings.DisplayPrivacyPreference" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="StoreInformationSettings.DisplayPrivacyPreference"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.FacebookLink" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <admin-input asp-for="StoreInformationSettings.FacebookLink" />
                <span asp-validation-for="StoreInformationSettings.FacebookLink"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.TwitterLink" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <admin-input asp-for="StoreInformationSettings.TwitterLink" />
                <span asp-validation-for="StoreInformationSettings.TwitterLink"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.YoutubeLink" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <admin-input asp-for="StoreInformationSettings.YoutubeLink" />
                <span asp-validation-for="StoreInformationSettings.YoutubeLink"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.InstagramLink" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <admin-input asp-for="StoreInformationSettings.InstagramLink" />
                <span asp-validation-for="StoreInformationSettings.InstagramLink"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.LinkedInLink" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <admin-input asp-for="StoreInformationSettings.LinkedInLink" />
                <span asp-validation-for="StoreInformationSettings.LinkedInLink"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.PinterestLink" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <admin-input asp-for="StoreInformationSettings.PinterestLink" />
                <span asp-validation-for="StoreInformationSettings.PinterestLink"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="StoreInformationSettings.VoiceNavigation" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="StoreInformationSettings.VoiceNavigation" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="StoreInformationSettings.VoiceNavigation"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.StoreInDatabaseContactUsForm" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.StoreInDatabaseContactUsForm" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.StoreInDatabaseContactUsForm"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.SubjectFieldOnContactUsForm" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.SubjectFieldOnContactUsForm" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.SubjectFieldOnContactUsForm"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.UseSystemEmailForContactUsForm" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.UseSystemEmailForContactUsForm" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.UseSystemEmailForContactUsForm"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.AllowToReadLetsEncryptFile" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.AllowToReadLetsEncryptFile" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.AllowToReadLetsEncryptFile"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.AllowToSelectStore" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.AllowToSelectStore" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.AllowToSelectStore"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.PopupForTermsOfServiceLinks" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.PopupForTermsOfServiceLinks" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.PopupForTermsOfServiceLinks"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.Log404Errors" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.Log404Errors" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.Log404Errors"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.SitemapEnabled" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.SitemapEnabled" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.SitemapEnabled"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.SitemapIncludeCategories" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.SitemapIncludeCategories" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.SitemapIncludeCategories"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.SitemapIncludeImage" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.SitemapIncludeImage" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.SitemapIncludeImage"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.SitemapIncludeBrands" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.SitemapIncludeBrands" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.SitemapIncludeBrands"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-8 col-md-4 col-sm-4 text-right">
                <admin-label asp-for="CommonSettings.SitemapIncludeProducts" class="control-label" />
            </div>
            <div class="col-4 col-md-8 col-sm-8">
                <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                    <admin-input asp-for="CommonSettings.SitemapIncludeProducts" />
                    <div class="control__indicator"></div>
                </label>
                <span asp-validation-for="CommonSettings.SitemapIncludeProducts"></span>
            </div>
        </div>
    </div>
</div>