Пример #1
0
        internal static MvcHtmlString VersionRelation(this HtmlHelper source, string id, string value, string valueToMerge, Field field, int articleId, ArticleViewType viewType)
        {
            if (viewType == ArticleViewType.CompareVersions)
            {
                var titles1 = field.GetRelatedTitles(value);
                var titles2 = field.GetRelatedTitles(valueToMerge);
                return(source.VersionText(id, ArticleVersion.MergeRelation(titles1, titles2)));
            }

            var titles = string.Join("<br />", field.GetRelatedTitles(value).Select(i => $"(#{i.Value}) - {i.Text}"));

            return(source.VersionText(id, titles));
        }