mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
service="Orchard.Environment.Configuration.IShellSettingsManager">
|
||||
</component>
|
||||
|
||||
<component instance-scope="single-instance"
|
||||
<component instance-scope="per-lifetime-scope"
|
||||
type="Orchard.Azure.FileSystems.Media.AzureBlobStorageProvider, Orchard.Azure"
|
||||
service="Orchard.FileSystems.Media.IStorageProvider">
|
||||
</component>
|
||||
|
@@ -176,6 +176,98 @@
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Lucene\Lucene.csproj">
|
||||
<Project>{D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}</Project>
|
||||
<Name>Lucene</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.ArchiveLater\Orchard.ArchiveLater.csproj">
|
||||
<Project>{1C981BB3-26F7-494C-9005-CC27A5144233}</Project>
|
||||
<Name>Orchard.ArchiveLater</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Blogs\Orchard.Blogs.csproj">
|
||||
<Project>{63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}</Project>
|
||||
<Name>Orchard.Blogs</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.CodeGeneration\Orchard.CodeGeneration.csproj">
|
||||
<Project>{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}</Project>
|
||||
<Name>Orchard.CodeGeneration</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Comments\Orchard.Comments.csproj">
|
||||
<Project>{14C049FD-B35B-415A-A824-87F26B26E7FD}</Project>
|
||||
<Name>Orchard.Comments</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.ContentTypes\Orchard.ContentTypes.csproj">
|
||||
<Project>{0E7646E8-FE8F-43C1-8799-D97860925EC4}</Project>
|
||||
<Name>Orchard.ContentTypes</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Email\Orchard.Email.csproj">
|
||||
<Project>{05660F47-D649-48BD-9DED-DF4E01E7CFF9}</Project>
|
||||
<Name>Orchard.Email</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Experimental\Orchard.Experimental.csproj">
|
||||
<Project>{AB3C207C-0126-4143-8D62-1119DF80D366}</Project>
|
||||
<Name>Orchard.Experimental</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Indexing\Orchard.Indexing.csproj">
|
||||
<Project>{EA2B9121-EF54-40A6-A53E-6593C86EE696}</Project>
|
||||
<Name>Orchard.Indexing</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.jQuery\Orchard.jQuery.csproj">
|
||||
<Project>{8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}</Project>
|
||||
<Name>Orchard.jQuery</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Media\Orchard.Media.csproj">
|
||||
<Project>{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}</Project>
|
||||
<Name>Orchard.Media</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Migrations\Orchard.Migrations.csproj">
|
||||
<Project>{EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}</Project>
|
||||
<Name>Orchard.Migrations</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Modules\Orchard.Modules.csproj">
|
||||
<Project>{17F86780-9A1F-4AA1-86F1-875EEC2730C7}</Project>
|
||||
<Name>Orchard.Modules</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.MultiTenancy\Orchard.MultiTenancy.csproj">
|
||||
<Project>{72457126-E118-4171-A08F-9A709EE4B7FC}</Project>
|
||||
<Name>Orchard.MultiTenancy</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Packaging\Orchard.Packaging.csproj">
|
||||
<Project>{DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}</Project>
|
||||
<Name>Orchard.Packaging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Roles\Orchard.Roles.csproj">
|
||||
<Project>{D10AD48F-407D-4DB5-A328-173EC7CB010F}</Project>
|
||||
<Name>Orchard.Roles</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Search\Orchard.Search.csproj">
|
||||
<Project>{4BE4EB01-AC56-4048-924E-2CA77F509ABA}</Project>
|
||||
<Name>Orchard.Search</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Setup\Orchard.Setup.csproj">
|
||||
<Project>{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}</Project>
|
||||
<Name>Orchard.Setup</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Tags\Orchard.Tags.csproj">
|
||||
<Project>{5D0F00F0-26C9-4785-AD61-B85710C60EB0}</Project>
|
||||
<Name>Orchard.Tags</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Themes\Orchard.Themes.csproj">
|
||||
<Project>{CDE24A24-01D3-403C-84B9-37722E18DFB7}</Project>
|
||||
<Name>Orchard.Themes</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Users\Orchard.Users.csproj">
|
||||
<Project>{79AED36E-ABD0-4747-93D3-8722B042454B}</Project>
|
||||
<Name>Orchard.Users</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\Orchard.Widgets\Orchard.Widgets.csproj">
|
||||
<Project>{194D3CCC-1153-474D-8176-FDE8D7D0D0BD}</Project>
|
||||
<Name>Orchard.Widgets</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard.Web\Modules\TinyMce\TinyMce.csproj">
|
||||
<Project>{954CA994-D204-468B-9D69-51F6AD3E1C29}</Project>
|
||||
<Name>TinyMce</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard\Orchard.Framework.csproj">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard.Framework</Name>
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<system.web>
|
||||
<!-- system.web>
|
||||
<machineKey xdt:Transform="Remove" />
|
||||
<machineKey xdt:Transform="Insert" validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" decryption="AES" />
|
||||
</system.web>
|
||||
</system.web -->
|
||||
<system.web.extensions xdt:Transform="Remove" />
|
||||
</configuration>
|
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<system.web>
|
||||
<!-- system.web>
|
||||
<machineKey xdt:Transform="Remove" />
|
||||
<machineKey xdt:Transform="Insert" validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" decryption="AES" />
|
||||
</system.web>
|
||||
</system.web -->
|
||||
<system.web.extensions xdt:Transform="Remove" />
|
||||
</configuration>
|
@@ -242,6 +242,9 @@ namespace Orchard.Tests.Modules.Widgets.Services {
|
||||
Assert.That(widgetPart3.Position, Is.EqualTo(Position3), "Widget remained in the same position");
|
||||
}
|
||||
|
||||
[Test, Ignore("Fix when possible")]
|
||||
public void GetLayerWidgetsTest() {
|
||||
LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, "");
|
||||
_contentManager.Flush();
|
||||
|
||||
// same zone widgets
|
||||
|
@@ -288,8 +288,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
return RedirectToAction("Edit", new RouteValueDictionary { { "Id", contentItem.Id } });
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Remove")]
|
||||
public ActionResult RemovePOST(int id, string returnUrl) {
|
||||
public ActionResult Remove(int id, string returnUrl) {
|
||||
var contentItem = _contentManager.Get(id, VersionOptions.Latest);
|
||||
|
||||
if (!Services.Authorizer.Authorize(Permissions.DeleteContent, contentItem, T("Couldn't remove content")))
|
||||
|
@@ -1,8 +1,8 @@
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Utility.Extensions;
|
||||
@{
|
||||
ContentItem contentItem = Model.ContentItem;
|
||||
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||
ContentItem contentItem = Model.ContentItem;
|
||||
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||
}
|
||||
<div class="summary" itemscope="itemscope" itemid="@contentItem.Id" itemtype="http://orchardproject.net/data/ContentItem">
|
||||
<div class="properties">
|
||||
|
@@ -6,7 +6,7 @@ using System.Xml.Linq;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.Blogs.Routing;
|
||||
using Orchard.Blogs.Services;
|
||||
using Orchard.Blogs.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Themes;
|
||||
@@ -53,25 +53,27 @@ namespace Orchard.Blogs.Controllers {
|
||||
if (correctedSlug == null)
|
||||
return HttpNotFound();
|
||||
|
||||
BlogPart blog = _blogService.Get(correctedSlug);
|
||||
if (blog == null)
|
||||
var blogPart = _blogService.Get(correctedSlug);
|
||||
if (blogPart == null)
|
||||
return HttpNotFound();
|
||||
|
||||
var blogPosts = _blogPostService.Get(blog, (page - 1)*pageSize, pageSize).Select(b => _services.ContentManager.BuildDisplay(b, "Summary"));
|
||||
var blogPosts = _blogPostService.Get(blogPart, (page - 1) * pageSize, pageSize)
|
||||
.Select(b => _services.ContentManager.BuildDisplay(b, "Summary"));
|
||||
|
||||
blogPart.As<BlogPagerPart>().Page = page;
|
||||
blogPart.As<BlogPagerPart>().PageSize = pageSize;
|
||||
blogPart.As<BlogPagerPart>().BlogSlug = correctedSlug;
|
||||
blogPart.As<BlogPagerPart>().ThereIsANextPage = _blogPostService.Get(blogPart, (page) * pageSize, pageSize).Any();
|
||||
|
||||
var blog = _services.ContentManager.BuildDisplay(blogPart);
|
||||
|
||||
var list = Shape.List();
|
||||
list.AddRange(blogPosts);
|
||||
|
||||
var blogShape = _services.ContentManager.BuildDisplay(blog);
|
||||
var model = new DisplayBlogViewModel {
|
||||
Blog = blogShape,
|
||||
BlogPostList = list,
|
||||
Page = page,
|
||||
PageSize = pageSize
|
||||
};
|
||||
|
||||
return View(model);
|
||||
blog.ContentItem = blogPart;
|
||||
blog.Content.Add(Shape.Parts_Blogs_BlogPost_List(ContentItems: list), "5");
|
||||
|
||||
return View("Display", blog);
|
||||
}
|
||||
|
||||
public ActionResult LiveWriterManifest(string blogSlug) {
|
||||
|
@@ -1,6 +1,5 @@
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.Blogs.Services;
|
||||
using Orchard.Blogs.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.ContentsLocation.Models;
|
||||
@@ -16,16 +15,17 @@ namespace Orchard.Blogs.Drivers {
|
||||
}
|
||||
|
||||
protected override DriverResult Display(BlogArchivesPart part, string displayType, dynamic shapeHelper) {
|
||||
BlogPart blog = null;
|
||||
if (!string.IsNullOrWhiteSpace(part.ForBlog))
|
||||
blog = _blogService.Get(part.ForBlog);
|
||||
return ContentShape("Parts_Blogs_BlogArchives",
|
||||
() => {
|
||||
BlogPart blog = null;
|
||||
if (!string.IsNullOrWhiteSpace(part.ForBlog))
|
||||
blog = _blogService.Get(part.ForBlog);
|
||||
|
||||
if ( blog != null ) {
|
||||
var model = new BlogPostArchiveViewModel {BlogPart = blog, Archives = _blogPostService.GetArchives(blog)};
|
||||
return ContentPartTemplate(model, "Parts/Blogs.BlogArchives");
|
||||
}
|
||||
if (blog == null)
|
||||
return null;
|
||||
|
||||
return null;
|
||||
return shapeHelper.Parts_Blogs_BlogArchives(ContentItem: part, Blog: blog, Archives: _blogPostService.GetArchives(blog));
|
||||
}).Location("Content");
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(BlogArchivesPart part, dynamic shapeHelper) {
|
||||
|
@@ -0,0 +1,11 @@
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
|
||||
namespace Orchard.Blogs.Drivers {
|
||||
public class BlogPagerPartDriver : ContentPartDriver<BlogPagerPart> {
|
||||
protected override DriverResult Display(BlogPagerPart part, string displayType, dynamic shapeHelper) {
|
||||
return ContentShape("Parts_Blogs_Blog_Pager",
|
||||
() => shapeHelper.Parts_Blogs_Blog_Pager(ContentPart: part, Page: part.Page, PageSize: part.PageSize, BlogSlug: part.BlogSlug, ThereIsANextPage: part.ThereIsANextPage));
|
||||
}
|
||||
}
|
||||
}
|
@@ -38,13 +38,15 @@ namespace Orchard.Blogs.Drivers {
|
||||
() => shapeHelper.Parts_Blogs_Blog_Manage(ContentPart: part)),
|
||||
ContentShape("Parts_Blogs_Blog_Description",
|
||||
() => shapeHelper.Parts_Blogs_Blog_Description(ContentPart: part, Description: part.Description)),
|
||||
// todo: (heskew) implement a paging solution that doesn't require blog posts to be tied to the blog within the controller
|
||||
ContentShape("Parts_Blogs_BlogPost_List",
|
||||
() => {
|
||||
_feedManager.Register(part);
|
||||
var list = shapeHelper.List();
|
||||
list.AddRange(_blogPostService.Get(part)
|
||||
.Select(bp => _contentManager.BuildDisplay(bp, "Summary")));
|
||||
return shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, ContentItems: list);
|
||||
return null;
|
||||
// var list = shapeHelper.List();
|
||||
// list.AddRange(_blogPostService.Get(part)
|
||||
// .Select(bp => _contentManager.BuildDisplay(bp, "Summary")));
|
||||
// return shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, ContentItems: list);
|
||||
}),
|
||||
ContentShape("Parts_Blogs_BlogPost_List_Admin",
|
||||
() => {
|
||||
|
@@ -18,7 +18,7 @@ namespace Orchard.Blogs.Drivers {
|
||||
}
|
||||
|
||||
protected override DriverResult Display(RecentBlogPostsPart part, string displayType, dynamic shapeHelper) {
|
||||
IEnumerable<BlogPostPart> blogPosts = null;
|
||||
IEnumerable<BlogPostPart> blogPosts;
|
||||
|
||||
BlogPart blog = null;
|
||||
if (!string.IsNullOrWhiteSpace(part.ForBlog))
|
||||
@@ -32,7 +32,6 @@ namespace Orchard.Blogs.Drivers {
|
||||
.Select(ci => ci.As<BlogPostPart>());
|
||||
}
|
||||
else {
|
||||
var blogs = _blogService.Get().ToList();
|
||||
blogPosts = _contentManager.Query(VersionOptions.Published, "BlogPost")
|
||||
.Join<CommonPartRecord>()
|
||||
.OrderByDescending(cr => cr.CreatedUtc)
|
||||
@@ -41,12 +40,11 @@ namespace Orchard.Blogs.Drivers {
|
||||
}
|
||||
|
||||
var list = shapeHelper.List();
|
||||
list.AddRange(blogPosts.Select(bp => _contentManager.BuildDisplay(bp, "Summary.BlogPost")));
|
||||
list.AddRange(blogPosts.Select(bp => _contentManager.BuildDisplay(bp, "Summary")));
|
||||
|
||||
var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, BlogPosts: list);
|
||||
blogPostList.Metadata.Type = "Parts_Blogs_BlogPost.List";
|
||||
var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, ContentItems: list);
|
||||
|
||||
return ContentShape(blogPostList).Location("Primary");
|
||||
return ContentShape(shapeHelper.Parts_Blogs_RecentBlogPosts(ContentItem: part, ContentItems: blogPostList));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(RecentBlogPostsPart part, dynamic shapeHelper) {
|
||||
|
@@ -89,5 +89,11 @@ namespace Orchard.Blogs {
|
||||
|
||||
return 5;
|
||||
}
|
||||
|
||||
public int UpdateFrom5() {
|
||||
ContentDefinitionManager.AlterTypeDefinition("Blog",
|
||||
cfg => cfg.WithPart("BlogPagerPart"));
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Blogs.Models {
|
||||
public class BlogPagerPart : ContentPart {
|
||||
public int Page { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
public string BlogSlug { get; set; }
|
||||
public bool ThereIsANextPage { get; set; }
|
||||
}
|
||||
}
|
@@ -68,11 +68,13 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Drivers\BlogArchivesPartDriver.cs" />
|
||||
<Compile Include="Drivers\BlogPagerPartDriver.cs" />
|
||||
<Compile Include="Drivers\RecentBlogPostsPartDriver.cs" />
|
||||
<Compile Include="Handlers\BlogArchivesPartHandler.cs" />
|
||||
<Compile Include="Handlers\RecentBlogPostsPartHandler.cs" />
|
||||
<Compile Include="Models\BlogArchivesPart.cs" />
|
||||
<Compile Include="Models\BlogArchivesPartRecord.cs" />
|
||||
<Compile Include="Models\BlogPagerPart.cs" />
|
||||
<Compile Include="Models\RecentBlogPostsPart.cs" />
|
||||
<Compile Include="Models\RecentBlogPostsPartRecord.cs" />
|
||||
<Compile Include="ResourceManifest.cs" />
|
||||
@@ -107,8 +109,7 @@
|
||||
<Compile Include="Services\IBlogService.cs" />
|
||||
<Compile Include="Services\XmlRpcHandler.cs" />
|
||||
<Compile Include="RemoteBlogPublishingShapes.cs" />
|
||||
<Compile Include="ViewModels\BlogPostArchiveViewModel.cs" />
|
||||
<Compile Include="ViewModels\DisplayBlogViewModel.cs" />
|
||||
<Compile Include="Shapes.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\Admin\images\draft.gif" />
|
||||
@@ -161,7 +162,7 @@
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<Content Include="Views\RemoteBlogPublishing.cshtml" />
|
||||
<None Include="Views\DisplayTemplates\Parts\Blogs.BlogArchives.cshtml" />
|
||||
<None Include="Views\Parts\Blogs.BlogArchives.cshtml" />
|
||||
<None Include="Views\EditorTemplates\Parts\Blogs.RecentBlogPosts.cshtml" />
|
||||
<None Include="Views\EditorTemplates\Parts\Blogs.BlogArchives.cshtml" />
|
||||
<None Include="Views\Items\Blog.DetailAdmin.cshtml" />
|
||||
@@ -169,6 +170,8 @@
|
||||
<None Include="Views\Items\BlogPost.Editor.cshtml" />
|
||||
<None Include="Views\Items\BlogPost.SummaryAdmin.cshtml" />
|
||||
<None Include="Views\Parts\Blogs.BlogPost.List.cshtml" />
|
||||
<None Include="Views\Parts\Blogs.Blog.Pager.cshtml" />
|
||||
<None Include="Views\Parts\Blogs.RecentBlogPosts.cshtml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
|
@@ -1,13 +1,23 @@
|
||||
<Placement>
|
||||
<Place Parts_Blogs_Blog_Manage="-"/>
|
||||
<Place Parts_Blogs_Blog_Description="-"/>
|
||||
<Place Parts_Blogs_BlogPost_List="-"/>
|
||||
<Place Parts_Blogs_BlogPost_List_Admin="-"/>
|
||||
<!-- available display shapes -->
|
||||
<!--
|
||||
Parts_Blogs_Blog_Manage
|
||||
Parts_Blogs_Blog_Description
|
||||
Parts_Blogs_Blog_Pager
|
||||
Parts_Blogs_BlogPost_List -> when in the blog detail display the blog post list is currently hard-coded to Content:5 to enable the current state of blog paging
|
||||
Parts_Blogs_BlogPost_List_Admin
|
||||
-->
|
||||
<!-- widget and edit shapes just get default placement -->
|
||||
<!-- edit "shapes" -->
|
||||
<Place Parts_Blogs_Blog_Fields="Primary:2"/>
|
||||
<!-- widgets -->
|
||||
<Place Parts_Blogs_BlogArchives="Content"/>
|
||||
<Place Parts_Blogs_RecentBlogPosts="Content"/>
|
||||
<Match ContentType="Blog">
|
||||
<Match DisplayType="Detail">
|
||||
<!-- current paging solution makes this redundant
|
||||
<Place Parts_Blogs_BlogPost_List="Content:5" /> -->
|
||||
<!-- blog posts currently added to the blog within the controller into Content:5 <Place Parts_Blogs_BlogPost_List="Content:5" />-->
|
||||
<Place Parts_Blogs_Blog_Pager="Content:after"
|
||||
Parts_Blogs_Blog_Description="Content:before" />
|
||||
</Match>
|
||||
<Match DisplayType="DetailAdmin">
|
||||
<Place Parts_Blogs_BlogPost_List_Admin="Content:5"
|
||||
|
22
src/Orchard.Web/Modules/Orchard.Blogs/Shapes.cs
Normal file
22
src/Orchard.Web/Modules/Orchard.Blogs/Shapes.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//using Orchard.ContentManagement;
|
||||
//using Orchard.DisplayManagement.Descriptors;
|
||||
|
||||
//namespace Orchard.Blogs {
|
||||
// public class Shapes : IShapeTableProvider {
|
||||
// public void Discover(ShapeTableBuilder builder) {
|
||||
// builder.Describe("Items_Content__Blog")
|
||||
// .OnCreated(created => {
|
||||
// var blog = created.Shape;
|
||||
// blog.Content.Add(created.New.Parts_Blogs_BlogPost_List(ContentPart: blog.ContentItem, ContentItems: blog.));
|
||||
// })
|
||||
// .OnDisplaying(displaying => {
|
||||
// ContentItem contentItem = displaying.Shape.ContentItem;
|
||||
// if (contentItem != null) {
|
||||
// var zoneName = contentItem.As<WidgetPart>().Zone;
|
||||
// displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + contentItem.ContentType);
|
||||
// displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + zoneName);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
//}
|
@@ -1,9 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Blogs.Models;
|
||||
|
||||
namespace Orchard.Blogs.ViewModels {
|
||||
public class BlogPostArchiveViewModel {
|
||||
public BlogPart BlogPart { get; set; }
|
||||
public IEnumerable<KeyValuePair<ArchiveData, int>> Archives { get; set; }
|
||||
}
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
namespace Orchard.Blogs.ViewModels {
|
||||
public class DisplayBlogViewModel {
|
||||
public dynamic Blog { get; set; }
|
||||
public dynamic BlogPostList { get; set; }
|
||||
public int Page { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
}
|
||||
}
|
@@ -1,26 +1,2 @@
|
||||
@model Orchard.Blogs.ViewModels.DisplayBlogViewModel
|
||||
@using Orchard.Blogs.Extensions;
|
||||
@{
|
||||
Style.Include("pagination.css");
|
||||
}
|
||||
@Display(Model.Blog)
|
||||
@if (Model.BlogPostList.Items.Count > 0) {
|
||||
@Display(Model.BlogPostList)
|
||||
|
||||
<ul class="pagination">
|
||||
@if(Model.BlogPostList.Items.Count == Model.PageSize) {
|
||||
<li class="older">
|
||||
@Html.ActionLink(T("Older Posts").Text, "Item", new { Area = "Orchard.Blogs", blogSlug = Model.Blog.Slug, page = Model.Page + 1 })
|
||||
</li>
|
||||
}
|
||||
|
||||
@if(Model.Page > 1) {
|
||||
<li class="newer">
|
||||
@Html.ActionLink(T("Newer Posts").Text, "Item", new { Area = "Orchard.Blogs", blogSlug = Model.Blog.Slug, page = Model.Page - 1 })
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
else {
|
||||
<p>@T("There are no posts for this blog.")</p>
|
||||
}
|
||||
@Display(Model.Meta)
|
||||
@Display(Model.Content)
|
@@ -3,6 +3,6 @@
|
||||
<div>
|
||||
@Html.LabelFor(m => m.ForBlog)
|
||||
@Html.TextBoxFor(m => m.ForBlog)
|
||||
<span class="hint">@T("The blog's slug to display the archives for.")</span>
|
||||
<span class="hint">@T("Show the archives for which blog? Note: specify the blog's slug.")</span>
|
||||
</div>
|
||||
</fieldset>
|
@@ -1,9 +1,11 @@
|
||||
<h1>@Html.TitleForPage((string)Model.Title)</h1>
|
||||
@if (Model.Meta != null) {
|
||||
<div class="metadata">
|
||||
@Display(Model.Meta)
|
||||
</div>
|
||||
}
|
||||
<div class="content">
|
||||
<article>
|
||||
<header>
|
||||
@Display(Model.Header)
|
||||
<p class="metadata">
|
||||
@Display(Model.Meta)
|
||||
</p>
|
||||
</header>
|
||||
<section>
|
||||
@Display(Model.Content)
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
@@ -0,0 +1,18 @@
|
||||
@using Orchard.Blogs.Extensions;
|
||||
@{
|
||||
Style.Include("pagination.css");
|
||||
}
|
||||
@if (Model.ThereIsANextPage || Model.Page > 1) {
|
||||
<ul class="blog-pagination">
|
||||
@if(Model.ThereIsANextPage) {
|
||||
<li class="older">
|
||||
@Html.ActionLink(T("Older Posts").Text, "Item", new { Area = "Orchard.Blogs", blogSlug = Model.BlogSlug, page = Model.Page + 1 })
|
||||
</li>
|
||||
}
|
||||
@if(Model.Page > 1) {
|
||||
<li class="newer">
|
||||
@Html.ActionLink(T("Newer Posts").Text, "Item", new { Area = "Orchard.Blogs", blogSlug = Model.BlogSlug, page = Model.Page - 1 })
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
@@ -1,23 +1,20 @@
|
||||
@model Orchard.Blogs.ViewModels.BlogPostArchiveViewModel
|
||||
@using Orchard.Blogs.Extensions;
|
||||
|
||||
@using Orchard.Blogs.Extensions;
|
||||
@using Orchard.Blogs.Models;
|
||||
@{
|
||||
Style.Require("BlogsArchives");
|
||||
Script.Require("BlogsArchives");
|
||||
IEnumerable<KeyValuePair<ArchiveData, int>> archives = Model.Archives;
|
||||
}
|
||||
|
||||
<div class="archives">
|
||||
<h3>@T("Archives")</h3>
|
||||
@if (Model.Archives.Count() > 20) {
|
||||
@if (archives.Count() > 20) {
|
||||
<ul class="years">
|
||||
@{
|
||||
int lastYear = Model.Archives.First().Key.Year;
|
||||
int firstYear = Model.Archives.Last().Key.Year;
|
||||
int lastYear = archives.First().Key.Year;
|
||||
int firstYear = archives.Last().Key.Year;
|
||||
}
|
||||
|
||||
|
||||
@for (int year = lastYear; year >= firstYear; year--) {
|
||||
var yearMonths = Model.Archives.Where(m => m.Key.Year == year);
|
||||
var yearMonths = archives.Where(m => m.Key.Year == year);
|
||||
|
||||
if (year == lastYear) {
|
||||
<li>
|
||||
@@ -28,15 +25,14 @@
|
||||
if (year != lastYear) {
|
||||
<li class="previous">
|
||||
<h4>@year <span>(@yearMonths.Sum(ym => ym.Value))</span></h4>
|
||||
@Html.UnorderedList(yearMonths, (t, i) => Html.Link(string.Format("{0:MMMM} ({1})", t.Key.ToDateTime(), t.Value), Url.BlogArchiveMonth(Model.BlogPart.Slug, t.Key.Year, t.Key.Month)), "archiveMonthList")
|
||||
@Html.UnorderedList(yearMonths, (t, i) => Html.Link(string.Format("{0:MMMM} ({1})", t.Key.ToDateTime(), t.Value), Url.BlogArchiveMonth((string)Model.BlogPart.Slug, t.Key.Year, t.Key.Month)), "archiveMonthList")
|
||||
</li>
|
||||
}
|
||||
}
|
||||
|
||||
</ul>
|
||||
}
|
||||
else if (Model.Archives.Count() > 0) {
|
||||
@Html.UnorderedList(Model.Archives, (t, i) => Html.Link(string.Format("{0:MMMM yyyy} ({1})", t.Key.ToDateTime(), t.Value), Url.BlogArchiveMonth(Model.BlogPart.Slug, t.Key.Year, t.Key.Month)), "archiveMonthList")
|
||||
else if (archives.Count() > 0) {
|
||||
@Html.UnorderedList(archives, (t, i) => Html.Link(string.Format("{0:MMMM yyyy} ({1})", t.Key.ToDateTime(), t.Value), Url.BlogArchiveMonth((string)Model.BlogPart.Slug, t.Key.Year, t.Key.Month)), "archiveMonthList")
|
||||
}
|
||||
else {
|
||||
<div class="message info">@T("None found")</div>
|
@@ -1,9 +1,7 @@
|
||||
@{
|
||||
IEnumerable<object> blogPosts = Model.BlogPosts;
|
||||
IEnumerable<object> blogPosts = Model.ContentItems;
|
||||
}
|
||||
@Display(ContentItems)
|
||||
@Display(Model.ContentItems)
|
||||
@if (blogPosts == null || blogPosts.Count() < 1) {
|
||||
<p>@T("There are no posts for this blog.")</p>
|
||||
}
|
||||
|
||||
hi
|
||||
}
|
@@ -0,0 +1 @@
|
||||
@Display(Model.ContentItems)
|
@@ -2,15 +2,20 @@
|
||||
@using Orchard.Comments.Models;
|
||||
|
||||
<ul class="comments">
|
||||
@foreach (var comment in Model) {
|
||||
<li>
|
||||
<div class="comment">
|
||||
<span class="who">@Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" })</span>
|
||||
<span>said @Html.Link(Html.DateTimeRelative(comment.Record.CommentDateUtc.GetValueOrDefault(), T).ToString(), "#")</span>
|
||||
</div>
|
||||
<div class="text">
|
||||
<p>@comment.Record.CommentText</p>
|
||||
</div>
|
||||
</li>
|
||||
@foreach (var comment in Model) {
|
||||
<li>
|
||||
<article class="comment">
|
||||
<header>
|
||||
<h4>
|
||||
<span class="who">@Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" })
|
||||
</span>
|
||||
<span class="when">said <time datetime="@comment.Record.CommentDateUtc.GetValueOrDefault()">@Html.Link(Html.DateTimeRelative(comment.Record.CommentDateUtc.GetValueOrDefault(), T).ToString(), "#")</time>
|
||||
</span>
|
||||
</h4>
|
||||
</header>
|
||||
<p class="text">@comment.Record.CommentText</p>
|
||||
</article>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
@@ -19,37 +19,44 @@ else if(!Request.IsAuthenticated && !AuthorizedFor(Permissions.AddComment)) {
|
||||
} else {
|
||||
using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comment" })) {
|
||||
@Html.ValidationSummary()
|
||||
<h2 id="addacomment">@T("Add a Comment")</h2>
|
||||
if (!Request.IsAuthenticated) {
|
||||
if (!Request.IsAuthenticated) {
|
||||
|
||||
<fieldset class="who">
|
||||
<div>
|
||||
<legend id="addacomment">@T("Add a Comment")</legend>
|
||||
<ol>
|
||||
<li>
|
||||
<label for="Name">@T("Name")</label>
|
||||
<input id="Name" class="text" name="Name" type="text" />
|
||||
</div>
|
||||
<div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="Email">@T("Email")</label>
|
||||
<input id="Email" class="text" name="Email" type="text" />
|
||||
</div>
|
||||
<div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="SiteName">@T("Url")</label>
|
||||
<input id="SiteName" class="text" name="SiteName" type="text" />
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
} else {
|
||||
@Html.Hidden("Name", WorkContext.CurrentUser.UserName ?? "")
|
||||
@Html.Hidden("Email", WorkContext.CurrentUser.Email ?? "")
|
||||
}
|
||||
|
||||
<h2 id="commenter">@if (Request.IsAuthenticated) { @T("Hi, {0}!", Html.Encode(WorkContext.CurrentUser.UserName))}</h2>
|
||||
<fieldset class="what">
|
||||
<div>
|
||||
<label for="CommentText">@if (Request.IsAuthenticated) { @T("Hi, {0}!", Html.Encode(WorkContext.CurrentUser.UserName))<br /> } @T("Comment")</label>
|
||||
<ol>
|
||||
<li>
|
||||
<label for="CommentText">@T("Comment")</label>
|
||||
<textarea id="CommentText" rows="10" cols="30" name="CommentText"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
</li>
|
||||
<li>
|
||||
<input type="submit" class="button" value="@T("Submit Comment")" />
|
||||
@Html.Hidden("CommentedOn", (int)Model.ContentPart.ContentItem.Id)
|
||||
@Html.Hidden("ReturnUrl", Context.Request.ToUrlString())
|
||||
@Html.AntiForgeryTokenOrchard()
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.Commands;
|
||||
using Orchard.Data.Migration;
|
||||
@@ -11,27 +12,29 @@ namespace Orchard.Migrations.Commands {
|
||||
[OrchardFeature("Orchard.Migrations")]
|
||||
public class DataMigrationCommands : DefaultOrchardCommandHandler {
|
||||
private readonly IDataMigrationManager _dataMigrationManager;
|
||||
private readonly IDataMigrationInterpreter _dataMigrationInterpreter;
|
||||
private readonly ISchemaCommandGenerator _schemaCommandGenerator;
|
||||
private readonly IExtensionManager _extensionManager;
|
||||
|
||||
public DataMigrationCommands(
|
||||
IDataMigrationManager dataMigrationManager,
|
||||
IDataMigrationInterpreter dataMigrationInterpreter,
|
||||
ISchemaCommandGenerator schemaCommandGenerator
|
||||
IExtensionManager extensionManager
|
||||
) {
|
||||
_dataMigrationManager = dataMigrationManager;
|
||||
_dataMigrationInterpreter = dataMigrationInterpreter;
|
||||
_schemaCommandGenerator = schemaCommandGenerator;
|
||||
_extensionManager = extensionManager;
|
||||
}
|
||||
|
||||
[OrchardSwitch]
|
||||
public bool Drop { get; set; }
|
||||
|
||||
[CommandName("upgrade database")]
|
||||
[CommandHelp("upgrade database <feature-name> \r\n\t" + "Upgrades or create the database tables for the <feature-name>")]
|
||||
public string UpgradeDatabase(string featureName) {
|
||||
[CommandHelp("upgrade database <feature-name-1> ... <feature-name-n> \r\n\t" + "Upgrades or create the database tables for the <feature-name> or all features if not available")]
|
||||
public string UpgradeDatabase(params string[] featureNames) {
|
||||
try {
|
||||
_dataMigrationManager.Update(featureName);
|
||||
IEnumerable<string> features = featureNames.Any()
|
||||
? featureNames
|
||||
: _extensionManager.AvailableExtensions()
|
||||
.SelectMany(ext => ext.Features)
|
||||
.Select(f => f.Name);
|
||||
|
||||
foreach(var feature in features) {
|
||||
_dataMigrationManager.Update(feature);
|
||||
}
|
||||
}
|
||||
catch ( Exception ex ) {
|
||||
Context.Output.WriteLine(T("An error occured while upgrading the database: " + ex.Message));
|
||||
@@ -40,6 +43,22 @@ namespace Orchard.Migrations.Commands {
|
||||
|
||||
return "Database upgraded";
|
||||
}
|
||||
}
|
||||
[OrchardFeature("DatabaseUpdate")]
|
||||
public class DatabaseUpdateCommands : DefaultOrchardCommandHandler {
|
||||
private readonly IDataMigrationInterpreter _dataMigrationInterpreter;
|
||||
private readonly ISchemaCommandGenerator _schemaCommandGenerator;
|
||||
|
||||
[OrchardSwitch]
|
||||
public bool Drop { get; set; }
|
||||
|
||||
public DatabaseUpdateCommands(
|
||||
IDataMigrationInterpreter dataMigrationInterpreter,
|
||||
ISchemaCommandGenerator schemaCommandGenerator
|
||||
) {
|
||||
_dataMigrationInterpreter = dataMigrationInterpreter;
|
||||
_schemaCommandGenerator = schemaCommandGenerator;
|
||||
}
|
||||
|
||||
[CommandName("update database")]
|
||||
[CommandHelp("update database \r\n\t" + "Automatically updates the database schema for the enabled features")]
|
||||
|
@@ -79,7 +79,7 @@ namespace Orchard.Modules.Commands {
|
||||
[CommandName("feature disable")]
|
||||
public void Disable(params string[] featureNames) {
|
||||
Context.Output.WriteLine(T("Disabling features {0}", string.Join(",", featureNames)));
|
||||
_moduleService.DisableFeatures(featureNames);
|
||||
_moduleService.DisableFeatures(featureNames, true);
|
||||
Context.Output.WriteLine(T("Disabled features {0}", string.Join(",", featureNames)));
|
||||
}
|
||||
}
|
||||
|
@@ -95,9 +95,10 @@ namespace Orchard.Modules.Services {
|
||||
public void DisableFeatures(IEnumerable<string> features, bool force) {
|
||||
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||
var enabledFeatures = shellDescriptor.Features.ToList();
|
||||
var availableFeatures = GetAvailableFeatures().ToList();
|
||||
|
||||
var featuresToDisable =
|
||||
features.Select(s => DisableFeature(s, GetAvailableFeatures(), force)).SelectMany(
|
||||
features.Select(s => DisableFeature(s, availableFeatures, force)).SelectMany(
|
||||
ies => ies.Select(s => s));
|
||||
|
||||
if (featuresToDisable.Count() == 0)
|
||||
|
@@ -1,10 +1,14 @@
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Query.Dynamic;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Indexing;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Search.Services;
|
||||
using Orchard.Search.ViewModels;
|
||||
using Orchard.Settings;
|
||||
using Orchard.Search.Models;
|
||||
using Orchard.UI.Notify;
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Collections;
|
||||
using Orchard.Themes;
|
||||
@@ -15,20 +19,38 @@ namespace Orchard.Search.Controllers {
|
||||
private readonly ISearchService _searchService;
|
||||
private readonly IContentManager _contentManager;
|
||||
|
||||
public SearchController(ISearchService searchService, IContentManager contentManager) {
|
||||
public SearchController(
|
||||
IOrchardServices services,
|
||||
ISearchService searchService,
|
||||
IContentManager contentManager) {
|
||||
|
||||
Services = services;
|
||||
_searchService = searchService;
|
||||
_contentManager = contentManager;
|
||||
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
private IOrchardServices Services { get; set; }
|
||||
public Localizer T { get; set; }
|
||||
|
||||
protected virtual ISite CurrentSite { get; [UsedImplicitly] private set; }
|
||||
|
||||
public ActionResult Index(string q, int page = 1, int pageSize = 10) {
|
||||
var searchFields = CurrentSite.As<SearchSettingsPart>().SearchedFields;
|
||||
|
||||
var searchHits = _searchService.Query(q, page, pageSize,
|
||||
CurrentSite.As<SearchSettingsPart>().Record.FilterCulture,
|
||||
searchFields,
|
||||
searchHit => searchHit);
|
||||
IPageOfItems<ISearchHit> searchHits;
|
||||
|
||||
if (q.Trim().StartsWith("?") || q.Trim().StartsWith("*")) {
|
||||
searchHits = new PageOfItems<ISearchHit>(new ISearchHit[] { });
|
||||
Services.Notifier.Error(T("'*' or '?' not allowed as first character in WildcardQuery"));
|
||||
}
|
||||
else {
|
||||
searchHits = _searchService.Query(q, page, pageSize,
|
||||
CurrentSite.As<SearchSettingsPart>().Record.FilterCulture,
|
||||
searchFields,
|
||||
searchHit => searchHit);
|
||||
}
|
||||
|
||||
var searchResultViewModels = new List<SearchResultViewModel>();
|
||||
|
||||
|
@@ -7,7 +7,13 @@ namespace Orchard.Search.Drivers {
|
||||
|
||||
protected override DriverResult Display(SearchFormPart part, string displayType, dynamic shapeHelper) {
|
||||
var model = new SearchViewModel();
|
||||
return ContentPartTemplate(model, "Parts/Search.SearchForm");
|
||||
return ContentShape("Parts_Search_SearchForm", "Content:1",
|
||||
() => {
|
||||
var shape = shapeHelper.Parts_Search_SearchForm();
|
||||
shape.ContentPart = part;
|
||||
shape.ViewModel = model;
|
||||
return shape;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@@ -101,11 +101,10 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\EditorTemplates\Parts\Search.SiteSettings.cshtml" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Search.SearchForm.cshtml" />
|
||||
<Content Include="Views\Search\Index.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\DisplayTemplates\Parts\Search.SearchForm.cshtml" />
|
||||
<Content Include="Views\Parts\Search.SearchForm.cshtml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
|
@@ -1 +0,0 @@
|
||||
|
@@ -1,8 +1,8 @@
|
||||
@model Orchard.Search.ViewModels.SearchViewModel
|
||||
@using Orchard.Search.ViewModels;
|
||||
|
||||
@using(Html.BeginForm("index", "search", new { area = "Orchard.Search" }, FormMethod.Get, new { @class = "search" })) {
|
||||
<fieldset>
|
||||
@Html.TextBox("q", Model.Query)
|
||||
@Html.TextBox("q", (SearchViewModel)Model.ViewModel.Query)
|
||||
<button type="submit">@T("Search")</button>
|
||||
</fieldset>
|
||||
}
|
||||
}
|
@@ -2,7 +2,6 @@
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.ContentsLocation.Models;
|
||||
using Orchard.Security;
|
||||
using Orchard.Tags.Helpers;
|
||||
using Orchard.Tags.Models;
|
||||
@@ -12,6 +11,7 @@ using Orchard.Tags.ViewModels;
|
||||
namespace Orchard.Tags.Drivers {
|
||||
[UsedImplicitly]
|
||||
public class TagsPartDriver : ContentPartDriver<TagsPart> {
|
||||
private const string TemplateName = "Parts/Tags";
|
||||
private readonly ITagService _tagService;
|
||||
private readonly IAuthorizationService _authorizationService;
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace Orchard.Tags.Drivers {
|
||||
|
||||
public virtual IUser CurrentUser { get; set; }
|
||||
|
||||
protected override string Prefix {
|
||||
get { return "Tags"; }
|
||||
}
|
||||
|
||||
protected override DriverResult Display(TagsPart part, string displayType, dynamic shapeHelper) {
|
||||
return ContentShape("Parts_Tags_ShowTags",
|
||||
() => shapeHelper.Parts_Tags_ShowTags(ContentPart: part, Tags: part.CurrentTags));
|
||||
@@ -35,7 +39,9 @@ namespace Orchard.Tags.Drivers {
|
||||
var model = new EditTagsViewModel {
|
||||
Tags = string.Join(", ", part.CurrentTags.Select((t, i) => t.TagName).ToArray())
|
||||
};
|
||||
return ContentPartTemplate(model, "Parts/Tags.EditTags").Location(part.GetLocation("Editor"));
|
||||
|
||||
return ContentShape("Parts_Tags_Editor",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(TagsPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
@@ -50,7 +56,8 @@ namespace Orchard.Tags.Drivers {
|
||||
_tagService.UpdateTagsForContentItem(part.ContentItem.Id, tagNames);
|
||||
}
|
||||
|
||||
return ContentPartTemplate(model, "Parts/Tags.EditTags").Location(part.GetLocation("Editor"));
|
||||
return ContentShape("Parts_Tags_Editor",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix));
|
||||
}
|
||||
}
|
||||
}
|
@@ -98,7 +98,7 @@
|
||||
<Content Include="Views\Admin\Index.cshtml" />
|
||||
<Content Include="Views\Admin\Search.cshtml" />
|
||||
<Content Include="Views\Parts\Tags.ShowTags.cshtml" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Tags.EditTags.cshtml" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Tags.cshtml" />
|
||||
<Content Include="Views\Home\Index.cshtml" />
|
||||
<Content Include="Views\Home\Search.cshtml" />
|
||||
</ItemGroup>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
<Placement>
|
||||
<Place Parts_Tags_ShowTags="Header:after.7"/>
|
||||
<Place Parts_Tags_Editor="Primary:7"/>
|
||||
</Placement>
|
||||
|
@@ -5,21 +5,23 @@
|
||||
@Html.ValidationSummary(T("Login was unsuccessful. Please correct the errors and try again.").ToString())
|
||||
|
||||
@using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Request.QueryString["ReturnUrl"]}))) {
|
||||
<fieldset class="login-form">
|
||||
<fieldset class="login-form group">
|
||||
<legend>@T("Account Information")</legend>
|
||||
<div class="group">
|
||||
<ol>
|
||||
<li>
|
||||
<label for="userNameOrEmail">@T("Username:")</label>
|
||||
@Html.TextBox("userNameOrEmail", "", new { autofocus = "autofocus" })
|
||||
@Html.ValidationMessage("userNameOrEmail")
|
||||
</div>
|
||||
<div class="group">
|
||||
</li>
|
||||
<li>
|
||||
<label for="password">@T("Password:")</label>
|
||||
@Html.Password("password")
|
||||
@Html.ValidationMessage("password")
|
||||
</div>
|
||||
<div class="group">
|
||||
</li>
|
||||
<li>
|
||||
@Html.CheckBox("rememberMe")<label class="forcheckbox" for="rememberMe">@T("Remember me?")</label>
|
||||
</div>
|
||||
</li>
|
||||
<input type="submit" value="@T("Log On")" />
|
||||
</ol>
|
||||
</fieldset>
|
||||
}
|
@@ -51,7 +51,7 @@ namespace Orchard.Widgets.Controllers {
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
currentLayerWidgets = _widgetsService.GetWidgets().Where(widgetPart => widgetPart.LayerPart.Id == currentLayer.Id);
|
||||
currentLayerWidgets = _widgetsService.GetWidgets(currentLayer.Id);
|
||||
}
|
||||
else {
|
||||
currentLayer = null;
|
||||
|
@@ -27,7 +27,12 @@ var AddMediaDialog = {
|
||||
var result = window.frames[iframeName].result, close = 0;
|
||||
|
||||
if (result && result.url) {
|
||||
window.parent.AddMediaDialog.insertMedia(result.url);
|
||||
if (window.parent && window.parent.AddMediaDialog) {
|
||||
window.parent.AddMediaDialog.insertMedia(result.url);
|
||||
} else {
|
||||
AddMediaDialog.insertMedia(result.url);
|
||||
}
|
||||
|
||||
close = 1;
|
||||
} else if (result && result.error) {
|
||||
alert(tinyMCEPopup.getLang("addmedia_dlg.msg_error") + "\n\r\n\r" + result.error);
|
||||
@@ -48,7 +53,14 @@ var AddMediaDialog = {
|
||||
tinymce.dom.Event.remove(iframe, 'load', iframeLoadHandler);
|
||||
tinymce.DOM.remove(iframe);
|
||||
iframe = null;
|
||||
if (close) window.parent.tinyMCEPopup.close();
|
||||
|
||||
if (close) {
|
||||
if (window.parent && window.parent.tinyMCEPopup) {
|
||||
window.parent.tinyMCEPopup.close();
|
||||
} else {
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
}
|
||||
},
|
||||
123);
|
||||
} catch (ex) {
|
||||
|
@@ -190,7 +190,7 @@ pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height:
|
||||
|
||||
#layout-main
|
||||
{
|
||||
border-top: 1px solid #dbdbdb;
|
||||
border-top: 1px solid #fff;
|
||||
}
|
||||
|
||||
#layout-after-main
|
||||
@@ -303,7 +303,6 @@ label.forcheckbox { margin:0 0 0 .4em; display:inline; }
|
||||
fieldset { padding:0em; margin: 0 0 0em 0; border: 0px solid #dbdbdb; }
|
||||
legend { font-weight: 600; font-size:1.2em; }
|
||||
|
||||
|
||||
input[type="text"], #CommentText, #password, #confirmPassword {
|
||||
border:1px solid #999;
|
||||
display: block;
|
||||
@@ -320,7 +319,9 @@ form.search {
|
||||
width:17em;
|
||||
}
|
||||
|
||||
fieldset div {margin:1.6em 0 0 0}
|
||||
fieldset ol {list-style-type:none;}
|
||||
|
||||
fieldset ol li {margin:1.6em 0 0 0}
|
||||
|
||||
legend {
|
||||
font-size: 1.4em;
|
||||
@@ -400,35 +401,38 @@ button:focus, .button:focus {
|
||||
|
||||
|
||||
/* For testing purposes */
|
||||
#comments {
|
||||
#comments, #commenter {
|
||||
font-size:1.6em;
|
||||
font-weight:600;
|
||||
margin:1.2em 0 1.8em 1.2em;
|
||||
}
|
||||
|
||||
#commenter {
|
||||
margin:1.2em 0 0 1em;
|
||||
}
|
||||
|
||||
ul.comments, form.comment {
|
||||
margin:1.2em 0 1.2em 1.8em;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
div.comment {
|
||||
font-size:1.3em;
|
||||
font-style:italic;
|
||||
color:#484848;
|
||||
article.comment h4 {
|
||||
font-size:1.4em;
|
||||
}
|
||||
|
||||
div.comment a {
|
||||
article.comment a {
|
||||
color:#484848;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
div.comment span.who {
|
||||
article.comment span.who {
|
||||
font-weight:600;
|
||||
font-style:normal;
|
||||
text-transform:capitalize;
|
||||
color:#333;
|
||||
}
|
||||
|
||||
ul.comments li div.text {
|
||||
article.comment p.text {
|
||||
margin:.6em 0 2.4em 0;
|
||||
}
|
||||
|
||||
|
@@ -44,6 +44,9 @@ EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Tests", "Tools\Orchard.Tests\Orchard.Tests.csproj", "{0DFA2E10-96C8-4E05-BC10-B710B97ECCDE}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Notes", "_Notes", "{8A49DB66-40B2-4B6A-BFF0-D4839A240D00}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
Shapes.txt = Shapes.txt
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Modules", "Orchard.Web\Modules\Orchard.Modules\Orchard.Modules.csproj", "{17F86780-9A1F-4AA1-86F1-875EEC2730C7}"
|
||||
EndProject
|
||||
|
Reference in New Issue
Block a user