You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented successfully and usefully across PDEG2019, the ability to leave Title Comments that were visible to editors but not he public was considered extremely useful for seasonal and other rotating content. May or may not get used in other contexts but with a minor rewrite, its a solid addition to AccuLadder that might find a fan-base.
Note the variations by number of #s...
@functions {
// Since TitleComments are now a thing, lets enhance them
// Leave # as is, ## means highlight (yellow), ### means H1/CAPS
public string TitleComments_Process(string inTitle, string sep = "#") {
string title = "title=\"This #Comment is hidden, not visible to the public (users that are not logged in).\"";
string sep2 = sep + sep;
string sep3 = sep2 + sep;
int foundAt = inTitle.IndexOf(sep3);
if(foundAt > 0) {
//return inTitle.Insert(foundAt, "?").Trim();
return inTitle.Replace(sep3, "#").Insert(foundAt, "<span " + title + " class=\"py-1 alert alert-warning\">").Trim() + "</span>";
}
foundAt = inTitle.IndexOf(sep2);
if(foundAt > 0) {
//return inTitle.Insert(foundAt, "?").Trim();
return inTitle.Replace(sep2, "#").Insert(foundAt, "<span " + title + "class=\"py-1 alert alert-info\">").Trim() + "</span>";
}
return inTitle;
}
// only strip if user is not logged in
public string StripComment_WhenAnon(string inTitle, string sep = "#") {
if(Request.IsAuthenticated) {
return TitleComments_Process(inTitle, sep);
} else {
return StripComment(inTitle, sep);
}
}
// remove everything after the separator, so "Hi #comment" will become just "Hi"
public string StripComment(string inTitle, string sep = "#") {
if(inTitle.Contains(sep)) {
return inTitle.Substring(0, inTitle.IndexOf(sep)).Trim();
} else {
return inTitle.Trim();
}
}
}
The text was updated successfully, but these errors were encountered:
Implemented successfully and usefully across PDEG2019, the ability to leave Title Comments that were visible to editors but not he public was considered extremely useful for seasonal and other rotating content. May or may not get used in other contexts but with a minor rewrite, its a solid addition to AccuLadder that might find a fan-base.
Note the variations by number of
#
s...The text was updated successfully, but these errors were encountered: