Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#549 altering the list links render to use bootstrap 5 styling and co… #615

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,48 @@
@using cloudscribe.SimpleContent.ContentTemplates.ViewModels
@inject IStringLocalizer<ContentTemplateResources> sr
@inject ILinkListOptionsProvider optionsProvider
@inject IOptions<IconCssClasses> iconClassesAccessor

@{

var icons = iconClassesAccessor.Value;
var sorted = Model.Items.OrderBy(x => x.Sort).ToList();
var options = await optionsProvider.ResolveLinkListOptions(Context.Request.Host.Host, Context.Request.Path);
var imageStyle = "height:" + options.ImageRenderMaxHeight.ToString() + "px;";
}
@functions {
public string GetTarget(ListItemModel item)
{
if (item.OpensInNewWindow) { return "_blank"; }
return null;
}
public string GetTarget(ListItemModel item)
{
if (item.OpensInNewWindow) { return "_blank"; }
return null;
}
}
<div class="content-top">
@Html.Raw(Model.ContentAbove)
</div>
<div class="links-wrap">
<ul class="list-group">
@for (int i = 0; i < Model.Items.Count; i++)
{
<div class="clearfix linklist-item">
<h2 class="h4"><a href="@sorted[i].LinkUrl" target="@GetTarget(sorted[i])">@sorted[i].Title</a></h2>

@if (!string.IsNullOrWhiteSpace(sorted[i].ResizedUrl))
{
<a target="@GetTarget(sorted[i])" href="@sorted[i].LinkUrl">
<img class="float-start me-2" src="@sorted[i].ResizedUrl" style="@imageStyle" alt="@sorted[i].AltText" />
</a>
}
<p class="linklist-item-description">@sorted[i].Description</p>
</div>
<li class="list-group-item d-flex justify-content-between align-items-start flex-column">
<div>
<h4 class="d-flex align-items-start"><a href="@sorted[i].LinkUrl" target="@GetTarget(sorted[i])">@sorted[i].Title</a>
@if (GetTarget(sorted[i]) == "_blank")
{
<span class="@icons.OpenInNewWindow ms-2 fs-6" aria-hidden="true"></span>
}
</h4>
</div>
<div class="d-flex me-auto">
@if (!string.IsNullOrWhiteSpace(sorted[i].ResizedUrl))
{
<a target="@GetTarget(sorted[i])" href="@sorted[i].LinkUrl">
<img class="flex-start me-2" src="@sorted[i].ResizedUrl" style="@imageStyle" alt="@sorted[i].AltText" />
</a>
}
<p class="list-group-item-description">@sorted[i].Description</p>
</div>
</li>
}
</div>
</ul>
<div class="mt-3 content-bottom">
@Html.Raw(Model.ContentBelow)
</div>
35 changes: 1 addition & 34 deletions src/cloudscribe.SimpleContent.Web/Design/IconCssClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public class IconCssClasses

public string Home { get; set; } = "glyphicons glyphicons-home";

//public string HideEditToolbar { get; set; } = "glyphicon glyphicon-chevron-right";

public string ShowEditToolbar { get; set; } = "glyphicon glyphicon-pencil";

public string NewItem { get; set; } = "glyphicon glyphicon-plus";
Expand All @@ -44,37 +42,6 @@ public class IconCssClasses
public string Unpublish { get; set; } = "glyphicon glyphicon-eye-close";

public string RelatedPosts { get; set; } = "far fa-hand-point-right"; //"fas fa-asterisk";

//<i class="far fa-hand-point-right"></i>



// public string JustifyLeft { get; set; } = "glyphicon glyphicon-align-left";

//public string JustifyCenter { get; set; } = "glyphicon glyphicon-align-center";

//public string JustifyRight { get; set; } = "glyphicon glyphicon-align-right";

//public string JustifyFull { get; set; } = "glyphicon glyphicon-align-justify";

//public string UnorderedList { get; set; } = "glyphicon glyphicon-list";

//public string OrderedList { get; set; } = "glyphicon glyphicon-th-list";

//public string Outdent { get; set; } = "glyphicon glyphicon-indent-left";

//public string Indent { get; set; } = "glyphicon glyphicon-indent-right";

//public string Hyperlink { get; set; } = "glyphicon glyphicon-globe";

//public string RemoveHyperlink { get; set; } = "glyphicon glyphicon-remove";

