Skip to content

Commit

Permalink
Merge pull request #439 from Sitefinity/sf-14.4
Browse files Browse the repository at this point in the history
Sitefinity 14.4 update
  • Loading branch information
todorm85 authored Nov 7, 2023
2 parents 6695250 + 7e0cd90 commit c4e976c
Show file tree
Hide file tree
Showing 39 changed files with 9,886 additions and 16,874 deletions.
3 changes: 2 additions & 1 deletion Bootstrap4/MVC/Views/BlogPost/Detail.DetailPage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
@Model.Item.GetDateTime("PublicationDate", "MMM d, yyyy, HH:mm tt")
@Html.Resource("By")
@DataResolver.Resolve(@Model.Item.DataItem, "Author", null)

@Html.CommentsCount(string.Empty, @Model.Item.DataItem)
</div>

<div @Html.InlineEditingFieldAttributes("Summary", "LongText")>@Html.HtmlSanitize((string)Model.Item.Fields.Summary)</div>

<div @Html.InlineEditingFieldAttributes("Content", "LongText")>@Html.HtmlSanitize((string)Model.Item.Fields.Content)</div>
Expand Down
3 changes: 2 additions & 1 deletion Bootstrap4/MVC/Views/BlogPost/List.BlogPostList.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@foreach (var item in Model.Items)
{
var navigateUrl = HyperLinkHelpers.GetDetailPageUrl(item, ViewBag.DetailsPageId, ViewBag.OpenInSamePage, Model.UrlKeyPrefix);

<li @Html.InlineEditingAttributes(Model.ProviderName, Model.ContentType.FullName, (Guid)item.Fields.Id)>
<h3>
<a @Html.InlineEditingFieldAttributes("Title", "ShortText") href="@navigateUrl">@item.Fields.Title</a>
Expand All @@ -22,6 +22,7 @@
@item.GetDateTime("PublicationDate", "MMM d, yyyy, HH:mm tt")
@Html.Resource("By")
@DataResolver.Resolve(item.DataItem, "Author", null)

@Html.CommentsCount((string)navigateUrl, item.DataItem)
</div>

Expand Down
66 changes: 33 additions & 33 deletions Bootstrap4/MVC/Views/Event/Detail.EventDetails.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
</h3>
<span class="sf-event-type" style="background: @Model.Item.EventCalendarColour()"></span>

@if (!string.IsNullOrEmpty(Model.Item.EventDates()))
{
<p>
<time>@Model.Item.EventDates()</time>
</p>
@if (!string.IsNullOrEmpty(Model.Item.EventDates()))
{
<p>
<time>@Model.Item.EventDates()</time>
</p>
}

@if (!string.IsNullOrEmpty(Model.Item.Fields.City) || !string.IsNullOrEmpty(Model.Item.Fields.Country))
{<address>

@if (!string.IsNullOrEmpty(Model.Item.Fields.City) && !string.IsNullOrEmpty(Model.Item.Fields.Country))
{
@Model.Item.Fields.City <span>,</span> @Model.Item.Fields.Country
<br>
}
else
{
@(string.IsNullOrEmpty(Model.Item.Fields.City) ? Model.Item.Fields.Country : Model.Item.Fields.City)
<br>
}
@if (!string.IsNullOrEmpty(Model.Item.Fields.City) && !string.IsNullOrEmpty(Model.Item.Fields.Country))
{
@Model.Item.Fields.City <span>,</span> @Model.Item.Fields.Country
<br>
}
else
{
@(string.IsNullOrEmpty(Model.Item.Fields.City) ? Model.Item.Fields.Country : Model.Item.Fields.City)
<br>
}

@if (!string.IsNullOrEmpty(Model.Item.Fields.Street))
{
@Model.Item.Fields.Street
}
</address>
@if (!string.IsNullOrEmpty(Model.Item.Fields.Street))
{
@Model.Item.Fields.Street
}
</address>
}

<div>
@if (!string.IsNullOrEmpty(Model.Item.Fields.ContactName))
{
Expand All @@ -56,37 +56,37 @@
@Model.Item.Fields.ContactCell
<br>
}

@if (!string.IsNullOrEmpty(Model.Item.Fields.ContactEmail))
{
<address><a href="mailto:@(Model.Item.Fields.ContactEmail)" target="_blank">@Model.Item.Fields.ContactEmail</a></address>
}

@if (!string.IsNullOrEmpty(Model.Item.Fields.ContactWeb))
{
<a href="@Html.UrlSanitize((string)Model.Item.Fields.ContactWeb))" target="_blank">@Model.Item.Fields.ContactWeb</a>
<a href="@(Html.UrlSanitize((string)Model.Item.Fields.ContactWeb))" target="_blank">@Model.Item.Fields.ContactWeb</a>
}
</div>

@if (!string.IsNullOrEmpty(Model.Item.Fields.Location))
{
{
<p>
@*How to find us field*@
@Model.Item.Fields.Location
</p>
@*How to find us field*@
@Model.Item.Fields.Location
</p>
}

@if (!string.IsNullOrEmpty(Model.Item.Fields.Description))
{
{
<p>
@Model.Item.Fields.Description
</p>
}

<p>
@Html.CommentsCount(string.Empty, Model.Item.DataItem)
</p>
</p>

@if (ViewBag.AllowCalendarExport)
{
<div>
Expand All @@ -100,12 +100,12 @@
}

@if (!string.IsNullOrEmpty(Model.Item.Fields.Summary))
{
{
<p @Html.InlineEditingFieldAttributes("Summary", "LongText")>@Html.HtmlSanitize((string)Model.Item.Fields.Summary)</p>
}

@if (!string.IsNullOrEmpty(Model.Item.Fields.Content))
{
{
<p @Html.InlineEditingFieldAttributes("Content", "LongText")>@Html.HtmlSanitize((string)Model.Item.Fields.Content)</p>
}

Expand Down
1 change: 1 addition & 0 deletions Bootstrap4/MVC/Views/Event/List.EventsList.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<time>@item.EventDates()</time>@if (!string.IsNullOrEmpty(item.Fields.City)){<span>, @item.Fields.City</span>}
</p>
<p @Html.InlineEditingFieldAttributes("Summary", "LongText")>@Html.HtmlSanitize((string)item.Fields.Summary)</p>

<div class="sf-Comment-count--block">@Html.CommentsCount((string)navigateUrl, item.DataItem)</div>
</li>
}
Expand Down
151 changes: 110 additions & 41 deletions Bootstrap4/MVC/Views/Facets/Facets.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,127 @@
<div id="facetContainer">
@if (ViewBag.HasAnyFacetElements)
{
<h3 class="h6 mb-3 font-weight-normal">@Model.FilterResultsLabel</h3>
<h3 class="h6 mb-3 font-weight-normal">@Model.FilterResultsLabel</h3>

<div class="d-flex align-items-center justify-content-between">
<label class="form-label">@Model.AppliedFiltersLabel</label>
<button id="sf-facet-clear-all-btn" class="btn btn-link px-0 py-0 mb-2" hidden>@Model.ClearAllLabel</button>
</div>
<ul id="applied-filters" class="list-unstyled list-inline" data-sf-applied-filter-html-tag="li" data-sf-filter-label-css-class="sf-facets-filter-label list-inline-item bg-secondary rounded-pill pl-2 pr-4 pb-1 mr-1 mb-1 mw-100 position-relative overflow-hidden text-truncate text-nowrap" data-sf-remove-filter-css-class="sf-facets-remove-filter px-2 position-absolute">
</ul>
<div class="d-flex align-items-center justify-content-between">
<label class="form-label">@Model.AppliedFiltersLabel</label>
<button id="sf-facet-clear-all-btn" class="btn btn-link px-0 py-0 mb-2" hidden>@Model.ClearAllLabel</button>
</div>
<ul id="applied-filters" class="list-unstyled list-inline" data-sf-applied-filter-html-tag="li" data-sf-filter-label-css-class="sf-facets-filter-label list-inline-item bg-secondary rounded-pill pl-2 pr-4 pb-1 mr-1 mb-1 mw-100 position-relative overflow-hidden text-truncate text-nowrap" data-sf-remove-filter-css-class="sf-facets-remove-filter px-2 position-absolute">
</ul>
}

<div id="facetContent" class="mb-3">
@foreach (var facet in Model.SearchFacets)
{
<div id="facetContent" class="mb-3">
@foreach (var facet in Model.SearchFacets)
{
var value = 0;
if (facet.FacetElements.Any())
if (facet.FacetElements.Any() || facet.ShowNumberCustomRange || facet.ShowDateCustomRanges)
{
<h4 class="h6 font-weight-normal mt-3">@facet.FacetTitle</h4>
<h4 class="h6 font-weight-normal mt-3">@facet.FacetTitle</h4>

<ul class="list-unstyled mb-0" id="facets-group-list-@facet.FacetFieldName">
@foreach (var facetElement in facet.FacetElements)
{
string facetElementLabel = facetElement.FacetValue;

if (facetElement.FacetFieldType == SearchIndexAdditonalFieldType.DateAndTime)
<ul class="list-unstyled mb-0" id="facets-group-list-@facet.FacetFieldName" data-facet-type="@facet.FacetFieldType">
@foreach (var facetElement in facet.FacetElements)
{
DateTime facetDateValue = DateTime.Parse(facetElementLabel);
facetElementLabel = facetDateValue.ToSitefinityUITime().ToString("MMM dd, yyyy");
}
value++;
bool hideElement = (value > defaultFacetsCollapseCount) && Model.IsShowMoreLessButtonActive;
<li @(hideElement ? "hidden" : string.Empty)>
<input type="checkbox"
id="facet-checkbox-@facet.FacetFieldName-@facetElement.FacetValue"
data-facet-key="@facet.FacetFieldName"
data-facet-value="@facetElement.FacetValue" />

value++;
bool hideElement = (value > defaultFacetsCollapseCount) && Model.IsShowMoreLessButtonActive;
<li class="form-check" @(hideElement ? "hidden" : string.Empty)>
<input type="checkbox"
id="facet-checkbox-@facet.FacetFieldName-@facetElement.FacetValue"
class="form-check-input"
data-facet-key="@facet.FacetFieldName"
data-facet-value="@facetElement.FacetValue" />
<label for="facet-checkbox-@facet.FacetFieldName-@facetElement.FacetValue" id="facet-@facetElement.FacetValue" class="form-check-label">@facetElementLabel</label>
@if (Model.DisplayItemCount)
{
<span class="small text-muted">(@facetElement.FacetCount)</span>
<label for="facet-checkbox-@facet.FacetFieldName-@facetElement.FacetValue" id="facet-@facetElement.FacetValue">@facetElement.FacetLabel</label>

@if (Model.DisplayItemCount)
{
<span class="small text-muted">(@facetElement.FacetCount)</span>
}
</li>
}
</li>
</ul>
if (facet.FacetElements.Count > defaultFacetsCollapseCount && Model.IsShowMoreLessButtonActive)
{
<button type="button" class="btn btn-link p-0" show-more="@Model.ShowMoreLabel" show-less="@Model.ShowLessLabel" data-facet-type="@facet.FacetFieldName" id="show-more-less-@facet.FacetFieldName">@Model.ShowMoreLabel</button>
}
if (facet.ShowNumberCustomRange)
{
<div class="mt-2 d-flex flex-row align-items-center">
@if (facet.FacetFieldType == "NumberWhole")
{
<input type="number"
id="from-@facet.FacetFieldName"
class="form-control"
data-custom-range="true"
placeholder="Min"
onkeypress="return event.charCode >= 48 && event.charCode <= 57" />
}
else
{
<input type="number"
id="from-@facet.FacetFieldName"
class="form-control"
data-custom-range="true"
placeholder="Min" />
}
<span class="mx-2">&mdash;</span>
@if (facet.FacetFieldType == "NumberWhole")
{
<input type="number"
id="to-@facet.FacetFieldName"
class="form-control"
data-custom-range="true"
placeholder="Max"
onkeypress="return event.charCode >= 48 && event.charCode <= 57" />
}
else
{
<input type="number"
id="to-@facet.FacetFieldName"
class="form-control"
data-custom-range="true"
placeholder="Max" />
}

<button type="button"
id="custom-range-btn-@facet.FacetFieldName"
class="btn btn-outline-secondary ml-2"
data-custom-range-name="@facet.FacetFieldName"
data-custom-range-type="@facet.FacetFieldType">
<svg class="sf-icon-xs" aria-hidden="true">
<use xlink:href="~/ResourcePackages/Bootstrap4/assets/dist/sprites/solid.svg#chevron-right"></use>
</svg>
</button>
</div>
}

if (facet.ShowDateCustomRanges)
{
<div class="mt-2 d-flex flex-row align-items-center">
<input type="date"
id="from-@facet.FacetFieldName"
class="form-control"
data-custom-range="true" />

<span class="mx-2">&mdash;</span>
<input type="date"
id="to-@facet.FacetFieldName"
class="form-control"
data-custom-range="true" />
<button type="button"
id="custom-range-btn-@facet.FacetFieldName"
class="btn btn-outline-secondary ml-2"
data-custom-range-name="@facet.FacetFieldName"
data-custom-range-type="@facet.FacetFieldType">
<svg class="sf-icon-xs" aria-hidden="true">
<use xlink:href="~/ResourcePackages/Bootstrap4/assets/dist/sprites/solid.svg#chevron-right"></use>
</svg>
</button>

</div>
}
</ul>
if (facet.FacetElements.Count > defaultFacetsCollapseCount && Model.IsShowMoreLessButtonActive)
{
<button type="button" class="btn btn-link p-0" show-more="@Model.ShowMoreLabel" show-less="@Model.ShowLessLabel" data-facet-type="@facet.FacetFieldName" id="show-more-less-@facet.FacetFieldName">@Model.ShowMoreLabel</button>
}
}
}
</div>
}
</div>

</div>

Expand Down
2 changes: 1 addition & 1 deletion Bootstrap4/MVC/Views/Form/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
else
{
using (Html.BeginFormSitefinity("", null, (System.Web.Routing.RouteValueDictionary)null, FormMethod.Post, new Dictionary<string, object> { { "enctype", "multipart/form-data" }, { "role", "form" } }, true))
using (Html.BeginFormSitefinity("", null, (System.Web.Routing.RouteValueDictionary)null, FormMethod.Post, Model.HtmlAttributes, true))
{
@* Fields Markup *@
@Html.AddSitefinityAntiforgeryToken()
Expand Down
4 changes: 2 additions & 2 deletions Bootstrap4/MVC/Views/Image/Image.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
}
}

<img src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Html.HtmlSanitize(Model.AlternativeText)"/>
<img src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Model.AlternativeText"/>
</picture>
}
else
{

<img loading="lazy" class="@Model.CssClass" src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Html.HtmlSanitize(Model.AlternativeText)"
<img loading="lazy" class="@Model.CssClass" src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Model.AlternativeText"
@Html.GetWidthAttributeForVectorGraphics(Model.CustomSize, Model.Item.DataItem)
@Html.GetHeightAttributeForVectorGraphics(Model.CustomSize, Model.Item.DataItem) />
}
Expand Down
4 changes: 2 additions & 2 deletions Bootstrap4/MVC/Views/Image/ImageDimensions.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
}
}

<img src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Html.HtmlSanitize(Model.AlternativeText)"/>
<img src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Model.AlternativeText"/>
</picture>
}
else
{

<img loading="lazy" class="@Model.CssClass" src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Html.HtmlSanitize(Model.AlternativeText)"
<img loading="lazy" class="@Model.CssClass" src="@Model.SelectedSizeUrl" title="@Model.Title" alt="@Model.AlternativeText"
@Html.GetWidthAttributeForImage(Model)
@Html.GetHeightAttributeForImage(Model) />
}
Expand Down
Loading

0 comments on commit c4e976c

Please sign in to comment.