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_260dda0f4bbd40acabce807329179612.Execute() in C:\home\site\wwwroot\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.RazorEngineService.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 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 if (!eventsCategories.Any(c => c.PageId.Equals(RecurringEvent.Category.PageId))) 214 { 215 eventsCategories = eventsCategories.Append(new Category 216 { 217 PageId = RecurringEvent.Category.PageId, 218 Name = Dynamicweb.Services.Pages.GetPage(RecurringEvent.Category.PageId).MenuText, 219 ItemId = Dynamicweb.Services.Pages.GetPage(RecurringEvent.Category.PageId).ItemId 220 }); 221 } 222 223 RecurringEvent.DetailUrl = string.Format("{0}?itemId={1}:{2}", Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Pageview.Page.ID), RecurringParagraph.ItemType, RecurringParagraph.Item.Id); 224 225 Dynamicweb.Content.Page CategoryPage = Dynamicweb.Services.Pages.GetPage(RecurringEvent.Category.PageId); 226 RecurringEvent.Category.Name = CategoryPage.MenuText; 227 RecurringEvent.Category.ItemId = CategoryPage.ItemId; 228 RecurringEvent.Category.Color = CategoryPage.Item != null && CategoryPage.Item["Color"] != null ? CategoryPage.Item["Color"].ToString() : "#0f6b9e"; 229 230 if (RecurringEvent.Recurring.DatesIncluded.Any()) 231 { 232 foreach (DateTime IncludedDate in RecurringEvent.Recurring.DatesIncluded) 233 { 234 Event NewRecurringEvent = new Event(); 235 NewRecurringEvent = RecurringEvent.CopyEvent(); 236 237 NewRecurringEvent.StartDateTime = IncludedDate; 238 NewRecurringEvent.EndDateTime = IncludedDate; 239 NewRecurringEvent.DetailUrl = string.Format("{0}?itemId={1}:{2}&d={3}", Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Pageview.Page.ID), RecurringParagraph.ItemType, RecurringParagraph.Item.Id, NewRecurringEvent.StartDateTime); 240 241 if (DateTime.Compare(DateTime.Now, NewRecurringEvent.StartDateTime) < 0 && !RecurringEvent.Recurring.DatesExcluded.Any(d => d.Date.Equals(NewRecurringEvent.StartDateTime.Date))) 242 { 243 Events = Events.Append(NewRecurringEvent); 244 } 245 } 246 } 247 248 int weeks_loop = RecurringEvent.Recurring.RepeatsWeeks > 0 ? RecurringEvent.Recurring.RepeatsWeeks : 1, 249 days_loop = 7 * weeks_loop, 250 occurrences_counter = 0, 251 occurrences_max = RecurringEvent.Recurring.StopRepeatingAfter > 0 ? (RecurringEvent.Recurring.StopRepeatingAfter) : 99999999; 252 253 if (RecurringEvent.Recurring.Repeats.Equals("weekly") && string.IsNullOrEmpty(RecurringEvent.Recurring.RepeatsDays)) 254 { 255 for (var EventDay = RecurringEvent.StartDateTime; EventDay <= RecurringEvent.Recurring.StopRepeatingOn.AddDays(1); EventDay = EventDay.AddDays(days_loop)) 256 { 257 occurrences_counter++; 258 259 Event NewRecurringEvent = new Event(); 260 NewRecurringEvent = RecurringEvent.CopyEvent(); 261 262 NewRecurringEvent.StartDateTime = EventDay; 263 NewRecurringEvent.EndDateTime = EventDay; 264 NewRecurringEvent.DetailUrl = string.Format("{0}?itemId={1}:{2}&d={3}", Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Pageview.Page.ID), RecurringParagraph.ItemType, RecurringParagraph.Item.Id, NewRecurringEvent.StartDateTime); 265 266 if (DateTime.Compare(DateTime.Now, NewRecurringEvent.StartDateTime) < 0 && 267 !RecurringEvent.Recurring.DatesExcluded.Any(d => d.Date.Equals(NewRecurringEvent.StartDateTime.Date)) && 268 occurrences_counter <= occurrences_max) 269 { 270 Events = Events.Append(NewRecurringEvent); 271 } 272 } 273 } 274 else if (RecurringEvent.Recurring.Repeats.Equals("daily") || !string.IsNullOrEmpty(RecurringEvent.Recurring.RepeatsDays)) 275 { 276 days_loop = 1; 277 278 String[] RepeatsDays = !string.IsNullOrEmpty(RecurringEvent.Recurring.RepeatsDays) ? RecurringEvent.Recurring.RepeatsDays.Split(',') : null; 279 String[] Days = { "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; 280 281 for (var EventDay = RecurringEvent.StartDateTime; EventDay <= RecurringEvent.Recurring.StopRepeatingOn.AddDays(1); EventDay = EventDay.AddDays(days_loop)) 282 { 283 if (RepeatsDays == null || RepeatsDays.Contains(Days[(int)System.Globalization.CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(EventDay)])) 284 { 285 286 occurrences_counter++; 287 288 Event NewRecurringEvent = new Event(); 289 NewRecurringEvent = RecurringEvent.CopyEvent(); 290 291 NewRecurringEvent.StartDateTime = EventDay; 292 NewRecurringEvent.EndDateTime = EventDay; 293 NewRecurringEvent.DetailUrl = string.Format("{0}?itemId={1}:{2}&d={3}", Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Pageview.Page.ID), RecurringParagraph.ItemType, RecurringParagraph.Item.Id, NewRecurringEvent.StartDateTime); 294 295 if (DateTime.Compare(DateTime.Now, NewRecurringEvent.StartDateTime) < 0 && 296 !RecurringEvent.Recurring.DatesExcluded.Any(d => d.Date.Equals(NewRecurringEvent.StartDateTime.Date)) && 297 occurrences_counter <= occurrences_max) 298 { 299 Events = Events.Append(NewRecurringEvent); 300 } 301 302 } 303 304 305 } 306 } 307 308 } 309 310 } 311 312 Events = Events.OrderBy(ev => ev.StartDateTime).Take(GetInteger("ItemPublisher:Items.Count")); 313 314 // End Recurring Events 315 316 int eventsCounter = Events.Count(), 317 eventsTotalCount = eventsCounter; 318 319 string eventsPageName = Pageview.Page.MenuText, 320 eventsParagraphName = Pageview.CurrentParagraph.Header, 321 eventsTitle = eventsParagraphName; 322 323 /* Pagination */ 324 325 int itemsPerPage = 12, 326 pageSize = itemsPerPage == 0 ? 12 : itemsPerPage, 327 page = 1, 328 totalItems = eventsCounter; 329 330 int.TryParse(Sanitize.Parameter("p", ParameterType.Number), out page); 331 332 int totalPages = (int) Math.Ceiling((double) totalItems / pageSize); 333 334 if (page > totalPages) 335 { 336 page = totalPages; 337 } 338 else if (page < 1) 339 { 340 page = 1; 341 } 342 343 Events = Events.Skip((page - 1) * pageSize).Take(pageSize); 344 345 bool hasResults = Events.Any(); 346 347 } 348 349 <div id="events-@(paragraphId)" class="events-container events-list-container container-fluid" data-view="List"> 350 <div class="events-list-head"> 351 <h2 class="events-title">@eventsTitle</h2> 352 <div class="events-actions"> 353 <a href="/global/events" class="event-action-button btn btn-primary"> 354 @Translate("All Events", "All Events") 355 </a> 356 <a href="/global/events/create" class="event-action-button btn btn-primary"> 357 @Translate("Create Event", "Create Event") 358 </a> 359 </div> 360 </div> 361 <div class="events-list-container"> 362 363 <div class="events-list-results row" data-has-results="@hasResults"> 364 365 @if (Events.Any()) 366 { 367 <ul class="events-list row"> 368 @foreach (Event CalendarEvent in Events) 369 { 370 371 string eventClass = "event-item col-xs-12 col-md-4", 372 eventDate = string.Empty, 373 eventUrl = string.Format("{0}&cat={1}",CalendarEvent.DetailUrl, CalendarEvent.Category.PageId), 374 eventHeader = string.Format("{0}{1}", CalendarEvent.GetFormatDates(), CalendarEvent.Category.Name.ToLower().Equals("place2book") ? string.Empty : "<br/>"+CalendarEvent.Category.Name); 375 376 bool hasEvent = !string.IsNullOrEmpty(CalendarEvent.Id); 377 378 if (hasEvent) 379 { 380 381 <li class="@(eventClass)" data-color="@(CalendarEvent.Category.Color)"> 382 <a href="@(eventUrl)" title="@Translate("Read More", "Read More")"> 383 <div class="event-item-container"> 384 <div class="event-header" style="border-color: @(CalendarEvent.Category.Color);"> 385 <span style="color: @(CalendarEvent.Category.Color);">@(eventHeader)</span> 386 </div> 387 388 @* 389 @if (!string.IsNullOrEmpty(CalendarEvent.Image)) 390 { 391 //CalendarEvent.Image = string.Format("{0}?width=600&height=600&anchor=center&mode=crop", CalendarEvent.Image); 392 CalendarEvent.Image = string.Format("/Admin/Public/GetImage.ashx?width=600&height=600&crop=5&Compression=75&image={0}", CalendarEvent.Image); 393 <figure class="event-image"> 394 <img src="@(CalendarEvent.Image)" class="img-responsive" alt="@(CalendarEvent.Title)" /> 395 </figure> 396 } 397 *@ 398 399 @if (!string.IsNullOrEmpty(CalendarEvent.Title)) 400 { 401 <h2 class="event-title"> 402 <span> 403 @(CalendarEvent.Title) 404 </span> 405 </h2> 406 } 407 408 <ul> 409 <li> 410 <span class="event-label">@Translate("Date", "Date"):</span> 411 <div class="event-values"> 412 @CalendarEvent.GetFullDates() 413 </div> 414 </li> 415 416 417 @if (!string.IsNullOrEmpty(CalendarEvent.GetFullTimes())) 418 { 419 <li> 420 <span class="event-label">@Translate("Time", "Time"):</span> 421 <div class="event-values"> 422 @CalendarEvent.GetFullTimes() 423 </div> 424 </li> 425 } 426 427 @if (!string.IsNullOrEmpty(CalendarEvent.Location.Name)) 428 { 429 <li> 430 <span class="event-label">@Translate("Location", "Location"):</span> 431 <div class="event-values"> 432 @(CalendarEvent.Location.Name) 433 </div> 434 </li> 435 436 } 437 438 @if (CalendarEvent.Price > 0 || (!string.IsNullOrEmpty(CalendarEvent.Payment) && !CalendarEvent.Payment.Equals("payment1"))) 439 { 440 <li> 441 <span class="event-label">@Translate("Price", "Price")</span> 442 <div class="event-values"> 443 @(string.Format("{0:0.00}", CalendarEvent.Price)) 444 </div> 445 </li> 446 447 } 448 else 449 { 450 <li> 451 <span class="event-label">@Translate("Free", "Free")</span> 452 </li> 453 454 } 455 </ul> 456 </div> 457 </a> 458 @if (!string.IsNullOrEmpty(CalendarEvent.Registration.HomePage)) 459 { 460 <a href="@(CalendarEvent.Registration.HomePage)" class="event-registration-button btn btn-primary" target="_blank" > 461 @Translate("Signup", "Signup") 462 </a> 463 } 464 @* 465 <a href="@(eventUrl)" class="event-registration-button btn btn-primary"> 466 @Translate("Read More", "Read More") 467 </a> 468 *@ 469 </li> 470 } 471 } 472 </ul> 473 } 474 else 475 { 476 <div class="events-no-results"> 477 <p> 478 <h3>@Translate("No Results", "No Results")</h3> 479 </p> 480 </div> 481 } 482 483 </div> 484 485 </div> 486 487 @if (totalPages > 1 && page < totalPages) 488 { 489 NameValueCollection queryPageParameters = HttpUtility.ParseQueryString(Dynamicweb.Context.Current.Request.Url.Query); 490 queryPageParameters.Set("p", (page + 1).ToString()); 491 System.Uri pageUrl = Urls.BuildUri(Tools.GetCurrentUrl(true) + Dynamicweb.Context.Current.Request.Path, queryPageParameters); 492 493 <div class="events-load-more col-12"> 494 <div class="events-load-more-actions"> 495 <a class="load-more btn btn-primary" href="@pageUrl"> 496 <span>@Translate("View More", "View More")</span> 497 <span class="arrow"></span> 498 </a> 499 </div> 500 </div> 501 } 502 503 </div> 504 505 @SnippetStart("StyleSheetHead") 506 <link rel="stylesheet" href="~/Files/Templates/Designs/bleau-solutionset/assets/stylesheets/jquery-ui.min.css" media="screen"> 507 <link rel="stylesheet" href="~/Files/Templates/Designs/bleau-solutionset/assets/modules/bleau-calendar/css/style.min.css" media="screen"> 508 @SnippetEnd("StyleSheetHead") 509 510 @SnippetStart("JavaScriptHead") 511 <script type="text/javascript" src="~/Files/Templates/Designs/bleau-solutionset/assets/vendor/jquery-ui.min.js"></script> 512 <script type="text/javascript" src="~/Files/Templates/Designs/bleau-solutionset/assets/modules/bleau-calendar/js/main.js"></script> 513 <script type="text/javascript"> 514 $(function () { 515 BleauCalendar.Events().List().load({id:'events-@(paragraphId)'}); 516 }); 517 </script> 518 @SnippetEnd("JavaScriptHead") 519