Compare commits

..

10 Commits

701 changed files with 4930 additions and 7216 deletions

3
.gitignore vendored
View File

@@ -68,9 +68,6 @@ ipch/
_ReSharper*/
*.[Rr]e[Ss]harper
# CodeRush is a .NET coding add-in
.cr*/
# TeamCity is a build add-in
_TeamCity*

View File

@@ -23,14 +23,13 @@ echo "Unable to detect suitable environment. Build may not succeed."
SET target=%1
SET project=%2
SET solution=%3
IF "%target%" == "" SET target=Build
IF "%project%" == "" SET project=Orchard.proj
IF "%solution%" == "" SET solution=src\Orchard.sln
IF "%project%" =="" SET project=Orchard.proj
lib\nuget\nuget.exe restore %solution%
lib\nuget\nuget.exe restore .\src\Orchard.sln
msbuild /t:%target% %project% /p:Solution=%solution% /m
msbuild /t:%target% %project%
pause
pause

View File

@@ -28,14 +28,11 @@
<BuildPlatform Condition="$(ProgramW6432) != ''">x64</BuildPlatform>
<BuildPlatform Condition="$(BuildPlatform) == ''">x86</BuildPlatform>
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
<OrchardSolution>$(SrcFolder)\Orchard.sln</OrchardSolution>
<Solution Condition="$(Solution) == ''">$(OrchardSolution)</Solution>
<!-- TeamCity build number -->
<Version>$(BUILD_NUMBER)</Version>
</PropertyGroup>
<!-- Finding the restored NuGet package of NUnit (version number doesn't matter)
to be able to reference the test runner executable (http://stackoverflow.com/a/25617556). -->
<ItemGroup>
@@ -48,11 +45,11 @@
<!-- Coordinating Targets -->
<Target Name="Build">
<Target Name ="Build">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Test"/>
<CallTarget Targets="Package"/>
<CallTarget Targets="Package"/>
</Target>
<Target Name="FastBuild">
@@ -106,7 +103,7 @@
<!-- Building -->
<Target Name="Clean">
<MSBuild Projects="$(Solution)" Targets="Clean" />
<MSBuild Projects="$(SrcFolder)\Orchard.sln" Targets="Clean" />
<RemoveDir Directories="$(BuildFolder)" ContinueOnError="true"/>
<RemoveDir Directories="$(ArtifactsFolder)" />
</Target>
@@ -114,16 +111,16 @@
<Target Name="Compile">
<!-- Compile to "OutputFolder" -->
<MSBuild
Projects="$(Solution)"
Projects="$(SrcFolder)\Orchard.sln"
Targets="Build"
Properties="Configuration=$(Configuration);OutputPath=$(CompileFolder)" />
<!-- Compile to "regular" output folder for devs using VS locally -->
<MSBuild
Projects="$(Solution)"
Projects="$(SrcFolder)\Orchard.sln"
Targets="Build"/>
</Target>
<Target Name="CompileMsBuildTasks">
<Target Name ="CompileMsBuildTasks">
<MSBuild
Projects="$(SrcFolder)\Tools\MSBuild.Orchard.Tasks\MSBuild.Orchard.Tasks.csproj"
Targets="Build"
@@ -132,25 +129,27 @@
<!-- Testing -->
<Target Name="Test">
<Target Name ="Test">
<!-- TeamCity support -->
<ItemGroup>
<NUnitAddinFiles Include="$(teamcity_dotnet_nunitaddin)-2.5.2.*" />
</ItemGroup>
<Copy SourceFiles="@(NUnitAddinFiles)" DestinationFolder="$(NUnitPackageToolsFolder)\addins" />
<!-- Run unit test assemblies -->
<CreateItem Include="$(CompileFolder)\*.Tests.*dll" Exclude="$(CompileFolder)\Orchard.Azure.Tests.dll">
<CreateItem Include="$(CompileFolder)\*.Tests.*dll">
<Output TaskParameter="Include" ItemName="TestAssemblies" />
</CreateItem>
<NUnit Assemblies="@(TestAssemblies)" ToolPath="@(NUnitPackageToolsFolder)" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Tests.xml" ExcludeCategory="longrunning" />
</Target>
<Target Name="TestAzure">
<!-- Run unit test assemblies -->
<CreateItem Include="$(CompileFolder)\Orchard.Azure.Tests.dll">
<Output TaskParameter="Include" ItemName="TestAssemblies" />
</CreateItem>
<NUnit Assemblies="@(TestAssemblies)" ToolPath="@(NUnitPackageToolsFolder)" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Tests.xml" ExcludeCategory="longrunning" />
</Target>
<Target Name="Spec" DependsOnTargets="Package-Stage">
<Target Name ="Spec" DependsOnTargets="Package-Stage">
<!-- TeamCity support -->
<ItemGroup>
<NUnitAddinFiles Include="$(teamcity_dotnet_nunitaddin)-2.5.2.*" />
</ItemGroup>
<Copy SourceFiles="@(NUnitAddinFiles)" DestinationFolder="$(NUnitPackageToolsFolder)\addins" />
<CreateItem Include="$(CompileFolder)\*.Specs.dll">
<Output TaskParameter="Include" ItemName="SpecAssemblies" />
@@ -282,6 +281,7 @@
<!-- Packaging (MsDeploy) -->
<Target Name="Package-MsDeploy">
<ItemGroup>
<!--<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.pdb;$(StageFolder)\**\bin\**\*.xml" />-->
<MsDeploy-Exclude-Modules Include="
$(StageFolder)\**\Modules\Orchard.CustomForms\**;
@@ -292,7 +292,7 @@
$(StageFolder)\**\Modules\Orchard.TaskLease\**;
" />
<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml;$(StageFolder)\**\obj\**\*;$(StageFolder)\**\bin\**\*.pdb;$(StageFolder)\**\bin\**\*.dll.config;@(MsDeploy-Exclude-Modules)" />
<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml;$(StageFolder)\**\obj\**\*;@(MsDeploy-Exclude-Modules)" />
<MsDeploy-Parameters Include="$(LibFolder)\msdeploy\*.xml;$(LibFolder)\msdeploy\*.sql"/>
</ItemGroup>
@@ -331,12 +331,11 @@
$(MSBuildProjectDirectory)\**\*.user;
$(MSBuildProjectDirectory)\**\*.patch;
$(MSBuildProjectDirectory)\**\*.hgignore;
$(MSBuildProjectDirectory)\**\*.hg*\**\*;
$(LibFolder)\nunit\addins\**\*;" />
$(MSBuildProjectDirectory)\**\*.hg*\**\*;" />
<Zip-Stage Include="$(StageFolder)\**\*" />
<Zip-MsDeploy Include="$(MsDeployFolder)\**\*" Exclude=""/>
<Zip-MsDeploy Include="$(MsDeployFolder)\**\*" Exclude="$(MSBuildProjectDirectory)\**\bin\**\*.pdb;" />
<Zip-Source Include="
$(MSBuildProjectDirectory)\lib\**\*;

View File

@@ -6,7 +6,7 @@ Orchard is a free, open source, community-focused Content Management System buil
You can try it for free on [DotNest.com](https://dotnest.com) or on Microsoft Azure by clicking on this button.
[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/OutercurveFoundation.OrchardCMS)
[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/OutercurveFoundation.OrchardCMS.1.0.4)
## About The Orchard Project
@@ -16,19 +16,17 @@ Orchard is a free, open source, community-focused **Content Management System**
Orchard is built on a modern architecture that puts extensibility up-front, as its number one concern. All components in Orchard can be replaced or extended. Content is built from easily composable building blocks. Modules extend the system in a very decoupled fashion, where a commenting module for example can as easily apply to pages, blog posts, photos or products. A rich UI composition system completes the picture and ensures that you can get the exact presentation that you need for your content.
Orchard is delivered under the [.NET Foundation](https://dotnetfoundation.org/orchard-cms). It is licensed under a [New BSD license](http://www.opensource.org/licenses/bsd-license.php), which is approved by the OSI.
Orchard is delivered under the [.NET Foundation](http://www.dotnetfoundation.org/orchard). It is licensed under a [New BSD license](http://www.opensource.org/licenses/bsd-license.php), which is approved by the OSI.
Our mission is to empower our users and foster a dedicated and diverse community that builds the CMS that we all want to use.
## Project Status
Orchard is currently in version **[1.10.1](https://github.com/OrchardCMS/Orchard/releases/tag/1.10.1)**: It contains bugfixes and the more impactful changes and new features added in the latest major version (*1.10*).
We invite participation by the developer community in shaping the projects direction, so that we can publicly validate our designs and development approach.
All our releases are available on our [Releases](https://github.com/OrchardCMS/Orchard/releases) page, and it's easy to [Install Orchard using the Web Platform Installer](http://docs.orchardproject.net/Documentation/Installing-Orchard) as well. We encourage interested developers to check out the source code on the Orchard GitHub site and get involved with the project.
Orchard is currently in version 1.9.2. We invite participation by the developer community in shaping the projects direction, so that we can publicly validate our designs and development approach.
Our 1.9.2 release is available from our Downloads page, and is easy to [Install Orchard using the Web Platform Installer](http://docs.orchardproject.net/Documentation/Installing-Orchard). We encourage interested developers to check out the source code on the Orchard Github site and get involved with the project.
* [Download the latest release](https://github.com/OrchardCMS/Orchard/releases)
* [Feature roadmap](http://docs.orchardproject.net/Documentation/Feature-roadmap)
* [Feature roadmap](http://docs.orchardproject.net/Documentation/feature-roadmap)
* [Docs and designs/specs](http://www.orchardproject.net/docs)
* [About us](http://www.orchardproject.net/about)
* [Contact us](mailto:ofeedbk@microsoft.com)
@@ -47,10 +45,10 @@ There are many ways you can [contribute to Orchard](http://orchardproject.net/co
* [Participate in our gitter.im chatroom](https://gitter.im/OrchardCMS/Orchard)
* [Participate in forum discussions](http://orchard.codeplex.com/discussions)
* [Submit a pull request](http://docs.orchardproject.net/Documentation/Contributing-patches)
* [Translate Orchard](http://orchardproject.net/localization)
* [Translate Orchard](http://orchardproject.net/localize)
* [Contribute modules and themes to our gallery](http://gallery.orchardproject.net/)
* [Send us feedback](mailto:ofeedbk@microsoft.com)
## The Future Of Orchard CMS: Orchard 2
As the underlying frameworks (.NET, ASP.NET and ASP.NET MVC) are constantly evolving, Orchard of course keeps track of the changes and improvements of these: Orchard 2 is the next generation of Orchard releases that is based on [ASP.NET Core](http://www.asp.net/core). Just like the current Orchard project, it's fully [open-source and is publicly available on GitHub](https://github.com/OrchardCMS/Orchard2). Orchard 2 (as a framework) is being built from scratch: it's still in development and does not share any of its code base (at least directly) with the current versions of Orchard.
As the underlying frameworks (.NET, ASP.NET and ASP.NET MVC) are constantly evolving, Orchard of course keeps track of the changes and improvements of these: Orchard 2 is the next generation of Orchard releases that is based on [ASP.NET vNext](http://www.asp.net/vnext). Just like the current Orchard project, it's fully [open-source and is publicly available on GitHub](https://github.com/OrchardCMS/Orchard2). Orchard 2 (as a framework) is being built from scratch: it's still in development and does not share any of its code base (at least directly) with the current versions of Orchard.

View File

@@ -68,11 +68,13 @@ IF NOT DEFINED MSBUILD_PATH (
echo Handling .NET Web Application deployment.
:: 1. Restore NuGet packages
call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\src\Orchard.sln"
IF !ERRORLEVEL! NEQ 0 goto error
IF /I "" NEQ "" (
call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\"
IF !ERRORLEVEL! NEQ 0 goto error
)
:: 2. Build to the temporary path
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /t:Precompiled /v:m /m
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /t:Precompiled /v:m
IF !ERRORLEVEL! NEQ 0 goto error
:: 3. KuduSync

View File

@@ -10,10 +10,7 @@ var fs = require("fs"),
plumber = require("gulp-plumber"),
sourcemaps = require("gulp-sourcemaps"),
less = require("gulp-less"),
sass = require("gulp-sass"),
postcss = require("gulp-postcss"),
autoprefixer = require("autoprefixer"),
cssnano = require("cssnano"),
cssnano = require("gulp-cssnano"),
typescript = require("gulp-typescript"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
@@ -134,16 +131,12 @@ function createAssetGroupTask(assetGroup, doRebuild) {
function buildCssPipeline(assetGroup, doConcat, doRebuild) {
assetGroup.inputPaths.forEach(function (inputPath) {
var ext = path.extname(inputPath).toLowerCase();
if (ext !== ".less" && ext !== ".scss" && ext !== ".css")
if (ext !== ".less" && ext !== ".css")
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
});
var generateSourceMaps = assetGroup.hasOwnProperty("generateSourceMaps") ? assetGroup.generateSourceMaps : true;
var containsLessOrScss = assetGroup.inputPaths.some(function (inputPath) {
var ext = path.extname(inputPath).toLowerCase();
return ext === ".less" || ext === ".scss";
});
// Source maps are useless if neither concatenating nor transforming.
if ((!doConcat || assetGroup.inputPaths.length < 2) && !containsLessOrScss)
if ((!doConcat || assetGroup.inputPaths.length < 2) && !assetGroup.inputPaths.some(function (inputPath) { return path.extname(inputPath).toLowerCase() === ".less"; }))
generateSourceMaps = false;
var minifiedStream = gulp.src(assetGroup.inputPaths) // Minified output, source mapping completely disabled.
.pipe(gulpif(!doRebuild,
@@ -155,26 +148,21 @@ function buildCssPipeline(assetGroup, doConcat, doRebuild) {
}))))
.pipe(plumber())
.pipe(gulpif("*.less", less()))
.pipe(gulpif("*.scss", sass({
precision: 10
})))
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
.pipe(postcss([
autoprefixer({ browsers: ["last 2 versions"] }),
cssnano({
discardComments: { removeAll: true },
discardUnused: false,
mergeIdents: false,
reduceIdents: false,
zindex: false
})
]))
.pipe(cssnano({
autoprefixer: { browsers: ["last 2 versions"] },
discardComments: { removeAll: true },
discardUnused: false,
mergeIdents: false,
reduceIdents: false,
zindex: false
}))
.pipe(rename({
suffix: ".min"
}))
.pipe(eol())
.pipe(gulp.dest(assetGroup.outputDir));
var devStream = gulp.src(assetGroup.inputPaths) // Non-minified output, with source mapping.
var devStream = gulp.src(assetGroup.inputPaths) // Non-minified output, with source mapping
.pipe(gulpif(!doRebuild,
gulpif(doConcat,
newer(assetGroup.outputPath),
@@ -185,13 +173,7 @@ function buildCssPipeline(assetGroup, doConcat, doRebuild) {
.pipe(plumber())
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
.pipe(gulpif("*.less", less()))
.pipe(gulpif("*.scss", sass({
precision: 10
})))
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
.pipe(postcss([
autoprefixer({ browsers: ["last 2 versions"] })
]))
.pipe(header(
"/*\n" +
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +

View File

@@ -34,7 +34,7 @@ namespace Orchard.Azure.Tests.FileSystems.Media {
[ExpectedException(typeof(ArgumentException))]
public void GetFileShouldOnlyAcceptRelativePath() {
_azureBlobStorageProvider.CreateFile("foo.txt");
_azureBlobStorageProvider.GetFile("/foo.txt");
_azureBlobStorageProvider.GetFile("/foot.txt");
}
[Test]
@@ -291,7 +291,7 @@ namespace Orchard.Azure.Tests.FileSystems.Media {
[Test]
public void GetStoragePathShouldReturnNullIfPathIsNotLocal()
{
var storagePath = _azureBlobStorageProvider.GetStoragePath("http://orchardproject.net/foo");
var storagePath = _azureBlobStorageProvider.GetStoragePath("foo");
Assert.IsNull(storagePath);
}

View File

@@ -91,14 +91,6 @@
<HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.mocks, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="pnunit.framework, Version=1.0.4109.34242, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core">

View File

@@ -6,7 +6,7 @@
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net452" />
<package id="Moq" version="4.2.1510.2205" targetFramework="net452" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
<package id="NUnit" version="2.5.10.11092" targetFramework="net452" />
<package id="System.Spatial" version="5.6.4" targetFramework="net452" />
<package id="WindowsAzure.Storage" version="5.0.2" targetFramework="net452" />
<package id="NUnit" version="2.5.10.11092" targetFramework="net452" />
</packages>

View File

@@ -61,8 +61,8 @@
<HintPath>..\packages\Autofac.3.5.2\lib\net40\Autofac.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
<Reference Include="FluentNHibernate, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
<HintPath>..\packages\FluentNHibernate.1.4.0.0\lib\net35\FluentNHibernate.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">

View File

@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10")]
[assembly: AssemblyFileVersion("1.10")]

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autofac" version="3.5.2" targetFramework="net452" />
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net452" />
<package id="FluentNHibernate" version="1.4.0.0" targetFramework="net452" />
<package id="Iesi.Collections" version="4.0.1.4000" targetFramework="net452" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />

View File

@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10")]
[assembly: AssemblyFileVersion("1.10")]

View File

@@ -24,7 +24,7 @@ namespace Orchard.Specs.Bindings {
webApp.GivenIHaveACleanSiteWith(
virtualDirectory,
TableData(
new { extension = "Module", names = "Lucene, Markdown, Orchard.Alias, Orchard.AntiSpam, Orchard.ArchiveLater, Orchard.Autoroute, Orchard.Azure, Orchard.Blogs, Orchard.Caching, Orchard.CodeGeneration, Orchard.Comments, Orchard.ContentPermissions, Orchard.ContentPicker, Orchard.ContentTypes, Orchard.DesignerTools, Orchard.Email, Orchard.Fields, Orchard.Forms, Orchard.ImageEditor, Orchard.ImportExport, Orchard.Indexing, Orchard.JobsQueue, Orchard.Resources, Orchard.Layouts, Orchard.Lists, Orchard.Localization, Orchard.MediaLibrary, Orchard.MediaProcessing, Orchard.Migrations, Orchard.Modules, Orchard.MultiTenancy, Orchard.OutputCache, Orchard.Packaging, Orchard.Pages, Orchard.Projections, Orchard.PublishLater, Orchard.Recipes, Orchard.Roles, Orchard.Scripting, Orchard.Scripting.CSharp, Orchard.Scripting.Dlr, Orchard.Search, Orchard.SecureSocketsLayer, Orchard.Setup, Orchard.Tags, Orchard.Taxonomies, Orchard.Templates, Orchard.Themes, Orchard.Tokens, Orchard.Users, Orchard.Warmup, Orchard.Widgets, Orchard.Workflows, Orchard.Conditions, SysCache, TinyMce, Upgrade" },
new { extension = "Module", names = "Lucene, Markdown, Orchard.Alias, Orchard.AntiSpam, Orchard.ArchiveLater, Orchard.Autoroute, Orchard.Azure, Orchard.Blogs, Orchard.Caching, Orchard.CodeGeneration, Orchard.Comments, Orchard.ContentPermissions, Orchard.ContentPicker, Orchard.ContentTypes, Orchard.CustomForms, Orchard.DesignerTools, Orchard.Email, Orchard.Fields, Orchard.Forms, Orchard.ImageEditor, Orchard.ImportExport, Orchard.Indexing, Orchard.JobsQueue, Orchard.Resources, Orchard.Layouts, Orchard.Lists, Orchard.Localization, Orchard.Media, Orchard.MediaLibrary, Orchard.MediaPicker, Orchard.MediaProcessing, Orchard.Migrations, Orchard.Modules, Orchard.MultiTenancy, Orchard.OutputCache, Orchard.Packaging, Orchard.Pages, Orchard.Projections, Orchard.PublishLater, Orchard.Recipes, Orchard.Roles, Orchard.Rules, Orchard.Scripting, Orchard.Scripting.CSharp, Orchard.Scripting.Dlr, Orchard.Search, Orchard.SecureSocketsLayer, Orchard.Setup, Orchard.Tags, Orchard.TaskLease, Orchard.Taxonomies, Orchard.Templates, Orchard.Themes, Orchard.Tokens, Orchard.Users, Orchard.Warmup, Orchard.Widgets, Orchard.Workflows, Orchard.Conditions, SysCache, TinyMce, Upgrade" },
new { extension = "Core", names = "Common, Containers, Contents, Dashboard, Feeds, Navigation, Scheduling, Settings, Shapes, Title, XmlRpc" },
new { extension = "Theme", names = "SafeMode, TheAdmin, TheThemeMachine" }));

View File

@@ -53,7 +53,7 @@ Scenario: Creating and using Boolean fields
And I go to "Admin/Contents/Create/Event"
Then I should see "Check if the event is active"
# The default value should be proposed on creation
# The default value should be selected
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
@@ -65,12 +65,18 @@ Scenario: Creating and using Boolean fields
# The value should be required
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].BooleanFieldSettings.Optional | false |
| name | value |
| Fields[0].BooleanFieldSettings.Optional | false |
And I fill in
| name | value |
| Fields[0].BooleanFieldSettings.NotSetLabel | May be |
And I fill in
| name | value |
| Fields[0].BooleanFieldSettings.SelectionMode | Radiobutton |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
And I fill in
| name | value |
| Event.Active.Value | |
And I hit "Save"
Then I should see "The Active field is required."
Then I should see "The field Active is mandatory."

View File

@@ -195,23 +195,41 @@ this.ScenarioSetup(scenarioInfo);
"false"});
#line 67
testRunner.And("I fill in", ((string)(null)), table6, "And ");
#line 70
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 71
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table7.AddRow(new string[] {
"Fields[0].BooleanFieldSettings.NotSetLabel",
"May be"});
#line 70
testRunner.And("I fill in", ((string)(null)), table7, "And ");
#line hidden
TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table8.AddRow(new string[] {
"Fields[0].BooleanFieldSettings.SelectionMode",
"Radiobutton"});
#line 73
testRunner.And("I fill in", ((string)(null)), table8, "And ");
#line 76
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 77
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table9.AddRow(new string[] {
"Event.Active.Value",
""});
#line 72
testRunner.And("I fill in", ((string)(null)), table7, "And ");
#line 75
#line 78
testRunner.And("I fill in", ((string)(null)), table9, "And ");
#line 81
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 76
testRunner.Then("I should see \"The Active field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 82
testRunner.Then("I should see \"The field Active is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}

View File

@@ -89,9 +89,9 @@ Scenario: Creating and using Date fields
# Required & Date and Time
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].DateTimeFieldSettings.Display | DateAndTime |
| Fields[0].DateTimeFieldSettings.Required | true |
| name | value |
| Fields[0].DateTimeFieldSettings.Display | DateAndTime |
| Fields[0].DateTimeFieldSettings.Required | true |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "Event.EventDate.Editor.Date"
@@ -139,23 +139,6 @@ Scenario: Creating and using Date fields
When I hit "Save"
Then I should see "Date of the event is required."
# The default value should be proposed on creation
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].DateTimeFieldSettings.Display | DateAndTime |
| Fields[0].DateTimeFieldSettings.Editor.Date | 01/31/2016 |
| Fields[0].DateTimeFieldSettings.Editor.Time | 10:00 AM |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "Event.EventDate.Editor.Date"
When I hit "Save"
And I am redirected
Then I should see "Your Event has been created."
When I go to "Admin/Contents/List"
Then I should see "Date of the event"
And I should see "1/31/2016 10:00"
Scenario: Creating and using date time fields in another culture
# Creating an Event content type
@@ -207,4 +190,4 @@ Scenario: Creating and using date time fields in another culture
| Event.EventDate.Editor.Time | 18:00 |
And I hit "Save"
And I am redirected
Then I should see "Your Event has been created."
Then I should see "Your Event has been created."

View File

@@ -350,41 +350,6 @@ this.ScenarioSetup(scenarioInfo);
testRunner.When("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 140
testRunner.Then("I should see \"Date of the event is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 143
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table15.AddRow(new string[] {
"Fields[0].DateTimeFieldSettings.Display",
"DateAndTime"});
table15.AddRow(new string[] {
"Fields[0].DateTimeFieldSettings.Editor.Date",
"01/31/2016"});
table15.AddRow(new string[] {
"Fields[0].DateTimeFieldSettings.Editor.Time",
"10:00 AM"});
#line 144
testRunner.And("I fill in", ((string)(null)), table15, "And ");
#line 149
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 150
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 151
testRunner.Then("I should see \"Event.EventDate.Editor.Date\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 152
testRunner.When("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 153
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 154
testRunner.Then("I should see \"Your Event has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 155
testRunner.When("I go to \"Admin/Contents/List\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 156
testRunner.Then("I should see \"Date of the event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 157
testRunner.And("I should see \"1/31/2016 10:00\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
this.ScenarioCleanup();
}
@@ -394,83 +359,101 @@ this.ScenarioSetup(scenarioInfo);
public virtual void CreatingAndUsingDateTimeFieldsInAnotherCulture()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Creating and using date time fields in another culture", ((string[])(null)));
#line 159
#line 142
this.ScenarioSetup(scenarioInfo);
#line 162
#line 145
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 163
#line 146
testRunner.And("I have installed \"Orchard.Fields\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 164
#line 147
testRunner.And("I have the file \"Content\\orchard.core.po\" in \"Core\\App_Data\\Localization\\fr-FR\\or" +
"chard.core.po\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 165
#line 148
testRunner.When("I go to \"Admin/ContentTypes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 166
#line 149
testRunner.Then("I should see \"<a[^>]*>.*?Create new type</a>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 167
#line 150
testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table15.AddRow(new string[] {
"DisplayName",
"Event"});
table15.AddRow(new string[] {
"Name",
"Event"});
#line 151
testRunner.And("I fill in", ((string)(null)), table15, "And ");
#line 155
testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 156
testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 157
testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 160
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 161
testRunner.And("I follow \"Add Field\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table16.AddRow(new string[] {
"DisplayName",
"Event"});
"Date of the event"});
table16.AddRow(new string[] {
"Name",
"Event"});
#line 168
"EventDate"});
table16.AddRow(new string[] {
"FieldTypeName",
"DateTimeField"});
#line 162
testRunner.And("I fill in", ((string)(null)), table16, "And ");
#line 167
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 168
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 169
testRunner.Then("I should see \"The \\\"Date of the event\\\" field has been added.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 172
testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
testRunner.When("I have \"fr-FR\" as the default culture", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 173
testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 174
testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 177
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 178
testRunner.And("I follow \"Add Field\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
testRunner.And("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table17.AddRow(new string[] {
"DisplayName",
"Date of the event"});
"Fields[0].DateTimeFieldSettings.Display",
"DateAndTime"});
table17.AddRow(new string[] {
"Name",
"EventDate"});
table17.AddRow(new string[] {
"FieldTypeName",
"DateTimeField"});
#line 179
"Fields[0].DateTimeFieldSettings.Required",
"true"});
#line 174
testRunner.And("I fill in", ((string)(null)), table17, "And ");
#line 184
#line 178
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 185
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 186
testRunner.Then("I should see \"The \\\"Date of the event\\\" field has been added.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 189
testRunner.When("I have \"fr-FR\" as the default culture", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 190
testRunner.And("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 179
testRunner.When("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table18.AddRow(new string[] {
"Fields[0].DateTimeFieldSettings.Display",
"DateAndTime"});
"Event.EventDate.Editor.Date",
"01/31/2012"});
table18.AddRow(new string[] {
"Fields[0].DateTimeFieldSettings.Required",
"true"});
#line 191
"Event.EventDate.Editor.Time",
"12:00 AM"});
#line 180
testRunner.And("I fill in", ((string)(null)), table18, "And ");
#line 195
#line 184
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 196
#line 185
testRunner.Then("I should see \"Date of the event could not be parsed as a valid date and time\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 186
testRunner.When("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] {
@@ -478,35 +461,17 @@ this.ScenarioSetup(scenarioInfo);
"value"});
table19.AddRow(new string[] {
"Event.EventDate.Editor.Date",
"01/31/2012"});
"31/01/2012"});
table19.AddRow(new string[] {
"Event.EventDate.Editor.Time",
"12:00 AM"});
#line 197
testRunner.And("I fill in", ((string)(null)), table19, "And ");
#line 201
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 202
testRunner.Then("I should see \"Date of the event could not be parsed as a valid date and time\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 203
testRunner.When("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table20.AddRow(new string[] {
"Event.EventDate.Editor.Date",
"31/01/2012"});
table20.AddRow(new string[] {
"Event.EventDate.Editor.Time",
"18:00"});
#line 204
testRunner.And("I fill in", ((string)(null)), table20, "And ");
#line 208
#line 187
testRunner.And("I fill in", ((string)(null)), table19, "And ");
#line 191
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 209
#line 192
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 210
#line 193
testRunner.Then("I should see \"Your Event has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();

View File

@@ -106,35 +106,4 @@ Scenario: Creating and using Enumeration fields
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
And I hit "Save"
Then I should see "The Location field is required."
# The default value should be proposed on creation
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].EnumerationFieldSettings.Options | Seattle |
| Fields[0].EnumerationFieldSettings.ListMode | Dropdown |
| Fields[0].EnumerationFieldSettings.DefaultValue | Seattle |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "selected=\"selected">Seattle"
# The required attribute should be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].EnumerationFieldSettings.Required | true |
| Fields[0].EnumerationFieldSettings.ListMode | Listbox |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "required=\"required\""
# The required attribute should not be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].EnumerationFieldSettings.Required | false |
| Fields[0].EnumerationFieldSettings.ListMode | Listbox |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should not see "required=\"required\""
Then I should see "The field Location is mandatory."

View File

@@ -272,70 +272,7 @@ this.ScenarioSetup(scenarioInfo);
#line 108
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 109
testRunner.Then("I should see \"The Location field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 112
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table11.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Options",
"Seattle"});
table11.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.ListMode",
"Dropdown"});
table11.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.DefaultValue",
"Seattle"});
#line 113
testRunner.And("I fill in", ((string)(null)), table11, "And ");
#line 118
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 119
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 120
testRunner.Then("I should see \"selected=\\\"selected\">Seattle\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 123
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table12.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Required",
"true"});
table12.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.ListMode",
"Listbox"});
#line 124
testRunner.And("I fill in", ((string)(null)), table12, "And ");
#line 128
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 129
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 130
testRunner.Then("I should see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 133
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table13.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Required",
"false"});
table13.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.ListMode",
"Listbox"});
#line 134
testRunner.And("I fill in", ((string)(null)), table13, "And ");
#line 138
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 139
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 140
testRunner.Then("I should not see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
testRunner.Then("I should see \"The field Location is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}

View File

@@ -13,8 +13,7 @@ namespace Orchard.Specs.Hosting {
}
public override IPersistenceConfigurer GetPersistenceConfigurer(bool createDatabase) {
var config = (MsSqlCeConfiguration)base.GetPersistenceConfigurer(createDatabase);
// Uncomment to display SQL while running tests
// config.ShowSql();
config.ShowSql();
return config;
}
}

View File

@@ -114,7 +114,7 @@ Scenario: Creating and using Input fields
| name | value |
| Event.Contact.Value | |
And I hit "Save"
Then I should see "The Contact field is required."
Then I should see "The field Contact is mandatory."
# Creating an Event content item
When I go to "Admin/Contents/Create/Event"
@@ -128,30 +128,3 @@ Scenario: Creating and using Input fields
When I go to "Admin/Contents/List"
Then I should see "Contact:"
And I should see "contact@orchardproject.net"
# The default value should be proposed on creation
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].InputFieldSettings.DefaultValue | contact@orchardproject.net |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "value=\"contact@orchardproject.net\""
# The required attribute should be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].InputFieldSettings.Required | true |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "required=\"required\""
# The required attribute should not be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].InputFieldSettings.Required | false |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should not see "required=\"required\""

View File

@@ -271,7 +271,7 @@ this.ScenarioSetup(scenarioInfo);
#line 116
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 117
testRunner.Then("I should see \"The Contact field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
testRunner.Then("I should see \"The field Contact is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 120
testRunner.When("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 121
@@ -297,57 +297,6 @@ this.ScenarioSetup(scenarioInfo);
testRunner.Then("I should see \"Contact:\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 130
testRunner.And("I should see \"contact@orchardproject.net\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 133
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table13.AddRow(new string[] {
"Fields[0].InputFieldSettings.DefaultValue",
"contact@orchardproject.net"});
#line 134
testRunner.And("I fill in", ((string)(null)), table13, "And ");
#line 137
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 138
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 139
testRunner.Then("I should see \"value=\\\"contact@orchardproject.net\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 142
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table14.AddRow(new string[] {
"Fields[0].InputFieldSettings.Required",
"true"});
#line 143
testRunner.And("I fill in", ((string)(null)), table14, "And ");
#line 146
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 147
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 148
testRunner.Then("I should see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 151
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table15.AddRow(new string[] {
"Fields[0].InputFieldSettings.Required",
"false"});
#line 152
testRunner.And("I fill in", ((string)(null)), table15, "And ");
#line 155
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 156
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 157
testRunner.Then("I should not see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}

View File

@@ -67,31 +67,4 @@ Scenario: Creating and using Link fields
| name | value |
| Event.SiteUrl.Value | |
And I hit "Save"
Then I should see "Url is required for Site Url."
# The default value should be proposed on creation
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].LinkFieldSettings.DefaultValue | http://www.orchardproject.net |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "value=\"http://www.orchardproject.net\""
# The required attribute should be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].LinkFieldSettings.Required | true |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "required=\"required\""
# The required attribute should not be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].LinkFieldSettings.Required | false |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should not see "required=\"required\""
Then I should see "Url is required for Site Url."

View File

@@ -204,57 +204,6 @@ this.ScenarioSetup(scenarioInfo);
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 70
testRunner.Then("I should see \"Url is required for Site Url.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 73
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table8.AddRow(new string[] {
"Fields[0].LinkFieldSettings.DefaultValue",
"http://www.orchardproject.net"});
#line 74
testRunner.And("I fill in", ((string)(null)), table8, "And ");
#line 77
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 78
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 79
testRunner.Then("I should see \"value=\\\"http://www.orchardproject.net\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 82
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table9.AddRow(new string[] {
"Fields[0].LinkFieldSettings.Required",
"true"});
#line 83
testRunner.And("I fill in", ((string)(null)), table9, "And ");
#line 86
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 87
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 88
testRunner.Then("I should see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 91
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table10.AddRow(new string[] {
"Fields[0].LinkFieldSettings.Required",
"false"});
#line 92
testRunner.And("I fill in", ((string)(null)), table10, "And ");
#line 95
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 96
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 97
testRunner.Then("I should not see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}

View File

@@ -63,7 +63,7 @@ Scenario: Creating and using media fields
| name | value |
| Event.File.Url | |
And I hit "Save"
Then I should see "The File field is required."
Then I should see "The field File is mandatory."
# The value should be bound
When I go to "Admin/ContentTypes/Edit/Event"
@@ -77,4 +77,4 @@ Scenario: Creating and using media fields
| name | value |
| Event.File.Url | ~/Media/Default/images/Image.png |
And I hit "Save"
Then I should see "The File field must have one of these extensions: jpg."
Then I should see "The field File must have one of these extensions: jpg"

View File

@@ -190,7 +190,7 @@ this.ScenarioSetup(scenarioInfo);
#line 65
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 66
testRunner.Then("I should see \"The File field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
testRunner.Then("I should see \"The field File is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 69
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
@@ -221,7 +221,7 @@ this.ScenarioSetup(scenarioInfo);
#line 79
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 80
testRunner.Then("I should see \"The File field must have one of these extensions: jpg.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
testRunner.Then("I should see \"The field File must have one of these extensions: jpg\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}

View File

@@ -25,7 +25,6 @@ Scenario: A new tenant is created
And I fill in
| name | value |
| Name | Scott |
| RequestUrlPrefix | scott |
And I hit "Save"
And I am redirected
Then I should see "<h3>Scott\s*</h3>"
@@ -38,7 +37,6 @@ Scenario: A new tenant is created with uninitialized state
And I fill in
| name | value |
| Name | Scott |
| RequestUrlPrefix | scott |
And I hit "Save"
And I am redirected
Then I should see "<li class="tenant Uninitialized">"
@@ -201,4 +199,4 @@ Scenario: Listing tenants from command line
And I have tenant "Alpha" on "example.org" as "New-site-name"
When I execute >tenant list
Then I should see "Name: Alpha"
And I should see "Request URL host: example.org"
And I should see "Request URL host: example.org"

View File

@@ -129,9 +129,6 @@ this.ScenarioSetup(scenarioInfo);
table1.AddRow(new string[] {
"Name",
"Scott"});
table1.AddRow(new string[] {
"RequestUrlPrefix",
"scott"});
#line 25
testRunner.And("I fill in", ((string)(null)), table1, "And ");
#line 28
@@ -166,9 +163,6 @@ this.ScenarioSetup(scenarioInfo);
table2.AddRow(new string[] {
"Name",
"Scott"});
table2.AddRow(new string[] {
"RequestUrlPrefix",
"scott"});
#line 37
testRunner.And("I fill in", ((string)(null)), table2, "And ");
#line 40

View File

@@ -64,7 +64,7 @@ Scenario: Creating and using numeric fields
| name | value |
| Event.Guests.Value | |
And I hit "Save"
Then I should see "The Guests field is required."
Then I should see "The field Guests is mandatory."
# The value should be bound
When I go to "Admin/ContentTypes/Edit/Event"
@@ -96,39 +96,4 @@ Scenario: Creating and using numeric fields
| Fields[0].NumericFieldSettings.Maximum | b |
And I hit "Save"
Then I should see "The value &#39;a&#39; is not valid for Minimum."
And I should see "The value &#39;b&#39; is not valid for Maximum."
# The value should be validated
When I go to "Admin/Contents/Create/Event"
And I fill in
| name | value |
| Event.Guests.Value | a |
And I hit "Save"
Then I should see "Guests is an invalid number"
# The default value should be proposed on creation
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].NumericFieldSettings.DefaultValue | 1234 |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "value=\"1234\""
# The required attribute should be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].NumericFieldSettings.Required | true |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "required=\"required\""
# The required attribute should not be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].NumericFieldSettings.Required | false |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should not see "required=\"required\""
And I should see "The value &#39;b&#39; is not valid for Maximum."

View File

@@ -194,7 +194,7 @@ this.ScenarioSetup(scenarioInfo);
#line 66
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 67
testRunner.Then("I should see \"The Guests field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
testRunner.Then("I should see \"The field Guests is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 70
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
@@ -265,72 +265,6 @@ this.ScenarioSetup(scenarioInfo);
testRunner.Then("I should see \"The value &#39;a&#39; is not valid for Minimum.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 99
testRunner.And("I should see \"The value &#39;b&#39; is not valid for Maximum.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 102
testRunner.When("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table11.AddRow(new string[] {
"Event.Guests.Value",
"a"});
#line 103
testRunner.And("I fill in", ((string)(null)), table11, "And ");
#line 106
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 107
testRunner.Then("I should see \"Guests is an invalid number\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 110
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table12.AddRow(new string[] {
"Fields[0].NumericFieldSettings.DefaultValue",
"1234"});
#line 111
testRunner.And("I fill in", ((string)(null)), table12, "And ");
#line 114
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 115
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 116
testRunner.Then("I should see \"value=\\\"1234\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 119
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table13.AddRow(new string[] {
"Fields[0].NumericFieldSettings.Required",
"true"});
#line 120
testRunner.And("I fill in", ((string)(null)), table13, "And ");
#line 123
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 124
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 125
testRunner.Then("I should see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 128
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table14.AddRow(new string[] {
"Fields[0].NumericFieldSettings.Required",
"false"});
#line 129
testRunner.And("I fill in", ((string)(null)), table14, "And ");
#line 132
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 133
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 134
testRunner.Then("I should not see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}

View File

@@ -65,8 +65,8 @@
<HintPath>..\packages\Castle.Core.3.3.1\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
<Reference Include="FluentNHibernate, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
<HintPath>..\packages\FluentNHibernate.1.4.0.0\lib\net35\FluentNHibernate.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentPath, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
@@ -205,11 +205,6 @@
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Text.feature.cs">
<DependentUpon>Text.feature</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Input.feature.cs">
<DependentUpon>Input.feature</DependentUpon>
<AutoGen>True</AutoGen>
@@ -376,10 +371,6 @@
<None Include="Hosting\Orchard.Web\Config\HostComponents.Release.config">
<DependentUpon>HostComponents.config</DependentUpon>
</None>
<None Include="Text.feature">
<Generator>SpecFlowSingleFileGenerator</Generator>
<LastGenOutput>Text.feature.cs</LastGenOutput>
</None>
<None Include="Input.feature">
<Generator>SpecFlowSingleFileGenerator</Generator>
<LastGenOutput>Input.feature.cs</LastGenOutput>

View File

@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10")]
[assembly: AssemblyFileVersion("1.10")]

View File

@@ -1,101 +0,0 @@
Feature: Text Field
In order to add Text content to my types
As an administrator
I want to create, edit and publish Text fields
Scenario: Creating and using Text fields
# Creating an Event content type
Given I have installed Orchard
And I have installed "Orchard.Fields"
When I go to "Admin/ContentTypes"
Then I should see "<a[^>]*>.*?Create new type</a>"
When I go to "Admin/ContentTypes/Create"
And I fill in
| name | value |
| DisplayName | Event |
| Name | Event |
And I hit "Create"
And I go to "Admin/ContentTypes/"
Then I should see "Event"
# Adding a Text field
When I go to "Admin/ContentTypes/Edit/Event"
And I follow "Add Field"
And I fill in
| name | value |
| DisplayName | Subject |
| Name | Subject |
| FieldTypeName | TextField |
And I hit "Save"
And I am redirected
Then I should see "The \"Subject\" field has been added."
# The display option should be effective
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].TextFieldSettingsEventsViewModel.Settings.Flavor | Large |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "class=\"text large\""
# The value should be required
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].TextFieldSettingsEventsViewModel.Settings.Required | true |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
And I fill in
| name | value |
| Event.Subject.Text | |
And I hit "Save"
Then I should see "The Subject field is required."
# The hint should be displayed
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].TextFieldSettingsEventsViewModel.Settings.Hint | Subject of the event |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "Subject of the event"
# Creating an Event content item
When I go to "Admin/Contents/Create/Event"
Then I should see "Subject"
When I fill in
| name | value |
| Event.Subject.Text | Orchard Harvest 2015 |
And I hit "Save"
And I am redirected
Then I should see "Your Event has been created."
And I should see "Orchard Harvest 2015"
# The default value should be proposed on creation
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].TextFieldSettingsEventsViewModel.Settings.DefaultValue | Orchard Harvest 2016 |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "value=\"Orchard Harvest 2016\""
# The required attribute should be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].TextFieldSettingsEventsViewModel.Settings.Required | true |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "required=\"required\""
# The required attribute should not be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].TextFieldSettingsEventsViewModel.Settings.Required | false |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should not see "required=\"required\""

View File

@@ -1,268 +0,0 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
namespace Orchard.Specs
{
using TechTalk.SpecFlow;
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Text Field")]
public partial class TextFieldFeature
{
private static TechTalk.SpecFlow.ITestRunner testRunner;
#line 1 "Text.feature"
#line hidden
[NUnit.Framework.TestFixtureSetUpAttribute()]
public virtual void FeatureSetup()
{
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Text Field", " In order to add Text content to my types\r\n As an administrator\r\n I want to cr" +
"eate, edit and publish Text fields", ProgrammingLanguage.CSharp, ((string[])(null)));
testRunner.OnFeatureStart(featureInfo);
}
[NUnit.Framework.TestFixtureTearDownAttribute()]
public virtual void FeatureTearDown()
{
testRunner.OnFeatureEnd();
testRunner = null;
}
[NUnit.Framework.SetUpAttribute()]
public virtual void TestInitialize()
{
}
[NUnit.Framework.TearDownAttribute()]
public virtual void ScenarioTearDown()
{
testRunner.OnScenarioEnd();
}
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
{
testRunner.OnScenarioStart(scenarioInfo);
}
public virtual void ScenarioCleanup()
{
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Creating and using Text fields")]
public virtual void CreatingAndUsingTextFields()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Creating and using Text fields", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line 9
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 10
testRunner.And("I have installed \"Orchard.Fields\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 11
testRunner.When("I go to \"Admin/ContentTypes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 12
testRunner.Then("I should see \"<a[^>]*>.*?Create new type</a>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 13
testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table1.AddRow(new string[] {
"DisplayName",
"Event"});
table1.AddRow(new string[] {
"Name",
"Event"});
#line 14
testRunner.And("I fill in", ((string)(null)), table1, "And ");
#line 18
testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 19
testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 20
testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 23
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 24
testRunner.And("I follow \"Add Field\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table2.AddRow(new string[] {
"DisplayName",
"Subject"});
table2.AddRow(new string[] {
"Name",
"Subject"});
table2.AddRow(new string[] {
"FieldTypeName",
"TextField"});
#line 25
testRunner.And("I fill in", ((string)(null)), table2, "And ");
#line 30
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 31
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 32
testRunner.Then("I should see \"The \\\"Subject\\\" field has been added.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 35
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table3.AddRow(new string[] {
"Fields[0].TextFieldSettingsEventsViewModel.Settings.Flavor",
"Large"});
#line 36
testRunner.And("I fill in", ((string)(null)), table3, "And ");
#line 39
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 40
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 41
testRunner.Then("I should see \"class=\\\"text large\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 44
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table4.AddRow(new string[] {
"Fields[0].TextFieldSettingsEventsViewModel.Settings.Required",
"true"});
#line 45
testRunner.And("I fill in", ((string)(null)), table4, "And ");
#line 48
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 49
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table5.AddRow(new string[] {
"Event.Subject.Text",
""});
#line 50
testRunner.And("I fill in", ((string)(null)), table5, "And ");
#line 53
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 54
testRunner.Then("I should see \"The Subject field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 57
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table6.AddRow(new string[] {
"Fields[0].TextFieldSettingsEventsViewModel.Settings.Hint",
"Subject of the event"});
#line 58
testRunner.And("I fill in", ((string)(null)), table6, "And ");
#line 61
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 62
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 63
testRunner.Then("I should see \"Subject of the event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 66
testRunner.When("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 67
testRunner.Then("I should see \"Subject\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table7.AddRow(new string[] {
"Event.Subject.Text",
"Orchard Harvest 2015"});
#line 68
testRunner.When("I fill in", ((string)(null)), table7, "When ");
#line 71
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 72
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 73
testRunner.Then("I should see \"Your Event has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 74
testRunner.And("I should see \"Orchard Harvest 2015\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 77
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table8.AddRow(new string[] {
"Fields[0].TextFieldSettingsEventsViewModel.Settings.DefaultValue",
"Orchard Harvest 2016"});
#line 78
testRunner.And("I fill in", ((string)(null)), table8, "And ");
#line 81
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 82
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 83
testRunner.Then("I should see \"value=\\\"Orchard Harvest 2016\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 86
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table9.AddRow(new string[] {
"Fields[0].TextFieldSettingsEventsViewModel.Settings.Required",
"true"});
#line 87
testRunner.And("I fill in", ((string)(null)), table9, "And ");
#line 90
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 91
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 92
testRunner.Then("I should see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 95
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table10.AddRow(new string[] {
"Fields[0].TextFieldSettingsEventsViewModel.Settings.Required",
"false"});
#line 96
testRunner.And("I fill in", ((string)(null)), table10, "And ");
#line 99
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 100
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 101
testRunner.Then("I should not see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}
}
}
#pragma warning restore
#endregion

View File

@@ -2,7 +2,7 @@
<packages>
<package id="Autofac" version="3.5.2" targetFramework="net452" />
<package id="Castle.Core" version="3.3.1" targetFramework="net452" />
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net452" />
<package id="FluentNHibernate" version="1.4.0.0" targetFramework="net452" />
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net452" />
<package id="Iesi.Collections" version="4.0.1.4000" targetFramework="net452" />
<package id="log4net" version="2.0.3" targetFramework="net452" />

View File

@@ -203,8 +203,6 @@ namespace Orchard.Tests.Modules.Comments.Services {
public class ProcessingEngineStub : IProcessingEngine {
public void Initialize() { }
public string AddTask(ShellSettings shellSettings, ShellDescriptor shellDescriptor, string messageName, Dictionary<string, object> parameters) {
return "";
}

View File

@@ -65,8 +65,8 @@
<HintPath>..\packages\Castle.Core.3.3.1\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
<Reference Include="FluentNHibernate, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
<HintPath>..\packages\FluentNHibernate.1.4.0.0\lib\net35\FluentNHibernate.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentPath, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">

View File

@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10")]
[assembly: AssemblyFileVersion("1.10")]

View File

@@ -205,8 +205,7 @@ namespace Orchard.Tests.Modules.Users.Controllers {
@"Ima.Fool@example.com",
@"""Ima.Fool""@example.com",
@"""Ima Fool""@example.com",
"2xxx1414@i.ua",
"Dreißig-öffentliche-Ämter-in-Übersee@Beispiel.de"
"2xxx1414@i.ua"
)]
string email)
{

View File

@@ -3,7 +3,7 @@
<package id="Autofac" version="3.5.2" targetFramework="net452" />
<package id="Castle.Core" version="3.3.1" targetFramework="net452" />
<package id="DotNetZip" version="1.9.1.8" targetFramework="net452" />
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net452" />
<package id="FluentNHibernate" version="1.4.0.0" targetFramework="net452" />
<package id="Iesi.Collections" version="4.0.1.4000" targetFramework="net452" />
<package id="IronRuby" version="1.1.3" targetFramework="net452" />
<package id="Lucene.Net" version="3.0.3" targetFramework="net452" />

View File

@@ -23,8 +23,7 @@ namespace Orchard.Tests {
// .Conventions.AddFromAssemblyOf<DataModule>();
var persistenceModel = AbstractDataServicesProvider.CreatePersistenceModel(types.Select(t => new RecordBlueprint { TableName = "Test_" + t.Name, Type = t }).ToList());
var persistenceConfigurer = new SqlCeDataServicesProvider(fileName).GetPersistenceConfigurer(true/*createDatabase*/);
// Uncomment to display SQL while running tests
// ((MsSqlCeConfiguration)persistenceConfigurer).ShowSql();
((MsSqlCeConfiguration)persistenceConfigurer).ShowSql();
return Fluently.Configure()
.Database(persistenceConfigurer)

View File

@@ -46,8 +46,7 @@ namespace Orchard.Tests {
var fileName = "temp.sdf";
var persistenceConfigurer = new SqlCeDataServicesProvider(fileName).GetPersistenceConfigurer(true/*createDatabase*/);
// Uncomment to display SQL while running tests
// ((MsSqlCeConfiguration)persistenceConfigurer).ShowSql();
((MsSqlCeConfiguration)persistenceConfigurer).ShowSql();
var sessionFactory = Fluently.Configure()
.Database(persistenceConfigurer)

View File

@@ -3,7 +3,6 @@ using Autofac;
using NUnit.Framework;
using Orchard.Localization.Models;
using Orchard.Localization.Services;
using Orchard.Tests.Stubs;
namespace Orchard.Tests.Localization {
@@ -304,11 +303,10 @@ namespace Orchard.Tests.Localization {
}
[Test]
[Description("DST is ignored when date is ignored (non-DST date).")]
[Description("DST date and time are not properly round-tripped when date is ignored.")]
public void ConvertToLocalizedTimeStringTest03() {
var timeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
var clock = new StubClock(new DateTime(2012, 1, 1, 12, 0, 0, DateTimeKind.Utc));
var container = TestHelpers.InitializeContainer("en-US", null, timeZone, clock);
var container = TestHelpers.InitializeContainer("en-US", null, timeZone);
var target = container.Resolve<IDateLocalizationServices>();
var dateString = "3/10/2012";
@@ -320,27 +318,7 @@ namespace Orchard.Tests.Localization {
var timeString2 = target.ConvertToLocalizedTimeString(dateTimeUtc, new DateLocalizationOptions() { IgnoreDate = true });
Assert.AreEqual(dateString, dateString2);
Assert.AreEqual(timeString, timeString2);
}
[Test]
[Description("DST is ignored when date is ignored (DST date).")]
public void ConvertToLocalizedTimeStringTest04() {
var timeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
var clock = new StubClock(new DateTime(2012, 10, 3, 12, 0, 0, DateTimeKind.Utc));
var container = TestHelpers.InitializeContainer("en-US", null, timeZone, clock);
var target = container.Resolve<IDateLocalizationServices>();
var dateString = "3/10/2012";
var timeString = "12:00:00 PM";
var dateTimeUtc = target.ConvertFromLocalizedString(dateString, timeString);
var dateString2 = target.ConvertToLocalizedDateString(dateTimeUtc);
var timeString2 = target.ConvertToLocalizedTimeString(dateTimeUtc, new DateLocalizationOptions() { IgnoreDate = true });
Assert.AreEqual(dateString, dateString2);
Assert.AreEqual(timeString, timeString2);
Assert.AreNotEqual(timeString, timeString2);
}
/*

View File

@@ -39,21 +39,5 @@ namespace Orchard.Tests.Localization {
Assert.AreEqual("Foo \"{0}\"", translations["~/themes/mytheme/views/myview.cshtml|foo \"{0}\""]);
}
[Test]
public void ShouldHandleUnclosedQuote() {
var parser = new LocalizationStreamParser();
var text = new StringBuilder();
text.AppendLine("#: ~/Themes/MyTheme/Views/MyView.cshtml");
text.AppendLine("msgctxt \"");
text.AppendLine("msgid \"Foo \\\"{0}\\\"\"");
text.AppendLine("msgstr \"Foo \\\"{0}\\\"\"");
var translations = new Dictionary<string, string>();
parser.ParseLocalizationStream(text.ToString(), translations, false);
Assert.AreEqual("Foo \"{0}\"", translations["|foo \"{0}\""]);
}
}
}

View File

@@ -9,12 +9,9 @@ using Orchard.Tests.Stubs;
namespace Orchard.Tests.Localization {
internal class TestHelpers {
public static IContainer InitializeContainer(string cultureName, string calendarName, TimeZoneInfo timeZone, IClock clock = null) {
public static IContainer InitializeContainer(string cultureName, string calendarName, TimeZoneInfo timeZone) {
var builder = new ContainerBuilder();
if (clock != null)
builder.RegisterInstance(clock);
else
builder.RegisterType<StubClock>().As<IClock>();
builder.RegisterType<StubClock>().As<IClock>();
builder.RegisterInstance<WorkContext>(new StubWorkContext(cultureName, calendarName, timeZone));
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
builder.RegisterType<CultureDateTimeFormatProvider>().As<IDateTimeFormatProvider>();

View File

@@ -69,8 +69,8 @@
<HintPath>..\packages\Castle.Core.3.3.1\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
<Reference Include="FluentNHibernate, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
<HintPath>..\packages\FluentNHibernate.1.4.0.0\lib\net35\FluentNHibernate.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">

View File

@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10")]
[assembly: AssemblyFileVersion("1.10")]

View File

@@ -4,13 +4,8 @@ using Orchard.Services;
namespace Orchard.Tests.Stubs {
public class StubClock : IClock {
public StubClock()
: this(new DateTime(2009, 10, 14, 12, 34, 56, DateTimeKind.Utc)) {
}
public StubClock(DateTime utcNow) {
UtcNow = utcNow;
public StubClock() {
UtcNow = new DateTime(2009, 10, 14, 12, 34, 56, DateTimeKind.Utc);
}
public DateTime UtcNow { get; private set; }
@@ -23,6 +18,7 @@ namespace Orchard.Tests.Stubs {
return UtcNow.Add(span);
}
public IVolatileToken When(TimeSpan duration) {
return new Clock.AbsoluteExpirationToken(this, duration);
}

View File

@@ -31,13 +31,9 @@ namespace Orchard.Tests.UI.Resources {
}
private void VerifyPaths(string resourceType, RequireSettings defaultSettings, string expectedPaths) {
VerifyPaths(resourceType, defaultSettings, expectedPaths, false);
}
private void VerifyPaths(string resourceType, RequireSettings defaultSettings, string expectedPaths, bool ssl) {
defaultSettings = defaultSettings ?? new RequireSettings();
var requiredResources = _resourceManager.BuildRequiredResources(resourceType);
var renderedResources = string.Join(",", requiredResources.Select(context => context.GetResourceUrl(defaultSettings, _appPath, ssl)).ToArray());
var renderedResources = string.Join(",", requiredResources.Select(context => context.GetResourceUrl(defaultSettings, _appPath)).ToArray());
Assert.That(renderedResources, Is.EqualTo(expectedPaths));
}
@@ -96,33 +92,6 @@ namespace Orchard.Tests.UI.Resources {
VerifyPaths("script", new RequireSettings { CdnMode = true }, "http://cdn/script1.min.js");
}
[Test]
public void CdnSslPathIsUsedInCdnMode() {
_testManifest.DefineManifest = m => {
m.DefineResource("script", "Script1").SetUrl("script1.js").SetCdn("https://cdn/script1.min.js");
};
_resourceManager.Require("script", "Script1");
VerifyPaths("script", new RequireSettings { CdnMode = true }, "https://cdn/script1.min.js", true);
}
[Test]
public void LocalPathIsUsedInCdnModeNotSupportsSsl() {
_testManifest.DefineManifest = m => {
m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js").SetCdn("http://cdn/script1.min.js", "http://cdn/script1.js", false);
};
_resourceManager.Require("script", "Script1");
VerifyPaths("script", new RequireSettings { CdnMode = true }, "script1.min.js", true);
}
[Test]
public void LocalDebugPathIsUsedInCdnModeNotSupportsSslAndDebug() {
_testManifest.DefineManifest = m => {
m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js").SetCdn("http://cdn/script1.min.js", "http://cdn/script1.js", false);
};
_resourceManager.Require("script", "Script1");
VerifyPaths("script", new RequireSettings { CdnMode = true, DebugMode = true }, "script1.js", true);
}
[Test]
public void CdnDebugPathIsUsedInCdnModeAndDebugMode() {
_testManifest.DefineManifest = m => {

View File

@@ -3,7 +3,7 @@
<package id="Autofac" version="3.5.2" targetFramework="net452" />
<package id="Autofac.Web" version="3.2.0" targetFramework="net452" />
<package id="Castle.Core" version="3.3.1" targetFramework="net452" />
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net452" />
<package id="FluentNHibernate" version="1.4.0.0" targetFramework="net452" />
<package id="Iesi.Collections" version="4.0.1.4000" targetFramework="net452" />
<package id="IronRuby" version="1.1.3" targetFramework="net452" />
<package id="log4net" version="2.0.3" targetFramework="net452" />

View File

@@ -32,8 +32,8 @@ using System.Security;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10")]
[assembly: AssemblyFileVersion("1.10")]
// Enable web application to call this assembly in Full Trust
[assembly: AllowPartiallyTrustedCallers]

View File

@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10")]
[assembly: AssemblyFileVersion("1.10")]

View File

@@ -95,7 +95,7 @@
</Properties>
</Component>
<Component Type="Orchard.Services.ClientHostAddressAccessor">
<Component Type="Orchard.Services.ClientAddressAccessor">
<Properties>
<!-- Set Value="true" to read the client host address from the specified HTTP header. -->
<Property Name="EnableClientHostAddressHeader" Value="false"/>
@@ -120,13 +120,5 @@
</Properties>
</Component>
<Component Type="Orchard.Environment.DefaultOrchardHost">
<Properties>
<!-- The number of retries when a tenant can't be loaded -->
<Property Name="Retries" Value="1"/>
<Property Name="DelayRetries" Value="true"/>
</Properties>
</Component>
</Components>
</HostComponents>

View File

@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<log4net xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<root>
<priority value="ERROR" xdt:Transform="SetAttributes(value)" />
<appender-ref ref="debug-file" xdt:Locator="Match(ref)" xdt:Transform="Remove" />
</root>
<logger name="Orchard" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<appender name="debugger" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<appender name="debug-file" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<appender>
<immediateFlush value="false" xdt:Transform="SetAttributes(value)" />
</appender>
</log4net>

View File

@@ -11,7 +11,6 @@ using Orchard.Core.Common.ViewModels;
using Orchard.Services;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.ContentManagement.Handlers;
namespace Orchard.Core.Common.Drivers {
public class BodyPartDriver : ContentPartDriver<BodyPart> {
@@ -76,10 +75,6 @@ namespace Orchard.Core.Common.Drivers {
context.Element(part.PartDefinition.Name).SetAttributeValue("Text", part.Text);
}
protected override void Cloning(BodyPart originalPart, BodyPart clonePart, CloneContentContext context) {
clonePart.Text = originalPart.Text;
}
private static BodyEditorViewModel BuildEditorViewModel(BodyPart part,RequestContext requestContext) {
return new BodyEditorViewModel {
BodyPart = part,

View File

@@ -123,9 +123,5 @@ namespace Orchard.Core.Common.Drivers {
.SetAttributeValue("ModifiedUtc", XmlConvert.ToString(part.ModifiedUtc.Value, XmlDateTimeSerializationMode.Utc));
}
}
protected override void Cloning(CommonPart originalPart, CommonPart clonePart, CloneContentContext context) {
clonePart.Container = originalPart.Container;
}
}
}

View File

@@ -45,13 +45,10 @@ namespace Orchard.Core.Common.Drivers {
protected override DriverResult Editor(ContentPart part, TextField field, dynamic shapeHelper) {
return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part),
() => {
var settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>();
var text = part.IsNew() ? settings.DefaultValue : field.Value;
var viewModel = new TextFieldDriverViewModel {
Field = field,
Text = text,
Settings = settings,
Text = field.Value,
Settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>(),
ContentItem = part.ContentItem
};
@@ -61,15 +58,28 @@ namespace Orchard.Core.Common.Drivers {
protected override DriverResult Editor(ContentPart part, TextField field, IUpdateModel updater, dynamic shapeHelper) {
var viewModel = new TextFieldDriverViewModel();
var viewModel = new TextFieldDriverViewModel {
Field = field,
Text = field.Value,
Settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>(),
ContentItem = part.ContentItem
};
if (updater.TryUpdateModel(viewModel, GetPrefix(field, part), null, null)) {
var settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>();
if (viewModel.Settings.Required && string.IsNullOrWhiteSpace(viewModel.Text)) {
updater.AddModelError("Text", T("The field {0} is mandatory", T(field.DisplayName)));
return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part),
() => shapeHelper.EditorTemplate(TemplateName: "Fields.Common.Text.Edit", Model: viewModel, Prefix: GetPrefix(field, part)));
}
field.Value = viewModel.Text;
var settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>();
if (settings.Required && String.IsNullOrWhiteSpace(field.Value)) {
updater.AddModelError("Text", T("The {0} field is required.", T(field.DisplayName)));
if (String.IsNullOrEmpty(field.Value) && !String.IsNullOrEmpty(settings.DefaultValue)) {
field.Value = settings.DefaultValue;
}
else {
field.Value = viewModel.Text;
}
}
@@ -88,10 +98,6 @@ namespace Orchard.Core.Common.Drivers {
context.Element(field.FieldDefinition.Name + "." + field.Name).SetAttributeValue("Text", field.Value);
}
protected override void Cloning(ContentPart part, TextField originalField, TextField cloneField, CloneContentContext context) {
cloneField.Value = originalField.Value;
}
protected override void Describe(DescribeMembersContext context) {
context
.Member(null, typeof(string), T("Value"), T("The text associated with the field."))

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The common module introduces content parts that are going to be used by most content types (common, body, identity).
FeatureDescription: Core content parts.

View File

@@ -23,12 +23,12 @@ namespace Orchard.Core.Common {
}
[Shape]
public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc, LocalizedString customDateFormat) {
public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc) {
if (!publisheddateTimeUtc.HasValue) {
return T("Draft");
}
return Display.DateTime(DateTimeUtc: createdDateTimeUtc, CustomFormat: customDateFormat);
return Display.DateTime(DateTimeUtc: createdDateTimeUtc);
}
[Shape]

View File

@@ -1,6 +1,4 @@
@{
var propertyName = Model.PropertyName != null ? (string)Model.PropertyName : "Text";
var htmlAttributes = new Dictionary<string, object> {
{"class", "text large"}
};
@@ -14,4 +12,4 @@
}
}
@Html.TextBox(propertyName, (string)Model.Text, htmlAttributes)
@Html.TextBox("Text", (string)Model.Text, htmlAttributes)

View File

@@ -1,6 +1,4 @@
@{
var propertyName = Model.PropertyName != null ? (string)Model.PropertyName : "Text";
var htmlAttributes = new Dictionary<string, object> {
{"class", "text small"}
};
@@ -14,4 +12,4 @@
}
}
@Html.TextBox(propertyName, (string)Model.Text, htmlAttributes)
@Html.TextBox("Text", (string)Model.Text, htmlAttributes)

View File

@@ -1,6 +1,4 @@
@{
var propertyName = Model.PropertyName != null ? (string)Model.PropertyName : "Text";
var htmlAttributes = new Dictionary<string, object>();
if (Model.Required == true) {
@@ -16,4 +14,4 @@
}
}
@Html.TextArea(propertyName, (string)Model.Text, 25, 80, htmlAttributes)
@Html.TextArea("Text", (string)Model.Text, 25, 80, htmlAttributes)

View File

@@ -1,6 +1,4 @@
@{
var propertyName = Model.PropertyName != null ? (string)Model.PropertyName : "Text";
var htmlAttributes = new Dictionary<string, object> {
{"class", "text medium"}
};
@@ -14,4 +12,4 @@
}
}
@Html.TextBox(propertyName, (string)Model.Text, htmlAttributes)
@Html.TextBox("Text", (string)Model.Text, htmlAttributes)

View File

@@ -1,7 +1,5 @@
@using Orchard.Utility.Extensions;
@{
var propertyName = Model.PropertyName != null ? (string)Model.PropertyName : "Text";
string editorFlavor = Model.EditorFlavor;
var htmlAttributes = new Dictionary<string, object> {
@@ -21,4 +19,4 @@
}
}
@Html.TextArea(propertyName, (string)Model.Text, 25, 80, htmlAttributes)
@Html.TextArea("Text", (string)Model.Text, 25, 80, htmlAttributes)

View File

@@ -1,6 +1,8 @@
@model Orchard.Core.Common.ViewModels.TextFieldSettingsEventsViewModel
@* This is a token-less default value editor that can be overridden from features that can depend on Orchard.Tokens. *@
<label for="@Html.FieldIdFor(m => m.Settings.DefaultValue)">@T("Default value")</label>
@Html.TextBoxFor(m => m.Settings.DefaultValue, new { @class = "text large" })
<span class="hint">@T("The default value proposed when creating a content item. (optional)")</span>
<span class="hint">@T("Default value for the field. If there is no value given for the actual field, this will be filled in. (optional)")</span>
@Html.ValidationMessageFor(m => m.Settings.DefaultValue)

View File

@@ -14,4 +14,7 @@
@if (HasText(Model.Settings.Hint)) {
<span class="hint">@Model.Settings.Hint</span>
}
@if (!String.IsNullOrWhiteSpace(Model.Settings.DefaultValue)) {
<span class="hint">@T("If the field is left empty then the default value will be used.")</span>
}
</fieldset>

View File

@@ -0,0 +1,66 @@
using System;
using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.ContentManagement;
using Orchard.Core.Common.Models;
using Orchard.Core.Containers.Extensions;
using Orchard.Core.Containers.Models;
using Orchard.Core.Contents;
using Orchard.Core.Feeds;
using Orchard.DisplayManagement;
using Orchard.Mvc;
using Orchard.Themes;
using Orchard.UI.Navigation;
using Orchard.Settings;
using Orchard.Localization;
namespace Orchard.Core.Containers.Controllers {
public class ItemController : Controller {
private readonly IContentManager _contentManager;
private readonly ISiteService _siteService;
private readonly IFeedManager _feedManager;
public ItemController(
IContentManager contentManager,
IShapeFactory shapeFactory,
ISiteService siteService,
IFeedManager feedManager,
IOrchardServices services) {
_contentManager = contentManager;
_siteService = siteService;
_feedManager = feedManager;
Shape = shapeFactory;
Services = services;
T = NullLocalizer.Instance;
}
dynamic Shape { get; set; }
public IOrchardServices Services { get; private set; }
public Localizer T { get; set; }
[Themed]
public ActionResult Display(int id, PagerParameters pagerParameters) {
var container = _contentManager
.Get(id, VersionOptions.Published)
.As<ContainerPart>();
if (container == null) {
return HttpNotFound(T("Container not found").Text);
}
if (!Services.Authorizer.Authorize(Permissions.ViewContent, container, T("Cannot view content"))) {
return new HttpUnauthorizedResult();
}
// TODO: (PH) Find a way to apply PagerParameters via a driver so we can lose this controller
container.PagerParameters = pagerParameters;
var model = _contentManager.BuildDisplay(container);
return new ShapeResult(this, model);
}
}
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using Orchard.ContentManagement;
@@ -28,8 +27,8 @@ namespace Orchard.Core.Containers.Drivers {
private readonly IContainerService _containerService;
public ContainerPartDriver(
IContentDefinitionManager contentDefinitionManager,
IOrchardServices orchardServices,
IContentDefinitionManager contentDefinitionManager,
IOrchardServices orchardServices,
ISiteService siteService,
IFeedManager feedManager, IContainerService containerService) {
_contentDefinitionManager = contentDefinitionManager;
@@ -48,7 +47,7 @@ namespace Orchard.Core.Containers.Drivers {
if (!part.ItemsShown)
return null;
return ContentShape("Parts_Container_Contained", () => {
return ContentShape("Parts_Container_Contained", () => {
var container = part.ContentItem;
var query = _contentManager
.Query(VersionOptions.Published)
@@ -56,26 +55,13 @@ namespace Orchard.Core.Containers.Drivers {
.Join<ContainablePartRecord>().OrderByDescending(x => x.Position);
var metadata = container.ContentManager.GetItemMetadata(container);
if (metadata != null) {
_feedManager.Register(metadata.DisplayText, "rss", new RouteValueDictionary {{"containerid", container.Id}});
}
if (metadata!=null)
_feedManager.Register(metadata.DisplayText, "rss", new RouteValueDictionary { { "containerid", container.Id } });
// Retrieving pager parameters.
var queryString = _orchardServices.WorkContext.HttpContext.Request.QueryString;
var page = 0;
// Don't try to page if not necessary.
if (part.Paginated && queryString["page"] != null) {
Int32.TryParse(queryString["page"], out page);
}
var pageSize = part.PageSize;
// If the container is paginated and pageSize is provided in the query string then retrieve it.
if (part.Paginated && queryString["pageSize"] != null) {
Int32.TryParse(queryString["pageSize"], out pageSize);
}
var pager = new Pager(_siteService.GetSiteSettings(), page, pageSize);
var pager = new Pager(_siteService.GetSiteSettings(), part.PagerParameters);
pager.PageSize = part.PagerParameters.PageSize != null && part.Paginated
? pager.PageSize
: part.PageSize;
var pagerShape = shapeHelper.Pager(pager).TotalItemCount(query.Count());
var startIndex = part.Paginated ? pager.GetStartIndex() : 0;
@@ -102,7 +88,7 @@ namespace Orchard.Core.Containers.Drivers {
protected override DriverResult Editor(ContainerPart part, IUpdateModel updater, dynamic shapeHelper) {
return ContentShape("Parts_Container_Edit", () => {
if (!part.ContainerSettings.DisplayContainerEditor) {
if(!part.ContainerSettings.DisplayContainerEditor) {
return null;
}
@@ -121,7 +107,7 @@ namespace Orchard.Core.Containers.Drivers {
EnablePositioning = part.Record.EnablePositioning,
OverrideEnablePositioning = part.ContainerSettings.EnablePositioning == null
};
if (updater != null) {
if (updater.TryUpdateModel(model, "Container", null, new[] { "OverrideEnablePositioning" })) {
part.AdminMenuPosition = model.AdminMenuPosition;
@@ -141,7 +127,7 @@ namespace Orchard.Core.Containers.Drivers {
}
}
}
return shapeHelper.EditorTemplate(TemplateName: "Container", Model: model, Prefix: "Container");
});
}

View File

@@ -7,6 +7,7 @@ using Orchard.Core.Containers.Models;
using Orchard.Core.Containers.Services;
using Orchard.Core.Containers.Settings;
using Orchard.Data;
using System.Web.Routing;
namespace Orchard.Core.Containers.Handlers {
public class ContainerPartHandler : ContentHandler {
@@ -34,6 +35,14 @@ namespace Orchard.Core.Containers.Handlers {
});
OnGetContentItemMetadata<ContainerPart>((context, part) => {
context.Metadata.DisplayRouteValues = new RouteValueDictionary {
{"Area", "Containers"},
{"Controller", "Item"},
{"Action", "Display"},
{"id", context.ContentItem.Id}
};
});
OnActivated<ContainerPart>((context, part) => {
part.ContainerSettingsField.Loader(() => part.Settings.GetModel<ContainerTypePartSettings>());

View File

@@ -71,6 +71,12 @@ namespace Orchard.Core.Containers.Models {
get { return Record.ItemCount; }
set { Record.ItemCount = value; }
}
public PagerParameters PagerParameters { get; set; }
public ContainerPart() {
PagerParameters = new PagerParameters();
}
}
public class ContainerPartRecord : ContentPartRecord {

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The containers module introduces container and containable behaviors for content items.
FeatureDescription: Container and containable parts to enable parent-child relationships between content items.

View File

@@ -22,7 +22,7 @@
<fieldset>
@Html.LabelFor(m => m.EnablePositioning, @T("Enable drag and drop"))
@Html.EditorFor(m => m.EnablePositioning)
<span class="hint">@T("Check this option to enable manual repositioning of items using drag and drop. If not set, this option will be configurable on the list content item itself.")</span>
<span class="hint">@T("Check this option to enable manual repositioning of items using. If not set, this option will be configurable on the list content item itself.")</span>
</fieldset>
<fieldset>
@Html.LabelFor(m => m.AdminListViewName, @T("List View"))
@@ -45,4 +45,4 @@
<span class="hint">@T("Select zero or more content types that this content type supports. Selecting zero content types means the list can contain any content type. Only types with the Containable part can be contained in a list.")</span>
</div>
</fieldset>
}
}

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Web.Mvc;
using System.Web.Routing;
@@ -111,11 +110,11 @@ namespace Orchard.Core.Contents.Controllers {
break;
}
if (!String.IsNullOrWhiteSpace(model.Options.SelectedCulture)) {
if(!String.IsNullOrWhiteSpace(model.Options.SelectedCulture)) {
query = _cultureFilter.FilterCulture(query, model.Options.SelectedCulture);
}
if (model.Options.ContentsStatus == ContentsStatus.Owner) {
if(model.Options.ContentsStatus == ContentsStatus.Owner) {
query = query.Where<CommonPartRecord>(cr => cr.OwnerId == Services.WorkContext.CurrentUser.Id);
}
@@ -242,10 +241,6 @@ namespace Orchard.Core.Contents.Controllers {
if (string.IsNullOrEmpty(id))
return CreatableTypeList(containerId);
if (_contentDefinitionManager.GetTypeDefinition(id) == null) {
return RedirectToAction("Create", new { id = "" });
}
var contentItem = _contentManager.New(id);
if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Cannot create content")))
@@ -388,24 +383,26 @@ namespace Orchard.Core.Contents.Controllers {
}
[HttpPost]
public ActionResult Clone(int id) {
var originalContentItem = _contentManager.GetLatest(id);
public ActionResult Clone(int id, string returnUrl) {
var contentItem = _contentManager.GetLatest(id);
if (!Services.Authorizer.Authorize(Permissions.ViewContent, originalContentItem, T("Couldn't open original content")))
if (contentItem == null)
return HttpNotFound();
if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Couldn't clone content")))
return new HttpUnauthorizedResult();
// pass a dummy content to the authorization check to check for "own" variations
var dummyContent = _contentManager.New(originalContentItem.ContentType);
if (!Services.Authorizer.Authorize(Permissions.EditContent, dummyContent, T("Couldn't create clone content")))
return new HttpUnauthorizedResult();
var cloneContentItem = _contentManager.Clone(originalContentItem);
try {
Services.ContentManager.Clone(contentItem);
}
catch (InvalidOperationException) {
Services.Notifier.Warning(T("Could not clone the content item."));
return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
}
Services.Notifier.Success(T("Successfully cloned. The clone was saved as a draft."));
var adminRouteValues = _contentManager.GetItemMetadata(cloneContentItem).AdminRouteValues;
return RedirectToRoute(adminRouteValues);
return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
}
[HttpPost]
@@ -418,40 +415,13 @@ namespace Orchard.Core.Contents.Controllers {
if (contentItem != null) {
_contentManager.Remove(contentItem);
Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
? T("The content has been removed.")
: T("The {0} has been removed.", contentItem.TypeDefinition.DisplayName));
? T("That content has been removed.")
: T("That {0} has been removed.", contentItem.TypeDefinition.DisplayName));
}
return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
}
[HttpPost]
public ActionResult DiscardDraft(int id, string returnUrl) {
var contentItem = _contentManager.Get(id, VersionOptions.Latest);
if (contentItem == null) {
return HttpNotFound();
}
if (!contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable
|| !contentItem.HasPublished()
|| contentItem.IsPublished()) {
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
if (!Services.Authorizer.Authorize(Permissions.DeleteContent, contentItem, T("Couldn't remove draft"))) {
return new HttpUnauthorizedResult();
}
_contentManager.DiscardDraft(contentItem);
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
? T("That draft has been removed.")
: T("That {0} draft has been removed.", contentItem.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
}
[HttpPost]
public ActionResult Publish(int id, string returnUrl) {
var contentItem = _contentManager.GetLatest(id);
@@ -463,7 +433,7 @@ namespace Orchard.Core.Contents.Controllers {
_contentManager.Publish(contentItem);
Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("The content has been published.") : T("The {0} has been published.", contentItem.TypeDefinition.DisplayName));
Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been published.") : T("That {0} has been published.", contentItem.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
}
@@ -479,7 +449,7 @@ namespace Orchard.Core.Contents.Controllers {
_contentManager.Unpublish(contentItem);
Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("The content has been unpublished.") : T("The {0} has been unpublished.", contentItem.TypeDefinition.DisplayName));
Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been unpublished.") : T("That {0} has been unpublished.", contentItem.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
}

View File

@@ -12,7 +12,9 @@ namespace Orchard.Core.Contents.Drivers {
ContentShape("Parts_Contents_Publish_Summary",
() => shapeHelper.Parts_Contents_Publish_Summary()),
ContentShape("Parts_Contents_Publish_SummaryAdmin",
() => shapeHelper.Parts_Contents_Publish_SummaryAdmin())
() => shapeHelper.Parts_Contents_Publish_SummaryAdmin()),
ContentShape("Parts_Contents_Clone_SummaryAdmin",
() => shapeHelper.Parts_Contents_Clone_SummaryAdmin())
);
}

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The contents module enables the creation of custom content types.
Features:

View File

@@ -12,6 +12,7 @@
<Place Parts_Contents_Publish="Content:5"/>
</Match>
<Match DisplayType="SummaryAdmin">
<Place Parts_Contents_Publish_SummaryAdmin="Actions:5"/>
<Place Parts_Contents_Publish_SummaryAdmin="Actions:5"
Parts_Contents_Clone_SummaryAdmin="Actions:6"/>
</Match>
</Placement>

View File

@@ -8,7 +8,7 @@
Layout.Title = T("New {0}", Html.Raw(typeDisplayName)).Text;
}
@using (Html.BeginFormAntiForgeryPost(Url.Action("Create", new { ReturnUrl = Request.QueryString["ReturnUrl"] }), FormMethod.Post, new { enctype = "multipart/form-data", @class = "no-multisubmit" })) {
@using (Html.BeginFormAntiForgeryPost(Url.Action("Create", new { ReturnUrl = Request.QueryString["ReturnUrl"] }), FormMethod.Post, new { enctype = "multipart/form-data" })) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)

View File

@@ -8,7 +8,7 @@
Layout.Title = pageTitle;
}
@using (Html.BeginFormAntiForgeryPost(Url.Action("Edit"), FormMethod.Post, new { enctype = "multipart/form-data", @class= "no-multisubmit" })) {
@using (Html.BeginFormAntiForgeryPost(Url.Action("Edit"), FormMethod.Post, new { enctype = "multipart/form-data" })) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)

View File

@@ -54,7 +54,7 @@
@Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Modified, T("recently modified").ToString())
@Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Published, T("recently published").ToString())
</select>
<label for="contentResults" class="bulk-filter">@T("Filter by")</label>
<label for="contentResults" class="bulk-order">@T("Filter by")</label>
<select id="contentResults" name="Options.ContentsStatus">
@Html.SelectOption((ContentsStatus)Model.Options.ContentsStatus, ContentsStatus.Owner, T("owned by me").ToString())
@Html.SelectOption((ContentsStatus)Model.Options.ContentsStatus, ContentsStatus.Latest, T("latest").ToString())

View File

@@ -1,12 +1,8 @@
@using Orchard.Utility.Extensions;
@{
var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify();
Model.Classes.Add(contentTypeClassName);
Model.Classes.Add("content-item");
var tag = Tag(Model, "article");
}
@tag.StartElement
<article class="content-item @contentTypeClassName">
<header>
@Display(Model.Header)
@if (Model.Meta != null) {
@@ -21,4 +17,4 @@
@Display(Model.Footer)
</footer>
}
@tag.EndElement
</article>

View File

@@ -1,8 +1,9 @@
@using Orchard.ContentManagement;
@using Orchard.Core.Contents;
@using Orchard.Core.Contents
@using Orchard.Utility.Extensions;
@{
ContentItem contentItem = Model.ContentItem;
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
}
<div class="summary" itemscope="itemscope" itemid="@contentItem.Id" itemtype="http://orchardproject.net/data/ContentItem">
<div class="properties">
@@ -17,6 +18,12 @@
</div>
<div class="related">
@Display(Model.Actions)
@if (Authorizer.Authorize(Permissions.EditContent, contentItem)) {
@Html.ItemEditLink(T("Edit").Text, contentItem)@T(" | ")
}
@if (Authorizer.Authorize(Permissions.DeleteContent, contentItem)) {
@Html.Link(T("Delete").Text, Url.ItemRemoveUrl(contentItem, new {returnUrl}), new {itemprop = "RemoveUrl UnsafeUrl"})
}
</div>
@if (Model.Content != null) {
<div class="primary">@Display(Model.Content)</div>

View File

@@ -1,9 +1,10 @@
@using Orchard.ContentManagement
@using Orchard.Core.Contents
@using Orchard.Utility.Extensions
@{
ContentPart contentPart = Model.ContentPart;
}
@if (Authorizer.Authorize(Permissions.EditContent, contentPart)) {
<a href="@Url.Action("Clone", "Admin", new { Id = Model.ContentItem.Id, Area = "Contents" })" itemprop="UnsafeUrl">@T("Clone")</a>
<a href="@Url.Action("Clone", "Admin", new { Id = Model.ContentItem.Id, ReturnUrl = Request.ToUrlString(), Area = "Contents" })" itemprop="UnsafeUrl">@T("Clone")</a>
@T(" | ")
}

View File

@@ -4,55 +4,38 @@
@{
Script.Require("ShapesBase");
ContentItem contentItem = Model.ContentItem;
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
var hasPublished = contentItem.HasPublished();
var hasDraft = contentItem.HasDraft();
var isPublished = contentItem.IsPublished();
var authorizedToEdit = Authorizer.Authorize(Permissions.EditContent, contentItem);
var authorizedToDelete = Authorizer.Authorize(Permissions.DeleteContent, contentItem);
var authorizedToPublish = Authorizer.Authorize(Permissions.PublishContent, contentItem);
ContentPart contentPart = Model.ContentPart;
}
@if (contentPart.HasPublished()) {
@Html.ItemDisplayLink(T("View").Text, (ContentItem)Model.ContentPart.ContentItem)
@T(" | ")
<div class="item-action-links">
<strong>@T("Item:")</strong>
@if (hasPublished) {
@Html.ItemDisplayLink(T("View").Text, contentItem);
}
@if (authorizedToEdit) {
if (hasPublished) {
if (contentPart.HasDraft()) {
if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) {
@Html.Link(T("Publish Draft").Text, Url.Action("Publish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"})
@T(" | ")
}
@Html.ItemEditLink(T("Edit").Text, contentItem);
@T(" | ")
@Html.ActionLink(T(" Clone").Text, "Clone", "Admin", new { Id = contentItem.Id, ReturnUrl = Request.ToUrlString(), Area = "Contents" }, new { itemprop = "UnsafeUrl" });
}
@if (hasPublished && authorizedToPublish) {
@T(" | ")
@Html.ActionLink(T("Unpublish").Text, "Unpublish", "Admin", new { area = "Contents", id = contentItem.Id, returnUrl = Request.ToUrlString() }, new { itemprop = "UnsafeUrl" });
}
@if (authorizedToDelete) {
@T(" | ")
@Html.Link(T("Remove").Text, Url.ItemRemoveUrl(contentItem, new { returnUrl }), new { itemprop = "RemoveUrl UnsafeUrl" });
}
</div>
@if ((!isPublished || hasDraft) && authorizedToEdit) {
<div class="draft-action-links">
<strong>@T("Draft:")</strong>
@if (!isPublished && Authorizer.Authorize(Permissions.PreviewContent, contentItem)) {
@Html.ActionLink(T("View").Text, "Display", "Item", new { area = "Contents", id = contentItem.Id, version = contentItem.Version }, new { });
}
@if (hasDraft && authorizedToPublish) {
if (Authorizer.Authorize(Permissions.PreviewContent, contentPart)) {
@Html.ActionLink(T("Preview").Text, "Display", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id, version = ((ContentItem)Model.ContentPart.ContentItem).Version }, new { })
@T(" | ")
@Html.ActionLink(T("Publish").Text, "Publish", "Admin", new { area = "Contents", id = contentItem.Id, returnUrl = Request.ToUrlString() }, new { itemprop = "UnsafeUrl" });
}
}
@if (!isPublished && hasPublished && authorizedToDelete) {
if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) {
@Html.Link(T("Unpublish").Text, Url.Action("Unpublish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"})
@T(" | ")
}
} else {
if (contentPart.HasDraft()) {
if (Authorizer.Authorize(Permissions.PreviewContent, contentPart)) {
@Html.ActionLink(T("Preview").Text, "Display", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id, version = ((ContentItem)Model.ContentPart.ContentItem).Version }, new { })
@T(" | ")
@Html.ActionLink(T("Discard").Text, "DiscardDraft", "Admin", new { area = "Contents", id = contentItem.Id, returnUrl = Request.ToUrlString() }, new { itemprop = "RemoveUrl UnsafeUrl" });
}
</div>
}
if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) {
@Html.Link(T("Publish").Text, Url.Action("Publish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"})
@T(" | ")
}
}

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application.
FeatureDescription: Standard admin dashboard.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The Feeds module is providing RSS feeds to content items.
FeatureDescription: RSS feeds for content items.

View File

@@ -1,8 +1,7 @@
using System;
using System;
using Orchard.Commands;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.Core.Common.Models;
using Orchard.Core.Navigation.Models;
using Orchard.Core.Navigation.Services;
using Orchard.Security;
@@ -16,7 +15,7 @@ namespace Orchard.Core.Navigation.Commands {
private readonly IMembershipService _membershipService;
public MenuCommands(
IContentManager contentManager,
IContentManager contentManager,
IMenuService menuService,
ISiteService siteService,
IMembershipService membershipService) {
@@ -28,10 +27,7 @@ namespace Orchard.Core.Navigation.Commands {
[OrchardSwitch]
public string MenuPosition { get; set; }
[OrchardSwitch]
public string Identity { get; set; }
[OrchardSwitch]
public string Owner { get; set; }
@@ -45,7 +41,7 @@ namespace Orchard.Core.Navigation.Commands {
public string MenuName { get; set; }
[CommandName("menuitem create")]
[CommandHelp("menuitem create /MenuPosition:<position> /MenuText:<text> /Url:<url> /MenuName:<name> [/Owner:<username>]\r\n\t" + "Creates a new menu item")]
[CommandHelp("menuitem create /MenuPosition:<position> /MenuText:<text> /Url:<url> /MenuName:<name> [/Owner:<username>] \r\n\t" + "Creates a new menu item")]
[OrchardSwitches("MenuPosition,MenuText,Url,MenuName,Owner")]
public void Create() {
// flushes before doing a query in case a previous command created the menu
@@ -79,20 +75,17 @@ namespace Orchard.Core.Navigation.Commands {
}
[CommandName("menu create")]
[CommandHelp("menu create /MenuName:<name> [/Identity:<identity>] \r\n\t" + "Creates a new menu")]
[OrchardSwitches("MenuName,Identity")]
[CommandHelp("menu create /MenuName:<name>\r\n\t" + "Creates a new menu")]
[OrchardSwitches("MenuName")]
public void CreateMenu() {
if (string.IsNullOrWhiteSpace(MenuName)) {
Context.Output.WriteLine(T("Menu name can't be empty.").Text);
return;
}
var menuItem = _menuService.Create(MenuName);
if (menuItem.Has<IdentityPart>() && !String.IsNullOrEmpty(Identity)) {
menuItem.As<IdentityPart>().Identifier = Identity;
}
_menuService.Create(MenuName);
Context.Output.WriteLine(T("Menu created successfully.").Text);
}
}
}
}

View File

@@ -177,13 +177,5 @@ namespace Orchard.Core.Navigation {
return 6;
}
public int UpdateFrom6() {
ContentDefinitionManager.AlterTypeDefinition("ShapeMenuItem", cfg => cfg
.WithIdentity()
);
return 7;
}
}
}
}

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The navigation module creates and manages a simple navigation menu for the front-end of the application and allows you to add content items to the admin menu.
FeatureDescription: Menu management.

View File

@@ -25,27 +25,27 @@
</fieldset>
<fieldset>
@Html.EditorFor(m => m.Breadcrumb)
@Html.EditorFor(m => m.Breadcrumb)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.Breadcrumb)">@T("Display as Breadcrumb")</label>
<span class="hint">@T("Check to render the path to the current content item.")</span>
</fieldset>
<div data-controllerid="@Html.FieldIdFor(m => m.Breadcrumb)">
<fieldset>
@Html.EditorFor(m => m.AddHomePage)
@Html.EditorFor(m => m.AddHomePage)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.AddHomePage)">@T("Add the home page as the first element")</label>
<span class="hint">@T("Check to render the home page as the first element of the breadcrumb.")</span>
</fieldset>
<fieldset>
@Html.EditorFor(m => m.AddCurrentPage)
@Html.EditorFor(m => m.AddCurrentPage)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.AddCurrentPage)">@T("Add the current content item as the last element")</label>
<span class="hint">@T("Check to render the current content item as the last element.")</span>
</fieldset>
</div>
<fieldset>
@Html.EditorFor(m => m.ShowFullMenu)
@Html.EditorFor(m => m.ShowFullMenu)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.ShowFullMenu)">@T("No filter on selected page")</label>
<span class="hint">@T("Check for the menu to be displayed without filtering the selected current page.")</span>
</fieldset>
<span class="hint">@T("Check for the menu to be display without filtering the selected current page.")</span>
</fieldset>

View File

@@ -11,7 +11,3 @@
@Display(Model.Sidebar)
</div>
</div>
@if (!String.IsNullOrWhiteSpace(Request.QueryString["returnUrl"])) {
@Html.Hidden("returnUrl", Request.QueryString["returnUrl"])
}

View File

@@ -119,6 +119,7 @@
<Compile Include="Common\ViewModels\DateTimeEditor.cs" />
<Compile Include="Common\ViewModels\TextFieldDriverViewModel.cs" />
<Compile Include="Common\ViewModels\TextFieldSettingsEventsViewModel.cs" />
<Compile Include="Containers\Controllers\ItemController.cs" />
<Compile Include="Containers\Drivers\ContainablePartDriver.cs" />
<Compile Include="Containers\Drivers\ContainerPartDriver.cs" />
<Compile Include="Common\Migrations.cs" />
@@ -558,6 +559,9 @@
<ItemGroup>
<Content Include="Navigation\Views\MenuItemLink-ShapeMenuItem.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Contents\Views\Parts.Contents.Clone.SummaryAdmin.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Contents\Views\Item\Display.cshtml" />
</ItemGroup>

View File

@@ -30,6 +30,6 @@ using System.Security;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10")]
[assembly: AssemblyFileVersion("1.10")]

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The dashboard module is providing the reports screen of the application.
FeatureDescription: Reports management.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The scheduling module enables background task scheduling.
FeatureDescription: Scheduled background tasks.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The settings module creates site settings that other modules can contribute to.
FeatureDescription: Site settings.

View File

@@ -63,8 +63,8 @@
<span class="hint">@T("Determines whether scripts and stylesheets load in their debuggable or minified form.")</span>
</div>
<div>
@Html.LabelFor(m => m.UseCdn, T("Use CDN"))
@Html.CheckBoxFor(m => m.UseCdn)
@Html.LabelFor(m => m.UseCdn, T("Use CDN").Text, new { @class = "forcheckbox" })
<span class="hint">@T("Determines whether the defined CDN value is used for scripts and stylesheets, or their local version")</span>
</div>
<div>
@@ -84,4 +84,4 @@
<span class="hint">@T("Determines the last element of the database that can be displayed. Leave 0 for unlimited.")</span>
</div>
}
</fieldset>
</fieldset>

View File

@@ -283,7 +283,7 @@ namespace Orchard.Core.Shapes {
[Shape]
public void ContentZone(dynamic Display, dynamic Shape, TextWriter Output) {
var unordered = ((IEnumerable<dynamic>)Shape).ToArray();
var tabbed = unordered.GroupBy(x => (string)x.Metadata.Tab ?? "");
var tabbed = unordered.GroupBy(x => (string)x.Metadata.Tab);
if (tabbed.Count() > 1) {
foreach (var tab in tabbed) {
@@ -455,12 +455,12 @@ namespace Orchard.Core.Shapes {
var appPath = httpContext == null || httpContext.Request == null
? null
: httpContext.Request.ApplicationPath;
var ssl = httpContext?.Request?.IsSecureConnection ?? false;
foreach (var context in requiredResources.Where(r =>
(includeLocation.HasValue ? r.Settings.Location == includeLocation.Value : true) &&
(excludeLocation.HasValue ? r.Settings.Location != excludeLocation.Value : true))) {
var path = context.GetResourceUrl(defaultSettings, appPath, ssl);
var path = context.GetResourceUrl(defaultSettings, appPath);
var condition = context.Settings.Condition;
var attributes = context.Settings.HasAttributes ? context.Settings.Attributes : null;
IHtmlString result;

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10
OrchardVersion: 1.9
Description: The shapes module contains core shape templates and display hooks.
FeatureDescription: Core shape templates and display hooks.

View File

@@ -52,9 +52,5 @@ namespace Orchard.Core.Title.Drivers {
protected override void Exporting(TitlePart part, ExportContentContext context) {
context.Element(part.PartDefinition.Name).SetAttributeValue("Title", part.Title);
}
protected override void Cloning(TitlePart originalPart, TitlePart clonePart, CloneContentContext context) {
clonePart.Title = originalPart.Title;
}
}
}

Some files were not shown because too many files have changed in this diff Show More