Browse Source

Modified commit hash to display truncated version and link to repo.

master
Teknikode 7 years ago
parent
commit
2fbcfb3373
  1. 17
      Teknik/Helpers/StringExtensions.cs
  2. 1
      Teknik/Teknik.csproj
  3. 3
      Teknik/Views/Shared/_Footer.cshtml

17
Teknik/Helpers/StringExtensions.cs

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Teknik.Helpers
{
public static class StringExtensions
{
public static string Truncate(this string value, int maxLength)
{
if (string.IsNullOrEmpty(value)) return value;
return value.Length <= maxLength ? value : value.Substring(0, maxLength);
}
}
}

1
Teknik/Teknik.csproj

@ -268,6 +268,7 @@ @@ -268,6 +268,7 @@
<Compile Include="Helpers\MarkdownHelper.cs" />
<Compile Include="Helpers\RequestHelper.cs" />
<Compile Include="Helpers\RSSFeedResult.cs" />
<Compile Include="Helpers\StringExtensions.cs" />
<Compile Include="Helpers\Tracking.cs" />
<Compile Include="Helpers\UrlExtensions.cs" />
<Compile Include="Helpers\Utility.cs" />

3
Teknik/Views/Shared/_Footer.cshtml

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@using System.Diagnostics;
@using System.Reflection;
@using Teknik.Helpers;
<footer id="footer" class="footer navbar navbar-default">
<div class="container">
@ -24,7 +25,7 @@ @@ -24,7 +25,7 @@
</div>
<div class="row">
<div class="col-md-12 text-center text-muted">
Version: @string.Format("{0}.{1} - Hash: {2}", verNum, commitVer, commitHash)
Version: @string.Format("{0}.{1}", verNum, commitVer) - Hash: <a href="http://git.teknik.io/Teknikode/Teknik/src/@commitHash">@commitHash.Truncate(10)</a>
</div>
</div>
</div>

Loading…
Cancel
Save