Splitting a few shapes

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2011-02-25 14:31:26 -08:00
parent 9d65d9b3be
commit f0b1be7bbb
6 changed files with 47 additions and 10 deletions

View File

@@ -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<CommonPart>() == null ? null : commonPart.As<CommonPart>().Owner;
}
@T("By {0}", owner == null ? "<null>" : owner.UserName)

View File

@@ -1,15 +1,12 @@
@using Orchard.ContentManagement;
@using Orchard.Core.Common.Models;
@using Orchard.Security;
@{
CommonPart commonPart = Model.ContentPart;
DateTime? modifiedUtc = commonPart.As<CommonPart>() == null ? null : commonPart.As<CommonPart>().ModifiedUtc;
// owner isn't really who last modified this, is it?
IUser owner = commonPart.As<CommonPart>() == null ? null : commonPart.As<CommonPart>().Owner;
}
<ul class="pageStatus">
<li>@if (modifiedUtc.HasValue) {
@T("Last modified: {0}", Display.DateTimeRelative(dateTimeUtc: modifiedUtc.Value))}&nbsp;&#124;&nbsp;
</li>
<li>@T("By {0}", owner == null ? "<null>" : owner.UserName)</li>
<li>@Display.CommonMetadataOwner(ContentPart: Model.ContentPart)</li>
</ul>

View File

@@ -236,7 +236,7 @@
<Content Include="Common\Views\Fields.Common.Text.cshtml" />
<Content Include="Common\Views\Parts.Common.Body.SummaryAdmin.cshtml" />
<Content Include="Common\Views\Parts.Common.Metadata.cshtml" />
<Content Include="Common\Views\Parts.Common.Metadata.SummaryAdmin.cshtml" />
<Content Include="Common\Views\CommonMetadataOwner.cshtml" />
<Content Include="Containers\Module.txt" />
<Content Include="Contents\Styles\images\menu.content.png" />
<Content Include="Contents\Styles\menu.content.css" />
@@ -406,6 +406,9 @@
<ItemGroup>
<Content Include="Reports\Styles\Web.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Common\Views\Parts.Common.Metadata.SummaryAdmin.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,13 @@
@*
Model:
ContentPart
*@
@using Orchard.Comments.Models;
@using Orchard.Utility.Extensions;
@{
var comment = (Orchard.Comments.Models.CommentPart)Model.ContentPart;
}
@Html.LinkOrDefault(comment.Record.Author, comment.Record.SiteName, new { rel = "nofollow" })

View File

@@ -0,0 +1,12 @@
@*
Model:
ContentPart
*@
@using Orchard.Comments.Models;
@using Orchard.Utility.Extensions;
@{
var comment = (Orchard.Comments.Models.CommentPart)Model.ContentPart;
}
said <time datetime="@comment.Record.CommentDateUtc.GetValueOrDefault()">@Html.Link((string)Display.DateTimeRelative(dateTimeUtc: comment.Record.CommentDateUtc.GetValueOrDefault()).ToString(), "#comment-" + comment.Id)</time>

View File

@@ -4,13 +4,11 @@
<ul class="comments">
@foreach (var comment in Model) {
<li>
<article class="comment">
<article class="comment" id="comment-@comment.Id">
<header>
<h4>
<span class="who">@Html.LinkOrDefault(comment.Record.Author, comment.Record.SiteName, new { rel = "nofollow" })
</span>
<span class="when">said <time datetime="@comment.Record.CommentDateUtc.GetValueOrDefault()">@Html.Link((string)Display.DateTimeRelative(dateTimeUtc: comment.Record.CommentDateUtc.GetValueOrDefault()).ToString(), "#")</time>
</span>
<span class="who">@Display.CommentAuthor(ContentPart: comment)</span>
<span class="when">@Display.CommentMetadata(ContentPart: comment)</span>
</h4>
</header>
<p class="text">@(new MvcHtmlString(Html.Encode(comment.Record.CommentText).ReplaceNewLinesWith("<br />$1")))</p>