Skip to content

Commit

Permalink
staging > live
Browse files Browse the repository at this point in the history
  • Loading branch information
ropalko committed Jun 17, 2024
1 parent fa7a74e commit 978c177
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
18 changes: 16 additions & 2 deletions live/AppCode/Razor/AppRazor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,24 @@ public string Title(Event item, EventDate eventDate)
/// <summary>
/// Shows Event Details boxes
/// </summary>
public IHtmlTag DetailsBox(string label, string copy)
public IHtmlTag DetailsBox(string label, string copy, string itemprop = "")
{
if (!Text.Has(copy)) return null;
return Tag.Div(Tag.H6(label), copy).Class("col-12 col-md-6 mb-3 app-events6-infocontainer");
var copyText = Tag.Span(copy);

if(itemprop == "location") copyText.Attr("itemprop", "address").Attr("itemscope", "").Attr("itemtype", "https://schema.org/PostalAddress");
if(itemprop == "performer" || itemprop == "organizer") copyText.Attr("itemprop", "name");
if(itemprop == "offers") copyText.Attr("itemprop", "price");

var tag = Tag.Div(Tag.H6(label), copyText).Class("col-12 col-md-6 mb-3 app-events6-infocontainer");

if(itemprop != "") tag.Attr("itemprop", itemprop);

if(itemprop == "location") tag.Attr("itemscope", "").Attr("itemtype", "https://schema.org/Place");
if(itemprop == "performer") tag.Attr("itemscope", "").Attr("itemtype", "https://schema.org/PerformingGroup");
if(itemprop == "offers") tag.Attr("itemscope", "").Attr("itemtype", "https://schema.org/Offer");

return tag;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion live/Details.PartDates.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

<li class="list-group-item mb-0 @currentEventClass @hiddenEvent" @toolbarDate.For(date)>
<a href='@Link.To(parameters: MyPage.Parameters.Set("dateId", date.Id))' class="d-block px-3 py-2">
<strong>@date.DateTime("Start").ToString("d") @(!date.Bool("EndDateIsStartDate") ? " - " + date.End.ToString("d") : "")</strong>
<strong><span itemprop="startDate">@date.DateTime("Start").ToString("d")</span> @(!date.Bool("EndDateIsStartDate") ? " - <span itemprop='endDate'>" + date.End.ToString("d") + "</span>": "")</strong>
@(date.IsEmpty("TitleAddition") ? "" : " - " + date.TitleAddition)
@(date.IsEmpty("TimeSpecifics") ? "" : " - " + date.TimeSpecifics)
@(MyUser.IsContentAdmin ? $"({regCount} {App.Resources.LabelRegistrations})" : "")
Expand Down
14 changes: 7 additions & 7 deletions live/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
}
}

<div class="app-events6 app-events6-detail" @itemToolbar.For(item)>
<div class="app-events6 app-events6-detail" itemscope itemtype="https://schema.org/Event" @itemToolbar.For(item)>
<div class="app-events6-detail-content mb-4">
<h1 class="m-0">@Title(item, firstEventDate)</h1>
<h1 class="m-0" itemprop="name">@Title(item, firstEventDate)</h1>

<div class="event-meta">
@if (hasEventDate) {
<span class="app-events6-date">@eventStart @eventEnd</span>
<div class="app-events6-date d-inline-block"><span itemprop="startDate">@eventStart</span> <span itemprop="endDate">@eventEnd</span></div>
}
<span class="app-events6-categories">@(item.IsNotEmpty("Category.Title") ? " | " + item.Category.Title : "")</span> </div>
</div>
Expand All @@ -69,21 +69,21 @@
<div class='@(Kit.Css.Is("bs3") ? "col-xs-12" : "col-12") @(item.IsNotEmpty("Image") ? "col-md-8" : "") order-1 order-md-0'>
<h2 class="h5">@item.ShortDescription</h2>
@* Show main body, with possible Inner-Content *@
<div class="app-events6-detail-body mb-4">
<div class="app-events6-detail-body mb-4" itemprop="description">
@Kit.Render.All(item, field: "BodyContentBlocks", merge: item.Description)
</div>

@Html.Partial("Details.PartDates.cshtml", new { item, hasEventDate, firstEventDate })

<div class="app-events6-detail-infos row mb-4">
@* Event Location *@
@DetailsBox(App.Resources.Location, eventDateInfo.Location)
@DetailsBox(App.Resources.Location, eventDateInfo.Location, "location")

@* Event Leader *@
@DetailsBox(App.Resources.Management, eventDateInfo.Person)
@DetailsBox(App.Resources.Management, eventDateInfo.Person, "performer")

@* Event Fee *@
@DetailsBox(App.Resources.Fee, eventDateInfo.Fee)
@DetailsBox(App.Resources.Fee, eventDateInfo.Fee, "offers")

@* Event Registration / Seat Info *@
@if (hasEventDate
Expand Down

0 comments on commit 978c177

Please sign in to comment.