mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -135,7 +135,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
|
||||
public ActionResult List() {
|
||||
var list = Services.New.List();
|
||||
list.AddRange(_blogService.Get()
|
||||
list.AddRange(_blogService.Get(VersionOptions.Latest)
|
||||
.Select(b => {
|
||||
var blog = Services.ContentManager.BuildDisplay(b, "SummaryAdmin");
|
||||
blog.TotalPostCount = _blogPostService.Get(b, VersionOptions.Latest).Count();
|
||||
|
@@ -29,7 +29,11 @@ namespace Orchard.Blogs.Services {
|
||||
}
|
||||
|
||||
public IEnumerable<BlogPart> Get() {
|
||||
return _contentManager.Query<BlogPart, BlogPartRecord>()
|
||||
return Get(VersionOptions.Published);
|
||||
}
|
||||
|
||||
public IEnumerable<BlogPart> Get(VersionOptions versionOptions) {
|
||||
return _contentManager.Query<BlogPart, BlogPartRecord>(versionOptions)
|
||||
.Join<RoutePartRecord>()
|
||||
.OrderBy(br => br.Title)
|
||||
.List();
|
||||
|
@@ -7,6 +7,7 @@ namespace Orchard.Blogs.Services {
|
||||
BlogPart Get(string slug);
|
||||
ContentItem Get(int id, VersionOptions versionOptions);
|
||||
IEnumerable<BlogPart> Get();
|
||||
IEnumerable<BlogPart> Get(VersionOptions versionOptions);
|
||||
void Delete(ContentItem blog);
|
||||
}
|
||||
}
|
@@ -21,7 +21,6 @@
|
||||
</div>
|
||||
<div class="related">
|
||||
@Display(Model.Actions)
|
||||
<a href="@Url.Blog(blog)" title="@T("View")">@T("View")</a>@T(" | ")
|
||||
<a href="@Url.BlogForAdmin(blog)" title="@T("List Posts")">@T("List Posts")</a>@T(" | ")
|
||||
<a href="@Url.BlogPostCreate(blog)" title="@T("New Post")">@T("New Post")</a>@T(" | ")
|
||||
<a href="@Url.BlogEdit(blog)" title="@T("Edit")">@T("Edit")</a>@T(" | ")
|
||||
|
@@ -127,7 +127,11 @@
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</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.
|
||||
|
@@ -75,7 +75,7 @@ namespace Orchard.Comments.Services {
|
||||
comment.Record.CommentText = context.CommentText;
|
||||
comment.Record.Email = context.Email;
|
||||
comment.Record.SiteName = context.SiteName;
|
||||
comment.Record.UserName = (_orchardServices.WorkContext.CurrentUser == null ? context.Author : _orchardServices.WorkContext.CurrentUser.UserName);
|
||||
comment.Record.UserName = (_orchardServices.WorkContext.CurrentUser != null ? _orchardServices.WorkContext.CurrentUser.UserName : null);
|
||||
comment.Record.CommentedOn = context.CommentedOn;
|
||||
|
||||
comment.Record.Status = _commentValidator.ValidateComment(comment)
|
||||
|
18
src/Orchard.Web/Modules/Orchard.Comments/Styles/Web.config
Normal file
18
src/Orchard.Web/Modules/Orchard.Comments/Styles/Web.config
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<!-- iis6 - for any request in this location, return via managed static file handler -->
|
||||
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
|
||||
</httpHandlers>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<handlers accessPolicy="Script,Read">
|
||||
<!--
|
||||
iis7 - for any request to a file exists on disk, return it via native http module.
|
||||
accessPolicy 'Script' is to allow for a managed 404 page.
|
||||
-->
|
||||
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
@@ -1,3 +1,13 @@
|
||||
table.items .actions {
|
||||
white-space:nowrap;
|
||||
}
|
||||
table.items tr {
|
||||
background:#f7f7f7;
|
||||
}
|
||||
table.items tr.anonymous {
|
||||
background:#fff;
|
||||
}
|
||||
.anonymous-commenter-id,
|
||||
.authenticated-commenter-id {
|
||||
font-style:italic;
|
||||
}
|
@@ -53,7 +53,11 @@
|
||||
</thead>
|
||||
@{var commentIndex = 0;}
|
||||
@foreach (var commentEntry in Model.Comments) {
|
||||
<tr itemscope="itemscope" itemid="@Model.Comments[commentIndex].Comment.Id" itemtype="http://orchardproject.net/data/Comment">
|
||||
var commentClass = "";
|
||||
if (!HasText(commentEntry.Comment.UserName)) {
|
||||
commentClass = "anonymous";
|
||||
}
|
||||
<tr itemscope="itemscope" itemid="@Model.Comments[commentIndex].Comment.Id" itemtype="http://orchardproject.net/data/Comment" class="@commentClass">
|
||||
<td>
|
||||
<input type="hidden" value="@Model.Comments[commentIndex].Comment.Id" name="@Html.NameOf(m => m.Comments[commentIndex].Comment.Id)"/>
|
||||
<input type="checkbox" value="true" name="@Html.NameOf(m => m.Comments[commentIndex].IsChecked)"/>
|
||||
@@ -63,7 +67,12 @@
|
||||
else if (commentEntry.Comment.Status == CommentStatus.Pending) { @T("Pending") }
|
||||
else { @T("Approved") }
|
||||
</td>
|
||||
<td>@commentEntry.Comment.UserName</td>
|
||||
<td>
|
||||
<div>@commentEntry.Comment.Author</div>
|
||||
@if (HasText(commentEntry.Comment.UserName) && commentEntry.Comment.Author != commentEntry.Comment.UserName) {
|
||||
<div class="authenticated-commenter-id">@commentEntry.Comment.UserName</div>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@* would ideally have permalinks for individual comments *@
|
||||
<p><a href="@Url.ItemDisplayUrl(commentEntry.CommentedOn)#comments"><time>@Html.DateTime(commentEntry.Comment.CommentDateUtc.GetValueOrDefault())</time></a></p>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<article class="comment">
|
||||
<header>
|
||||
<h4>
|
||||
<span class="who">@Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" })
|
||||
<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>
|
||||
|
Reference in New Issue
Block a user