Browse Source

Merge pull request #125 from onurpicakci/onur/version-update

Abp version imaging added
pull/126/head
Berkan Sasmaz 4 years ago
committed by GitHub
parent
commit
c2efd00b73
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 58
      src/EventHub.Domain.Shared/Assemblies/AssemblyInfoHelper.cs
  2. 14
      src/EventHub.Web.Theme/Themes/EventHub/Components/Footer/Default.cshtml

58
src/EventHub.Domain.Shared/Assemblies/AssemblyInfoHelper.cs

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading;
using Volo.Abp;
namespace EventHub;
public static class AssemblyInfoHelper
{
private const string AssemblyInfoCacheKey = "AssemblyInfoCacheKey";
private readonly static Dictionary<string, AssemblyInfo> AssemblyInfoCache = new();
public static AssemblyInfo Get()
{
if (AssemblyInfoCache.TryGetValue(AssemblyInfoCacheKey, out var assemblyInfo))
{
return assemblyInfo;
}
var abpCorePackageVersion = GetAbpCorePackageVersion();
var applicationAssembly = Assembly.GetEntryAssembly();
var applicationVersion = applicationAssembly?.GetFileVersion();
var modificationDate = applicationAssembly?.Location == null ? DateTime.Now : File.GetLastWriteTime(applicationAssembly.Location);
assemblyInfo = new AssemblyInfo(abpCorePackageVersion, applicationVersion, modificationDate);
AssemblyInfoCache[AssemblyInfoCacheKey] = assemblyInfo;
return assemblyInfo;
}
private static string GetAbpCorePackageVersion()
{
var abpCoreAssembly = Assembly.GetAssembly(typeof(AbpApplicationBase));
return abpCoreAssembly == null
? string.Empty
: abpCoreAssembly.GetFileVersion();
}
public class AssemblyInfo
{
public string AbpCoreVersion { get; }
public string Version { get; }
public DateTime ModificationDate { get; }
public AssemblyInfo(string abpCoreVersion, string version, DateTime modificationDate)
{
AbpCoreVersion = abpCoreVersion;
Version = version;
ModificationDate = modificationDate;
}
}
}

14
src/EventHub.Web.Theme/Themes/EventHub/Components/Footer/Default.cshtml

@ -8,6 +8,7 @@
@inject IOptions<EventHubUrlOptions> UrlOptions
@{
var currentPageUrl = Context.Request.GetDisplayUrl();
var platformVersion = EventHub.AssemblyInfoHelper.Get();
}
<footer class="mt-5">
@ -34,16 +35,16 @@
<div class="col-md">
<h5>Follow Us</h5>
<div class="footer-links">
<a href="https://www.facebook.com/openeventhub">
<a target="_blank" href="https://www.facebook.com/openeventhub">
<i class="fab fa-facebook"></i>
</a>
<a href="https://twitter.com/openeventhub">
<a target="_blank" href="https://twitter.com/openeventhub">
<i class="fab fa-twitter"></i>
</a>
<a href="https://www.instagram.com/openeventhub/">
<a target="_blank" href="https://www.instagram.com/openeventhub/">
<i class="fab fa-instagram"></i>
</a>
<a href="https://github.com/openeventhub">
<a target="_blank" href="https://github.com/abpframework/eventhub">
<i class="fab fa-github"></i>
</a>
</div>
@ -56,8 +57,11 @@
<div class="col-md-auto">
<span class="copyright">© 2021 - @DateTime.Now.Year © <a>OpenEventHub</a></span>
<div>
<span class="copyright">Open source license with <a href="https://github.com/abpframework/eventhub/blob/main/LICENSE">LGPLv3.0</a></span>
<span class="copyright">Open source license with <a href="https://github.com/abpframework/eventhub/blob/main/LICENSE" target="_blank">LGPLv3.0</a></span>
</div>
<span style="font-size: 0.7rem;">
Made with ❤️ on <a href="https://github.com/abpframework/abp" target="_blank">ABP</a> @($"v{platformVersion.AbpCoreVersion}") <br/> Updated on @($"{platformVersion.ModificationDate.ToString("MMMM dd, yyyy, HH:mm")}")
</span>
</div>
<div class="col-md text-center text-md-end">
<a href="@UrlOptions.Value.Www/terms-service">

Loading…
Cancel
Save