Merge branch 'master' into pr/311
This commit is contained in:
+68
-33
@@ -18,8 +18,7 @@ module.exports = function(grunt) {
|
||||
"app/views/archetype.config.fieldset.dialog_versioned.html": "app/views/archetype.config.fieldset.dialog.html",
|
||||
"app/views/archetype.config_versioned.html": "app/views/archetype.config.html",
|
||||
"app/views/archetype_versioned.html": "app/views/archetype.html",
|
||||
"app/views/archetype.default_versioned.html": "app/views/archetype.default.html",
|
||||
|
||||
"app/views/archetype.default_versioned.html": "app/views/archetype.default.html"
|
||||
},
|
||||
options: {
|
||||
replacements: [{
|
||||
@@ -126,7 +125,7 @@ module.exports = function(grunt) {
|
||||
expand: true
|
||||
},
|
||||
dll: {
|
||||
cwd: 'app/Umbraco/Umbraco.Archetype/bin/Debug/',
|
||||
cwd: 'app/Umbraco/Umbraco.Archetype/bin/Release/',
|
||||
src: 'Archetype.dll',
|
||||
dest: '<%= dest %>/bin/',
|
||||
expand: true
|
||||
@@ -152,7 +151,13 @@ module.exports = function(grunt) {
|
||||
{
|
||||
cwd: '<%= dest %>/bin',
|
||||
src: ['*.dll'],
|
||||
dest: 'tmp/nuget/lib/net40',
|
||||
dest: 'tmp/nuget_binaries/lib/net40',
|
||||
expand: true
|
||||
},
|
||||
{
|
||||
cwd: 'app/Umbraco/Archetype.Courier/bin/Release/',
|
||||
src: ['Archetype.Courier.dll'],
|
||||
dest: 'tmp/nuget_courier/lib/net40',
|
||||
expand: true
|
||||
}
|
||||
]
|
||||
@@ -169,6 +174,14 @@ module.exports = function(grunt) {
|
||||
dist: {
|
||||
src: 'tmp/nuget/package.nuspec',
|
||||
dest: 'pkg'
|
||||
},
|
||||
dist_binaries: {
|
||||
src: 'tmp/nuget_binaries/package_binaries.nuspec',
|
||||
dest: 'pkg'
|
||||
},
|
||||
dist_courier: {
|
||||
src: 'tmp/nuget_courier/package_courier.nuspec',
|
||||
dest: 'pkg'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -182,29 +195,61 @@ module.exports = function(grunt) {
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>',
|
||||
files: [{ path: 'tmp/nuget/**', target: 'content/App_Plugins/Archetype'}]
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>'
|
||||
}
|
||||
},
|
||||
'files': {
|
||||
'tmp/nuget/package.nuspec': ['config/package.nuspec']
|
||||
}
|
||||
},
|
||||
'nuspec_binaries': {
|
||||
'options': {
|
||||
'data': {
|
||||
name: '<%= pkgMeta.name %>.Binaries',
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>'
|
||||
}
|
||||
},
|
||||
'files': {
|
||||
'tmp/nuget_binaries/package_binaries.nuspec': ['config/package_binaries.nuspec']
|
||||
}
|
||||
},
|
||||
'nuspec_courier': {
|
||||
'options': {
|
||||
'data': {
|
||||
name: '<%= pkgMeta.name %>.Courier',
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>'
|
||||
}
|
||||
},
|
||||
'files': {
|
||||
'tmp/nuget_courier/package_courier.nuspec': ['config/package_courier.nuspec']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
umbracoPackage: {
|
||||
options: {
|
||||
name: "<%= pkgMeta.name %>",
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>',
|
||||
manifest: 'config/package.xml',
|
||||
readme: 'config/readme.txt',
|
||||
sourceDir: 'tmp/umbraco',
|
||||
outputDir: 'pkg',
|
||||
dist: {
|
||||
src: 'tmp/umbraco',
|
||||
dest: 'pkg',
|
||||
options: {
|
||||
name: "<%= pkgMeta.name %>",
|
||||
version: '<%= pkgMeta.version %>',
|
||||
url: '<%= pkgMeta.url %>',
|
||||
license: '<%= pkgMeta.license %>',
|
||||
licenseUrl: '<%= pkgMeta.licenseUrl %>',
|
||||
author: '<%= pkgMeta.author %>',
|
||||
authorUrl: '<%= pkgMeta.authorUrl %>',
|
||||
readme: '<%= grunt.file.read("config/readme.txt") %>'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -234,7 +279,7 @@ module.exports = function(grunt) {
|
||||
|
||||
assemblyinfo: {
|
||||
options: {
|
||||
files: ['app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj', 'app/Umbraco/Umbraco.Archetype/Archetype.Courier.csproj'],
|
||||
files: ['app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj', 'app/Umbraco/Archetype.Courier/Archetype.Courier.csproj'],
|
||||
filename: 'VersionInfo.cs',
|
||||
info: {
|
||||
version: '<%= (pkgMeta.version.indexOf("-") > 0 ? pkgMeta.version.substring(0, pkgMeta.version.indexOf("-")) : pkgMeta.version) %>',
|
||||
@@ -248,15 +293,6 @@ module.exports = function(grunt) {
|
||||
src: ['<%= grunt.option("target") %>\\Web.config']
|
||||
}
|
||||
},
|
||||
|
||||
jshint: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
},
|
||||
src: {
|
||||
src: ['app/**/*.js', 'lib/**/*.js']
|
||||
}
|
||||
},
|
||||
|
||||
msbuild: {
|
||||
options: {
|
||||
@@ -272,7 +308,7 @@ module.exports = function(grunt) {
|
||||
dist: {
|
||||
src: ['app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj','app/Umbraco/Archetype.Courier/Archetype.Courier.csproj'],
|
||||
options: {
|
||||
projectConfiguration: 'Debug',
|
||||
projectConfiguration: 'Release',
|
||||
targets: ['Clean', 'Rebuild'],
|
||||
}
|
||||
}
|
||||
@@ -280,8 +316,7 @@ module.exports = function(grunt) {
|
||||
});
|
||||
|
||||
grunt.registerTask('default', ['clean', 'string-replace', 'less', 'concat', 'assemblyinfo', 'msbuild:dist', 'copy:dll', 'copy:assets', 'copy:html', 'copy:config', 'clean:html', 'clean:js', 'clean:less']);
|
||||
|
||||
grunt.registerTask('nuget', ['clean:tmp', 'default', 'copy:nuget', 'template:nuspec', 'nugetpack', 'clean:tmp']);
|
||||
grunt.registerTask('umbraco', ['clean:tmp', 'default', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']);
|
||||
grunt.registerTask('package', ['clean:tmp', 'default', 'copy:nuget', 'template:nuspec', 'nugetpack', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']);
|
||||
grunt.registerTask('nuget', ['copy:nuget', 'template:nuspec', 'template:nuspec_binaries', 'template:nuspec_courier', 'nugetpack']);
|
||||
grunt.registerTask('umbraco', ['copy:umbraco', 'umbracoPackage']);
|
||||
grunt.registerTask('package', ['clean:tmp', 'default', 'nuget', 'copy:umbraco', 'umbracoPackage', 'clean:tmp']);
|
||||
};
|
||||
@@ -163,6 +163,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll</HintPath>
|
||||
|
||||
@@ -91,5 +91,66 @@ namespace Archetype.Tests.PublishedContent
|
||||
|
||||
Assert.Throws<ArgumentNullException>(code);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ArchetypePublishedContent_GetIndex()
|
||||
{
|
||||
var contentSet = _archetype.ToPublishedContentSet();
|
||||
var i = 0;
|
||||
|
||||
foreach (var content in contentSet)
|
||||
{
|
||||
Assert.AreEqual(content.GetIndex(), i);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ArchetypePublishedContentSet_IsFirstIsLast()
|
||||
{
|
||||
var contentSet = _archetype.ToPublishedContentSet();
|
||||
|
||||
foreach (var content in contentSet)
|
||||
{
|
||||
var value = content.GetPropertyValue<string>("boxHeadline");
|
||||
|
||||
Assert.That(value == "Box 1 Title", Is.EqualTo(content.IsFirst()));
|
||||
Assert.That(value == "Another Box", Is.EqualTo(content.IsLast()));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ArchetypePublishedContentSet_PreviousNext()
|
||||
{
|
||||
var contentSet = _archetype.ToPublishedContentSet();
|
||||
var list = contentSet.ToList();
|
||||
|
||||
Assert.That(list.Count, Is.EqualTo(2));
|
||||
|
||||
var first = list[0];
|
||||
var last = list[1];
|
||||
|
||||
var next = first.Next();
|
||||
Assert.AreEqual(next, last);
|
||||
|
||||
var prev = last.Previous();
|
||||
Assert.AreEqual(prev, first);
|
||||
}
|
||||
|
||||
[Test, ExpectedException(typeof(NullReferenceException))]
|
||||
public void ArchetypePublishedContentSet_Siblings()
|
||||
{
|
||||
var contentSet = _archetype.ToPublishedContentSet();
|
||||
var content = contentSet.FirstOrDefault();
|
||||
|
||||
var siblings = content.Siblings();
|
||||
Assert.That(siblings, Is.Not.Null);
|
||||
|
||||
var following = content.FollowingSibling();
|
||||
Assert.That(following, Is.Not.Null);
|
||||
|
||||
var preceding = content.PrecedingSibling();
|
||||
Assert.That(preceding, Is.Not.Null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
namespace DatabaseSizer
|
||||
{
|
||||
/// <summary>
|
||||
/// A now obsolete project that handled an Umbraco core limitation.
|
||||
/// </summary>
|
||||
[Obsolete("This project is now obsolete with 7.2.2+")]
|
||||
public class Application : ApplicationEventHandler
|
||||
{
|
||||
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
|
||||
{
|
||||
base.ApplicationStarted(umbracoApplication, applicationContext);
|
||||
|
||||
ExpandPrevalueValueColumnSize();
|
||||
}
|
||||
|
||||
protected void ExpandPrevalueValueColumnSize()
|
||||
{
|
||||
try
|
||||
{
|
||||
var dbContext = ApplicationContext.Current.DatabaseContext;
|
||||
var colCount =
|
||||
dbContext.Database.ExecuteScalar<int>(
|
||||
"SELECT COUNT(1) FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE = 'nvarchar' AND COLUMN_NAME = 'value' AND CHARACTER_MAXIMUM_LENGTH = 2500 AND TABLE_NAME = 'cmsDataTypePreValues'");
|
||||
|
||||
// Check column
|
||||
if (colCount != 0)
|
||||
{
|
||||
using (var trans = dbContext.Database.GetTransaction())
|
||||
{
|
||||
// Change column
|
||||
dbContext.Database.Execute("ALTER TABLE [cmsDataTypePreValues] ALTER COLUMN [value] ntext NULL;");
|
||||
|
||||
trans.Complete();
|
||||
}
|
||||
|
||||
LogHelper.Debug(typeof(Application), "Successfully expanded Prevalue table Value column");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.Debug(typeof(Application), "Prevalue table Value column is already expanded");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(typeof(Application), "Error expanding Prevalue table Value column", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,250 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{0114C963-C514-49C1-B7AB-DCB1825F498C}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DatabaseSizer</RootNamespace>
|
||||
<AssemblyName>DatabaseSizer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AutoMapper">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="AutoMapper.Net4">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="businesslogic">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core">
|
||||
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core.Mvc">
|
||||
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="cms">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="controls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\controls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="CookComputing.XmlRpcV2">
|
||||
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Examine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Examine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="HtmlAgilityPack">
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib">
|
||||
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImageProcessor">
|
||||
<HintPath>..\packages\ImageProcessor.1.9.0.0\lib\ImageProcessor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImageProcessor.Web">
|
||||
<HintPath>..\packages\ImageProcessor.Web.3.2.3.0\lib\net45\ImageProcessor.Web.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="interfaces">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Lucene.Net">
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Helpers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.Web.Helpers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.0\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="MiniProfiler">
|
||||
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SQLCE4Umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\SQLCE4Umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="TidyNet">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\TidyNet.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Core">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.DataLayer">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.DataLayer.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.editorControls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.editorControls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.MacroEngines">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.MacroEngines.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.providers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Web.UI">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Web.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.XmlSerializers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.XmlSerializers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UmbracoExamine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UmbracoExamine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UrlRewritingNet.UrlRewriter">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.2\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Application.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("DatabaseSizer.cs")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DatabaseSizer.cs")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("28dc35d2-3dfb-40b4-9093-bc47c91127ea")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
|
||||
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
|
||||
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
|
||||
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net45" />
|
||||
<package id="ImageProcessor" version="1.9.0.0" targetFramework="net45" />
|
||||
<package id="ImageProcessor.Web" version="3.2.3.0" targetFramework="net45" />
|
||||
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.1.2" targetFramework="net45" />
|
||||
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.40629.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Umbraco", "Umbraco.Archetype\Archetype.Umbraco.csproj", "{7D185D41-4228-4978-ACB8-83F9A48AD94F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D84AA4ED-85A6-484F-9E72-BE7AC9835821}"
|
||||
@@ -12,8 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D84AA4
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Tests", "Archetype.Tests\Archetype.Tests.csproj", "{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DatabaseSizer", "DatabaseSizer\DatabaseSizer.csproj", "{0114C963-C514-49C1-B7AB-DCB1825F498C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Archetype.Courier", "Archetype.Courier\Archetype.Courier.csproj", "{FE8BE437-8B11-4E49-9B02-F45994E6D723}"
|
||||
EndProject
|
||||
Global
|
||||
@@ -30,10 +30,6 @@ Global
|
||||
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{21F3E6CF-B76F-4059-9474-1AF1CE63CD6B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0114C963-C514-49C1-B7AB-DCB1825F498C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FE8BE437-8B11-4E49-9B02-F45994E6D723}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Archetype.Models;
|
||||
using System.Linq;
|
||||
using Archetype.Models;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Archetype.Extensions
|
||||
@@ -9,5 +10,16 @@ namespace Archetype.Extensions
|
||||
{
|
||||
return new ArchetypePublishedContent(fieldset);
|
||||
}
|
||||
|
||||
public static IPublishedContent ToPublishedContent(this ArchetypeFieldsetModel fieldset, ArchetypeModel archetype)
|
||||
{
|
||||
var contentSet = archetype.ToPublishedContentSet();
|
||||
|
||||
var first = contentSet
|
||||
.Cast<ArchetypePublishedContent>()
|
||||
.FirstOrDefault(x => x.ArchetypeFieldset == fieldset);
|
||||
|
||||
return first ?? new ArchetypePublishedContent(fieldset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,103 @@ namespace Archetype.Extensions
|
||||
/// </summary>
|
||||
public static class HtmlHelperExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Renders the partials based on the model, partial path and given viewdata dictionary.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="archetypeModel">The archetype model.</param>
|
||||
/// <param name="partialPath">The partial path.</param>
|
||||
/// <param name="viewDataDictionary">The view data dictionary.</param>
|
||||
/// <returns></returns>
|
||||
private static IHtmlString _renderPartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
foreach (var fieldsetModel in archetypeModel)
|
||||
{
|
||||
sb.AppendLine(_renderPartial(htmlHelper, fieldsetModel, partialPath, viewDataDictionary).ToString());
|
||||
}
|
||||
|
||||
return new HtmlString(sb.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the fieldset partial
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="fieldsetModel"></param>
|
||||
/// <param name="partialPath">The partial path.</param>
|
||||
/// <param name="viewDataDictionary">The view data dictionary.</param>
|
||||
/// <returns></returns>
|
||||
private static IHtmlString _renderPartial(HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, string partialPath, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
var context = HttpContext.Current;
|
||||
|
||||
if (fieldsetModel == null || context == null)
|
||||
{
|
||||
return new HtmlString("");
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
//default
|
||||
var pathToPartials = "~/Views/Partials/Archetype/";
|
||||
|
||||
if (!string.IsNullOrEmpty(partialPath))
|
||||
{
|
||||
pathToPartials = partialPath;
|
||||
}
|
||||
|
||||
var partial = string.Format("{0}{1}.cshtml", pathToPartials, fieldsetModel.Alias);
|
||||
|
||||
if (System.IO.File.Exists(context.Server.MapPath(partial)))
|
||||
{
|
||||
sb.AppendLine(htmlHelper.Partial(partial, fieldsetModel, viewDataDictionary).ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.Info<ArchetypeModel>(string.Format("The partial for {0} could not be found. Please create a partial with that name or rename your alias.", context.Server.MapPath(partial)));
|
||||
}
|
||||
|
||||
return new HtmlString(sb.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders a single archtype partial from a fieldset
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="fieldsetModel">The fieldset model.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartial(this HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel)
|
||||
{
|
||||
return _renderPartial(htmlHelper, fieldsetModel, null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the archetype partial.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="fieldsetModel">The fieldset model.</param>
|
||||
/// <param name="partialView">The partial view.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartial(this HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, string partialView)
|
||||
{
|
||||
return _renderPartial(htmlHelper, fieldsetModel, partialView, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the archetype partial.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="fieldsetModel">The fieldset model.</param>
|
||||
/// <param name="partialView">The partial view.</param>
|
||||
/// <param name="viewDataDictionary">The view data dictionary.</param>
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartial(this HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, string partialView, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
return _renderPartial(htmlHelper, fieldsetModel, partialView, viewDataDictionary);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the archetype partials.
|
||||
/// </summary>
|
||||
@@ -20,7 +117,7 @@ namespace Archetype.Extensions
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel)
|
||||
{
|
||||
return RenderPartials(htmlHelper, archetypeModel, null, null);
|
||||
return _renderPartials(htmlHelper, archetypeModel, null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -32,7 +129,7 @@ namespace Archetype.Extensions
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath)
|
||||
{
|
||||
return RenderPartials(htmlHelper, archetypeModel, partialPath, null);
|
||||
return _renderPartials(htmlHelper, archetypeModel, partialPath, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -44,7 +141,7 @@ namespace Archetype.Extensions
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
return RenderPartials(htmlHelper, archetypeModel, null, viewDataDictionary);
|
||||
return _renderPartials(htmlHelper, archetypeModel, null, viewDataDictionary);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -57,49 +154,7 @@ namespace Archetype.Extensions
|
||||
/// <returns></returns>
|
||||
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
return htmlHelper.RenderPartials(archetypeModel, partialPath, viewDataDictionary);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the partials based on the model, partial path and given viewdata dictionary.
|
||||
/// </summary>
|
||||
/// <param name="htmlHelper">The HTML helper.</param>
|
||||
/// <param name="archetypeModel">The archetype model.</param>
|
||||
/// <param name="partialPath">The partial path.</param>
|
||||
/// <param name="viewDataDictionary">The view data dictionary.</param>
|
||||
/// <returns></returns>
|
||||
private static IHtmlString RenderPartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
|
||||
{
|
||||
var context = HttpContext.Current;
|
||||
|
||||
if (archetypeModel == null || context == null)
|
||||
{
|
||||
return new HtmlString("");
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var pathToPartials = "~/Views/Partials/Archetype/";
|
||||
if (!string.IsNullOrEmpty(partialPath))
|
||||
{
|
||||
pathToPartials = partialPath;
|
||||
}
|
||||
|
||||
foreach (var fieldsetModel in archetypeModel)
|
||||
{
|
||||
var partial = pathToPartials + fieldsetModel.Alias + ".cshtml";
|
||||
|
||||
if (System.IO.File.Exists(context.Server.MapPath(partial)))
|
||||
{
|
||||
sb.AppendLine(htmlHelper.Partial(partial, fieldsetModel, viewDataDictionary).ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.Info<ArchetypeModel>(string.Format("The partial for {0} could not be found. Please create a partial with that name or rename your alias.", context.Server.MapPath(partial)));
|
||||
}
|
||||
}
|
||||
|
||||
return new HtmlString(sb.ToString());
|
||||
return htmlHelper._renderPartials(archetypeModel, partialPath, viewDataDictionary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,14 +11,17 @@ namespace Archetype.Models
|
||||
{
|
||||
private ArchetypeFieldsetModel _fieldset;
|
||||
|
||||
private IEnumerable<IPublishedContent> _parent;
|
||||
|
||||
private readonly Dictionary<string, IPublishedProperty> _properties;
|
||||
|
||||
public ArchetypePublishedContent(ArchetypeFieldsetModel fieldset)
|
||||
public ArchetypePublishedContent(ArchetypeFieldsetModel fieldset, ArchetypePublishedContentSet parent = null)
|
||||
{
|
||||
if (fieldset == null)
|
||||
throw new ArgumentNullException("fieldset");
|
||||
|
||||
_fieldset = fieldset;
|
||||
_parent = parent ?? Enumerable.Empty<IPublishedContent>();
|
||||
|
||||
_properties = fieldset.Properties
|
||||
.ToDictionary(
|
||||
@@ -39,7 +42,7 @@ namespace Archetype.Models
|
||||
|
||||
public IEnumerable<IPublishedContent> ContentSet
|
||||
{
|
||||
get { return Enumerable.Empty<IPublishedContent>(); }
|
||||
get { return _parent; }
|
||||
}
|
||||
|
||||
public PublishedContentType ContentType
|
||||
@@ -74,7 +77,7 @@ namespace Archetype.Models
|
||||
|
||||
public int GetIndex()
|
||||
{
|
||||
return default(int);
|
||||
return _parent.IndexOf(this);
|
||||
}
|
||||
|
||||
public IPublishedProperty GetProperty(string alias, bool recurse)
|
||||
|
||||
@@ -16,9 +16,12 @@ namespace Archetype.Models
|
||||
|
||||
this.ArchetypeModel = archetype;
|
||||
|
||||
var count = archetype.Fieldsets.Count();
|
||||
|
||||
_items = archetype.Fieldsets
|
||||
.Where(x => x.Disabled == false)
|
||||
.Select(x => new ArchetypePublishedContent(x));
|
||||
.Select(x => new ArchetypePublishedContent(x, this))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
internal ArchetypeModel ArchetypeModel { get; private set; }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("1.12.1")]
|
||||
[assembly: AssemblyFileVersion("1.12.1")]
|
||||
[assembly: AssemblyVersion("1.12.3")]
|
||||
[assembly: AssemblyFileVersion("1.12.3")]
|
||||
|
||||
@@ -314,7 +314,6 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
|
||||
template: template,
|
||||
show: true,
|
||||
callback: function(data) {
|
||||
$scope.archetypeConfigRenderModel = data;
|
||||
},
|
||||
dialogData: $scope.archetypeConfigRenderModel
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
angular.module('umbraco').controller('ArchetypeConfigOptionsController', function ($scope) {
|
||||
$scope.model = angular.copy($scope.dialogData);
|
||||
$scope.model = $scope.dialogData;
|
||||
|
||||
//handles a fieldset group add
|
||||
$scope.addFieldsetGroup = function () {
|
||||
|
||||
@@ -15,6 +15,8 @@ angular.module("umbraco").controller("Imulus.ArchetypeController", function ($sc
|
||||
|
||||
// store the umbraco property alias to help generate unique IDs. Hopefully there's a better way to get this in the future :)
|
||||
$scope.umbracoHostPropertyAlias = $scope.$parent.$parent.model.alias;
|
||||
|
||||
$scope.isDebuggingEnabled = Umbraco.Sys.ServerVariables.isDebuggingEnabled;
|
||||
|
||||
$scope.overlayMenu = {
|
||||
show: false,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
angular.module("umbraco.directives").directive('archetypeCustomView', function ($compile, $http) {
|
||||
var linker = function (scope, element, attrs) {
|
||||
|
||||
var view = "/App_plugins/Archetype/views/archetype.default.html";
|
||||
var view = "../App_plugins/Archetype/views/archetype.default.html";
|
||||
if(scope.model.config.customViewPath) {
|
||||
view = scope.model.config.customViewPath;
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c
|
||||
}
|
||||
}
|
||||
|
||||
//upload datatype hack
|
||||
if(view.indexOf('fileupload.html') != -1) {
|
||||
//upload, colorpicker datatype hack
|
||||
if(view.indexOf('fileupload.html') != -1 || view.indexOf('colorpicker.html') != -1) {
|
||||
scope.propertyForm = scope.form;
|
||||
scope.model.validation = {};
|
||||
scope.model.validation.mandatory = 0;
|
||||
|
||||
@@ -20,12 +20,8 @@
|
||||
<div class="umb-panel-footer">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
<a href="" ng-click="close()" class="btn btn-link">
|
||||
<localize key="general_cancel" class="ng-isolate-scope ng-scope">Cancel</localize>
|
||||
</a>
|
||||
|
||||
<button class="btn btn-primary" ng-click="apply()">
|
||||
<archetype-localize key="button_apply">Apply</archetype-localize>
|
||||
<button class="btn" ng-click="apply()">
|
||||
<archetype-localize key="button_close">Close</archetype-localize>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -53,12 +53,8 @@
|
||||
<div class="umb-panel-footer">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
<a href="" ng-click="close()" class="btn btn-link">
|
||||
<localize key="general_cancel" class="ng-isolate-scope ng-scope">Cancel</localize>
|
||||
</a>
|
||||
|
||||
<button class="btn btn-primary" ng-click="apply()">
|
||||
<archetype-localize key="button_apply">Apply</archetype-localize>
|
||||
<button class="btn" ng-click="apply()">
|
||||
<archetype-localize key="button_close">Close</archetype-localize>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -22,12 +22,8 @@
|
||||
<div class="umb-panel-footer">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
<a href="" ng-click="close()" class="btn btn-link">
|
||||
<localize key="general_cancel" class="ng-isolate-scope ng-scope">Cancel</localize>
|
||||
</a>
|
||||
|
||||
<button class="btn btn-primary" ng-click="apply()">
|
||||
<archetype-localize key="button_apply">Apply</archetype-localize>
|
||||
<button class="btn" ng-click="apply()">
|
||||
<archetype-localize key="button_close">Close</archetype-localize>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="archetypeCollapser animate-hide" ng-hide="model.config.enableCollapsing && isCollapsed(fieldset)" ng-if="!isCollapsed(fieldset)">
|
||||
<form class="form-inline">
|
||||
<div ng-class="[('archetype-property-' + property.alias), (getPropertyValidity($parent.$index, property.alias) === false ? 'archetypePropertyError' : '')]" class="archetypeProperty control-group" ng-repeat="property in fieldsetConfigModel.properties">
|
||||
<label ng-hide="model.config.hidePropertyLabels == '1'" class="control-label" for="archetype-property-{{model.alias}}-{{$parent.$index}}-{{$index}}">
|
||||
<label ng-hide="model.config.hidePropertyLabels == '1'" class="control-label" for="archetype-property-{{model.alias}}-f{{$parent.$index}}-{{property.alias}}-p{{$index}}" ng-attr-title="{{ isDebuggingEnabled || model.config.developerMode ? property.alias : null }}">
|
||||
<span>{{property.label}}</span>
|
||||
<div class="archetypeFieldsetHelpText" ng-show="property.helpText">
|
||||
<small>{{property.helpText}}</small>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Archetype",
|
||||
"version": "1.12.1",
|
||||
"version": "1.12.3",
|
||||
"url": "http://github.com/imulus/archetype/",
|
||||
"author": "Imulus - Kevin Giszewski - Tom Fulton - Lee Kelleher - Matt Brailsford - Kenn Jacobsen - Et. Al.",
|
||||
"authorUrl": "http://imulus.com/",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<iconUrl>http://github.com/imulus/archetype/raw/master/assets/logo.png</iconUrl>
|
||||
<licenseUrl><%= licenseUrl %></licenseUrl>
|
||||
<dependencies>
|
||||
<dependency id="UmbracoCms.Core" version="7.2.2" />
|
||||
<dependency id="Archetype.Binaries" version="<%= version %>" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
</package>
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<umbPackage>
|
||||
<info>
|
||||
<package>
|
||||
<name><%= name %></name>
|
||||
<version><%= version %></version>
|
||||
<license url="<%= licenseUrl %>"><%= license %></license>
|
||||
<url><%= url %></url>
|
||||
<requirements>
|
||||
<major>0</major>
|
||||
<minor>0</minor>
|
||||
<patch>0</patch>
|
||||
</requirements>
|
||||
</package>
|
||||
<author>
|
||||
<name><%= author %></name>
|
||||
<website><%= authorUrl %></website>
|
||||
</author>
|
||||
<readme><![CDATA[<%= readmeContents %>]]></readme>
|
||||
</info>
|
||||
<DocumentTypes />
|
||||
<Templates />
|
||||
<Stylesheets />
|
||||
<Macros />
|
||||
<DictionaryItems />
|
||||
<Languages />
|
||||
<DataTypes />
|
||||
<control />
|
||||
<Actions />
|
||||
<files>
|
||||
<% files.forEach(function(file) { %>
|
||||
<file>
|
||||
<guid><%= file.guid %>.<%= file.ext %></guid>
|
||||
<orgPath><%= file.dir %></orgPath>
|
||||
<orgName><%= file.name %></orgName>
|
||||
</file>
|
||||
<% }); %>
|
||||
</files>
|
||||
</umbPackage>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Archetype.Binaries</id>
|
||||
<version><%= version %></version>
|
||||
<title><%= name %></title>
|
||||
<authors>imulus, kgiszewski, tomfulton</authors>
|
||||
<owners>imulus, kgiszewski, tomfulton</owners>
|
||||
<projectUrl>http://github.com/imulus/archetype</projectUrl>
|
||||
<description><![CDATA[Archetype binaries for Umbraco]]></description>
|
||||
<tags>umbraco</tags>
|
||||
<iconUrl>http://github.com/imulus/archetype/raw/master/assets/logo.png</iconUrl>
|
||||
<licenseUrl><%= licenseUrl %></licenseUrl>
|
||||
<dependencies>
|
||||
<dependency id="UmbracoCms.Core" version="7.2.2" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
</package>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Archetype.Courier</id>
|
||||
<version><%= version %></version>
|
||||
<title><%= name %></title>
|
||||
<authors>leekelleher</authors>
|
||||
<owners>kgiszewski, leekelleher</owners>
|
||||
<projectUrl>http://github.com/imulus/archetype</projectUrl>
|
||||
<description><![CDATA[Archetype Courier extension for Umbraco]]></description>
|
||||
<tags>umbraco</tags>
|
||||
<iconUrl>http://github.com/imulus/archetype/raw/master/assets/logo.png</iconUrl>
|
||||
<licenseUrl><%= licenseUrl %></licenseUrl>
|
||||
<dependencies>
|
||||
<dependency id="Archetype.Binaries" version="<%= version %>" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
</package>
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
"grunt-msbuild": "~0.1.9",
|
||||
"grunt-dotnet-assembly-info": "~1.0.9",
|
||||
"load-grunt-tasks": "~0.4.0",
|
||||
"grunt-umbraco-package": "0.0.6"
|
||||
"grunt-umbraco-package": "^1.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
Reference in New Issue
Block a user