public static HtmlTag CoreLinksDiv(IProgress <string> progress = null) { var db = Db.Context().Result; var items = db.MenuLinks.OrderBy(x => x.MenuOrder).ToList(); if (!items.Any()) { return(HtmlTag.Empty()); } var coreLinksDiv = new DivTag().AddClass("core-links-container"); foreach (var loopItems in items) { var html = ContentProcessing.ProcessContent( BracketCodeCommon.ProcessCodesForSite(loopItems.LinkTag, progress), ContentFormatEnum.MarkdigMarkdown01); var coreLinkContainer = new DivTag().AddClass("core-links-item").Text(html).Encoded(false); coreLinksDiv.Children.Add(coreLinkContainer); } return(coreLinksDiv); }
public static HtmlTag PostBodyDiv(IBodyContent dbEntry, IProgress <string> progress = null) { if (string.IsNullOrWhiteSpace(dbEntry.BodyContent)) { return(HtmlTag.Empty()); } var bodyContainer = new HtmlTag("div").AddClass("post-body-container"); var bodyText = ContentProcessing.ProcessContent( BracketCodeCommon.ProcessCodesForSite(dbEntry.BodyContent, progress), dbEntry.BodyContentFormat); bodyContainer.Children.Add(new HtmlTag("div").AddClass("post-body-content").Encoded(false).Text(bodyText)); return(bodyContainer); }
public static HtmlTag UpdateNotesDiv(IUpdateNotes dbEntry) { if (string.IsNullOrWhiteSpace(dbEntry.UpdateNotes)) { return(HtmlTag.Empty()); } var updateNotesDiv = new DivTag().AddClass("update-notes-container"); updateNotesDiv.Children.Add(new DivTag().AddClass("update-notes-title").Text("Updates:")); var updateNotesContentContainer = new DivTag().AddClass("update-notes-content"); var updateNotesHtml = ContentProcessing.ProcessContent( BracketCodeCommon.ProcessCodesForSite(dbEntry.UpdateNotes, null), dbEntry.UpdateNotesFormat); updateNotesContentContainer.Encoded(false).Text(updateNotesHtml); updateNotesDiv.Children.Add(updateNotesContentContainer); return(updateNotesDiv); }