mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -287,13 +287,13 @@ namespace Orchard.Tests.Modules.Indexing {
|
|||||||
[Test]
|
[Test]
|
||||||
public void FiltersShouldNotAlterResults() {
|
public void FiltersShouldNotAlterResults() {
|
||||||
_provider.CreateIndex("default");
|
_provider.CreateIndex("default");
|
||||||
_provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped by Mirosoft in C#").Analyze().Add("culture", 1033));
|
_provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped by Microsoft in C#").Analyze().Add("culture", 1033));
|
||||||
_provider.Store("default", _provider.New(2).Add("body", "Windows a été développé par Mirosoft en C++").Analyze().Add("culture", 1036));
|
_provider.Store("default", _provider.New(2).Add("body", "Windows a été développé par Microsoft en C++").Analyze().Add("culture", 1036));
|
||||||
_provider.Store("default", _provider.New(3).Add("title", "Home").Analyze().Add("culture", 1033));
|
_provider.Store("default", _provider.New(3).Add("title", "Home").Analyze().Add("culture", 1033));
|
||||||
|
|
||||||
Assert.That(_searchBuilder.WithField("body", "Mirosoft").Count(), Is.EqualTo(2));
|
Assert.That(_searchBuilder.WithField("body", "Microsoft").Count(), Is.EqualTo(2));
|
||||||
Assert.That(_searchBuilder.WithField("body", "Mirosoft").WithField("culture", 1033).Count(), Is.EqualTo(3));
|
Assert.That(_searchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).Count(), Is.EqualTo(3));
|
||||||
Assert.That(_searchBuilder.WithField("body", "Mirosoft").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1));
|
Assert.That(_searchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1));
|
||||||
|
|
||||||
Assert.That(_searchBuilder.WithField("body", "Orchard").WithField("culture", 1036).Count(), Is.EqualTo(2));
|
Assert.That(_searchBuilder.WithField("body", "Orchard").WithField("culture", 1036).Count(), Is.EqualTo(2));
|
||||||
Assert.That(_searchBuilder.WithField("body", "Orchard").WithField("culture", 1036).AsFilter().Count(), Is.EqualTo(0));
|
Assert.That(_searchBuilder.WithField("body", "Orchard").WithField("culture", 1036).AsFilter().Count(), Is.EqualTo(0));
|
||||||
|
@@ -7,7 +7,7 @@ using Orchard.ContentManagement.MetaData.Builders;
|
|||||||
using Orchard.Core.Contents.Extensions;
|
using Orchard.Core.Contents.Extensions;
|
||||||
using Orchard.Data.Migration;
|
using Orchard.Data.Migration;
|
||||||
|
|
||||||
namespace $$FeatureName$$.DataMigrations {
|
namespace $$FeatureName$$ {
|
||||||
public class Migrations : DataMigrationImpl {
|
public class Migrations : DataMigrationImpl {
|
||||||
|
|
||||||
public int Create() {
|
public int Create() {
|
||||||
|
@@ -227,7 +227,6 @@ namespace Orchard.CodeGeneration.Commands {
|
|||||||
File.WriteAllText(propertiesPath + "\\AssemblyInfo.cs", templateText);
|
File.WriteAllText(propertiesPath + "\\AssemblyInfo.cs", templateText);
|
||||||
content.Add(propertiesPath + "\\AssemblyInfo.cs");
|
content.Add(propertiesPath + "\\AssemblyInfo.cs");
|
||||||
|
|
||||||
File.WriteAllText(modulePath + "Web.config", File.ReadAllText(_codeGenTemplatePath + "ModuleWebConfig.txt"));
|
|
||||||
templateText = File.ReadAllText(_codeGenTemplatePath + "ModuleManifest.txt");
|
templateText = File.ReadAllText(_codeGenTemplatePath + "ModuleManifest.txt");
|
||||||
templateText = templateText.Replace("$$ModuleName$$", moduleName);
|
templateText = templateText.Replace("$$ModuleName$$", moduleName);
|
||||||
File.WriteAllText(modulePath + "Module.txt", templateText);
|
File.WriteAllText(modulePath + "Module.txt", templateText);
|
||||||
|
@@ -61,7 +61,6 @@
|
|||||||
<Content Include="CodeGenerationTemplates\ModuleAssemblyInfo.txt" />
|
<Content Include="CodeGenerationTemplates\ModuleAssemblyInfo.txt" />
|
||||||
<Content Include="CodeGenerationTemplates\ModuleCsProj.txt" />
|
<Content Include="CodeGenerationTemplates\ModuleCsProj.txt" />
|
||||||
<Content Include="CodeGenerationTemplates\ModuleManifest.txt" />
|
<Content Include="CodeGenerationTemplates\ModuleManifest.txt" />
|
||||||
<Content Include="CodeGenerationTemplates\ModuleWebConfig.txt" />
|
|
||||||
<Content Include="CodeGenerationTemplates\ViewsWebConfig.txt" />
|
<Content Include="CodeGenerationTemplates\ViewsWebConfig.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
using Orchard.ContentManagement.Handlers;
|
using Orchard.ContentManagement.Handlers;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.Tasks.Indexing;
|
using Orchard.Tasks.Indexing;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Orchard.Indexing.Handlers {
|
namespace Orchard.Indexing.Handlers {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -9,16 +8,10 @@ namespace Orchard.Indexing.Handlers {
|
|||||||
/// is published, and to delete them when the content item is unpublished.
|
/// is published, and to delete them when the content item is unpublished.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CreateIndexingTaskHandler : ContentHandler {
|
public class CreateIndexingTaskHandler : ContentHandler {
|
||||||
private const string SearchIndexName = "Search";
|
|
||||||
private readonly IIndexingTaskManager _indexingTaskManager;
|
private readonly IIndexingTaskManager _indexingTaskManager;
|
||||||
private readonly IEnumerable<IIndexNotifierHandler> _indexNotifierHandlers;
|
|
||||||
|
|
||||||
public CreateIndexingTaskHandler(
|
public CreateIndexingTaskHandler(IIndexingTaskManager indexingTaskManager) {
|
||||||
IIndexingTaskManager indexingTaskManager,
|
|
||||||
IEnumerable<IIndexNotifierHandler> indexNotifierHandlers
|
|
||||||
) {
|
|
||||||
_indexingTaskManager = indexingTaskManager;
|
_indexingTaskManager = indexingTaskManager;
|
||||||
_indexNotifierHandlers = indexNotifierHandlers;
|
|
||||||
|
|
||||||
OnPublished<ContentPart>(CreateIndexingTask);
|
OnPublished<ContentPart>(CreateIndexingTask);
|
||||||
OnUnpublished<ContentPart>(CreateIndexingTask);
|
OnUnpublished<ContentPart>(CreateIndexingTask);
|
||||||
|
@@ -5,18 +5,45 @@
|
|||||||
padding: 1.2em 0.4em 0.5em
|
padding: 1.2em 0.4em 0.5em
|
||||||
}
|
}
|
||||||
.contentItems .properties {
|
.contentItems .properties {
|
||||||
float:left;
|
float: left;
|
||||||
|
clear: both;
|
||||||
}
|
}
|
||||||
.contentItems .pageStatus {
|
.contentItems .pageStatus {
|
||||||
margin:.8em 0;
|
margin: .8em 0;
|
||||||
color:#666;
|
color: #666;
|
||||||
}
|
}
|
||||||
.thumbnail {
|
.iconThumbnail {
|
||||||
|
padding-left: 70px;
|
||||||
|
}
|
||||||
|
.screenshotThumbnail {
|
||||||
|
padding-left: 191px;
|
||||||
|
}
|
||||||
|
.column {
|
||||||
float: left;
|
float: left;
|
||||||
padding: 1.2em 1.2em 0.5em 0em;
|
position: relative;
|
||||||
width: 10%;
|
}
|
||||||
|
.extensionThumbnail {
|
||||||
|
margin-left: -100%;
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
.iconThumbnail .extensionThumbnail {
|
||||||
|
width: 70px;
|
||||||
|
right: 70px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
.screenshotThumbnail .extensionThumbnail {
|
||||||
|
width: 191px;
|
||||||
|
right: 191px;
|
||||||
|
height: 128px;
|
||||||
}
|
}
|
||||||
.extensionDetails {
|
.extensionDetails {
|
||||||
float: left;
|
width: 100%;
|
||||||
width: 85%;
|
}
|
||||||
}
|
.iconThumbnail .thumbnail {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
.screenshotThumbnail .thumbnail {
|
||||||
|
width: 171px;
|
||||||
|
height: 128px;
|
||||||
|
}
|
||||||
|
@@ -28,30 +28,15 @@
|
|||||||
iconUrl = Href("../../Content/Images/ModuleDefaultIcon.png");
|
iconUrl = Href("../../Content/Images/ModuleDefaultIcon.png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<img src="@iconUrl" class="thumbnail"/>
|
|
||||||
|
|
||||||
<div class="extensionDetails">
|
<div class="iconThumbnail">
|
||||||
<div class="extensionName">
|
<div class="extensionDetails column">
|
||||||
<h2>@item.Title<span> - @T("Version: {0}", item.Version)</span></h2>
|
<div class="extensionName">
|
||||||
|
<h2>@item.Title<span> - @T("Version: {0}", item.Version)</span></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="related">
|
<div class="related">
|
||||||
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"packageId", item.PackageId}, {"version", item.Version}, {"sourceId", item.Source.Id}, {"redirectTo", "Modules"}})@T(" | ")
|
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary { { "packageId", item.PackageId }, { "version", item.Version }, { "sourceId", item.Source.Id }, { "redirectTo", "Modules" } })@T(" | ")
|
||||||
<a href="@item.PackageStreamUri">@T("Download")</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="properties">
|
|
||||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
|
||||||
<ul class="pageStatus">
|
|
||||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
|
||||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
|
||||||
<li> | @T("Rating: {0}", item.Rating)</li>
|
|
||||||
<li> | @T("Ratings Count: {0}", item.RatingsCount)</li>
|
|
||||||
<li> | @T("Website: ")
|
|
||||||
@if(!string.IsNullOrEmpty(item.ProjectUrl)) { <a href="@item.ProjectUrl">@item.ProjectUrl</a> }
|
|
||||||
else { @T("Unknown").ToString() }
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<a href="@item.PackageStreamUri">@T("Download")</a>
|
<a href="@item.PackageStreamUri">@T("Download")</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -19,42 +19,50 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@if (Model.Extensions.Count() > 0) {
|
@if (Model.Extensions.Count() > 0) {
|
||||||
<ul class="contentItems">
|
<ul class="contentItems theme">
|
||||||
@foreach (var item in Model.Extensions) {
|
@foreach (var item in Model.Extensions) {
|
||||||
<li>
|
<li>
|
||||||
@{
|
@{
|
||||||
|
string extensionClass = "iconThumbnail";
|
||||||
string iconUrl = @item.IconUrl;
|
string iconUrl = @item.IconUrl;
|
||||||
if (!string.IsNullOrWhiteSpace(@item.FirstScreenshot)) {
|
if (!string.IsNullOrWhiteSpace(@item.FirstScreenshot)) {
|
||||||
iconUrl = Href(@item.FirstScreenshot);
|
iconUrl = Href(@item.FirstScreenshot);
|
||||||
|
extensionClass = "screenshotThumbnail";
|
||||||
}
|
}
|
||||||
else if (string.IsNullOrWhiteSpace(iconUrl)) {
|
else if (string.IsNullOrWhiteSpace(iconUrl)) {
|
||||||
iconUrl = Href("../../Content/Images/imagePlaceholder.png");
|
iconUrl = Href("../../Content/Images/imagePlaceholder.png");
|
||||||
|
extensionClass = "screenshotThumbnail";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<img src="@iconUrl" class="thumbnail" />
|
|
||||||
|
|
||||||
<div class="extensionDetails">
|
<div class="@extensionClass">
|
||||||
<div class="extensionName">
|
<div class="extensionDetails column">
|
||||||
<h2>@item.Title<span> - @T("Version: {0}", item.Version)</span></h2>
|
<div class="extensionName">
|
||||||
|
<h2>@item.Title<span> - @T("Version: {0}", item.Version)</span></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="related">
|
||||||
|
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"packageId", item.PackageId}, {"version", item.Version}, {"sourceId", item.Source.Id}, {"redirectTo", "Themes"}})@T(" | ")
|
||||||
|
<a href="@item.PackageStreamUri">@T("Download")</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="properties">
|
||||||
|
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
||||||
|
<ul class="pageStatus">
|
||||||
|
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
||||||
|
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
||||||
|
<li> | @T("Rating: {0}", item.Rating)</li>
|
||||||
|
<li> | @T("Ratings Count: {0}", item.RatingsCount)</li>
|
||||||
|
<li> | @T("Website: ")
|
||||||
|
@if(!string.IsNullOrEmpty(item.ProjectUrl)) { <a href="@item.ProjectUrl">@item.ProjectUrl</a> }
|
||||||
|
else { @T("Unknown").ToString() }
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="related">
|
<div class="extensionThumbnail column">
|
||||||
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"packageId", item.PackageId}, {"version", item.Version}, {"sourceId", item.Source.Id}, {"redirectTo", "Themes"}})@T(" | ")
|
<img src="@iconUrl" class="thumbnail" alt="theme" />
|
||||||
<a href="@item.PackageStreamUri">@T("Download")</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="properties">
|
|
||||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
|
||||||
<ul class="pageStatus">
|
|
||||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
|
||||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
|
||||||
<li> | @T("Rating: {0}", item.Rating)</li>
|
|
||||||
<li> | @T("Ratings Count: {0}", item.RatingsCount)</li>
|
|
||||||
<li> | @T("Website: ")
|
|
||||||
@if(!string.IsNullOrEmpty(item.ProjectUrl)) { <a href="@item.ProjectUrl">@item.ProjectUrl</a> }
|
|
||||||
else { @T("Unknown").ToString() }
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>}
|
</li>}
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
Name: Setup
|
Name: Setup
|
||||||
AntiForgery: enabled
|
|
||||||
Author: The Orchard Team
|
Author: The Orchard Team
|
||||||
Website: http://orchardproject.net
|
Website: http://orchardproject.net
|
||||||
Version: 0.9.0
|
Version: 0.9.0
|
||||||
|
@@ -45,7 +45,7 @@ namespace Orchard.Users.Controllers {
|
|||||||
if (currentUser == null) {
|
if (currentUser == null) {
|
||||||
Logger.Information("Access denied to anonymous request on {0}", returnUrl);
|
Logger.Information("Access denied to anonymous request on {0}", returnUrl);
|
||||||
var shape = _orchardServices.New.LogOn().Title(T("Access Denied").Text);
|
var shape = _orchardServices.New.LogOn().Title(T("Access Denied").Text);
|
||||||
return new ShapeResult(shape);
|
return new ShapeResult(this, shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: (erikpo) Add a setting for whether or not to log access denieds since these can fill up a database pretty fast from bots on a high traffic site
|
//TODO: (erikpo) Add a setting for whether or not to log access denieds since these can fill up a database pretty fast from bots on a high traffic site
|
||||||
@@ -59,7 +59,7 @@ namespace Orchard.Users.Controllers {
|
|||||||
return Redirect("~/");
|
return Redirect("~/");
|
||||||
|
|
||||||
var shape = _orchardServices.New.LogOn().Title(T("Log On").Text);
|
var shape = _orchardServices.New.LogOn().Title(T("Log On").Text);
|
||||||
return new ShapeResult(shape);
|
return new ShapeResult(this, shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -69,7 +69,7 @@ namespace Orchard.Users.Controllers {
|
|||||||
var user = ValidateLogOn(userNameOrEmail, password);
|
var user = ValidateLogOn(userNameOrEmail, password);
|
||||||
if (!ModelState.IsValid) {
|
if (!ModelState.IsValid) {
|
||||||
var shape = _orchardServices.New.LogOn().Title(T("Log On").Text);
|
var shape = _orchardServices.New.LogOn().Title(T("Log On").Text);
|
||||||
return new ShapeResult(shape);
|
return new ShapeResult(this, shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
_authenticationService.SignIn(user, false);
|
_authenticationService.SignIn(user, false);
|
||||||
|
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
namespace Orchard.Mvc {
|
namespace Orchard.Mvc {
|
||||||
public class ShapeResult : ViewResult {
|
public class ShapeResult : ViewResult {
|
||||||
public ShapeResult(dynamic shape) {
|
public ShapeResult(ControllerBase controller, dynamic shape) {
|
||||||
|
ViewData = controller.ViewData;
|
||||||
|
TempData = controller.TempData;
|
||||||
ViewData.Model = shape;
|
ViewData.Model = shape;
|
||||||
ViewName = "~/Core/Shapes/Views/ShapeResult/Display.cshtml";
|
ViewName = "~/Core/Shapes/Views/ShapeResult/Display.cshtml";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user