Pleistermes RVS 450 mm met Sledegreep

203900350

Op voorraad

Error executing template "CookieWarning/Cookies.cshtml"
System.IO.IOException: The process cannot access the file 'D:\inetpub\wwwroot\www.cmi-nederland.nl\Application\Files\Templates\Designs\Swift\Translations.xml' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Dynamicweb.Rendering.Translation.Source.WriteDocument(XmlDocument document)
   at Dynamicweb.Rendering.Translation.Source.Save()
   at Dynamicweb.Rendering.Translation.Source.UpdateTranslationSource(Source source, IEnumerable`1 newKeys, String designName, IEnumerable`1 cultures)
   at Dynamicweb.Rendering.Template.TranslateText(String text, String defaultValue, String cultureName)
   at Dynamicweb.Rendering.TemplateBase`1.Translate(String text)
   at CompiledRazorTemplates.Dynamic.RazorEngine_39e20d9c24474cc0add1dc5d1d19472b.Execute() in D:\inetpub\wwwroot\www.cmi-nederland.nl\Application\Files\Templates\CookieWarning\Cookies.cshtml:line 72
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Dynamicweb.Environment; 3 4 @{ 5 var categories = CookieManager.GetCategories(); 6 7 string cookieNoticeLink = Pageview.AreaSettings.GetLink("CookiePolicyLink") != null ? Pageview.AreaSettings.GetLink("CookiePolicyLink").Url : ""; 8 string privacyPolicyLink = Pageview.AreaSettings.GetLink("PrivacyPolicyLink") != null ? Pageview.AreaSettings.GetLink("PrivacyPolicyLink").Url : ""; 9 int cookieNoticePageID = Pageview.AreaSettings.GetLink("CookiePolicyLink") != null ? Pageview.AreaSettings.GetLink("CookiePolicyLink").PageId : 0; 10 int privacyPolicyPageID = Pageview.AreaSettings.GetLink("PrivacyPolicyLink") != null ? Pageview.AreaSettings.GetLink("PrivacyPolicyLink").PageId : 0; 11 12 string layout = Pageview.AreaSettings.GetRawValueString("CookieLayout", "modal"); 13 14 layout = Pageview.Page.ID == cookieNoticePageID || Pageview.Page.ID == privacyPolicyPageID ? "both" : layout; 15 } 16 17 @if (!Pageview.IsVisualEditorMode) { 18 if (layout == "banner" || layout == "both") 19 { 20 string bannerTheme = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetRawValueString("CookieBannerTheme")) ? " theme " + Pageview.AreaSettings.GetRawValueString("CookieBannerTheme").Replace(" ", "").Trim().ToLower() : "theme light"; 21 22 <div class="position-fixed bottom-0 w-100 shadow @bannerTheme" id="dwCookieBanner"> 23 <div class="align-items-center grid p-3"> 24 @if (layout == "banner") 25 { 26 <div class="g-col-12 g-col-md-6 g-col-lg-8"> 27 <span>@Translate("By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Functionality, Statistics and Marketing")</span> 28 </div> 29 <div class="g-col-12 g-col-md-6 g-col-lg-4"> 30 <div class="grid grid-1 grid-sm-2"> 31 <button type="button" onclick="setOptInCookie(2)" class="btn btn-primary" id="CookiesAcceptAll"> 32 @Translate("Accept all") 33 </button> 34 <button type="button" onclick="setOptInCookie(0)" class="btn btn-secondary" id="CookiesDeclineAll"> 35 @Translate("Decline all") 36 </button> 37 </div> 38 </div> 39 } 40 @if (layout == "both") 41 { 42 <div class="g-col-12 g-col-lg-6 g-col-xxl-8"> 43 <span>@Translate("By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Functionality, Statistics and Marketing")</span> 44 </div> 45 <div class="g-col-12 g-col-lg-6 g-col-xxl-4"> 46 <div class="grid grid-1 grid-sm-3"> 47 <button type="button" class="btn btn-link" data-bs-toggle="modal" data-bs-target="#dwCookieModal"> 48 @Translate("Customize settings") 49 </button> 50 <button type="button" onclick="setOptInCookie(2)" class="btn btn-secondary" id="CookiesAcceptAll"> 51 @Translate("Accept all") 52 </button> 53 <button type="button" onclick="setOptInCookie(0)" class="btn btn-secondary" id="CookiesDeclineAll"> 54 @Translate("Decline all") 55 </button> 56 </div> 57 </div> 58 } 59 </div> 60 </div> 61 } 62 63 if (layout == "modal" || layout == "both") 64 { 65 string modalTheme = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetRawValueString("CookieModalTheme")) ? " theme " + Pageview.AreaSettings.GetRawValueString("CookieModalTheme").Replace(" ", "").Trim().ToLower() : "theme light"; 66 67 <div class="modal fade" id="dwCookieModal"> 68 <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" style="max-width:560px;"> 69 <div class="modal-content @modalTheme"> 70 <div style="overflow-y:auto;overflow-x:hidden"> 71 <div class="p-3 p-md-4 overflow-auto" style="max-height:50vh;"> 72 <div class="h3 mb-3">@Translate("You control your data")</div> 73 <p>@Translate("We and our partners use technologies, including cookies, to collect information about you for various purposes, including"):</p> 74 <ol> 75 <li>@Translate("Functionality")</li> 76 <li>@Translate("Statistics")</li> 77 <li>@Translate("Marketing")</li> 78 </ol> 79 <p>@Translate("By clicking 'Accept All' you consent to all these purposes. You can also choose to indicate what purposes you will consent to using the custom selections and then click 'Accept selected'").</p> 80 81 @if (!string.IsNullOrEmpty(cookieNoticeLink) || !string.IsNullOrEmpty(privacyPolicyLink)) 82 { 83 <p>@Translate("You can read more about our use of cookies and other technologies, as well as our collection and processing of personal data by clicking here"):</p> 84 } 85 86 @if (!string.IsNullOrEmpty(cookieNoticeLink)) 87 { 88 <a href="@cookieNoticeLink" class="d-block mb-3" id="CookiesReadModeAbout">@Translate("Read more about Cookies")</a> 89 } 90 @if (!string.IsNullOrEmpty(privacyPolicyLink)) 91 { 92 <a href="@privacyPolicyLink" class="d-block" id="CookiesPrivacyPolicy">@Translate("Our privacy policy")</a> 93 } 94 </div> 95 96 <div class="p-3 px-md-4 border-top"> 97 <div class="grid grid-1 grid-sm-2 gap-3"> 98 <button type="button" onclick="setOptInCookie(0)" class="btn btn-secondary" data-bs-dismiss="modal" id="dwCookieDeclineAll">@Translate("Decline All")</button> 99 @if (categories.Any()) 100 { 101 <button type="button" onclick="acceptCustomSetup()" class="btn btn-secondary d-none" data-bs-dismiss="modal" id="dwCookieAcceptSelected">@Translate("Accept selected")</button> 102 } 103 <button type="button" onclick="setOptInCookie(2)" class="btn btn-secondary" data-bs-dismiss="modal" id="dwCookieAcceptAll">@Translate("Accept All")</button> 104 </div> 105 </div> 106 107 @if (categories.Any()) 108 { 109 int categoriesCount = 0; 110 int totalCategories = categories.Count(); 111 112 <form id="dwCookieModalCustomForm" method="post" action="/Admin/Public/CookieOptInLevelConfig.aspx"> 113 <input type="hidden" name="cmd" value="SetCookieOptInLevel"> 114 <input type="hidden" name="OptInLevel" id="OptInLevel" value="1"> 115 <div class="grid grid-2 grid-sm-4 gap-0 px-md-3 border-top border-1"> 116 <div class="p-3"> 117 <label class="form-check-label" for="dwCookieNecessary"><span>@Translate("Necessary")</span></label> 118 <div class="form-check form-switch form-control-lg py-0"> 119 <input class="form-check-input opacity-100" type="checkbox" id="dwCookieNecessary" checked disabled style="background-color: rgba(0,0,0,0.1);"> 120 </div> 121 </div> 122 @foreach (var category in categories) 123 { 124 string border = categoriesCount < (totalCategories - 1) ? "" : ""; 125 126 <div class="p-3 @(border)"> 127 <label class="form-check-label" for="CookieCategory_@category"><span>@category</span></label> 128 <div class="form-check form-switch form-control-lg py-0"> 129 <input class="form-check-input js-checkbox" type="checkbox" name="OptInCategory" value="@category" id="CookieCategory_@category" onchange="toggleAcceptSelected()" style="background-color: rgba(0,0,0,0.1);"> 130 </div> 131 </div> 132 categoriesCount++; 133 } 134 </div> 135 </form> 136 } 137 </div> 138 </div> 139 </div> 140 </div> 141 } 142 143 144 <script> 145 async function setOptInCookie(optInLevel) { 146 let response = await fetch("/admin/public/CookieOptInLevelConfig.aspx?cmd=SetCookieOptInLevel&OptInLevel=" + optInLevel); 147 148 if (response.ok) { 149 if (document.querySelector("#dwCookieBanner")) { 150 document.querySelector("#dwCookieBanner").classList.add("d-none"); 151 } 152 return false; 153 } else { 154 return false; 155 } 156 } 157 158 async function acceptCustomSetup() { 159 var form = document.querySelector("#dwCookieModalCustomForm"); 160 161 let formData = new FormData(form); 162 var fetchOptions = { 163 method: 'POST', 164 body: formData 165 }; 166 167 let response = await fetch(form.action, fetchOptions); 168 169 if (response.ok) { 170 if (document.querySelector("#dwCookieBanner")) { 171 document.querySelector("#dwCookieBanner").classList.add("d-none"); 172 } 173 return false; 174 } else { 175 return false; 176 } 177 } 178 179 function toggleAcceptSelected() { 180 var cookieCalegoriesElement = document.querySelector("#dwCookieModalCustomForm"); 181 var enableAcceptSelected = false; 182 183 cookieCalegoriesElement.querySelectorAll(".js-checkbox").forEach(function (field) { 184 if (field.checked == true) { 185 enableAcceptSelected = true; 186 } 187 }); 188 189 if (enableAcceptSelected) { 190 document.querySelector("#dwCookieDeclineAll").classList.add("d-none"); 191 document.querySelector("#dwCookieAcceptSelected").classList.remove("d-none"); 192 } else { 193 document.querySelector("#dwCookieDeclineAll").classList.remove("d-none"); 194 document.querySelector("#dwCookieAcceptSelected").classList.add("d-none"); 195 } 196 } 197 198 function showCookieModal() { 199 var cookieModal = new bootstrap.Modal(document.querySelector('#dwCookieModal'), { 200 backdrop: 'static' 201 }); 202 cookieModal.show(); 203 } 204 </script> 205 206 if (layout == "modal") 207 { 208 <script type="module"> 209 showCookieModal(); 210 </script> 211 } 212 } 213