From 144714da423f73e2fdd93125219813eac7aacc29 Mon Sep 17 00:00:00 2001 From: Jonathan Wall Date: Fri, 15 Oct 2010 11:52:19 -0700 Subject: [PATCH 01/21] Updated Blog post html to html5. --HG-- branch : dev --- .../Orchard.Blogs/Views/Items/BlogPost.cshtml | 18 ++++++++++-------- .../Themes/TheThemeMachine/Styles/Site.css | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.cshtml index b1f6519a6..d325507ec 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/BlogPost.cshtml @@ -1,9 +1,11 @@ -

@Html.TitleForPage((string)Model.Title)

-@if (Model.Meta != null) { -
- @Display(Model.Meta) -
-} -
+
+
+ @Display(Model.Header) + +
+
@Display(Model.Content) -
\ No newline at end of file + + \ No newline at end of file diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css index 90001aa12..2fb7161ea 100644 --- a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css +++ b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css @@ -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 From c308aa1fbd5de0df526ff3dc53c22403266a6817 Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Fri, 15 Oct 2010 11:55:48 -0700 Subject: [PATCH 02/21] Refactoring some shape naming conventions Items_Content* shapes types now Content* Items_Widget* shape types now Widget* *_Editor shapes now *_Edit --HG-- branch : dev --- .../Core/Common/Drivers/BodyPartDriver.cs | 4 +- src/Orchard.Web/Core/Common/Placement.info | 2 +- src/Orchard.Web/Core/Contents/Shapes.cs | 4 +- src/Orchard.Web/Core/Orchard.Core.csproj | 2 +- .../Drivers/PublishLaterPartDriver.cs | 4 +- .../Core/PublishLater/Placement.info | 2 +- .../Orchard.Widgets/Orchard.Widgets.csproj | 6 +- src/Orchard.Web/Orchard.Web.csproj | 169 ++++++++++++++++++ .../DefaultContentDisplay.cs | 4 +- 9 files changed, 183 insertions(+), 14 deletions(-) diff --git a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs index a5717ce14..4f52efb0a 100644 --- a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs @@ -55,7 +55,7 @@ namespace Orchard.Core.Common.Drivers { protected override DriverResult Editor(BodyPart part, dynamic shapeHelper) { var model = BuildEditorViewModel(part); - return ContentShape("Parts_Common_Body_Editor", + return ContentShape("Parts_Common_Body_Edit", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); } @@ -63,7 +63,7 @@ namespace Orchard.Core.Common.Drivers { var model = BuildEditorViewModel(part); updater.TryUpdateModel(model, Prefix, null, null); - return ContentShape("Parts_Common_Body_Editor", + return ContentShape("Parts_Common_Body_Edit", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); } diff --git a/src/Orchard.Web/Core/Common/Placement.info b/src/Orchard.Web/Core/Common/Placement.info index dc0adb995..08f8a7883 100644 --- a/src/Orchard.Web/Core/Common/Placement.info +++ b/src/Orchard.Web/Core/Common/Placement.info @@ -2,7 +2,7 @@ - + diff --git a/src/Orchard.Web/Core/Contents/Shapes.cs b/src/Orchard.Web/Core/Contents/Shapes.cs index 648ea96ee..20abec04f 100644 --- a/src/Orchard.Web/Core/Contents/Shapes.cs +++ b/src/Orchard.Web/Core/Contents/Shapes.cs @@ -19,12 +19,12 @@ namespace Orchard.Core.Contents { } }); - builder.Describe("Items_Content_Editor") + builder.Describe("Items_Content_Edit") .OnDisplaying(displaying => { ContentItem contentItem = displaying.Shape.ContentItem; if (contentItem != null) { //Content.Editor-Page - displaying.ShapeMetadata.Alternates.Add("Items_Content_Editor__" + contentItem.ContentType); + displaying.ShapeMetadata.Alternates.Add("Items_Content_Edit__" + contentItem.ContentType); } }); } diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index b493f2ab8..c3f5499d7 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -381,7 +381,7 @@ - + diff --git a/src/Orchard.Web/Core/PublishLater/Drivers/PublishLaterPartDriver.cs b/src/Orchard.Web/Core/PublishLater/Drivers/PublishLaterPartDriver.cs index 4b7c32cd5..e0821d4c5 100644 --- a/src/Orchard.Web/Core/PublishLater/Drivers/PublishLaterPartDriver.cs +++ b/src/Orchard.Web/Core/PublishLater/Drivers/PublishLaterPartDriver.cs @@ -43,7 +43,7 @@ namespace Orchard.Core.PublishLater.Drivers { protected override DriverResult Editor(PublishLaterPart part, dynamic shapeHelper) { var model = BuildEditorViewModel(part); - return ContentShape("Parts_PublishLater_Editor", + return ContentShape("Parts_PublishLater_Edit", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); } protected override DriverResult Editor(PublishLaterPart part, IUpdateModel updater, dynamic shapeHelper) { @@ -65,7 +65,7 @@ namespace Orchard.Core.PublishLater.Drivers { //Services.Notifier.Information(T("{0} draft has been saved!", model.ContentItem.TypeDefinition.DisplayName)); break; } - return ContentShape("Parts_PublishLater_Editor", + return ContentShape("Parts_PublishLater_Edit", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); } diff --git a/src/Orchard.Web/Core/PublishLater/Placement.info b/src/Orchard.Web/Core/PublishLater/Placement.info index 0aac725c1..e7e177112 100644 --- a/src/Orchard.Web/Core/PublishLater/Placement.info +++ b/src/Orchard.Web/Core/PublishLater/Placement.info @@ -2,7 +2,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj index 4210fb3de..0483cc885 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj @@ -116,12 +116,12 @@ Designer - - + + - + diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj index 11a36e4f4..31ae9639c 100644 --- a/src/Orchard.Web/Orchard.Web.csproj +++ b/src/Orchard.Web/Orchard.Web.csproj @@ -125,9 +125,27 @@ + + + + + + + + + + + + + + + + + Designer + @@ -147,12 +165,163 @@ Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard/ContentManagement/DefaultContentDisplay.cs b/src/Orchard/ContentManagement/DefaultContentDisplay.cs index 589fe36c2..d44078a1e 100644 --- a/src/Orchard/ContentManagement/DefaultContentDisplay.cs +++ b/src/Orchard/ContentManagement/DefaultContentDisplay.cs @@ -81,7 +81,7 @@ namespace Orchard.ContentManagement { if (!contentTypeDefinition.Settings.TryGetValue("Stereotype", out stereotype)) stereotype = "Content"; - var actualShapeType = "Items_" + stereotype + "_Editor"; + var actualShapeType = "Items_" + stereotype + "_Edit"; dynamic itemShape = CreateItemShape(actualShapeType); itemShape.ContentItem = content.ContentItem; @@ -99,7 +99,7 @@ namespace Orchard.ContentManagement { if (!contentTypeDefinition.Settings.TryGetValue("Stereotype", out stereotype)) stereotype = "Content"; - var actualShapeType = "Items_" + stereotype + "_Editor"; + var actualShapeType = "Items_" + stereotype + "_Edit"; dynamic itemShape = CreateItemShape(actualShapeType); itemShape.ContentItem = content.ContentItem; From 03a82cbb1148f7e35c4a027cc8c783f67d78b73f Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Fri, 15 Oct 2010 11:56:30 -0700 Subject: [PATCH 03/21] Missed a file --HG-- branch : dev --- .../Core/Contents/Views/Items/Content.Edit.cshtml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml new file mode 100644 index 000000000..170021de6 --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml @@ -0,0 +1,11 @@ +
+
+ @Display(Model.Primary) +
+
+ @Display(Model.Secondary) +
+ +
+
+
\ No newline at end of file From 194c6b8fb47862d083b6a8681d33782ad7855051 Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Fri, 15 Oct 2010 12:01:04 -0700 Subject: [PATCH 04/21] Fixing incorrect action. --HG-- branch : dev --- src/Orchard.Web/Core/Contents/Controllers/AdminController.cs | 3 +-- .../Core/Contents/Views/Items/Content.SummaryAdmin.cshtml | 4 ++-- .../Modules/Orchard.Widgets/Controllers/AdminController.cs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs index 960fa7c85..c3a2bc47e 100644 --- a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs @@ -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"))) diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml index 56b5da5d5..82ed945da 100644 --- a/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml @@ -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(); }
diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs index 2a7dd5851..e1264dc24 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs @@ -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; From e3950c601032637e136f86b7cb29cd57b2f9f32c Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Fri, 15 Oct 2010 12:02:15 -0700 Subject: [PATCH 05/21] Adding aditional UT. --HG-- branch : dev --- .../Widgets/Services/WidgetsServiceTest.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Orchard.Tests.Modules/Widgets/Services/WidgetsServiceTest.cs b/src/Orchard.Tests.Modules/Widgets/Services/WidgetsServiceTest.cs index d517ca7f6..ec0dfe524 100644 --- a/src/Orchard.Tests.Modules/Widgets/Services/WidgetsServiceTest.cs +++ b/src/Orchard.Tests.Modules/Widgets/Services/WidgetsServiceTest.cs @@ -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 WidgetPart widgetPart1 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, Position1, Zone1); WidgetPart widgetPart2 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle2, Position2, Zone1); // different zone widget _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle3, Position3, Zone2); + // test 1 - moving first widget up will have no effect IEnumerable layerWidgets = _widgetService.GetWidgets(layerPart.Id); Assert.That(layerWidgets.Count(), Is.EqualTo(2)); Assert.That(layerWidgets.Contains(widgetPart1)); Assert.That(layerWidgets.Contains(widgetPart2)); } + public class StubLayerPartHandler : ContentHandler { public StubLayerPartHandler(IRepository layersRepository) { Filters.Add(new ActivatingFilter("Layer")); From 7ba0ab27a6d8fd86ff42f88ca7c54e15d8c147a1 Mon Sep 17 00:00:00 2001 From: Jonathan Wall Date: Fri, 15 Oct 2010 12:28:12 -0700 Subject: [PATCH 06/21] Changed the list of comments to html5. --HG-- branch : dev --- .../Views/ListOfComments.cshtml | 27 +++++++++++-------- .../Themes/TheThemeMachine/Styles/Site.css | 13 +++++---- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Views/ListOfComments.cshtml b/src/Orchard.Web/Modules/Orchard.Comments/Views/ListOfComments.cshtml index 9de2d99ae..d1c566b6e 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Views/ListOfComments.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Comments/Views/ListOfComments.cshtml @@ -2,15 +2,20 @@ @using Orchard.Comments.Models;
    -@foreach (var comment in Model) { -
  • -
    - @Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" }) - said @Html.Link(Html.DateTimeRelative(comment.Record.CommentDateUtc.GetValueOrDefault(), T).ToString(), "#") -
    -
    -

    @comment.Record.CommentText

    -
    -
  • +@foreach (var comment in Model) { +
  • +
    +
    +

    + @Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" }) + + said + +

    +
    +

    @comment.Record.CommentText

    +
    +
  • } -
\ No newline at end of file + + diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css index 2fb7161ea..7205f7c6c 100644 --- a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css +++ b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css @@ -408,27 +408,26 @@ button:focus, .button:focus { 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; } From 5cd048f30db109e5cacc485e30c1313508cfcf76 Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Fri, 15 Oct 2010 12:47:47 -0700 Subject: [PATCH 07/21] Committing changes on content Items_ name change --HG-- branch : dev --- .../BasicShapeTemplateHarvesterTests.cs | 27 +++++++------------ src/Orchard.Web/Core/Contents/Shapes.cs | 14 +++++----- .../RemoteBlogPublishingShapes.cs | 2 +- .../Orchard.Widgets/Orchard.Widgets.csproj | 6 ++--- .../Modules/Orchard.Widgets/Shapes.cs | 6 ++--- .../Views/Items_Widget.Editor.cshtml | 11 -------- .../Orchard.Widgets/Views/Items_Widget.cshtml | 2 -- .../DefaultContentDisplay.cs | 6 ++--- .../IShapeTemplateHarvester.cs | 11 +------- 9 files changed, 28 insertions(+), 57 deletions(-) delete mode 100644 src/Orchard.Web/Modules/Orchard.Widgets/Views/Items_Widget.Editor.cshtml delete mode 100644 src/Orchard.Web/Modules/Orchard.Widgets/Views/Items_Widget.cshtml diff --git a/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs b/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs index 1ee81ae98..10c5aa2cd 100644 --- a/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs +++ b/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs @@ -6,7 +6,7 @@ namespace Orchard.Tests.DisplayManagement.Descriptors { [TestFixture] public class BasicShapeTemplateHarvesterTests { private static void VerifyShapeType(string givenSubPath, string givenFileName, string expectedShapeType) { - var harvester = new BasicShapeTemplateHarvester(Enumerable.Empty()); + var harvester = new BasicShapeTemplateHarvester(); var harvestShapeHits = harvester.HarvestShape(new HarvestShapeInfo { SubPath = givenSubPath, FileName = givenFileName }); Assert.That(harvestShapeHits.Count(), Is.EqualTo(1)); Assert.That(harvestShapeHits.Single().ShapeType, Is.EqualTo(expectedShapeType)); @@ -31,38 +31,31 @@ namespace Orchard.Tests.DisplayManagement.Descriptors { [Test] public void DefaultItemsContentTemplate() { - VerifyShapeType("Views/Items", "Content", "Items_Content"); + VerifyShapeType("Views/Items", "Content", "Content"); } [Test] public void ImplicitSpecializationOfItemsContentTemplate() { - VerifyShapeType("Views/Items", "MyType", "Items_Content__MyType"); + VerifyShapeType("Views/Items", "MyType", "MyType"); } [Test] public void ExplicitSpecializationOfItemsContentTemplate() { - VerifyShapeType("Views/Items", "Content-MyType", "Items_Content__MyType"); + VerifyShapeType("Views/Items", "Content-MyType", "Content__MyType"); } [Test] public void ContentItemDisplayTypes() { - VerifyShapeType("Views/Items", "Content", "Items_Content"); - VerifyShapeType("Views/Items", "Content.Summary", "Items_Content_Summary"); - VerifyShapeType("Views/Items", "Content.Edit", "Items_Content_Edit"); + VerifyShapeType("Views/Items", "Content", "Content"); + VerifyShapeType("Views/Items", "Content.Summary", "Content_Summary"); + VerifyShapeType("Views/Items", "Content.Edit", "Content_Edit"); } [Test] public void ExplicitSpecializationMixedWithDisplayTypes() { - VerifyShapeType("Views/Items", "Content-MyType", "Items_Content__MyType"); - VerifyShapeType("Views/Items", "Content-MyType.Summary", "Items_Content_Summary__MyType"); - VerifyShapeType("Views/Items", "Content-MyType.Edit", "Items_Content_Edit__MyType"); - } - - [Test] - public void ImplicitSpecializationMixedWithDisplayTypes() { - VerifyShapeType("Views/Items", "MyType", "Items_Content__MyType"); - VerifyShapeType("Views/Items", "MyType.Summary", "Items_Content_Summary__MyType"); - VerifyShapeType("Views/Items", "MyType.Edit", "Items_Content_Edit__MyType"); + VerifyShapeType("Views/Items", "Content-MyType", "Content__MyType"); + VerifyShapeType("Views/Items", "Content-MyType.Summary", "Content_Summary__MyType"); + VerifyShapeType("Views/Items", "Content-MyType.Edit", "Content_Edit__MyType"); } [Test] diff --git a/src/Orchard.Web/Core/Contents/Shapes.cs b/src/Orchard.Web/Core/Contents/Shapes.cs index 20abec04f..0999dea75 100644 --- a/src/Orchard.Web/Core/Contents/Shapes.cs +++ b/src/Orchard.Web/Core/Contents/Shapes.cs @@ -4,27 +4,27 @@ using Orchard.DisplayManagement.Descriptors; namespace Orchard.Core.Contents { public class Shapes : IShapeTableProvider { public void Discover(ShapeTableBuilder builder) { - builder.Describe("Items_Content") + builder.Describe("Content") .OnDisplaying(displaying => { ContentItem contentItem = displaying.Shape.ContentItem; if (contentItem != null) { //Content-BlogPost - displaying.ShapeMetadata.Alternates.Add("Items_Content__" + contentItem.ContentType); + displaying.ShapeMetadata.Alternates.Add("Content__" + contentItem.ContentType); //Content-42 - displaying.ShapeMetadata.Alternates.Add("Items_Content__" + contentItem.Id); + displaying.ShapeMetadata.Alternates.Add("Content__" + contentItem.Id); //Content.Summary - displaying.ShapeMetadata.Alternates.Add("Items_Content_" + displaying.ShapeMetadata.DisplayType); + displaying.ShapeMetadata.Alternates.Add("Content_" + displaying.ShapeMetadata.DisplayType); //Content.Summary-Page - displaying.ShapeMetadata.Alternates.Add("Items_Content_" + displaying.ShapeMetadata.DisplayType + "__" + contentItem.ContentType); + displaying.ShapeMetadata.Alternates.Add("Content_" + displaying.ShapeMetadata.DisplayType + "__" + contentItem.ContentType); } }); - builder.Describe("Items_Content_Edit") + builder.Describe("Content_Edit") .OnDisplaying(displaying => { ContentItem contentItem = displaying.Shape.ContentItem; if (contentItem != null) { //Content.Editor-Page - displaying.ShapeMetadata.Alternates.Add("Items_Content_Edit__" + contentItem.ContentType); + displaying.ShapeMetadata.Alternates.Add("Content_Edit__" + contentItem.ContentType); } }); } diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/RemoteBlogPublishingShapes.cs b/src/Orchard.Web/Modules/Orchard.Blogs/RemoteBlogPublishingShapes.cs index e9c5d7fc7..024076387 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/RemoteBlogPublishingShapes.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/RemoteBlogPublishingShapes.cs @@ -5,7 +5,7 @@ namespace Orchard.Blogs { [OrchardFeature("Remote Blog Publishing")] public class RemoteBlogPublishingShapes : IShapeTableProvider { public void Discover(ShapeTableBuilder builder) { - builder.Describe("Items_Content__Blog") + builder.Describe("Content__Blog") .OnDisplaying(displaying => { if (displaying.ShapeMetadata.DisplayType == "Detail") { displaying.ShapeMetadata.Wrappers.Add("RemoteBlogPublishing"); diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj index 0483cc885..f9e17d2ed 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj @@ -116,12 +116,12 @@ Designer - - + + + - diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs index 54de14d3a..a097a2d21 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Shapes.cs @@ -5,7 +5,7 @@ using Orchard.Widgets.Models; namespace Orchard.Widgets { public class Shapes : IShapeTableProvider { public void Discover(ShapeTableBuilder builder) { - builder.Describe("Items_Widget") + builder.Describe("Widget") .Configure(descriptor => { // todo: have "alternates" for chrome //todo: (heskew) something...this still doesn't feel right @@ -20,8 +20,8 @@ namespace Orchard.Widgets { ContentItem contentItem = displaying.Shape.ContentItem; if (contentItem != null) { var zoneName = contentItem.As().Zone; - displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + contentItem.ContentType); - displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + zoneName); + displaying.ShapeMetadata.Alternates.Add("Widget__" + contentItem.ContentType); + displaying.ShapeMetadata.Alternates.Add("Widget__" + zoneName); } }); } diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items_Widget.Editor.cshtml b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items_Widget.Editor.cshtml deleted file mode 100644 index c3a6edaa4..000000000 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items_Widget.Editor.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -
-
- @Display(Model.Primary) -
-
- @Display(Model.secondary) -
- -
-
-
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items_Widget.cshtml b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items_Widget.cshtml deleted file mode 100644 index 05001230b..000000000 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items_Widget.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@Display(Model.Header) -@Display(Model.Content) \ No newline at end of file diff --git a/src/Orchard/ContentManagement/DefaultContentDisplay.cs b/src/Orchard/ContentManagement/DefaultContentDisplay.cs index d44078a1e..91c68341d 100644 --- a/src/Orchard/ContentManagement/DefaultContentDisplay.cs +++ b/src/Orchard/ContentManagement/DefaultContentDisplay.cs @@ -61,7 +61,7 @@ namespace Orchard.ContentManagement { if (!contentTypeDefinition.Settings.TryGetValue("Stereotype", out stereotype)) stereotype = "Content"; - var actualShapeType = "Items_" + stereotype; + var actualShapeType = stereotype; var actualDisplayType = string.IsNullOrWhiteSpace(displayType) ? "Detail" : displayType; dynamic itemShape = CreateItemShape(actualShapeType); @@ -81,7 +81,7 @@ namespace Orchard.ContentManagement { if (!contentTypeDefinition.Settings.TryGetValue("Stereotype", out stereotype)) stereotype = "Content"; - var actualShapeType = "Items_" + stereotype + "_Edit"; + var actualShapeType = stereotype + "_Edit"; dynamic itemShape = CreateItemShape(actualShapeType); itemShape.ContentItem = content.ContentItem; @@ -99,7 +99,7 @@ namespace Orchard.ContentManagement { if (!contentTypeDefinition.Settings.TryGetValue("Stereotype", out stereotype)) stereotype = "Content"; - var actualShapeType = "Items_" + stereotype + "_Edit"; + var actualShapeType = stereotype + "_Edit"; dynamic itemShape = CreateItemShape(actualShapeType); itemShape.ContentItem = content.ContentItem; diff --git a/src/Orchard/DisplayManagement/Descriptors/ShapeTemplateStrategy/IShapeTemplateHarvester.cs b/src/Orchard/DisplayManagement/Descriptors/ShapeTemplateStrategy/IShapeTemplateHarvester.cs index 40e573555..3bbcd92d7 100644 --- a/src/Orchard/DisplayManagement/Descriptors/ShapeTemplateStrategy/IShapeTemplateHarvester.cs +++ b/src/Orchard/DisplayManagement/Descriptors/ShapeTemplateStrategy/IShapeTemplateHarvester.cs @@ -15,11 +15,6 @@ namespace Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy { } public class BasicShapeTemplateHarvester : IShapeTemplateHarvester { - private readonly IEnumerable _shapeTemplateViewEngines; - - public BasicShapeTemplateHarvester(IEnumerable shapeTemplateViewEngines) { - _shapeTemplateViewEngines = shapeTemplateViewEngines; - } public IEnumerable SubPaths() { return new[] { "Views", "Views/Items", "Views/Parts", "Views/Fields" }; @@ -43,14 +38,10 @@ namespace Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy { static string Adjust(string subPath, string fileName, string displayType) { var leader = ""; - if (subPath.StartsWith("Views/")) { + if (subPath.StartsWith("Views/") && subPath != "Views/Items") { leader = subPath.Substring("Views/".Length) + "_"; } - if (leader == "Items_" && !fileName.StartsWith("Content")) { - leader = "Items_Content__"; - } - // canonical shape type names must not have - or . to be compatible // with display and shape api calls))) var shapeType = leader + fileName.Replace("--", "__").Replace("-", "__").Replace('.', '_'); From 46c9dbfc554cc7d9a18429215fe20cfd2c6f5ae3 Mon Sep 17 00:00:00 2001 From: Jonathan Wall Date: Fri, 15 Oct 2010 13:24:26 -0700 Subject: [PATCH 08/21] Wrapped the comments form fields in an ordered list. --HG-- branch : dev --- .../Views/ListOfComments.cshtml | 2 +- .../Views/Parts/Comments.Comments.cshtml | 30 +++++++++++-------- .../Themes/TheThemeMachine/Styles/Site.css | 6 ++-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Views/ListOfComments.cshtml b/src/Orchard.Web/Modules/Orchard.Comments/Views/ListOfComments.cshtml index d1c566b6e..17bff6a75 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Views/ListOfComments.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Comments/Views/ListOfComments.cshtml @@ -9,7 +9,7 @@

@Html.LinkOrDefault(comment.Record.UserName, comment.Record.SiteName, new { rel = "nofollow" }) - said + said

diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml b/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml index 887980133..2be3bafbb 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml @@ -19,37 +19,41 @@ else if(!Request.IsAuthenticated && !AuthorizedFor(Permissions.AddComment)) { } else { using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comment" })) { @Html.ValidationSummary() -

@T("Add a Comment")

- if (!Request.IsAuthenticated) { + if (!Request.IsAuthenticated) { +

@T("Add a Comment")

-
+
    +
  1. -
-
+ +
  • -
  • -
    + +
  • -
  • + +
    } else { @Html.Hidden("Name", WorkContext.CurrentUser.UserName ?? "") @Html.Hidden("Email", WorkContext.CurrentUser.Email ?? "") }
    -
    +
      +
    1. -
    -
    + +
  • @Html.Hidden("CommentedOn", (int)Model.ContentPart.ContentItem.Id) @Html.Hidden("ReturnUrl", Context.Request.ToUrlString()) @Html.AntiForgeryTokenOrchard() -
  • + +
    } -} \ No newline at end of file +} diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css index 7205f7c6c..ea846c1ee 100644 --- a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css +++ b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css @@ -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,11 +319,14 @@ 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; border:none; + border:1px solid #ff0000; } label { From 31968a8eaad5ea844d7e8aff72edc5430d2ba266 Mon Sep 17 00:00:00 2001 From: Jonathan Wall Date: Fri, 15 Oct 2010 13:26:18 -0700 Subject: [PATCH 09/21] Removed one test style. --HG-- branch : dev --- src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css index ea846c1ee..3ecadbd85 100644 --- a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css +++ b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css @@ -326,7 +326,6 @@ fieldset ol li {margin:1.6em 0 0 0} legend { font-size: 1.4em; border:none; - border:1px solid #ff0000; } label { From 5598623b0a61137fdcb5355c0652c8e5e7614633 Mon Sep 17 00:00:00 2001 From: Jonathan Wall Date: Fri, 15 Oct 2010 13:39:21 -0700 Subject: [PATCH 10/21] Fixed an issue with the legend not rendering. --HG-- branch : dev --- .../Orchard.Comments/Views/Parts/Comments.Comments.cshtml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml b/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml index 2be3bafbb..a8a7206ab 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml @@ -20,8 +20,9 @@ else if(!Request.IsAuthenticated && !AuthorizedFor(Permissions.AddComment)) { using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comment" })) { @Html.ValidationSummary() if (!Request.IsAuthenticated) { -

    @T("Add a Comment")

    +
    + @T("Add a Comment")
    1. From f1ccd646f5c3330008c88782a21536548af6863d Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Fri, 15 Oct 2010 14:06:22 -0700 Subject: [PATCH 11/21] Adjusting search widget to new shape template format. --HG-- branch : dev --- .../Orchard.Search/Drivers/SearchFormPartDriver.cs | 8 +++++++- .../Modules/Orchard.Search/Orchard.Search.csproj | 3 +-- .../Views/EditorTemplates/Parts/Search.SearchForm.cshtml | 1 - .../{DisplayTemplates => }/Parts/Search.SearchForm.cshtml | 6 +++--- 4 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 src/Orchard.Web/Modules/Orchard.Search/Views/EditorTemplates/Parts/Search.SearchForm.cshtml rename src/Orchard.Web/Modules/Orchard.Search/Views/{DisplayTemplates => }/Parts/Search.SearchForm.cshtml (64%) diff --git a/src/Orchard.Web/Modules/Orchard.Search/Drivers/SearchFormPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Search/Drivers/SearchFormPartDriver.cs index 26a78c124..aa09a6fc5 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Drivers/SearchFormPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Search/Drivers/SearchFormPartDriver.cs @@ -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; + }); } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Search/Orchard.Search.csproj b/src/Orchard.Web/Modules/Orchard.Search/Orchard.Search.csproj index e0e430aeb..c9f772b90 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Orchard.Search.csproj +++ b/src/Orchard.Web/Modules/Orchard.Search/Orchard.Search.csproj @@ -101,11 +101,10 @@ - - + diff --git a/src/Orchard.Web/Modules/Orchard.Search/Views/EditorTemplates/Parts/Search.SearchForm.cshtml b/src/Orchard.Web/Modules/Orchard.Search/Views/EditorTemplates/Parts/Search.SearchForm.cshtml deleted file mode 100644 index 5f282702b..000000000 --- a/src/Orchard.Web/Modules/Orchard.Search/Views/EditorTemplates/Parts/Search.SearchForm.cshtml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Search/Views/DisplayTemplates/Parts/Search.SearchForm.cshtml b/src/Orchard.Web/Modules/Orchard.Search/Views/Parts/Search.SearchForm.cshtml similarity index 64% rename from src/Orchard.Web/Modules/Orchard.Search/Views/DisplayTemplates/Parts/Search.SearchForm.cshtml rename to src/Orchard.Web/Modules/Orchard.Search/Views/Parts/Search.SearchForm.cshtml index bd3b849fa..6fd978460 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Views/DisplayTemplates/Parts/Search.SearchForm.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Search/Views/Parts/Search.SearchForm.cshtml @@ -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" })) {
      - @Html.TextBox("q", Model.Query) + @Html.TextBox("q", (SearchViewModel)Model.ViewModel.Query)
      -} +} \ No newline at end of file From 0d5c2db898727cc56eb6487291b6fc5fc2e1ae48 Mon Sep 17 00:00:00 2001 From: Suha Can Date: Fri, 15 Oct 2010 14:24:25 -0700 Subject: [PATCH 12/21] - Migrating Tags to the shape API. --HG-- branch : dev --- .../Modules/Orchard.Tags/Drivers/TagsPartDriver.cs | 13 ++++++++++--- .../Modules/Orchard.Tags/Orchard.Tags.csproj | 2 +- src/Orchard.Web/Modules/Orchard.Tags/Placement.info | 1 + .../Parts/{Tags.EditTags.cshtml => Tags.cshtml} | 0 4 files changed, 12 insertions(+), 4 deletions(-) rename src/Orchard.Web/Modules/Orchard.Tags/Views/EditorTemplates/Parts/{Tags.EditTags.cshtml => Tags.cshtml} (100%) diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs index 2b63945e2..dde0560c6 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/Drivers/TagsPartDriver.cs @@ -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 { + 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)); } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj b/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj index 819b7050b..045ae63fc 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj +++ b/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj @@ -98,7 +98,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Placement.info b/src/Orchard.Web/Modules/Orchard.Tags/Placement.info index cc123898e..8fecfe31d 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.Tags/Placement.info @@ -1,3 +1,4 @@  + diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Views/EditorTemplates/Parts/Tags.EditTags.cshtml b/src/Orchard.Web/Modules/Orchard.Tags/Views/EditorTemplates/Parts/Tags.cshtml similarity index 100% rename from src/Orchard.Web/Modules/Orchard.Tags/Views/EditorTemplates/Parts/Tags.EditTags.cshtml rename to src/Orchard.Web/Modules/Orchard.Tags/Views/EditorTemplates/Parts/Tags.cshtml From 0a1ed98ac284485c883009d56cb1ab8e77bb1d4e Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Fri, 15 Oct 2010 14:26:45 -0700 Subject: [PATCH 13/21] Files lost in translation --HG-- branch : dev --- .../Modules/Orchard.Widgets/Orchard.Widgets.csproj | 2 +- .../Orchard.Widgets/Views/Items/Widget.Edit.cshtml | 11 +++++++++++ .../Modules/Orchard.Widgets/Views/Items/Widget.cshtml | 2 ++ src/Orchard.Web/Orchard.Web.csproj | 4 +++- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.Edit.cshtml create mode 100644 src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.cshtml diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj index f9e17d2ed..e9295e01f 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj @@ -116,8 +116,8 @@ Designer - + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.Edit.cshtml b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.Edit.cshtml new file mode 100644 index 000000000..77078e324 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.Edit.cshtml @@ -0,0 +1,11 @@ +
      +
      + @Display(Model.Primary) +
      +
      + @Display(Model.secondary) +
      + +
      +
      +
      diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.cshtml b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.cshtml new file mode 100644 index 000000000..5480ffce7 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.cshtml @@ -0,0 +1,2 @@ +@Display(Model.Header) +@Display(Model.Content) diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj index 31ae9639c..194e44950 100644 --- a/src/Orchard.Web/Orchard.Web.csproj +++ b/src/Orchard.Web/Orchard.Web.csproj @@ -125,7 +125,9 @@ - + + Designer + From 054bd9f76e66eeee059f478a68b2b142900e2a24 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Fri, 15 Oct 2010 14:29:04 -0700 Subject: [PATCH 14/21] Correcting disabling feature from command line - http://orchard.codeplex.com/workitem/16524 --HG-- branch : dev --- .../Modules/Orchard.Modules/Commands/FeatureCommands.cs | 2 +- .../Modules/Orchard.Modules/Services/ModuleService.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Commands/FeatureCommands.cs b/src/Orchard.Web/Modules/Orchard.Modules/Commands/FeatureCommands.cs index e44d71829..5fadbcd3c 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Commands/FeatureCommands.cs +++ b/src/Orchard.Web/Modules/Orchard.Modules/Commands/FeatureCommands.cs @@ -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))); } } diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Services/ModuleService.cs b/src/Orchard.Web/Modules/Orchard.Modules/Services/ModuleService.cs index 446c4d66a..59807fd95 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Services/ModuleService.cs +++ b/src/Orchard.Web/Modules/Orchard.Modules/Services/ModuleService.cs @@ -95,9 +95,10 @@ namespace Orchard.Modules.Services { public void DisableFeatures(IEnumerable 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) From 88fe32ce2b28eee06c45908a042c4b33b974b754 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Fri, 15 Oct 2010 14:29:24 -0700 Subject: [PATCH 15/21] Updating Azure solution --HG-- branch : dev --- .../Orchard.Azure.Web/Config/Host.config | 2 +- .../Orchard.Azure.Web.csproj | 92 +++++++++++++++++++ .../Orchard.Azure.Web/Web.Debug.config | 4 +- .../Orchard.Azure.Web/Web.Release.config | 4 +- 4 files changed, 97 insertions(+), 5 deletions(-) diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Config/Host.config b/src/Orchard.Azure/Orchard.Azure.Web/Config/Host.config index f43c28564..6bd02b8e9 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Config/Host.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Config/Host.config @@ -13,7 +13,7 @@ service="Orchard.Environment.Configuration.IShellSettingsManager"> - diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj b/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj index af11c3fa4..73110bfa0 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj +++ b/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj @@ -176,6 +176,98 @@ {9916839C-39FC-4CEB-A5AF-89CA7E87119F} Orchard.Core + + {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D} + Lucene + + + {1C981BB3-26F7-494C-9005-CC27A5144233} + Orchard.ArchiveLater + + + {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867} + Orchard.Blogs + + + {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962} + Orchard.CodeGeneration + + + {14C049FD-B35B-415A-A824-87F26B26E7FD} + Orchard.Comments + + + {0E7646E8-FE8F-43C1-8799-D97860925EC4} + Orchard.ContentTypes + + + {05660F47-D649-48BD-9DED-DF4E01E7CFF9} + Orchard.Email + + + {AB3C207C-0126-4143-8D62-1119DF80D366} + Orchard.Experimental + + + {EA2B9121-EF54-40A6-A53E-6593C86EE696} + Orchard.Indexing + + + {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768} + Orchard.jQuery + + + {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} + Orchard.Media + + + {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1} + Orchard.Migrations + + + {17F86780-9A1F-4AA1-86F1-875EEC2730C7} + Orchard.Modules + + + {72457126-E118-4171-A08F-9A709EE4B7FC} + Orchard.MultiTenancy + + + {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} + Orchard.Packaging + + + {D10AD48F-407D-4DB5-A328-173EC7CB010F} + Orchard.Roles + + + {4BE4EB01-AC56-4048-924E-2CA77F509ABA} + Orchard.Search + + + {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} + Orchard.Setup + + + {5D0F00F0-26C9-4785-AD61-B85710C60EB0} + Orchard.Tags + + + {CDE24A24-01D3-403C-84B9-37722E18DFB7} + Orchard.Themes + + + {79AED36E-ABD0-4747-93D3-8722B042454B} + Orchard.Users + + + {194D3CCC-1153-474D-8176-FDE8D7D0D0BD} + Orchard.Widgets + + + {954CA994-D204-468B-9D69-51F6AD3E1C29} + TinyMce + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} Orchard.Framework diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Web.Debug.config b/src/Orchard.Azure/Orchard.Azure.Web/Web.Debug.config index 5b18590d2..3a38cc0c5 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Web.Debug.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Web.Debug.config @@ -1,9 +1,9 @@  - + \ No newline at end of file diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Web.Release.config b/src/Orchard.Azure/Orchard.Azure.Web/Web.Release.config index 5b18590d2..3a38cc0c5 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Web.Release.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Web.Release.config @@ -1,9 +1,9 @@  - + \ No newline at end of file From 54f53af9817d32fae4a1a1e6443f348099d7f854 Mon Sep 17 00:00:00 2001 From: Dave Reed Date: Fri, 15 Oct 2010 14:29:56 -0700 Subject: [PATCH 16/21] Added Html.LabelFor overloads that accept string and LocalizedString. e.g. Html.LabelFor(m=>m.Tags, T("Tags")) Existing uses NOT converted. Conversion can be accomplished with a VS Regular Expression search/replace: Replace this: \.LabelFor:b*\({[a-zA-Z]+}:b*\=\>:b*\1\.{[a-zA-Z]+}:b*\) With this: .LabelFor(\1=>\1.\2, T("\2")) --HG-- branch : dev --- src/Orchard/Mvc/Html/HtmlHelperExtensions.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs b/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs index d4bf700da..3cb858bed 100644 --- a/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs +++ b/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs @@ -36,6 +36,21 @@ namespace Orchard.Mvc.Html { return id.Replace('[', '_').Replace(']', '_'); } + public static IHtmlString LabelFor(this HtmlHelper html, Expression> expression, LocalizedString labelText) { + return LabelFor(html, expression, labelText.ToString()); + } + + public static IHtmlString LabelFor(this HtmlHelper html, Expression> expression, string labelText) { + if (String.IsNullOrEmpty(labelText)) { + return MvcHtmlString.Empty; + } + var htmlFieldName = ExpressionHelper.GetExpressionText(expression); + var tag = new TagBuilder("label"); + tag.Attributes.Add("for", html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldId(htmlFieldName)); + tag.SetInnerText(labelText); + return MvcHtmlString.Create(tag.ToString(TagRenderMode.Normal)); + } + public static MvcHtmlString SelectOption(this HtmlHelper html, T currentValue, T optionValue, string text) { return SelectOption(html, optionValue, object.Equals(optionValue, currentValue), text); } From 089e8e63c9e441ec5fe00b2f0559763b5085e5b1 Mon Sep 17 00:00:00 2001 From: Jonathan Wall Date: Fri, 15 Oct 2010 14:38:27 -0700 Subject: [PATCH 17/21] Updates to commenting UI. --HG-- branch : dev --- .../Views/Parts/Comments.Comments.cshtml | 4 +++- .../Orchard.Users/Views/Account/LogOn.cshtml | 16 +++++++++------- .../Themes/TheThemeMachine/Styles/Site.css | 6 +++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml b/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml index a8a7206ab..0b4162ba8 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Comments/Views/Parts/Comments.Comments.cshtml @@ -42,10 +42,12 @@ using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, Fo @Html.Hidden("Name", WorkContext.CurrentUser.UserName ?? "") @Html.Hidden("Email", WorkContext.CurrentUser.Email ?? "") } + +

      @if (Request.IsAuthenticated) { @T("Hi, {0}!", Html.Encode(WorkContext.CurrentUser.UserName))}

      1. - +
      2. diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LogOn.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LogOn.cshtml index 80f10f300..0c5f3a985 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LogOn.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LogOn.cshtml @@ -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"]}))) { -
      3. +
      4. @Html.Password("password") @Html.ValidationMessage("password") -
    -
    + +
  • @Html.CheckBox("rememberMe") -
  • + + } \ No newline at end of file diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css index 3ecadbd85..bd44928bd 100644 --- a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css +++ b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css @@ -401,12 +401,16 @@ 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; From 262f4a45593680f3f649e5c22faa720879f820a2 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Fri, 15 Oct 2010 14:40:35 -0700 Subject: [PATCH 18/21] Getting Orchard.Blogs on the new UI composition model (for display) --HG-- branch : dev --- .../Controllers/BlogController.cs | 28 ++++++++++--------- .../Drivers/BlogArchivesPartDriver.cs | 18 ++++++------ .../Drivers/BlogPagerPartDriver.cs | 11 ++++++++ .../Orchard.Blogs/Drivers/BlogPartDriver.cs | 10 ++++--- .../Drivers/RecentBlogPostsPartDriver.cs | 10 +++---- .../Modules/Orchard.Blogs/Migrations.cs | 6 ++++ .../Orchard.Blogs/Models/BlogPagerPart.cs | 10 +++++++ .../Orchard.Blogs/Orchard.Blogs.csproj | 9 ++++-- .../Modules/Orchard.Blogs/Placement.info | 22 +++++++++++---- .../Modules/Orchard.Blogs/Shapes.cs | 22 +++++++++++++++ .../ViewModels/BlogPostArchiveViewModel.cs | 9 ------ .../ViewModels/DisplayBlogViewModel.cs | 8 ------ .../Orchard.Blogs/Views/Blog/Item.cshtml | 28 ++----------------- .../Parts/Blogs.BlogArchives.cshtml | 2 +- .../Views/Parts/Blogs.Blog.Pager.cshtml | 18 ++++++++++++ .../Parts/Blogs.BlogArchives.cshtml | 24 +++++++--------- .../Views/Parts/Blogs.BlogPost.List.cshtml | 8 ++---- .../Views/Parts/Blogs.RecentBlogPosts.cshtml | 1 + src/Orchard.sln | 3 ++ 19 files changed, 143 insertions(+), 104 deletions(-) create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPagerPartDriver.cs create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPagerPart.cs create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Shapes.cs delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/ViewModels/BlogPostArchiveViewModel.cs delete mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/ViewModels/DisplayBlogViewModel.cs create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.Blog.Pager.cshtml rename src/Orchard.Web/Modules/Orchard.Blogs/Views/{DisplayTemplates => }/Parts/Blogs.BlogArchives.cshtml (50%) create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.RecentBlogPosts.cshtml diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs index 5523068e1..524ed60c2 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs @@ -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().Page = page; + blogPart.As().PageSize = pageSize; + blogPart.As().BlogSlug = correctedSlug; + blogPart.As().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) { diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogArchivesPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogArchivesPartDriver.cs index 44621999e..4bc0982fb 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogArchivesPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogArchivesPartDriver.cs @@ -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) { diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPagerPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPagerPartDriver.cs new file mode 100644 index 000000000..727ff6b55 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPagerPartDriver.cs @@ -0,0 +1,11 @@ +using Orchard.Blogs.Models; +using Orchard.ContentManagement.Drivers; + +namespace Orchard.Blogs.Drivers { + public class BlogPagerPartDriver : ContentPartDriver { + 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)); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPartDriver.cs index f3cb14478..9ed222575 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/BlogPartDriver.cs @@ -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", () => { diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/RecentBlogPostsPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/RecentBlogPostsPartDriver.cs index ed5cb1adf..ac7ec0313 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/RecentBlogPostsPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Drivers/RecentBlogPostsPartDriver.cs @@ -18,7 +18,7 @@ namespace Orchard.Blogs.Drivers { } protected override DriverResult Display(RecentBlogPostsPart part, string displayType, dynamic shapeHelper) { - IEnumerable blogPosts = null; + IEnumerable blogPosts; BlogPart blog = null; if (!string.IsNullOrWhiteSpace(part.ForBlog)) @@ -32,7 +32,6 @@ namespace Orchard.Blogs.Drivers { .Select(ci => ci.As()); } else { - var blogs = _blogService.Get().ToList(); blogPosts = _contentManager.Query(VersionOptions.Published, "BlogPost") .Join() .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) { diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs index 51d8f85fb..5dd7888a5 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Migrations.cs @@ -89,5 +89,11 @@ namespace Orchard.Blogs { return 5; } + + public int UpdateFrom5() { + ContentDefinitionManager.AlterTypeDefinition("Blog", + cfg => cfg.WithPart("BlogPagerPart")); + return 6; + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPagerPart.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPagerPart.cs new file mode 100644 index 000000000..e5e9b4132 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPagerPart.cs @@ -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; } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj index f66a94a27..a3ef9685a 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj @@ -68,11 +68,13 @@ + + @@ -107,8 +109,7 @@ - - + @@ -161,7 +162,7 @@ Designer - + @@ -169,6 +170,8 @@ + + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info b/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info index 7a90c2c0e..107de8e35 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info @@ -1,13 +1,23 @@  - - - - + + + + + + + - + + { +// 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().Zone; +// displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + contentItem.ContentType); +// displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + zoneName); +// } +// }); +// } +// } +//} diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/ViewModels/BlogPostArchiveViewModel.cs b/src/Orchard.Web/Modules/Orchard.Blogs/ViewModels/BlogPostArchiveViewModel.cs deleted file mode 100644 index a2c6541ca..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/ViewModels/BlogPostArchiveViewModel.cs +++ /dev/null @@ -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> Archives { get; set; } - } -} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/ViewModels/DisplayBlogViewModel.cs b/src/Orchard.Web/Modules/Orchard.Blogs/ViewModels/DisplayBlogViewModel.cs deleted file mode 100644 index 9639d425e..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/ViewModels/DisplayBlogViewModel.cs +++ /dev/null @@ -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; } - } -} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Blog/Item.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Blog/Item.cshtml index 7b03eeae4..6057ccc62 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Blog/Item.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Blog/Item.cshtml @@ -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) - -
      - @if(Model.BlogPostList.Items.Count == Model.PageSize) { -
    • - @Html.ActionLink(T("Older Posts").Text, "Item", new { Area = "Orchard.Blogs", blogSlug = Model.Blog.Slug, page = Model.Page + 1 }) -
    • - } - - @if(Model.Page > 1) { -
    • - @Html.ActionLink(T("Newer Posts").Text, "Item", new { Area = "Orchard.Blogs", blogSlug = Model.Blog.Slug, page = Model.Page - 1 }) -
    • - } -
    -} -else { -

    @T("There are no posts for this blog.")

    -} \ No newline at end of file +@Display(Model.Meta) +@Display(Model.Content) \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts/Blogs.BlogArchives.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts/Blogs.BlogArchives.cshtml index 3f67d5472..1f29a1f88 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts/Blogs.BlogArchives.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts/Blogs.BlogArchives.cshtml @@ -3,6 +3,6 @@
    @Html.LabelFor(m => m.ForBlog) @Html.TextBoxFor(m => m.ForBlog) - @T("The blog's slug to display the archives for.") + @T("Show the archives for which blog? Note: specify the blog's slug.")
    \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.Blog.Pager.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.Blog.Pager.cshtml new file mode 100644 index 000000000..925ad6eef --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.Blog.Pager.cshtml @@ -0,0 +1,18 @@ +@using Orchard.Blogs.Extensions; +@{ + Style.Include("pagination.css"); +} +@if (Model.ThereIsANextPage || Model.Page > 1) { +
      + @if(Model.ThereIsANextPage) { +
    • + @Html.ActionLink(T("Older Posts").Text, "Item", new { Area = "Orchard.Blogs", blogSlug = Model.BlogSlug, page = Model.Page + 1 }) +
    • + } + @if(Model.Page > 1) { +
    • + @Html.ActionLink(T("Newer Posts").Text, "Item", new { Area = "Orchard.Blogs", blogSlug = Model.BlogSlug, page = Model.Page - 1 }) +
    • + } +
    +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/DisplayTemplates/Parts/Blogs.BlogArchives.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogArchives.cshtml similarity index 50% rename from src/Orchard.Web/Modules/Orchard.Blogs/Views/DisplayTemplates/Parts/Blogs.BlogArchives.cshtml rename to src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogArchives.cshtml index 072dda3bd..9b6c5910b 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/DisplayTemplates/Parts/Blogs.BlogArchives.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogArchives.cshtml @@ -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> archives = Model.Archives; } -

    @T("Archives")

    - @if (Model.Archives.Count() > 20) { + @if (archives.Count() > 20) {
      @{ - 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) {
    • @@ -28,15 +25,14 @@ if (year != lastYear) {
    • } } -
    } - 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 {
    @T("None found")
    diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.cshtml index 86506523a..c5ad057ad 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.BlogPost.List.cshtml @@ -1,9 +1,7 @@ @{ - IEnumerable blogPosts = Model.BlogPosts; + IEnumerable blogPosts = Model.ContentItems; } -@Display(ContentItems) +@Display(Model.ContentItems) @if (blogPosts == null || blogPosts.Count() < 1) {

    @T("There are no posts for this blog.")

    -} - -hi \ No newline at end of file +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.RecentBlogPosts.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.RecentBlogPosts.cshtml new file mode 100644 index 000000000..46e0c33a4 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts/Blogs.RecentBlogPosts.cshtml @@ -0,0 +1 @@ +@Display(Model.ContentItems) \ No newline at end of file diff --git a/src/Orchard.sln b/src/Orchard.sln index b21c15219..7f33dc2ef 100644 --- a/src/Orchard.sln +++ b/src/Orchard.sln @@ -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 From ed0b69f420e0dc4dd204312c879385ab6adf84fc Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Fri, 15 Oct 2010 14:42:16 -0700 Subject: [PATCH 19/21] Fix bug #91 - Page error occurs when manage contents after add "Archive Later" part to "Page"(2483) --HG-- branch : dev --- .../Controllers/SearchController.cs | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Search/Controllers/SearchController.cs b/src/Orchard.Web/Modules/Orchard.Search/Controllers/SearchController.cs index b52263e10..04bc91d8c 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Controllers/SearchController.cs +++ b/src/Orchard.Web/Modules/Orchard.Search/Controllers/SearchController.cs @@ -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().SearchedFields; - var searchHits = _searchService.Query(q, page, pageSize, - CurrentSite.As().Record.FilterCulture, - searchFields, - searchHit => searchHit); + IPageOfItems searchHits; + + if (q.Trim().StartsWith("?") || q.Trim().StartsWith("*")) { + searchHits = new PageOfItems(new ISearchHit[] { }); + Services.Notifier.Error(T("'*' or '?' not allowed as first character in WildcardQuery")); + } + else { + searchHits = _searchService.Query(q, page, pageSize, + CurrentSite.As().Record.FilterCulture, + searchFields, + searchHit => searchHit); + } var searchResultViewModels = new List(); From 21c04e45da3ebac9c4371c1b11469c6edbfe2423 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Fri, 15 Oct 2010 15:15:44 -0700 Subject: [PATCH 20/21] Adding a layout classification helper function to TheThemeMachine's layout --HG-- branch : dev --- .../TheThemeMachine/Views/Layout.cshtml | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Views/Layout.cshtml b/src/Orchard.Web/Themes/TheThemeMachine/Views/Layout.cshtml index be3a6916f..698790fc1 100644 --- a/src/Orchard.Web/Themes/TheThemeMachine/Views/Layout.cshtml +++ b/src/Orchard.Web/Themes/TheThemeMachine/Views/Layout.cshtml @@ -1,4 +1,12 @@ -@{ +@functions { + string CalcuClassify(string[] zoneNames, string classNamePrefix) + { + var zoneCounter = 0; + var zoneNumsFilled = string.Join("", zoneNames.Select(zoneName => { ++zoneCounter; return Model[zoneName] != null ? zoneCounter.ToString() : "";}).ToArray()); + return HasText(zoneNumsFilled) ? classNamePrefix + zoneNumsFilled : ""; + } +} +@{ Style.Include("http://fonts.googleapis.com/css?family=Lobster&subset=latin"); Style.Include("site.css"); @@ -28,22 +36,20 @@ // {WorkContext.Layout.FooterQuadThird.Add("3 This is some test text to see if zones are working. This is some test text to see if zones are working.");} //Add classes to the wrapper div to toggle quad widget zones on and off + var tripelClass = CalcuClassify(new [] {"TripelFirst", "TripelSecond", "TripelThird"}, "tripel-"); + if (HasText(tripelClass)) { + Model.Classes.Add(tripelClass); + } - if (Model.FooterQuadFirst == null && Model.FooterQuadSecond != null && Model.FooterQuadThird != null && Model.FooterQuadFourth != null) { - Model.Classes.Add("split-234"); + //Add classes to the wrapper div to toggle quad widget zones on and off + var footerQuadClass = CalcuClassify(new [] {"FooterQuadFirst", "FooterQuadSecond", "FooterQuadThird", "FooterQuadFourth"}, "split-"); + if (HasText(footerQuadClass)) { + Model.Classes.Add(footerQuadClass); } - else if (Model.FooterQuadFirst != null && Model.FooterQuadSecond == null && Model.FooterQuadThird != null && Model.FooterQuadFourth != null) { - Model.Classes.Add("split-134"); - } - else if (Model.FooterQuadFirst != null && Model.FooterQuadSecond != null && Model.FooterQuadThird == null && Model.FooterQuadFourth != null) { - Model.Classes.Add("split-124"); - } - else if (Model.FooterQuadFirst != null && Model.FooterQuadSecond != null && Model.FooterQuadThird != null && Model.FooterQuadFourth == null) { - Model.Classes.Add("split-123"); - } - else { - } + @*debug: *@ + @*tripelClass:@tripelClass*@ + @*footerQuadClass:@footerQuadClass*@ Model.Id = "layout-wrapper"; var tag = Tag (Model, "div"); From 3d72236e813e38e4ff1c15bee6ad5873cc053625 Mon Sep 17 00:00:00 2001 From: Suha Can Date: Fri, 15 Oct 2010 15:16:41 -0700 Subject: [PATCH 21/21] - Migrating Email module to the new shape API. --HG-- branch : dev --- .../Orchard.Email/Drivers/SmtpSettingsPartDriver.cs | 8 ++++++-- .../Modules/Orchard.Email/Orchard.Email.csproj | 5 ++++- src/Orchard.Web/Modules/Orchard.Email/Placement.info | 3 +++ ...{Smtp.SiteSettings.cshtml => SmtpSettings.cshtml} | 0 .../Modules/Orchard.Tags/Drivers/TagsPartDriver.cs | 12 +++++++----- .../Modules/Orchard.Tags/Orchard.Tags.csproj | 4 +++- 6 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 src/Orchard.Web/Modules/Orchard.Email/Placement.info rename src/Orchard.Web/Modules/Orchard.Email/Views/EditorTemplates/Parts/{Smtp.SiteSettings.cshtml => SmtpSettings.cshtml} (100%) diff --git a/src/Orchard.Web/Modules/Orchard.Email/Drivers/SmtpSettingsPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Email/Drivers/SmtpSettingsPartDriver.cs index 0e2d16515..e8847e280 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Drivers/SmtpSettingsPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Email/Drivers/SmtpSettingsPartDriver.cs @@ -9,6 +9,8 @@ namespace Orchard.Email.Drivers { // Thus the encryption/decryption will be done when accessing the part's property public class SmtpSettingsPartDriver : ContentPartDriver { + private const string TemplateName = "Parts/SmtpSettings"; + public SmtpSettingsPartDriver() { T = NullLocalizer.Instance; } @@ -18,12 +20,14 @@ namespace Orchard.Email.Drivers { protected override string Prefix { get { return "SmtpSettings"; } } protected override DriverResult Editor(SmtpSettingsPart part, dynamic shapeHelper) { - return ContentPartTemplate(part, "Parts/Smtp.SiteSettings"); + return ContentShape("Parts_SmtpSettings_Editor", + () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: part, Prefix: Prefix)); } protected override DriverResult Editor(SmtpSettingsPart part, IUpdateModel updater, dynamic shapeHelper) { updater.TryUpdateModel(part, Prefix, null, null); - return Editor(part, shapeHelper); + return ContentShape("Parts_SmtpSettings_Editor", + () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: part, Prefix: Prefix)); } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj index 004a884b9..08bf37967 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj +++ b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj @@ -82,7 +82,7 @@ - + @@ -98,6 +98,9 @@ Orchard.Users + + +