Browse Source

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

tags/2.0.3
Teknikode 4 years ago
parent
commit
2fbcfb3373
3 changed files with 20 additions and 1 deletions
  1. 17
    0
      Teknik/Helpers/StringExtensions.cs
  2. 1
    0
      Teknik/Teknik.csproj
  3. 2
    1
      Teknik/Views/Shared/_Footer.cshtml

+ 17
- 0
Teknik/Helpers/StringExtensions.cs View File

@@ -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
- 0
Teknik/Teknik.csproj View File

@@ -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" />

+ 2
- 1
Teknik/Views/Shared/_Footer.cshtml View File

@@ -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 @@
</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