diff --git a/Gruntfile.js b/Gruntfile.js
index 4c1340c..cf1ca49 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -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']);
};
\ No newline at end of file
diff --git a/app/Umbraco/Archetype.Tests/Archetype.Tests.csproj b/app/Umbraco/Archetype.Tests/Archetype.Tests.csproj
index 19264d5..75c4305 100644
--- a/app/Umbraco/Archetype.Tests/Archetype.Tests.csproj
+++ b/app/Umbraco/Archetype.Tests/Archetype.Tests.csproj
@@ -163,6 +163,7 @@
True
+
True
..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll
diff --git a/app/Umbraco/Archetype.Tests/PublishedContent/ArchetypePublishedContentTests.cs b/app/Umbraco/Archetype.Tests/PublishedContent/ArchetypePublishedContentTests.cs
index 27198cf..2fa05d5 100644
--- a/app/Umbraco/Archetype.Tests/PublishedContent/ArchetypePublishedContentTests.cs
+++ b/app/Umbraco/Archetype.Tests/PublishedContent/ArchetypePublishedContentTests.cs
@@ -91,5 +91,66 @@ namespace Archetype.Tests.PublishedContent
Assert.Throws(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("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);
+ }
}
}
\ No newline at end of file
diff --git a/app/Umbraco/DatabaseSizer/Application.cs b/app/Umbraco/DatabaseSizer/Application.cs
deleted file mode 100644
index 5261a0f..0000000
--- a/app/Umbraco/DatabaseSizer/Application.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using Umbraco.Core;
-using Umbraco.Core.Logging;
-
-namespace DatabaseSizer
-{
- ///
- /// A now obsolete project that handled an Umbraco core limitation.
- ///
- [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(
- "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);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/app/Umbraco/DatabaseSizer/DatabaseSizer.csproj b/app/Umbraco/DatabaseSizer/DatabaseSizer.csproj
deleted file mode 100644
index 7337c4d..0000000
--- a/app/Umbraco/DatabaseSizer/DatabaseSizer.csproj
+++ /dev/null
@@ -1,250 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {0114C963-C514-49C1-B7AB-DCB1825F498C}
- Library
- Properties
- DatabaseSizer
- DatabaseSizer
- v4.5
- 512
- ..\
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll
- False
-
-
- ..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\businesslogic.dll
- False
-
-
- ..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll
- False
-
-
- ..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\cms.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\controls.dll
- False
-
-
- ..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\Examine.dll
- False
-
-
- ..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll
- False
-
-
- ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll
- False
-
-
- ..\packages\ImageProcessor.1.9.0.0\lib\ImageProcessor.dll
- False
-
-
- ..\packages\ImageProcessor.Web.3.2.3.0\lib\net45\ImageProcessor.Web.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\interfaces.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\log4net.dll
- False
-
-
- ..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.ApplicationBlocks.Data.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\Microsoft.Web.Helpers.dll
- False
-
-
- False
- ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
-
-
- ..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.0\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll
- False
-
-
- ..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll
- False
-
-
- ..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll
- False
-
-
- ..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\SQLCE4Umbraco.dll
- False
-
-
-
-
- False
- ..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.dll
-
-
- False
- ..\packages\UmbracoCms.Core.7.1.2\lib\System.Data.SqlServerCe.Entity.dll
-
-
- ..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll
- False
-
-
-
- False
- ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll
-
-
- ..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll
- False
-
-
- ..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll
- False
-
-
- False
- ..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll
-
-
- False
- ..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll
-
-
- False
- ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll
-
-
- False
- ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll
-
-
- False
- ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll
-
-
-
-
-
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\TidyNet.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Core.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.DataLayer.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.editorControls.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.MacroEngines.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.providers.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\Umbraco.Web.UI.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\umbraco.XmlSerializers.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\UmbracoExamine.dll
- False
-
-
- ..\packages\UmbracoCms.Core.7.1.2\lib\UrlRewritingNet.UrlRewriter.dll
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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}.
-
-
-
-
-
\ No newline at end of file
diff --git a/app/Umbraco/DatabaseSizer/Properties/AssemblyInfo.cs b/app/Umbraco/DatabaseSizer/Properties/AssemblyInfo.cs
deleted file mode 100644
index 46a4e6f..0000000
--- a/app/Umbraco/DatabaseSizer/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -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")]
diff --git a/app/Umbraco/DatabaseSizer/app.config b/app/Umbraco/DatabaseSizer/app.config
deleted file mode 100644
index ccb9166..0000000
--- a/app/Umbraco/DatabaseSizer/app.config
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/Umbraco/DatabaseSizer/packages.config b/app/Umbraco/DatabaseSizer/packages.config
deleted file mode 100644
index 3fc6851..0000000
--- a/app/Umbraco/DatabaseSizer/packages.config
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/Umbraco/Umbraco.Archetype.sln b/app/Umbraco/Umbraco.Archetype.sln
index 342d893..000b32d 100644
--- a/app/Umbraco/Umbraco.Archetype.sln
+++ b/app/Umbraco/Umbraco.Archetype.sln
@@ -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
diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeFieldsetModelExtensions.cs b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeFieldsetModelExtensions.cs
index 1cf6933..1ccb442 100644
--- a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeFieldsetModelExtensions.cs
+++ b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeFieldsetModelExtensions.cs
@@ -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()
+ .FirstOrDefault(x => x.ArchetypeFieldset == fieldset);
+
+ return first ?? new ArchetypePublishedContent(fieldset);
+ }
}
}
\ No newline at end of file
diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/HtmlHelperExtensions.cs b/app/Umbraco/Umbraco.Archetype/Extensions/HtmlHelperExtensions.cs
index 7606b6a..204fb80 100644
--- a/app/Umbraco/Umbraco.Archetype/Extensions/HtmlHelperExtensions.cs
+++ b/app/Umbraco/Umbraco.Archetype/Extensions/HtmlHelperExtensions.cs
@@ -12,6 +12,103 @@ namespace Archetype.Extensions
///
public static class HtmlHelperExtensions
{
+ ///
+ /// Renders the partials based on the model, partial path and given viewdata dictionary.
+ ///
+ /// The HTML helper.
+ /// The archetype model.
+ /// The partial path.
+ /// The view data dictionary.
+ ///
+ 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());
+ }
+
+ ///
+ /// Renders the fieldset partial
+ ///
+ /// The HTML helper.
+ ///
+ /// The partial path.
+ /// The view data dictionary.
+ ///
+ 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(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());
+ }
+
+ ///
+ /// Renders a single archtype partial from a fieldset
+ ///
+ /// The HTML helper.
+ /// The fieldset model.
+ ///
+ public static IHtmlString RenderArchetypePartial(this HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel)
+ {
+ return _renderPartial(htmlHelper, fieldsetModel, null, null);
+ }
+
+ ///
+ /// Renders the archetype partial.
+ ///
+ /// The HTML helper.
+ /// The fieldset model.
+ /// The partial view.
+ ///
+ public static IHtmlString RenderArchetypePartial(this HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, string partialView)
+ {
+ return _renderPartial(htmlHelper, fieldsetModel, partialView, null);
+ }
+
+ ///
+ /// Renders the archetype partial.
+ ///
+ /// The HTML helper.
+ /// The fieldset model.
+ /// The partial view.
+ /// The view data dictionary.
+ ///
+ public static IHtmlString RenderArchetypePartial(this HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, string partialView, ViewDataDictionary viewDataDictionary)
+ {
+ return _renderPartial(htmlHelper, fieldsetModel, partialView, viewDataDictionary);
+ }
+
///
/// Renders the archetype partials.
///
@@ -20,7 +117,7 @@ namespace Archetype.Extensions
///
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel)
{
- return RenderPartials(htmlHelper, archetypeModel, null, null);
+ return _renderPartials(htmlHelper, archetypeModel, null, null);
}
///
@@ -32,7 +129,7 @@ namespace Archetype.Extensions
///
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath)
{
- return RenderPartials(htmlHelper, archetypeModel, partialPath, null);
+ return _renderPartials(htmlHelper, archetypeModel, partialPath, null);
}
///
@@ -44,7 +141,7 @@ namespace Archetype.Extensions
///
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, ViewDataDictionary viewDataDictionary)
{
- return RenderPartials(htmlHelper, archetypeModel, null, viewDataDictionary);
+ return _renderPartials(htmlHelper, archetypeModel, null, viewDataDictionary);
}
///
@@ -57,49 +154,7 @@ namespace Archetype.Extensions
///
public static IHtmlString RenderArchetypePartials(this HtmlHelper htmlHelper, ArchetypeModel archetypeModel, string partialPath, ViewDataDictionary viewDataDictionary)
{
- return htmlHelper.RenderPartials(archetypeModel, partialPath, viewDataDictionary);
- }
-
- ///
- /// Renders the partials based on the model, partial path and given viewdata dictionary.
- ///
- /// The HTML helper.
- /// The archetype model.
- /// The partial path.
- /// The view data dictionary.
- ///
- 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(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);
}
}
}
\ No newline at end of file
diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypePublishedContent.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypePublishedContent.cs
index b691431..b22b850 100644
--- a/app/Umbraco/Umbraco.Archetype/Models/ArchetypePublishedContent.cs
+++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypePublishedContent.cs
@@ -11,14 +11,17 @@ namespace Archetype.Models
{
private ArchetypeFieldsetModel _fieldset;
+ private IEnumerable _parent;
+
private readonly Dictionary _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();
_properties = fieldset.Properties
.ToDictionary(
@@ -39,7 +42,7 @@ namespace Archetype.Models
public IEnumerable ContentSet
{
- get { return Enumerable.Empty(); }
+ 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)
diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypePublishedContentSet.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypePublishedContentSet.cs
index 5a529d9..88a9397 100644
--- a/app/Umbraco/Umbraco.Archetype/Models/ArchetypePublishedContentSet.cs
+++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypePublishedContentSet.cs
@@ -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; }
diff --git a/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs b/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs
index 2ba2adf..f7b7bb7 100644
--- a/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs
+++ b/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs
@@ -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")]
diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js
index 615d45e..47c54b9 100644
--- a/app/controllers/config.controller.js
+++ b/app/controllers/config.controller.js
@@ -314,7 +314,6 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
template: template,
show: true,
callback: function(data) {
- $scope.archetypeConfigRenderModel = data;
},
dialogData: $scope.archetypeConfigRenderModel
});
diff --git a/app/controllers/config.dialog.controller.js b/app/controllers/config.dialog.controller.js
index c057730..1661ea0 100644
--- a/app/controllers/config.dialog.controller.js
+++ b/app/controllers/config.dialog.controller.js
@@ -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 () {
diff --git a/app/controllers/controller.js b/app/controllers/controller.js
index 1af7336..6dbbb9c 100644
--- a/app/controllers/controller.js
+++ b/app/controllers/controller.js
@@ -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,
diff --git a/app/directives/archetypecustomview.js b/app/directives/archetypecustomview.js
index d6719aa..3cc83c5 100644
--- a/app/directives/archetypecustomview.js
+++ b/app/directives/archetypecustomview.js
@@ -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;
}
diff --git a/app/directives/archetypeproperty.js b/app/directives/archetypeproperty.js
index f5a2ab9..62045e1 100644
--- a/app/directives/archetypeproperty.js
+++ b/app/directives/archetypeproperty.js
@@ -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;
diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html
index 5571427..d5dacbb 100644
--- a/app/views/archetype.config.developer.dialog.html
+++ b/app/views/archetype.config.developer.dialog.html
@@ -20,12 +20,8 @@