Error executing template "Designs/mch365_admin/eCom7/CartV2/Step/MCH365-booth.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_2783d734553345e992e5e076c3fae41d.Execute() in E:\dynamicweb.net\Solutions\mch365.espresso5.dk\Files\Templates\Designs\mch365_admin\eCom7\CartV2\Step\MCH365-booth.cshtml:line 9
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 @using Co3.Espresso.Website.Services
2 @using Co3.MCH.Website.Frontend.Models.Frontend.MCH365
3 @using Co3.MCH.Website.Frontend.Models.Frontend.Users
4 @using Dynamicweb.SystemTools
5 6 @{
7 BoothContainer container = UserContext.Current.Booth;
8 long cacheBusterParam = DateTime.Now.Ticks;
9 string floorPlanSvg = $"{container.FloorPlan}?v={cacheBusterParam}";
10 }
11 12 <style>
13 :root {
14 --booth-scale: 1;
15 --booth-units-per-meter: 3;
16 --booth-grid-unit-size: 0px;
17 --booth-floorplan-left: 10px;
18 --booth-floorplan-top: 10px;
19 --booth-floorplan-width: 250px;
20 --booth-floorplan-height: 500px;
21 --booth-floorplan-svg: url('@floorPlanSvg');
22 }
23 </style>
24 25 <div class="e-loading-overlay is-loading js-booth-cart-preloader">
26 @RenderingService.Instance.PartialView( "_partials/loading-spinner.cshtml" )
27 </div>
28 <div id="js-mch365-booth-cart-container" class="row gy-3 gx-1 js-mch365-booth-cart-container">
29 <script id="js-e-handlebars-tmpl-no-booth-or-orderlines-partial" type="text/x-handlebars-template">
30 <div class="col-6 mx-auto text-center">
31 <h2>@Translate("Du har ingen produkter til placering. Men sådan behøver det ikke at være.")</h2>
32 <p class="lead">@Translate("Du har ingen produkter til placering. Eller ingen stand tildelt.")</p>
33 </div>
34 </script>
35 36 <div class="col-3">
37 <div class="js-mch365-booth-cart mch365-booth-cart">
38 <script id="js-e-handlebars-tmpl-booth-cart" type="text/x-handlebars-template">
39 {{#if notplaced}}
40 <h3 class="mb-2">@Translate("Du mangler at placere")</h3>
41 {{#each notplaced}}
42 <div class="mch365-booth-cart-item d-flex js-mch365-booth-cart-item mch365-booth-cart-item {{#if collectionCount}}multiple{{/if}} mch365-booth-cart-item-layer-{{{product.layer}}}" data-orderlineid="{{{id}}}">
43 <div class="d-flex justify-content-between w-100 align-items-center">
44 <img class="mch365-booth-cart-item-icon" src="{{{product.icon}}}" />
45 <p class="d-flex flex-grow-1 flex-shrink-1 my-0 h4 small">{{{product.name}}}</p>
46 {{#if collectionCount}}
47 <span class="d-flex flex-shrink-0 flex-grow-0 badge badge-primary ml-1 font-weight-bold small">x {{{collectionCount}}}</span>
48 {{/if}}
49 <a class="mch365-booth-cart-utility-btn flex-shrink-0 ml-1 mch365-booth-cart-droppable-item js-mch365-booth-cart-droppable-item" title="">
50 @ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/diagram-all-direction-expand.svg" )
51 </a>
52 </div>
53 </div>
54 {{/each}}
55 {{/if}}
56 57 <h3 class="mb-2">@Translate("Placerede elementer")</h3>
58 {{#if placed}}
59 {{#each placed as |main|}}
60 {{#compare main.collection.length '>' 1}}
61 <div class="js-mch365-booth-cart-item d-flex mch365-booth-cart-item multiple mch365-booth-cart-item-layer-{{{main.product.layer}}}" >
62 <div class="flex-column w-100">
63 <div class="d-flex justify-content-between w-100 align-items-center {{#compare main.expanded '===' false}}collapsed{{/compare}}" style="min-height: calc(50px - 1rem);" data-orderlineid="{{{main.id}}}" data-productid="{{{main.product.id}}}" data-toggle="collapse" data-target="#orderline-collection-{{{main.product.id}}}" aria-expanded="{{main.expanded}}" aria-controls="orderline-collection-{{{main.product.id}}}">
64 <img class="mch365-booth-cart-item-icon" src="{{{main.product.icon}}}" />
65 <p class="d-flex flex-grow-1 flex-shrink-1 my-0 h4 small">Gruppe af {{{main.product.name}}}</p>
66 <span class="d-flex flex-shrink-0 flex-grow-0 badge badge-primary ml-1 font-weight-bold small">x {{{main.collection.length}}}</span>
67 <a class="ml-1 mch365-booth-cart-utility-btn dropdown flex-shrink-0" title="Fold ud/ind">@ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/arrow-down-1.svg" )</a>
68 </div>
69 70 <div class="collapse {{#compare main.expanded '===' true}}show{{/compare}}" id="orderline-collection-{{{main.product.id}}}">
71 <div class="border-top" style="margin-top: .5rem;">
72 <div style="margin-top: .5rem;">
73 {{#each main.collection as |sub|}}
74 <div class="js-mch365-booth-cart-item d-flex mch365-booth-cart-item flex-wrap mch365-booth-cart-subitem mch365-booth-cart-item-layer-{{{sub.product.layer}}}" data-orderlineid="{{{sub.id}}}">
75 <div class="d-flex justify-content-between w-100 align-items-center ">
76 <a class="js-mch365-booth-remove-item-btn mch365-booth-remove-item-btn"></a>
77 <p class="d-flex flex-grow-1 flex-shrink-1 my-0 font-weight-bold font-family-headings small">{{{sub.product.name}}}</p>
78 <div class="mch365-booth-cart-show-coordinates-wrapper">
79 <span class="mch365-booth-cart-show-coordinates-placeholder">@ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/grid-artboard.svg" )</span>
80 <div class="mch365-booth-cart-show-coordinates position-relative d-flex">
81 <span class="d-inline-flex flex-shrink-0 flex-grow-0 badge badge-light small border">x:{{{sub.coords.x}}}; y:{{{sub.coords.y}}}</span>
82 83 <span class="coordinates-direction-specific rotate-{{sub.boothItem.rotation}}"></span>
84 </div>
85 </div>
86 <a class="ml-1 mch365-booth-cart-utility-btn flex-shrink-0 js-mch365-booth-item-add-comment {{#compare comment '!==' ''}}comment-added{{/compare}} collapsed" title="tilføj/ret kommentar" type="button" data-toggle="collapse" data-target="#OrderLineFieldValue_{{id}}_OrderlineComment" aria-expanded="false" aria-controls="OrderLineFieldValue_{{id}}_OrderlineComment">
87 {{#compare comment '!==' ''}}
88 @ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/comment-box.svg" )
89 {{else}}
90 @ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/add-comment-box.svg" )
91 {{/compare}}
92 </a>
93 </div>
94 95 <div class="mb-0 w-100 collapse" id="OrderLineFieldValue_{{id}}_OrderlineComment">
96 <textarea class="form-control js-mch365-booth-cart-item-comment-input my-1" id="OrderLineFieldValue_{{id}}_OrderlineComment" name="OrderLineFieldValue_{{id}}_OrderlineComment" rows="4">{{comment}}</textarea>
97 @*<form method="post" enctype="multipart/form-data" class="js-mch365-form" id="mch365-form-comment" data-feed-url="/system/data/mch?Action=contactadd&DisplayType=form" novalidate="novalidate">
98 <div>
99 <div class="form-group mt-1 mb-2">
100 <textarea class="form-control" id="OrderLineFieldValue_{{id}}_OrderlineComment" name="OrderLineFieldValue_{{id}}_OrderlineComment" rows="4"></textarea>
101 </div>
102 </div>
103 </form>*@
104 </div>
105 </div>
106 {{/each}}
107 </div>
108 </div>
109 </div>
110 </div>
111 </div>
112 {{else}}
113 <div class="js-mch365-booth-cart-item d-flex mch365-booth-cart-item flex-wrap mch365-booth-cart-item-layer-{{{main.product.layer}}}" data-orderlineid="{{{main.id}}}">
114 <a class="js-mch365-booth-remove-item-btn mch365-booth-remove-item-btn"></a>
115 <div class="d-flex justify-content-between w-100 align-items-center">
116 <img class="mch365-booth-cart-item-icon" src="{{{main.product.icon}}}" />
117 <p class="d-flex flex-grow-1 flex-shrink-1 my-0 h4 small">{{{main.product.name}}}</p>
118 <div class="mch365-booth-cart-show-coordinates-wrapper">
119 <span class="mch365-booth-cart-show-coordinates-placeholder">@ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/grid-artboard.svg" )</span>
120 <div class="mch365-booth-cart-show-coordinates position-relative d-flex">
121 <span class="d-inline-flex flex-shrink-0 flex-grow-0 badge badge-light small border">x:{{{main.coords.x}}}; y:{{{main.coords.y}}}</span>
122 <span class="coordinates-direction-specific rotate-{{main.boothItem.rotation}}"></span>
123 </div>
124 </div>
125 <a class="ml-1 mch365-booth-cart-utility-btn flex-shrink-0 js-mch365-booth-item-add-comment {{#compare comment '!==' ''}}comment-added{{/compare}} collapsed" title="tilføj/ret kommentar" type="button" data-toggle="collapse" data-target="#OrderLineFieldValue_{{id}}_OrderlineComment" aria-expanded="false" aria-controls="OrderLineFieldValue_{{id}}_OrderlineComment">
126 {{#compare comment '!==' ''}}
127 @ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/comment-box.svg" )
128 {{else}}
129 @ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/add-comment-box.svg" )
130 {{/compare}}
131 </a>
132 </div>
133 <div class="mb-0 w-100 collapse" id="OrderLineFieldValue_{{id}}_OrderlineComment">
134 @*<form method="post" enctype="multipart/form-data" class="js-mch365-form" id="mch365-form-comment" data-feed-url="/system/data/mch?Action=contactadd&DisplayType=form" novalidate="novalidate">
135 <div>
136 <div class="form-group my-1">*@
137 <textarea class="form-control js-mch365-booth-cart-item-comment-input my-1" id="OrderLineFieldValue_{{id}}_OrderlineComment" name="OrderLineFieldValue_{{id}}_OrderlineComment" rows="4">{{comment}}</textarea>
138 @*</div>
139 </div>
140 </form>*@
141 </div>
142 </div>
143 {{/compare}}
144 {{/each}}
145 {{else}}
146 <p>@Translate("Du har endnu ingen placerede elementer. Træk i elementet i listen herover og før dem over på tegningen for at placere.")</p>
147 {{/if}}
148 </script>
149 </div>
150 </div>
151 <div class="col-9 js-mch365-booth-container">
152 <div class="d-flex js-mch365-booth-cart-header">
153 <script id="js-e-handlebars-tmpl-booth-cart-header" type="text/x-handlebars-template">
154 <div class="flex-fill mb-1">
155 <ul class="list-unstyled d-flex">
156 <li class="mr-3"><label class="mr-1">@Translate("Stand")</label>{{{cart.booth.id}}}</li>
157 <li><label class="mr-1">Total m<sup>2</sup></label>{{{cart.booth.size}}}</li>
158 </ul>
159 </div>
160 <div class="text-right">
161 <a class="underline small" download href="{{{cart.booth.pdfFloorPlan}}}">@Translate("Se hele halplanen")</a>
162 <div class="d-block small text-muted">@Translate("MCH365 - Hall link info - text", "OBS: Din stand vender som på halplanen.")</div>
163 </div>
164 </script>
165 </div>
166 167 <div class="align-items-center bg-light rounded d-flex justify-content-around position-relative" style="aspect-ratio: 4/3;">
168 169 <div class="btn-group d-flex flex-column position-absolute mch365-booth-canvas-zoom-container">
170 <a class="btn btn-icon js-mch365-booth-canvas-zoom" data-direction="in">@ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/add.svg" )</a>
171 <span class="mch365-booth-canvas-zoom-container-icon">@ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/streamline-icon-search-1@48x48.svg" )</span>
172 <a class="btn btn-icon js-mch365-booth-canvas-zoom" data-direction="out">@ImageService.Instance.GetSvgMarkup( "/Files/Templates/Designs/mch365_admin/_assets/img/streamline/subtract.svg" )</a>
173 </div>
174 175 <div id="js-mch365-booth-panzoom-canvas" class="js-mch365-booth-panzoom-canvas mch365-booth-panzoom-canvas">
176 177 <div class="js-mch365-booth-guide-layer mch365-booth-guide-layer">
178 <div class="mch365-booth-legend-xy">
179 <span>x</span>
180 <span>y</span>
181 </div>
182 <div class="mch365-x">
183 @for ( int i = -30; i <= 30; i++ )
184 {
185 string unit = i > 0 ? "m" : string.Empty;
186 <span>@i@(unit)</span>
187 }
188 </div>
189 <div class="mch365-y">
190 @for ( int i = -30; i <= 30; i++ )
191 {
192 string unit = i > 0 ? "m" : string.Empty;
193 <span>@i@(unit)</span>
194 }
195 </div>
196 <div id="js-mch365-booth" class="mch365-booth js-mch365-booth">
197 <script id="js-e-handlebars-tmpl-booth-item-partial" type="text/x-handlebars-template">
198 <div class="js-mch365-booth-item mch365-booth-item booth-item-{{{product.number}}} booth-item-dimensions-{{{id}}} mch365-booth-item-layer-{{{product.layer}}} {{#if product.rotatable}}is-rotatable deg-{{{boothItem.rotation}}}{{/if}}" data-orderlineid="{{{id}}}" data-x-ratio="{{{product.ratio.x}}}" data-y-ratio="{{{product.ratio.y}}}" data-icon="{{{product.icon}}}" data-rotation="{{{boothItem.rotation}}}" data-x="{{{boothItem.x}}}" data-y="{{{boothItem.y}}}">
199 <div class="test-ae show-on-active">
200 <svg class="e-loading-spinner" viewBox="0 0 100 100">
201 <circle class="path circle1" cx="50" cy="50" r="50" fill="none"></circle>
202 <circle class="path circle2" cx="50" cy="50" r="50" fill="none"></circle>
203 <circle class="path circle3" cx="50" cy="50" r="50" fill="none"></circle>
204 </svg>
205 </div>
206 <div class="item-icon"></div>
207 {{#if product.rotatable}}<span class="icon-rotate js-mch365-rotate-item show-on-active"><span></span></span>{{/if}}
208 </div>
209 <style>
210 .booth-item-{{{product.number}}}{
211 --booth-item-icon: url('{{{product.icon}}}');
212 }
213 </style>
214 </script>
215 </div>
216 </div>
217 </div>
218 </div>
219 220 221 <div class="mt-2 d-block d-xl-flex">
222 <div class="flex-grow-1 flex-shrink-1 pr-0 pr-xl-2 js-mch365-booth-legends mch365-booth-legends">
223 <script id="js-e-handlebars-tmpl-booth-legends" type="text/x-handlebars-template">
224 <div class="row">
225 <div class="col-4 js-mch365-booth-level-legends mch365-booth-level-legends">
226 <div class="border-bottom mb-1">
227 <label for="BoothLevel1" class="checkbox mch365-custom-checkbox mb-0 p-0 d-flex justify-content-between">
228 <span class="h4 small">@Translate("Grundplan")</span>
229 <div class="mch365-single-switch">
230 <input name="BoothLevel1" id="BoothLevel1" type="checkbox" checked data-layer="1" class="form-control js-mch365-booth-toggle-layer">
231 <span class="mch365-single-switch-slider"></span>
232 </div>
233 </label>
234 </div>
235 {{#each layer1}}
236 <div class="d-flex justify-content-start mch365-booth-level-item mb-1">
237 <img class="mch365-booth-level-item-icon" src="{{{product.icon}}}" />
238 <p class="mb-0 font-family-headings small">{{{boothItem.iconText}}}</p>
239 </div>
240 {{/each}}
241 </div>
242 <div class="col-4 js-mch365-booth-level-legends mch365-booth-level-legends">
243 <div class="border-bottom mb-1">
244 <label for="BoothLevel2" class="checkbox mch365-custom-checkbox mb-0 p-0 d-flex justify-content-between">
245 <span class="h4 small">@Translate("Interiør")</span>
246 <div class="mch365-single-switch">
247 <input name="BoothLevel2" id="BoothLevel2" type="checkbox" checked data-layer="2" class="form-control js-mch365-booth-toggle-layer">
248 <span class="mch365-single-switch-slider"></span>
249 </div>
250 </label>
251 </div>
252 {{#each layer2}}
253 <div class="d-flex justify-content-start mch365-booth-level-item mb-1">
254 <img class="mch365-booth-level-item-icon" src="{{{product.icon}}}" />
255 <p class="mb-0 font-family-headings small">{{{boothItem.iconText}}}</p>
256 </div>
257 {{/each}}
258 </div>
259 <div class="col-4 js-mch365-booth-level-legends mch365-booth-level-legends">
260 <div class="border-bottom mb-1">
261 <label for="BoothLevel3" class="checkbox mch365-custom-checkbox mb-0 p-0 d-flex justify-content-between">
262 <span class="h4 small">@Translate("Lys / strøm")</span>
263 <div class="mch365-single-switch">
264 <input name="BoothLevel3" id="BoothLevel3" type="checkbox" checked data-layer="3" class="form-control js-mch365-booth-toggle-layer">
265 <span class="mch365-single-switch-slider"></span>
266 </div>
267 </label>
268 </div>
269 {{#each layer3}}
270 <div class="d-flex justify-content-start mch365-booth-level-item mb-1">
271 <img class="mch365-booth-level-item-icon" src="{{{product.icon}}}" />
272 <p class="mb-0 font-family-headings small">{{{boothItem.iconText}}}</p>
273 </div>
274 {{/each}}
275 </div>
276 </div>
277 278 </script>
279 </div>
280 281 <div class="flex-grow-0 flex-shrink-0 mt-2 mt-xl-0">
282 <a class="btn btn-block btn-primary js-mch365-btn-booth-update" href="#">@Translate("Gem og luk")</a>
283 </div>
284 285 </div>
286 </div>
287 </div>
288