From 755771092d772a6fa416e511893ab7c2fdae17e7 Mon Sep 17 00:00:00 2001 From: Johan Date: Thu, 16 Dec 2021 07:56:32 +0100 Subject: [PATCH 1/2] Add config setting for default repository view. --- Bonobo.Git.Server/Views/Repository/Index.cshtml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bonobo.Git.Server/Views/Repository/Index.cshtml b/Bonobo.Git.Server/Views/Repository/Index.cshtml index cf827367b..c159b0a30 100644 --- a/Bonobo.Git.Server/Views/Repository/Index.cshtml +++ b/Bonobo.Git.Server/Views/Repository/Index.cshtml @@ -117,6 +117,7 @@
@{ var permitted = new WebGrid(source: model.Value, defaultSort: "Name", rowsPerPage: 15); + string defaultView = System.Configuration.ConfigurationManager.AppSettings["DefaultRepositoriesView"] ?? "Detail"; var columns = new List(); @@ -129,7 +130,7 @@ format: (item) => Html.ActionLink( GetNameToDisplay((string)item.Name, (RepositoryDetailStatus)item.Status), - "Detail", + defaultView, new { id = item.Id }, new { From b19663c114c37739d337f37e890953865fe33ab9 Mon Sep 17 00:00:00 2001 From: Johan Date: Thu, 16 Dec 2021 14:53:16 +0100 Subject: [PATCH 2/2] Replace CommonMark.NET with Markdig As CommonMark.NET is no longer maintained. --- Bonobo.Git.Server.Test/app.config | 4 ++++ Bonobo.Git.Server/Bonobo.Git.Server.csproj | 13 +++++++++---- Bonobo.Git.Server/Helpers/CustomHtmlHelpers.cs | 4 +++- Bonobo.Git.Server/packages.config | 4 +++- Bonobo.Git.Server/web.config | 4 ++++ 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Bonobo.Git.Server.Test/app.config b/Bonobo.Git.Server.Test/app.config index 2c5642f0d..6854e277f 100644 --- a/Bonobo.Git.Server.Test/app.config +++ b/Bonobo.Git.Server.Test/app.config @@ -66,6 +66,10 @@ + + + + diff --git a/Bonobo.Git.Server/Bonobo.Git.Server.csproj b/Bonobo.Git.Server/Bonobo.Git.Server.csproj index ad78e8525..a9f0c4a59 100644 --- a/Bonobo.Git.Server/Bonobo.Git.Server.csproj +++ b/Bonobo.Git.Server/Bonobo.Git.Server.csproj @@ -66,10 +66,6 @@ ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll True - - ..\packages\CommonMark.NET.0.15.1\lib\net45\CommonMark.dll - True - ..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll True @@ -86,6 +82,9 @@ ..\packages\LibGit2Sharp.0.23.1\lib\net40\LibGit2Sharp.dll True + + ..\packages\Markdig.0.26.0\lib\net452\Markdig.dll + ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll @@ -164,6 +163,9 @@ True + + ..\packages\System.Buffers.4.5.1\lib\netstandard1.1\System.Buffers.dll + ..\packages\System.Data.SQLite.Core.1.0.104.0\lib\net46\System.Data.SQLite.dll @@ -190,6 +192,9 @@ + + ..\packages\System.Memory.4.5.4\lib\netstandard1.1\System.Memory.dll + diff --git a/Bonobo.Git.Server/Helpers/CustomHtmlHelpers.cs b/Bonobo.Git.Server/Helpers/CustomHtmlHelpers.cs index b663bc227..9d6e81d36 100644 --- a/Bonobo.Git.Server/Helpers/CustomHtmlHelpers.cs +++ b/Bonobo.Git.Server/Helpers/CustomHtmlHelpers.cs @@ -10,6 +10,7 @@ using System.Linq.Expressions; using Bonobo.Git.Server.Models; using System.ComponentModel.DataAnnotations; +using Markdig; namespace Bonobo.Git.Server.Helpers { @@ -22,7 +23,8 @@ public static IHtmlString AssemblyVersion(this HtmlHelper helper) public static IHtmlString MarkdownToHtml(this HtmlHelper helper, string markdownText) { - return MvcHtmlString.Create(CommonMark.CommonMarkConverter.Convert(markdownText)); + var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); + return MvcHtmlString.Create(Markdown.ToHtml(markdownText, pipeline)); } public static MvcHtmlString DisplayEnum(this HtmlHelper helper, Enum e) diff --git a/Bonobo.Git.Server/packages.config b/Bonobo.Git.Server/packages.config index 03ed7230a..df8a3c6ef 100644 --- a/Bonobo.Git.Server/packages.config +++ b/Bonobo.Git.Server/packages.config @@ -2,12 +2,12 @@ - + @@ -31,11 +31,13 @@ + + diff --git a/Bonobo.Git.Server/web.config b/Bonobo.Git.Server/web.config index 7272fea61..498111aa2 100644 --- a/Bonobo.Git.Server/web.config +++ b/Bonobo.Git.Server/web.config @@ -132,6 +132,10 @@ + + + +