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