Error executing template "Designs/bleau-solutionset/ItemPublisher/List/EventListMinimal.cshtml"
System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at CompiledRazorTemplates.Dynamic.RazorEngine_fc46ae6e7e9d4f7f84b71531d5d0d965.Execute() in E:\Dynamicweb.net\SolutionsCustom\vallensbaek.devcl.bleaudev.dk_PBL\Files\Templates\Designs\bleau-solutionset\ItemPublisher\List\EventListMinimal.cshtml:line 84
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.DynamicWrapperService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, ITemplateSource templateSource, String name, Type modelType, Object model, DynamicViewBag viewBag)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 2 3 @using System.Collections.Specialized; 4 @using System.Collections.Generic; 5 @using System.Web; 6 @using System.Web.Script.Serialization; 7 @using System.Text; 8 @using System.Text.RegularExpressions; 9 @using System.Linq; 10 @using System.Globalization; 11 @using System.Security.Claims 12 @using Dynamicweb.Admin.eComBackend 13 @using Dynamicweb.Rendering; 14 @using Dynamicweb.Content; 15 @using Dynamicweb.Environment.Web 16 @using Dynamicweb.SystemTools; 17 @using Dynamicweb.Core; 18 @using Dynamicweb.DataManagement; 19 @using Dynamicweb.Forms; 20 @using Dynamicweb.Ecommerce.Variants; 21 @using Dynamicweb.Content.Items; 22 23 @using Bleau.Calendar.Core.Helper; 24 @using Bleau.Calendar.Core.Models.Events; 25 @using Bleau.Calendar.Events.Helper; 26 27 28 @{ 29 30 ParagraphService ParagraphService = new ParagraphService(); 31 List<string> EventItemTypes = new List<string>(); 32 EventItemTypes.Add("event"); 33 34 int paragraphId = Pageview.CurrentParagraph.ID; 35 36 IEnumerable<LoopItem> eventsList = GetLoop("ItemPublisher:Items.List"); 37 38 IEnumerable<Category> eventsCategories = eventsList.Select(e => e.GetInteger("ItemPublisher:Item.Field.PageId")).Distinct().Select(c => new Category 39 { 40 PageId = c, 41 Name = Dynamicweb.Services.Pages.GetPage(c).MenuText, 42 ItemId = Dynamicweb.Services.Pages.GetPage(c).ItemId 43 }); 44 45 string filterCategory = Sanitize.Parameter("category"), 46 filterStart = Sanitize.Parameter("start", ParameterType.Datetime), 47 filterEnd = Sanitize.Parameter("end", ParameterType.Datetime); 48 49 DateTime filterStartDate = !string.IsNullOrEmpty(filterStart) ? DateTime.Parse(filterStart) : new DateTime(), 50 filterEndDate = !string.IsNullOrEmpty(filterEnd) ? DateTime.Parse(filterEnd) : new DateTime(); 51 52 53 if (!string.IsNullOrEmpty(filterCategory)) 54 { 55 eventsList = eventsList.Where(e => e.GetString("ItemPublisher:Item.Field.PageId").Equals(filterCategory)); 56 57 } 58 59 if (!string.IsNullOrEmpty(filterStart) || !string.IsNullOrEmpty(filterEnd)) 60 { 61 62 eventsList = eventsList.Where(e => 63 { 64 65 bool included = true; 66 67 DateTime eventStartDate = e.GetDate("ItemPublisher:Item.StartDateTime.Value"), 68 eventEndDate = e.GetDate("ItemPublisher:Item.EndDateTime.Value"); 69 70 if (included && !string.IsNullOrEmpty(filterStart)) 71 { 72 included = DateTime.Compare(eventStartDate, filterStartDate) >= 0; 73 } 74 if (included && !string.IsNullOrEmpty(filterEnd)) 75 { 76 included = DateTime.Compare(eventStartDate, filterEndDate) <= 0; 77 } 78 79 return included; 80 81 }); 82 } 83 84 string pageDetailUrl = eventsList.First().GetString("ItemPublisher:Item.DetailsUrl").Split(new[] { "&itemId" }, StringSplitOptions.None)[0]; 85 86 IEnumerable<Event> Events = eventsList.Select(e => { 87 88 Event CalendarEvent = new Event(); 89 90 CalendarEvent.Id = e.GetString("ItemPublisher:Item.Field.Id"); 91 CalendarEvent.Title = e.GetString("ItemPublisher:Item.Title.Value"); 92 CalendarEvent.Description = e.GetString("ItemPublisher:Item.Description.Value"); 93 CalendarEvent.Image = e.GetString("ItemPublisher:Item.Image.Value"); 94 95 CalendarEvent.StartDateTime = e.GetDate("ItemPublisher:Item.StartDateTime.Value"); 96 CalendarEvent.EndDateTime = e.GetDate("ItemPublisher:Item.EndDateTime.Value"); 97 CalendarEvent.IsRecurring = e.GetBoolean("ItemPublisher:Item.IsRecurring.Value"); 98 99 CalendarEvent.Recurring.Repeats = e.GetString("ItemPublisher:Item.RecurringRepeats.Value"); 100 CalendarEvent.Recurring.RepeatsWeeks = e.GetInteger("ItemPublisher:Item.RecurringRepeatsWeeks.Value"); 101 CalendarEvent.Recurring.RepeatsDays = e.GetString("ItemPublisher:Item.RecurringRepeatsDays.Value"); 102 CalendarEvent.Recurring.StopRepeatingAfter = e.GetInteger("ItemPublisher:Item.StopRepeatingAfter.Value"); 103 CalendarEvent.Recurring.StopRepeatingOn = e.GetDate("ItemPublisher:Item.StopRepeatingOn.Value"); 104 105 CalendarEvent.Recurring.DatesExcluded = new List<DateTime>(); 106 CalendarEvent.Recurring.DatesIncluded = new List<DateTime>(); 107 108 CalendarEvent.Recurring.DatesExcluded.Add(e.GetDate("ItemPublisher:Item.DateExcluded1.Value")); 109 CalendarEvent.Recurring.DatesExcluded.Add(e.GetDate("ItemPublisher:Item.DateExcluded2.Value")); 110 CalendarEvent.Recurring.DatesExcluded.Add(e.GetDate("ItemPublisher:Item.DateExcluded3.Value")); 111 112 CalendarEvent.Recurring.DatesIncluded.Add(e.GetDate("ItemPublisher:Item.DateIncluded1.Value")); 113 CalendarEvent.Recurring.DatesIncluded.Add(e.GetDate("ItemPublisher:Item.DateIncluded2.Value")); 114 CalendarEvent.Recurring.DatesIncluded.Add(e.GetDate("ItemPublisher:Item.DateIncluded3.Value")); 115 116 CalendarEvent.Location.Name = e.GetString("ItemPublisher:Item.LocationName.Value"); 117 CalendarEvent.Location.Address = e.GetString("ItemPublisher:Item.LocationAddress.Value"); 118 119 CalendarEvent.Organizer.Name = e.GetString("ItemPublisher:Item.OrganizerName.Value"); 120 CalendarEvent.Organizer.Email = e.GetString("ItemPublisher:Item.OrganizerEmail.Value"); 121 CalendarEvent.Organizer.Phone = e.GetString("ItemPublisher:Item.OrganizerPhone.Value"); 122 CalendarEvent.Organizer.PossiblyUnion = e.GetString("ItemPublisher:Item.OrganizerPossiblyUnion.Value"); 123 124 CalendarEvent.Payment = e.GetString("ItemPublisher:Item.Payment.Value"); 125 CalendarEvent.Price = e.GetDouble("ItemPublisher:Item.Price.Value"); 126 127 CalendarEvent.RequiresRegistration = e.GetBoolean("ItemPublisher:Item.RequiresEventRegistration.Value"); 128 129 CalendarEvent.Registration.HomePage = e.GetString("ItemPublisher:Item.RegistrationHomepage.Value"); 130 131 CalendarEvent.Acceptance = e.GetBoolean("ItemPublisher:Item.Acceptance.Value"); 132 133 CalendarEvent.Category.PageId = e.GetInteger("ItemPublisher:Item.Field.PageId"); 134 135 CalendarEvent.DetailUrl = e.GetString("ItemPublisher:Item.DetailsUrl"); 136 137 Dynamicweb.Content.Page CategoryPage = Dynamicweb.Services.Pages.GetPage(CalendarEvent.Category.PageId); 138 CalendarEvent.Category.Name = CategoryPage.MenuText; 139 CalendarEvent.Category.ItemId = CategoryPage.ItemId; 140 CalendarEvent.Category.Color = CategoryPage.Item != null && CategoryPage.Item["Color"] != null ? CategoryPage.Item["Color"].ToString() : "#0f6b9e"; 141 142 return CalendarEvent; 143 144 }); 145 146 // Start Recurring Events 147 148 IEnumerable<Paragraph> EventParagraphs_All = ParagraphService.GetParagraphsByItemTypes(EventItemTypes), 149 RecurringEventParagraphs_All, 150 RecurringEventParagraphs_Active; 151 152 RecurringEventParagraphs_All = EventParagraphs_All.Any() ? EventParagraphs_All.Where(p => p.ShowParagraph && p.Item["IsRecurring"] != null && Convert.ToBoolean(p.Item["IsRecurring"].ToString()) && p.Item["Approved"] != null && Convert.ToBoolean(p.Item["Approved"].ToString())) : null; 153 RecurringEventParagraphs_Active = RecurringEventParagraphs_All != null && RecurringEventParagraphs_All.Any() ? RecurringEventParagraphs_All.Where(p => p.Item["StopRepeatingOn"] != null && DateTime.Compare(DateTime.Now,Convert.ToDateTime(p.Item["StopRepeatingOn"])) < 0 ) : null; 154 155 if (RecurringEventParagraphs_All != null && RecurringEventParagraphs_All.Any()) 156 { 157 158 foreach (Paragraph RecurringParagraph in RecurringEventParagraphs_Active) 159 { 160 161 Event RecurringEvent = new Event(); 162 163 RecurringEvent.Id = RecurringParagraph.Item.Id; 164 RecurringEvent.Title = RecurringParagraph.Item["Title"] != null ? RecurringParagraph.Item["Title"].ToString() : string.Empty; 165 RecurringEvent.Description = RecurringParagraph.Item["Description"] != null ? RecurringParagraph.Item["Description"].ToString() : string.Empty; 166 RecurringEvent.Image = RecurringParagraph.Item["Image"] != null ? RecurringParagraph.Item["Image"].ToString() : string.Empty; 167 168 RecurringEvent.StartDateTime = RecurringParagraph.Item["StartDateTime"] != null ? Convert.ToDateTime(RecurringParagraph.Item["StartDateTime"].ToString()) : new DateTime(); 169 RecurringEvent.EndDateTime = RecurringParagraph.Item["EndDateTime"] != null ? Convert.ToDateTime(RecurringParagraph.Item["EndDateTime"].ToString()) : new DateTime(); 170 RecurringEvent.IsRecurring = RecurringParagraph.Item["IsRecurring"] != null ? Convert.ToBoolean(RecurringParagraph.Item["IsRecurring"].ToString()) : false; 171 172 RecurringEvent.Recurring.Repeats = RecurringParagraph.Item["RecurringRepeats"] != null ? RecurringParagraph.Item["RecurringRepeats"].ToString() : string.Empty; 173 RecurringEvent.Recurring.RepeatsWeeks = RecurringParagraph.Item["RecurringRepeatsWeeks"] != null ? Convert.ToInt32(RecurringParagraph.Item["RecurringRepeatsWeeks"].ToString()) : 0; 174 RecurringEvent.Recurring.RepeatsDays = RecurringParagraph.Item["RecurringRepeatsDays"] != null ? RecurringParagraph.Item["RecurringRepeatsDays"].ToString() : string.Empty; 175 RecurringEvent.Recurring.StopRepeatingAfter = 0; 176 RecurringEvent.Recurring.StopRepeatingOn = RecurringParagraph.Item["StopRepeatingOn"] != null ? Convert.ToDateTime(RecurringParagraph.Item["StopRepeatingOn"].ToString()) : new DateTime(); 177 178 RecurringEvent.Recurring.DatesExcluded = new List<DateTime>(); 179 RecurringEvent.Recurring.DatesIncluded = new List<DateTime>(); 180 181 if (RecurringParagraph.Item["DateExcluded1"] != null) 182 { 183 RecurringEvent.Recurring.DatesExcluded.Add(Convert.ToDateTime(RecurringParagraph.Item["DateExcluded1"].ToString())); 184 } 185 if (RecurringParagraph.Item["DateExcluded2"] != null) 186 { 187 RecurringEvent.Recurring.DatesExcluded.Add(Convert.ToDateTime(RecurringParagraph.Item["DateExcluded2"].ToString())); 188 } 189 if (RecurringParagraph.Item["DateExcluded3"] != null) 190 { 191 RecurringEvent.Recurring.DatesExcluded.Add(Convert.ToDateTime(RecurringParagraph.Item["DateExcluded3"].ToString())); 192 } 193 194 RecurringEvent.Location.Name = RecurringParagraph.Item["LocationName"] != null ? RecurringParagraph.Item["LocationName"].ToString() : string.Empty; 195 RecurringEvent.Location.Address = RecurringParagraph.Item["LocationAddress"] != null ? RecurringParagraph.Item["LocationAddress"].ToString() : string.Empty; 196 197 RecurringEvent.Organizer.Name = RecurringParagraph.Item["OrganizerName"] != null ? RecurringParagraph.Item["OrganizerName"].ToString() : string.Empty; 198 RecurringEvent.Organizer.Email = RecurringParagraph.Item["OrganizerEmail"] != null ? RecurringParagraph.Item["OrganizerEmail"].ToString() : string.Empty; 199 RecurringEvent.Organizer.Phone = RecurringParagraph.Item["OrganizerPhone"] != null ? RecurringParagraph.Item["OrganizerPhone"].ToString() : string.Empty; 200 RecurringEvent.Organizer.PossiblyUnion = RecurringParagraph.Item["OrganizerPossiblyUnion"] != null ? RecurringParagraph.Item["OrganizerPossiblyUnion"].ToString() : string.Empty; 201 202 RecurringEvent.Payment = RecurringParagraph.Item["Payment"] != null ? RecurringParagraph.Item["Payment"].ToString() : string.Empty; 203 RecurringEvent.Price = RecurringParagraph.Item["Price"] != null ? Convert.ToDouble(RecurringParagraph.Item["Price"].ToString()) : 0; 204 205 RecurringEvent.RequiresRegistration = RecurringParagraph.Item["RequiresEventRegistration"] != null ? Convert.ToBoolean(RecurringParagraph.Item["RequiresEventRegistration"].ToString()) : false; 206 207 RecurringEvent.Registration.HomePage = RecurringParagraph.Item["RegistrationHomepage"] != null ? RecurringParagraph.Item["RegistrationHomepage"].ToString() : string.Empty; 208 209 RecurringEvent.Acceptance = RecurringParagraph.Item["Acceptance"] != null ? Convert.ToBoolean(RecurringParagraph.Item["Acceptance"].ToString()) : false; 210 211 RecurringEvent.Category.PageId = RecurringParagraph.PageID; 212 213 RecurringEvent.DetailUrl = string.Format("{0}&itemId={1}:{2}", pageDetailUrl, RecurringParagraph.ItemType, RecurringParagraph.Item.Id); 214 215 Dynamicweb.Content.Page CategoryPage = Dynamicweb.Services.Pages.GetPage(RecurringEvent.Category.PageId); 216 RecurringEvent.Category.Name = CategoryPage.MenuText; 217 RecurringEvent.Category.ItemId = CategoryPage.ItemId; 218 RecurringEvent.Category.Color = CategoryPage.Item != null && CategoryPage.Item["Color"] != null ? CategoryPage.Item["Color"].ToString() : "#0f6b9e"; 219 220 if (RecurringEvent.Recurring.DatesIncluded.Any()) 221 { 222 foreach (DateTime IncludedDate in RecurringEvent.Recurring.DatesIncluded) 223 { 224 Event NewRecurringEvent = new Event(); 225 NewRecurringEvent = RecurringEvent.CopyEvent(); 226 227 NewRecurringEvent.StartDateTime = IncludedDate; 228 NewRecurringEvent.EndDateTime = IncludedDate; 229 NewRecurringEvent.DetailUrl = string.Format("{0}&itemId={1}:{2}&d={3}", pageDetailUrl, RecurringParagraph.ItemType, RecurringParagraph.Item.Id, NewRecurringEvent.StartDateTime); 230 231 if (DateTime.Compare(DateTime.Now, NewRecurringEvent.StartDateTime) < 0 && !RecurringEvent.Recurring.DatesExcluded.Any(d => d.Date.Equals(NewRecurringEvent.StartDateTime.Date))) 232 { 233 Events = Events.Append(NewRecurringEvent); 234 } 235 } 236 } 237 238 int weeks_loop = RecurringEvent.Recurring.RepeatsWeeks > 0 ? RecurringEvent.Recurring.RepeatsWeeks : 1, 239 days_loop = 7 * weeks_loop, 240 occurrences_counter = 0, 241 occurrences_max = RecurringEvent.Recurring.StopRepeatingAfter > 0 ? (RecurringEvent.Recurring.StopRepeatingAfter) : 99999999; 242 243 if (RecurringEvent.Recurring.Repeats.Equals("weekly") && string.IsNullOrEmpty(RecurringEvent.Recurring.RepeatsDays)) 244 { 245 for (var EventDay = RecurringEvent.StartDateTime; EventDay <= RecurringEvent.Recurring.StopRepeatingOn.AddDays(1); EventDay = EventDay.AddDays(days_loop)) 246 { 247 occurrences_counter++; 248 249 Event NewRecurringEvent = new Event(); 250 NewRecurringEvent = RecurringEvent.CopyEvent(); 251 252 NewRecurringEvent.StartDateTime = EventDay; 253 NewRecurringEvent.EndDateTime = EventDay; 254 NewRecurringEvent.DetailUrl = string.Format("{0}&itemId={1}:{2}&d={3}", pageDetailUrl, RecurringParagraph.ItemType, RecurringParagraph.Item.Id, NewRecurringEvent.StartDateTime); 255 256 if (DateTime.Compare(DateTime.Now, NewRecurringEvent.StartDateTime) < 0 && 257 !RecurringEvent.Recurring.DatesExcluded.Any(d => d.Date.Equals(NewRecurringEvent.StartDateTime.Date)) && 258 occurrences_counter <= occurrences_max) 259 { 260 Events = Events.Append(NewRecurringEvent); 261 } 262 } 263 } 264 else if (RecurringEvent.Recurring.Repeats.Equals("daily") || !string.IsNullOrEmpty(RecurringEvent.Recurring.RepeatsDays)) 265 { 266 days_loop = 1; 267 268 String[] RepeatsDays = !string.IsNullOrEmpty(RecurringEvent.Recurring.RepeatsDays) ? RecurringEvent.Recurring.RepeatsDays.Split(',') : null; 269 String[] Days = { "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; 270 271 for (var EventDay = RecurringEvent.StartDateTime; EventDay <= RecurringEvent.Recurring.StopRepeatingOn.AddDays(1); EventDay = EventDay.AddDays(days_loop)) 272 { 273 if (RepeatsDays == null || RepeatsDays.Contains(Days[(int)System.Globalization.CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(EventDay)])) 274 { 275 276 occurrences_counter++; 277 278 Event NewRecurringEvent = new Event(); 279 NewRecurringEvent = RecurringEvent.CopyEvent(); 280 281 NewRecurringEvent.StartDateTime = EventDay; 282 NewRecurringEvent.EndDateTime = EventDay; 283 NewRecurringEvent.DetailUrl = string.Format("{0}&itemId={1}:{2}&d={3}", pageDetailUrl, RecurringParagraph.ItemType, RecurringParagraph.Item.Id, NewRecurringEvent.StartDateTime); 284 285 if (DateTime.Compare(DateTime.Now, NewRecurringEvent.StartDateTime) < 0 && 286 !RecurringEvent.Recurring.DatesExcluded.Any(d => d.Date.Equals(NewRecurringEvent.StartDateTime.Date)) && 287 occurrences_counter <= occurrences_max) 288 { 289 Events = Events.Append(NewRecurringEvent); 290 } 291 292 } 293 294 295 } 296 } 297 298 } 299 300 } 301 302 Events = Events.OrderBy(ev => ev.StartDateTime).Take(GetInteger("ItemPublisher:Items.Count")); 303 304 // End Recurring Events 305 306 int eventsCounter = Events.Count(), 307 eventsTotalCount = eventsCounter; 308 309 string eventsPageName = Pageview.Page.MenuText, 310 eventsParagraphName = Pageview.CurrentParagraph.Header, 311 eventsTitle = eventsParagraphName; 312 313 /* Pagination */ 314 315 int itemsPerPage = 12, 316 pageSize = itemsPerPage == 0 ? 12 : itemsPerPage, 317 page = 1, 318 totalItems = eventsCounter; 319 320 int.TryParse(Sanitize.Parameter("p", ParameterType.Number), out page); 321 322 int totalPages = (int) Math.Ceiling((double) totalItems / pageSize); 323 324 if (page > totalPages) 325 { 326 page = totalPages; 327 } 328 else if (page < 1) 329 { 330 page = 1; 331 } 332 333 Events = Events.Skip((page - 1) * pageSize).Take(pageSize); 334 335 bool hasResults = Events.Any(); 336 337 } 338 339 <div id="events-@(paragraphId)" class="events-container events-list-container container-fluid" data-view="List"> 340 <div class="events-list-head"> 341 <h2 class="events-title">@eventsTitle</h2> 342 <div class="events-actions"> 343 <a href="/global/events" class="event-action-button btn btn-primary"> 344 @Translate("All Events", "All Events") 345 </a> 346 <a href="/global/events/create" class="event-action-button btn btn-primary"> 347 @Translate("Create Event", "Create Event") 348 </a> 349 </div> 350 </div> 351 <div class="events-list-container"> 352 353 <div class="events-list-results row" data-has-results="@hasResults"> 354 355 @if (Events.Any()) 356 { 357 <ul class="events-list row"> 358 @foreach (Event CalendarEvent in Events) 359 { 360 361 string eventClass = "event-item col-xs-12 col-md-4", 362 eventDate = string.Empty, 363 eventUrl = string.Format("{0}&cat={1}",CalendarEvent.DetailUrl, CalendarEvent.Category.PageId), 364 eventHeader = string.Format("{0}{1}", CalendarEvent.GetFormatDates(), CalendarEvent.Category.Name.ToLower().Equals("place2book") ? string.Empty : "<br/>"+CalendarEvent.Category.Name); 365 366 bool hasEvent = !string.IsNullOrEmpty(CalendarEvent.Id); 367 368 if (hasEvent) 369 { 370 371 <li class="@(eventClass)" data-color="@(CalendarEvent.Category.Color)"> 372 <a href="@(eventUrl)" title="@Translate("Read More", "Read More")"> 373 <div class="event-item-container"> 374 <div class="event-header" style="border-color: @(CalendarEvent.Category.Color);"> 375 <span style="color: @(CalendarEvent.Category.Color);">@(eventHeader)</span> 376 </div> 377 378 @* 379 @if (!string.IsNullOrEmpty(CalendarEvent.Image)) 380 { 381 //CalendarEvent.Image = string.Format("{0}?width=600&height=600&anchor=center&mode=crop", CalendarEvent.Image); 382 CalendarEvent.Image = string.Format("/Admin/Public/GetImage.ashx?width=600&height=600&crop=5&Compression=75&image={0}", CalendarEvent.Image); 383 <figure class="event-image"> 384 <img src="@(CalendarEvent.Image)" class="img-responsive" alt="@(CalendarEvent.Title)" /> 385 </figure> 386 } 387 *@ 388 389 @if (!string.IsNullOrEmpty(CalendarEvent.Title)) 390 { 391 <h2 class="event-title"> 392 <span> 393 @(CalendarEvent.Title) 394 </span> 395 </h2> 396 } 397 398 <ul> 399 <li> 400 <span class="event-label">@Translate("Date", "Date"):</span> 401 <div class="event-values"> 402 @CalendarEvent.GetFullDates() 403 </div> 404 </li> 405 406 407 @if (!string.IsNullOrEmpty(CalendarEvent.GetFullTimes())) 408 { 409 <li> 410 <span class="event-label">@Translate("Time", "Time"):</span> 411 <div class="event-values"> 412 @CalendarEvent.GetFullTimes() 413 </div> 414 </li> 415 } 416 417 @if (!string.IsNullOrEmpty(CalendarEvent.Location.Name)) 418 { 419 <li> 420 <span class="event-label">@Translate("Location", "Location"):</span> 421 <div class="event-values"> 422 @(CalendarEvent.Location.Name) 423 </div> 424 </li> 425 426 } 427 428 @if (CalendarEvent.Price > 0 || (!string.IsNullOrEmpty(CalendarEvent.Payment) && !CalendarEvent.Payment.Equals("payment1"))) 429 { 430 <li> 431 <span class="event-label">@Translate("Price", "Price")</span> 432 <div class="event-values"> 433 @(string.Format("{0:0.00}", CalendarEvent.Price)) 434 </div> 435 </li> 436 437 } 438 else 439 { 440 <li> 441 <span class="event-label">@Translate("Free", "Free")</span> 442 </li> 443 444 } 445 </ul> 446 </div> 447 </a> 448 @if (!string.IsNullOrEmpty(CalendarEvent.Registration.HomePage)) 449 { 450 <a href="@(CalendarEvent.Registration.HomePage)" class="event-registration-button btn btn-primary" target="_blank" > 451 @Translate("Signup", "Signup") 452 </a> 453 } 454 @* 455 <a href="@(eventUrl)" class="event-registration-button btn btn-primary"> 456 @Translate("Read More", "Read More") 457 </a> 458 *@ 459 </li> 460 } 461 } 462 </ul> 463 } 464 else 465 { 466 <div class="events-no-results"> 467 <p> 468 <h3>@Translate("No Results", "No Results")</h3> 469 </p> 470 </div> 471 } 472 473 </div> 474 475 </div> 476 477 @if (totalPages > 1 && page < totalPages) 478 { 479 NameValueCollection queryPageParameters = HttpUtility.ParseQueryString(Dynamicweb.Context.Current.Request.Url.Query); 480 queryPageParameters.Set("p", (page + 1).ToString()); 481 System.Uri pageUrl = Urls.BuildUri(Tools.GetCurrentUrl(true) + Dynamicweb.Context.Current.Request.Path, queryPageParameters); 482 483 <div class="events-load-more col-12"> 484 <div class="events-load-more-actions"> 485 <a class="load-more btn btn-primary" href="@pageUrl"> 486 <span>@Translate("View More", "View More")</span> 487 <span class="arrow"></span> 488 </a> 489 </div> 490 </div> 491 } 492 493 </div> 494 495 @SnippetStart("StyleSheetHead") 496 <link rel="stylesheet" href="~/Files/Templates/Designs/bleau-solutionset/assets/stylesheets/jquery-ui.min.css" media="screen"> 497 <link rel="stylesheet" href="~/Files/Templates/Designs/bleau-solutionset/assets/modules/bleau-calendar/css/style.min.css" media="screen"> 498 @SnippetEnd("StyleSheetHead") 499 500 @SnippetStart("JavaScriptHead") 501 <script type="text/javascript" src="~/Files/Templates/Designs/bleau-solutionset/assets/vendor/jquery-ui.min.js"></script> 502 <script type="text/javascript" src="~/Files/Templates/Designs/bleau-solutionset/assets/modules/bleau-calendar/js/main.js"></script> 503 <script type="text/javascript"> 504 $(function () { 505 BleauCalendar.Events().List().load({id:'events-@(paragraphId)'}); 506 }); 507 </script> 508 @SnippetEnd("JavaScriptHead") 509