mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Removing unnecessary cast
This commit is contained in:
@@ -3,17 +3,14 @@
|
||||
ContentPart
|
||||
*@
|
||||
|
||||
@using Orchard.ContentManagement
|
||||
@using Orchard.Core.Common.Models;
|
||||
@{
|
||||
CommonPart commonPart = Model.ContentPart;
|
||||
string displayUser = null;
|
||||
if (commonPart.As<CommonPart>() != null) {
|
||||
if (!string.IsNullOrWhiteSpace(commonPart.As<CommonPart>().VersionModifiedBy)) {
|
||||
displayUser = commonPart.As<CommonPart>().VersionModifiedBy;
|
||||
if (Model.ContentPart != null) {
|
||||
if (!string.IsNullOrWhiteSpace(Model.ContentPart.VersionModifiedBy)) {
|
||||
displayUser = Model.ContentPart.VersionModifiedBy;
|
||||
}
|
||||
else if (commonPart.As<CommonPart>().Owner != null) {
|
||||
displayUser = commonPart.As<CommonPart>().Owner.UserName;
|
||||
else if (Model.ContentPart.Owner != null) {
|
||||
displayUser = Model.ContentPart.Owner.UserName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,12 +1,10 @@
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Core.Common.Models;
|
||||
@{
|
||||
CommonPart commonPart = Model.ContentPart;
|
||||
DateTime? modifiedUtc = commonPart.As<CommonPart>() == null ? null : commonPart.As<CommonPart>().ModifiedUtc;
|
||||
@{
|
||||
DateTime? modifiedUtc = Model.ContentPart == null ? null : Model.ContentPart.ModifiedUtc;
|
||||
}
|
||||
<ul class="pageStatus">
|
||||
<li>@if (modifiedUtc.HasValue) {
|
||||
@T("Last modified: {0}", Display.DateTimeRelative(DateTimeUtc: modifiedUtc.Value))} |
|
||||
</li>
|
||||
<li>@Display.CommonMetadataLastModified(ContentPart: Model.ContentPart)</li>
|
||||
</ul>
|
||||
<li>
|
||||
@if (modifiedUtc.HasValue) {
|
||||
@T("Last modified: {0}", Display.DateTimeRelative(DateTimeUtc: modifiedUtc.Value))} |
|
||||
</li>
|
||||
<li>@Display.CommonMetadataLastModified(ContentPart: Model.ContentPart)</li>
|
||||
</ul>
|
Reference in New Issue
Block a user