//public string InsertImage { get; set; } = "glyphicon glyphicon-picture";

//public string ToggleSource { get; set; } = "glyphicon glyphicon-eye-open";

//public string ClearAllFormatting { get; set; } = "glyphicon glyphicon-fire";


public string OpenInNewWindow { get; set; } = "fas fa-external-link-alt";
}
}
20 changes: 10 additions & 10 deletions src/sourceDev.WebApp/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"SimpleContentIconConfig": {
"DefaultSetId": "fontawesome5x",
"IconSets": [
{
{
"SetId": "fontawesome4x",
"Previous": "fa fa-backward",
"Next": "fa fa-forward",
Expand All @@ -185,10 +185,10 @@
"SortAlpha": "fa fa-sort-alpha-asc",
"Edit": "fa-pencil-square-o",
"View": "fa fa-eye",
"Delete": "fa fa-trash-o"

},
{
"Delete": "fa fa-trash-o",
"OpenInNewWindow": "fa fa-external-link"
},
{
"SetId": "fontawesome5x",
"Previous": "fas fa-backward",
"Next": "fas fa-forward",
Expand All @@ -209,9 +209,9 @@
"Edit": "fas fa-pencil-alt",
"View": "fas fa-eye",
"Delete": "far fa-trash-alt",
"Unpublish": "far fa-eye-slash"

},
"Unpublish": "far fa-eye-slash",
"OpenInNewWindow": "fas fa-external-link-alt"
},
{
"SetId": "glyphicons",
"Previous": "glyphicon glyphicon-backward",
Expand All @@ -233,8 +233,8 @@
"Edit": "glyphicon glyphicon-edit",
"View": "glyphicon glyphicon-eye-open",
"Delete": "glyphicon glyphicon-trash",
"Unpublish": "glyphicon glyphicon-eye-close"

"Unpublish": "glyphicon glyphicon-eye-close",
"OpenInNewWindow": "glyphicon glyphicon-square-new-window"
}

]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Id":"list-of-links","ProjectId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","ParentId":"0","ParentSlug":"","PageOrder":3,"Title":"list of links","Author":"Admin","Slug":"list-of-links","ExternalUrl":"","CorrelationKey":null,"MetaDescription":null,"MetaJson":null,"MetaHtml":null,"Content":"\r\n<div class=\"content-top\">\r\n \r\n</div>\r\n<ul class=\"list-group\">\r\n <li class=\"list-group-item d-flex justify-content-between align-items-start flex-column\">\r\n <div class=\"ms-2\">\r\n <h4 class=\"d-flex align-items-start\"><a href=\"https://www.google.com\" target=\"_blank\">link 1</a> \r\n <span class=\"fas fa-external-link-alt ms-2 fs-6\" aria-hidden=\"true\"></span>\r\n </h4>\r\n </div>\r\n <div class=\"ms-2 d-flex me-auto\">\r\n <a target=\"_blank\" href=\"https://www.google.com\">\r\n <img class=\"flex-start me-2\" src=\"/media/images/img_1150-ws.jpg\" style=\"height:150px;\" />\r\n </a>\r\n <p>google.com</p>\r\n </div>\r\n </li>\r\n <li class=\"list-group-item d-flex justify-content-between align-items-start flex-column\">\r\n <div class=\"ms-2\">\r\n <h4 class=\"d-flex align-items-start\"><a href=\"https://www.bbc.co.cuk\">link 2</a> \r\n </h4>\r\n </div>\r\n <div class=\"ms-2 d-flex me-auto\">\r\n <p>bbc</p>\r\n </div>\r\n </li>\r\n</ul>\r\n<div class=\"mt-3 content-bottom\">\r\n \r\n</div>\r\n\r\n","PubDate":"2024-12-11T14:21:11.7769023Z","LastModified":"2024-12-11T15:56:20.243055Z","IsPublished":true,"MenuOnly":false,"ShowMenu":false,"ViewRoles":null,"Categories":[],"Comments":[],"ShowHeading":true,"ShowPubDate":false,"ShowLastModified":false,"ShowCategories":false,"ShowComments":false,"MenuFilters":null,"DisableEditor":false,"Resources":[],"ContentType":"html","CreatedUtc":"2024-12-11T14:19:46.3814172Z","CreatedByUser":"admin","LastModifiedByUser":"admin","DraftContent":null,"DraftAuthor":null,"DraftPubDate":null,"TemplateKey":"sct-ListOfLinks","SerializedModel":"{\"ContentAbove\":null,\"ContentBelow\":null,\"Items\":[{\"FullSizeUrl\":null,\"ResizedUrl\":\"/media/images/img_1150-ws.jpg\",\"ThumbnailUrl\":null,\"LinkUrl\":\"https://www.google.com\",\"Title\":\"link 1\",\"Description\":\"google.com\",\"AltText\":null,\"Sort\":1,\"OpensInNewWindow\":true},{\"FullSizeUrl\":null,\"ResizedUrl\":null,\"ThumbnailUrl\":null,\"LinkUrl\":\"https://www.bbc.co.cuk\",\"Title\":\"link 2\",\"Description\":\"bbc\",\"AltText\":null,\"Sort\":3,\"OpensInNewWindow\":false}]}","DraftSerializedModel":null,"Serializer":"Json","ShowCreatedBy":null,"ShowCreatedDate":null,"ShowLastModifiedBy":null,"ShowLastModifiedDate":null}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"AuthorBio":"","Comment":"","NormalizedEmail":"[email protected]","NormalizedUserName":"ADMIN","EmailConfirmed":true,"EmailConfirmSentUtc":null,"AgreementAcceptedUtc":null,"LockoutEndDateUtc":null,"NewEmail":"","NewEmailApproved":false,"LastPasswordChangeUtc":"2024-06-03T14:17:55.2771124Z","MustChangePwd":false,"PasswordHash":"AQAAAAIAAYagAAAAEGVnALS6pFN3EERYv0nYhCQ4jy0t3WB+uYVRUM40L55rqYdKv3yw1MmjWvEYd6x2Pw==","CanAutoLockout":true,"AccessFailedCount":0,"RolesChanged":false,"SecurityStamp":"S7ZJ6RCVYLDHBWTECX2S2GQXJKWUXNSL","Signature":"","TwoFactorEnabled":false,"BrowserKey":"fb4ead8f-7afd-4cd9-84b0-3718d71fa575","Id":"17595de8-d27a-4304-bded-76b61a16ad19","SiteId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","Email":"[email protected]","UserName":"admin","DisplayName":"Admin","FirstName":"","LastName":"","AvatarUrl":"","DateOfBirth":null,"CreatedUtc":"2016-08-04T12:03:50.2175089Z","LastModifiedUtc":"2016-08-04T12:03:50.2175089Z","DisplayInMemberList":true,"Gender":"","IsLockedOut":false,"LastLoginUtc":"2024-11-27T08:52:25.2785938Z","PhoneNumber":"","PhoneNumberConfirmed":false,"AccountApproved":true,"TimeZoneId":"","WebSiteUrl":""}
{"AuthorBio":"","Comment":"","NormalizedEmail":"[email protected]","NormalizedUserName":"ADMIN","EmailConfirmed":true,"EmailConfirmSentUtc":null,"AgreementAcceptedUtc":null,"LockoutEndDateUtc":null,"NewEmail":"","NewEmailApproved":false,"LastPasswordChangeUtc":"2024-06-03T14:17:55.2771124Z","MustChangePwd":false,"PasswordHash":"AQAAAAIAAYagAAAAEGVnALS6pFN3EERYv0nYhCQ4jy0t3WB+uYVRUM40L55rqYdKv3yw1MmjWvEYd6x2Pw==","CanAutoLockout":true,"AccessFailedCount":0,"RolesChanged":false,"SecurityStamp":"S7ZJ6RCVYLDHBWTECX2S2GQXJKWUXNSL","Signature":"","TwoFactorEnabled":false,"BrowserKey":"a1490bf5-7bc0-4c51-8781-50e43a7f2698","Id":"17595de8-d27a-4304-bded-76b61a16ad19","SiteId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","Email":"[email protected]","UserName":"admin","DisplayName":"Admin","FirstName":"","LastName":"","AvatarUrl":"","DateOfBirth":null,"CreatedUtc":"2016-08-04T12:03:50.2175089Z","LastModifiedUtc":"2016-08-04T12:03:50.2175089Z","DisplayInMemberList":true,"Gender":"","IsLockedOut":false,"LastLoginUtc":"2024-12-11T14:19:23.5104068Z","PhoneNumber":"","PhoneNumberConfirmed":false,"AccountApproved":true,"TimeZoneId":"","WebSiteUrl":""}