mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Adding fallback to owner if VersionModifiedBy is not filled up
This commit is contained in:
@@ -7,7 +7,15 @@
|
||||
@using Orchard.Core.Common.Models;
|
||||
@{
|
||||
CommonPart commonPart = Model.ContentPart;
|
||||
string lastModifiedBy = commonPart.As<CommonPart>() == null ? null : commonPart.As<CommonPart>().VersionModifiedBy;
|
||||
string displayUser = null;
|
||||
if (commonPart.As<CommonPart>() != null) {
|
||||
if (!string.IsNullOrWhiteSpace(commonPart.As<CommonPart>().VersionModifiedBy)) {
|
||||
displayUser = commonPart.As<CommonPart>().VersionModifiedBy;
|
||||
}
|
||||
else if (commonPart.As<CommonPart>().Owner != null) {
|
||||
displayUser = commonPart.As<CommonPart>().Owner.UserName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@T("By {0}", lastModifiedBy ?? T("unknown").ToString())
|
||||
@T("By {0}", displayUser ?? T("unknown").ToString())
|
Reference in New Issue
Block a user