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

Add config setting for default repository view. #898

Open
wants to merge 2 commits 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
4 changes: 4 additions & 0 deletions Bonobo.Git.Server.Test/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
<assemblyIdentity name="Unity.Abstractions" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.11.6.0" newVersion="5.11.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
Expand Down
13 changes: 9 additions & 4 deletions Bonobo.Git.Server/Bonobo.Git.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CommonMark, Version=0.1.0.0, Culture=neutral, PublicKeyToken=001ef8810438905d, processorArchitecture=MSIL">
<HintPath>..\packages\CommonMark.NET.0.15.1\lib\net45\CommonMark.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="DotNetZip, Version=1.10.1.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll</HintPath>
<Private>True</Private>
Expand All @@ -86,6 +82,9 @@
<HintPath>..\packages\LibGit2Sharp.0.23.1\lib\net40\LibGit2Sharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Markdig, Version=0.26.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Markdig.0.26.0\lib\net452\Markdig.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -164,6 +163,9 @@
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\netstandard1.1\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.104.0\lib\net46\System.Data.SQLite.dll</HintPath>
Expand All @@ -190,6 +192,9 @@
</Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\netstandard1.1\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.Caching" />
Expand Down
4 changes: 3 additions & 1 deletion Bonobo.Git.Server/Helpers/CustomHtmlHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Linq.Expressions;
using Bonobo.Git.Server.Models;
using System.ComponentModel.DataAnnotations;
using Markdig;

namespace Bonobo.Git.Server.Helpers
{
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion Bonobo.Git.Server/Views/Repository/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<div class="pure-u-1">
@{
var permitted = new WebGrid(source: model.Value, defaultSort: "Name", rowsPerPage: 15);
string defaultView = System.Configuration.ConfigurationManager.AppSettings["DefaultRepositoriesView"] ?? "Detail";


var columns = new List<WebGridColumn>();
Expand All @@ -129,7 +130,7 @@
format: (item) => Html.ActionLink(
GetNameToDisplay((string)item.Name, (RepositoryDetailStatus)item.Status),

"Detail",
defaultView,
new { id = item.Id },
new
{
Expand Down
4 changes: 3 additions & 1 deletion Bonobo.Git.Server/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<packages>
<package id="AnonymousComparer" version="1.3.0.0" targetFramework="net45" />
<package id="Antlr" version="3.5.0.2" targetFramework="net45" />
<package id="CommonMark.NET" version="0.15.1" targetFramework="net45" />
<package id="CommonServiceLocator" version="1.3" targetFramework="net45" />
<package id="DotNetZip" version="1.10.1" targetFramework="net46" />
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
<package id="LibGit2Sharp" version="0.23.1" targetFramework="net46" />
<package id="LibGit2Sharp.NativeBinaries" version="1.0.164" targetFramework="net46" />
<package id="Markdig" version="0.26.0" targetFramework="net46" />
<package id="MediaTypeMap" version="2.1.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net46" />
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net46" />
Expand All @@ -31,11 +31,13 @@
<package id="Serilog.Settings.AppSettings" version="2.1.0" targetFramework="net46" />
<package id="Serilog.Sinks.File" version="3.2.0" targetFramework="net46" />
<package id="Serilog.Sinks.RollingFile" version="3.3.0" targetFramework="net46" />
<package id="System.Buffers" version="4.5.1" targetFramework="net46" />
<package id="System.Data.SQLite" version="1.0.104.0" targetFramework="net46" />
<package id="System.Data.SQLite.Core" version="1.0.104.0" targetFramework="net46" />
<package id="System.Data.SQLite.EF6" version="1.0.104.0" targetFramework="net46" />
<package id="System.Data.SQLite.Linq" version="1.0.104.0" targetFramework="net46" />
<package id="System.IdentityModel.Tokens.Jwt" version="4.0.4.403061554" targetFramework="net46" />
<package id="System.Memory" version="4.5.4" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net46" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net46" />
<package id="UDE.CSharp" version="1.1.0" targetFramework="net45" />
Expand Down
4 changes: 4 additions & 0 deletions Bonobo.Git.Server/web.config
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
Expand Down