From f0b1be7bbb6c4a3b852f6861dbb2cba2502fb7b0 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Fri, 25 Feb 2011 14:31:26 -0800 Subject: [PATCH] Splitting a few shapes --HG-- branch : dev --- .../Core/Common/Views/CommonMetadataOwner.cshtml | 14 ++++++++++++++ .../Parts.Common.Metadata.SummaryAdmin.cshtml | 5 +---- src/Orchard.Web/Core/Orchard.Core.csproj | 5 ++++- .../Orchard.Comments/Views/CommentAuthor.cshtml | 13 +++++++++++++ .../Orchard.Comments/Views/CommentMetadata.cshtml | 12 ++++++++++++ .../Orchard.Comments/Views/ListOfComments.cshtml | 8 +++----- 6 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 src/Orchard.Web/Core/Common/Views/CommonMetadataOwner.cshtml create mode 100644 src/Orchard.Web/Modules/Orchard.Comments/Views/CommentAuthor.cshtml create mode 100644 src/Orchard.Web/Modules/Orchard.Comments/Views/CommentMetadata.cshtml diff --git a/src/Orchard.Web/Core/Common/Views/CommonMetadataOwner.cshtml b/src/Orchard.Web/Core/Common/Views/CommonMetadataOwner.cshtml new file mode 100644 index 000000000..e40a1cf2a --- /dev/null +++ b/src/Orchard.Web/Core/Common/Views/CommonMetadataOwner.cshtml @@ -0,0 +1,14 @@ +@* + Model: + ContentPart +*@ + +@using Orchard.ContentManagement; +@using Orchard.Core.Common.Models; +@using Orchard.Security; +@{ + CommonPart commonPart = Model.ContentPart; + // owner isn't really who last modified this, is it? + IUser owner = commonPart.As() == null ? null : commonPart.As().Owner; +} +@T("By {0}", owner == null ? "" : owner.UserName) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/Parts.Common.Metadata.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Common/Views/Parts.Common.Metadata.SummaryAdmin.cshtml index 24bd964bb..cd3544eb0 100644 --- a/src/Orchard.Web/Core/Common/Views/Parts.Common.Metadata.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Core/Common/Views/Parts.Common.Metadata.SummaryAdmin.cshtml @@ -1,15 +1,12 @@ @using Orchard.ContentManagement; @using Orchard.Core.Common.Models; -@using Orchard.Security; @{ CommonPart commonPart = Model.ContentPart; DateTime? modifiedUtc = commonPart.As() == null ? null : commonPart.As().ModifiedUtc; - // owner isn't really who last modified this, is it? - IUser owner = commonPart.As() == null ? null : commonPart.As().Owner; }
  • @if (modifiedUtc.HasValue) { @T("Last modified: {0}", Display.DateTimeRelative(dateTimeUtc: modifiedUtc.Value))} | 
  • -
  • @T("By {0}", owner == null ? "" : owner.UserName)
  • +
  • @Display.CommonMetadataOwner(ContentPart: Model.ContentPart)
\ No newline at end of file diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index fbb014637..ea35096fb 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -236,7 +236,7 @@ - + @@ -406,6 +406,9 @@ + + +