diff --git a/Gruntfile.js b/Gruntfile.js index cf1ca49..14db49a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -85,6 +85,7 @@ module.exports = function(grunt) { 'app/controllers/controller_versioned.js', 'app/controllers/config.controller.js', 'app/controllers/config.dialog.controller.js', + 'app/controllers/config.global.controller.js', 'app/directives/archetypeproperty.js', 'app/directives/archetypesubmitwatcher.js', 'app/directives/archetypecustomview.js', @@ -95,7 +96,8 @@ module.exports = function(grunt) { 'app/resources/archetypePropertyEditorResource.js', 'app/services/archetypeService.js', 'app/services/archetypeLabelService.js', - 'app/services/archetypeCacheService.js' + 'app/services/archetypeCacheService.js', + 'app/services/archetypeGlobalConfigService.js' ], dest: '<%= basePath %>/js/archetype.js' } @@ -269,7 +271,8 @@ module.exports = function(grunt) { 'app/controllers/*.js', '!app/controllers/controller.js', '!app/controllers/config.controller.js', - '!app/controllers/config.dialog.controller.js' + '!app/controllers/config.dialog.controller.js', + '!app/controllers/config.global.controller.js' ], less: [ 'app/less/*.less', diff --git a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs index af0c4ce..015f3b5 100644 --- a/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs +++ b/app/Umbraco/Umbraco.Archetype/Api/ArchetypeDataTypeController.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; using System; -using System.Diagnostics; using System.Linq; using System.Net; -using System.Reflection; using System.Web.Http; using AutoMapper; using Umbraco.Core.Models; @@ -11,12 +9,14 @@ using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; using Umbraco.Web.Editors; using Archetype.Extensions; +using Archetype.Models; namespace Archetype.Api { /// /// Controller that handles datatype related interactions. /// + /// [PluginController("ArchetypeApi")] public class ArchetypeDataTypeController : UmbracoAuthorizedJsonController { @@ -24,14 +24,14 @@ namespace Archetype.Api { return global::Umbraco.Core.PropertyEditors.PropertyEditorResolver.Current.PropertyEditors - .Select(x => new {defaultPreValues = x.DefaultPreValuesForArchetype(), alias = x.Alias, view = x.ValueEditor.View}); + .Select(x => new { defaultPreValues = x.DefaultPreValuesForArchetype(), alias = x.Alias, view = x.ValueEditor.View }); } /// /// Gets all datatypes. /// /// - public object GetAll() + public object GetAll() { var dataTypes = Services.DataTypeService.GetAllDataTypeDefinitions(); return dataTypes.Select(t => new { guid = t.Key, name = t.Name }); @@ -68,11 +68,14 @@ namespace Archetype.Api public object GetByGuid(Guid guid, string contentTypeAlias, string propertyTypeAlias, string archetypeAlias, int nodeId) { var dataType = Services.DataTypeService.GetDataTypeDefinitionById(guid); + if (dataType == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } + var dataTypeDisplay = Mapper.Map(dataType); + return new { selectedEditor = dataTypeDisplay.SelectedEditor, preValues = dataTypeDisplay.PreValues, contentTypeAlias = contentTypeAlias, propertyTypeAlias = propertyTypeAlias, archetypeAlias = archetypeAlias, nodeId = nodeId }; } @@ -82,19 +85,58 @@ namespace Archetype.Api /// public object GetDllVersion() { - return new {dllVersion = _version()}; + return new { dllVersion = ArchetypeHelper.Instance.DllVersion() }; } /// - /// Gets the DLL version from the file. + /// Globals the settings. /// - /// - private string _version() + /// System.Object. + [HttpGet] + public object GlobalSettings() { - var asm = Assembly.GetExecutingAssembly(); - var fvi = FileVersionInfo.GetVersionInfo(asm.Location); + return new + { + isCheckingForUpdates = ArchetypeGlobalSettings.Instance.CheckForUpdates + }; + } - return fvi.FileVersion; + /// + /// Sets the check for updates. + /// + /// if set to true [is checking]. + [HttpPost] + public void SetCheckForUpdates([FromBody] bool isChecking) + { + ArchetypeGlobalSettings.Instance.CheckForUpdates = isChecking; + ArchetypeGlobalSettings.Instance.Save(); + } + + /// + /// Checks for updates. + /// + /// System.Object. + [HttpPost] + public object CheckForUpdates() + { + if (!ArchetypeGlobalSettings.Instance.CheckForUpdates) + { + return new + { + isUpdateAvailable = false + }; + } + + var updateNotificationModel = ArchetypeHelper.Instance.CheckForUpdates(); + + return new + { + isUpdateAvailable = updateNotificationModel.IsUpdateAvailable, + headline = updateNotificationModel.Headline, + type = updateNotificationModel.Type, + message = updateNotificationModel.Message, + url = updateNotificationModel.Url + }; } } } diff --git a/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj index 5a64ccc..015af80 100644 --- a/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj +++ b/app/Umbraco/Umbraco.Archetype/Archetype.Umbraco.csproj @@ -129,6 +129,7 @@ False + False @@ -238,6 +239,8 @@ + + @@ -248,6 +251,7 @@ + diff --git a/app/Umbraco/Umbraco.Archetype/Constants.cs b/app/Umbraco/Umbraco.Archetype/Constants.cs index d2a9db8..7f3b77a 100644 --- a/app/Umbraco/Umbraco.Archetype/Constants.cs +++ b/app/Umbraco/Umbraco.Archetype/Constants.cs @@ -12,5 +12,8 @@ public const string CacheKey_DataTypeByGuid = ""; public const string CacheKey_PreValueFromDataTypeId = "Archetype_GetArchetypePreValueFromDataTypeId_"; + + public const string UmbracoVersionAlias = "umbracoConfigurationStatus"; + public const string NotificationUrl = "https://api.gizmo42.com/v1/archetype/check-for-updates"; } } diff --git a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs index 73383eb..837a67b 100644 --- a/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs +++ b/app/Umbraco/Umbraco.Archetype/Extensions/ArchetypeHelper.cs @@ -1,12 +1,21 @@ using System; +using System.Configuration; using System.Linq; +using System.Net.Http; +using System.Text; using Archetype.Models; using Newtonsoft.Json; using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Models.PublishedContent; +using System.Reflection; +using System.Diagnostics; +using System.Net; +/// +/// The Extensions namespace. +/// namespace Archetype.Extensions { /// @@ -14,20 +23,52 @@ namespace Archetype.Extensions /// public class ArchetypeHelper { + /// + /// The json settings + /// protected JsonSerializerSettings _jsonSettings; + /// + /// The application + /// protected ApplicationContext _app; - - private static readonly ArchetypeHelper _instance = new ArchetypeHelper(); - - internal static ArchetypeHelper Instance { get { return _instance; } } + /// + /// The pad lock + /// + private static readonly object _padLock = new object(); + /// + /// The instance + /// + private static ArchetypeHelper _instance = new ArchetypeHelper(); /// - /// Initializes a new instance of the class. + /// Gets the instance. /// - internal ArchetypeHelper() + /// The instance. + internal static ArchetypeHelper Instance { + get + { + if (_instance == null) + { + lock (_padLock) + { + if (_instance == null) + { + _instance = new ArchetypeHelper(); + } + } + } + + return _instance; + } + } + + /// + /// Initializes a new instance of the class. + /// + private ArchetypeHelper() { var dcr = new Newtonsoft.Json.Serialization.DefaultContractResolver(); - dcr.DefaultMembersSearchFlags |= System.Reflection.BindingFlags.NonPublic; + dcr.DefaultMembersSearchFlags |= BindingFlags.NonPublic; _jsonSettings = new JsonSerializerSettings { ContractResolver = dcr }; _app = ApplicationContext.Current; @@ -36,9 +77,7 @@ namespace Archetype.Extensions /// /// Gets the json serializer settings. /// - /// - /// The json serializer settings. - /// + /// The json serializer settings. internal JsonSerializerSettings JsonSerializerSettings { get { return _jsonSettings; } } /// @@ -46,7 +85,7 @@ namespace Archetype.Extensions /// /// The source JSON. /// The data type pre values. - /// + /// ArchetypeModel. internal ArchetypeModel DeserializeJsonToArchetype(string sourceJson, PreValueCollection dataTypePreValues) { try @@ -78,7 +117,7 @@ namespace Archetype.Extensions /// The source JSON. /// The data type identifier. /// Type of the host content. - /// + /// ArchetypeModel. internal ArchetypeModel DeserializeJsonToArchetype(string sourceJson, int dataTypeId, PublishedContentType hostContentType = null) { try @@ -108,21 +147,66 @@ namespace Archetype.Extensions /// Determines whether datatypeId has had it's PVC overridden. /// /// The data type identifier. - /// + /// true if [is property value converter overridden] [the specified data type identifier]; otherwise, false. internal bool IsPropertyValueConverterOverridden(int dataTypeId) { var prevalues = GetArchetypePreValueFromDataTypeId(dataTypeId); + if (prevalues == null) return false; return prevalues.OverrideDefaultPropertyValueConverter; } + /// + /// Checks for updates. + /// + /// ArchetypeUpdateNotification. + internal ArchetypeUpdateNotification CheckForUpdates() + { + try + { + using (var client = new HttpClient()) + { + var content = new StringContent(JsonConvert.SerializeObject(new + { + umbracoVersion = ConfigurationManager.AppSettings[Constants.UmbracoVersionAlias], + archetypeVersion = DllVersion(), + id = ArchetypeGlobalSettings.Instance.Id + }), Encoding.UTF8, "application/json"); + + client.DefaultRequestHeaders.Add("x-api-key-id", ArchetypeGlobalSettings.Instance.ApiKey.ToString()); + + var response = client.PostAsync(new Uri(Constants.NotificationUrl), content).Result; + + if (response.StatusCode == HttpStatusCode.OK) + { + var responseString = response.Content.ReadAsStringAsync().Result; + + return JsonConvert.DeserializeObject(responseString); + } + + return new ArchetypeUpdateNotification + { + IsUpdateAvailable = false + }; + } + } + catch (Exception ex) + { + //if anything goes wrong let's make sure we don't break their site + return new ArchetypeUpdateNotification + { + IsUpdateAvailable = false + }; + } + } + /// /// Gets the archetype pre value from data type identifier. /// /// The data type identifier. - /// + /// ArchetypePreValue. private ArchetypePreValue GetArchetypePreValueFromDataTypeId(int dataTypeId) { return _app.ApplicationCache.RuntimeCache.GetCacheItem( @@ -147,7 +231,7 @@ namespace Archetype.Extensions /// Gets the archetype pre value from pre values collection. /// /// The data type pre values. - /// + /// ArchetypePreValue. private ArchetypePreValue GetArchetypePreValueFromPreValuesCollection(PreValueCollection dataTypePreValues) { var preValueAsString = dataTypePreValues.PreValuesAsDictionary.First().Value.Value; @@ -159,7 +243,7 @@ namespace Archetype.Extensions /// Gets the data type by unique identifier. /// /// The unique identifier. - /// + /// IDataTypeDefinition. internal IDataTypeDefinition GetDataTypeByGuid(Guid guid) { return (IDataTypeDefinition)ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem( @@ -172,6 +256,7 @@ namespace Archetype.Extensions /// /// The Archetype to add the additional metadata to /// The configuration of the Archetype + /// Type of the host content. private void RetrieveAdditionalProperties(ref ArchetypeModel archetype, ArchetypePreValue preValue, PublishedContentType hostContentType = null) { foreach (var fieldset in preValue.Fieldsets) @@ -197,7 +282,6 @@ namespace Archetype.Extensions /// /// Retrieves additional metadata that isn't available on the stored model of an ArchetypePreValue /// - /// The Archetype to add the additional metadata to /// The configuration of the Archetype private void RetrieveAdditionalProperties(ref ArchetypePreValue preValue) { @@ -209,5 +293,18 @@ namespace Archetype.Extensions } } } + + + /// + /// Gets the DLL version from the file. + /// + /// System.String. + internal string DllVersion() + { + var asm = Assembly.GetExecutingAssembly(); + var fvi = FileVersionInfo.GetVersionInfo(asm.Location); + + return fvi.FileVersion; + } } } \ No newline at end of file diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs new file mode 100644 index 0000000..ad95261 --- /dev/null +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeConfigFileModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace Archetype.Models +{ + public class ArchetypeConfigFileModel + { + public Guid Id { get; set; } + public bool CheckForUpdates { get; set; } + } +} diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs new file mode 100644 index 0000000..58de79c --- /dev/null +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeGlobalSettings.cs @@ -0,0 +1,134 @@ +using System; +using System.IO; +using System.Text; +using Newtonsoft.Json; +using Umbraco.Core.IO; +using Umbraco.Core.Logging; + +namespace Archetype.Models +{ + public class ArchetypeGlobalSettings + { + public bool CheckForUpdates { get; set; } + public Guid Id { get; set; } + + public Guid ApiKey = _getApiKey(); + + private static ArchetypeGlobalSettings _instance; + + private static string _pathToConfig = @"~/Config/Archetype.config.js"; + + private static readonly string _mappedPathToConfig = IOHelper.MapPath(_pathToConfig); + + private static object _padLock = new object(); + + private ArchetypeGlobalSettings() + { + + } + + public static ArchetypeGlobalSettings Instance + { + get + { + if (_instance == null) + { + lock (_padLock) + { + if (_instance == null) + { + _instance = new ArchetypeGlobalSettings(); + + _loadSettingsFromConfigFile(); + } + } + } + + return _instance; + } + } + + public void Save() + { + lock (_padLock) + { + //write to JSON + var configFileModel = new ArchetypeConfigFileModel + { + Id = _instance.Id, + CheckForUpdates = _instance.CheckForUpdates + }; + + var serializedJson = JsonConvert.SerializeObject(configFileModel, Formatting.Indented); + + File.WriteAllText(_mappedPathToConfig, serializedJson); + } + } + + private static void _loadSettingsFromConfigFile() + { + try + { + if (File.Exists(_mappedPathToConfig)) + { + //load + var deserializedConfigFile = JsonConvert.DeserializeObject(File.ReadAllText(_mappedPathToConfig)); + + if (deserializedConfigFile != null) + { + _instance.Id = deserializedConfigFile.Id; + _instance.CheckForUpdates = deserializedConfigFile.CheckForUpdates; + } + else + { + _createNewConfigFile("Config file model was null!"); + } + } + else + { + _createNewConfigFile("Config file was missing!"); + } + } + catch (Exception ex) + { + LogHelper.Error(ex.Message, ex); + + _createNewConfigFile("Exception!"); + } + } + + private static void _createNewConfigFile(string reason) + { + //write a new file with defaults + LogHelper.Info(string.Format("Generating a new config file reason: {0}", reason)); + + _instance.Id = Guid.NewGuid(); + _instance.CheckForUpdates = true; + _instance.Save(); + } + + private static Guid _getApiKey() + { + //this is just obfuscation and an attempt to keep out most but not the determined hacker + var array = new [] + { + "RTA4MUZDRjA=", + "NzkzQS1BRDIw", + "OTI3QjFDNjkwQTYy", + "MjI0OQ==" + }; + + return new Guid(string.Format("{0}-{1}-{3}-{2}", + _decodeBase64(array[0]), + _decodeBase64(array[1]), + _decodeBase64(array[2]), + _decodeBase64(array[3]) + )); + } + + private static string _decodeBase64(string input) + { + return Encoding.UTF8.GetString(Convert.FromBase64String(input)); + } + } +} diff --git a/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs new file mode 100644 index 0000000..e99b1ff --- /dev/null +++ b/app/Umbraco/Umbraco.Archetype/Models/ArchetypeUpdateNotification.cs @@ -0,0 +1,11 @@ +namespace Archetype.Models +{ + public class ArchetypeUpdateNotification + { + public bool IsUpdateAvailable { get; set; } + public string Headline { get; set; } + public string Type { get; set; } + public string Message { get; set; } + public string Url { get; set; } + } +} diff --git a/app/Umbraco/Umbraco.Archetype/Properties/AssemblyInfo.cs b/app/Umbraco/Umbraco.Archetype/Properties/AssemblyInfo.cs index 47eb6ba..53871e3 100644 --- a/app/Umbraco/Umbraco.Archetype/Properties/AssemblyInfo.cs +++ b/app/Umbraco/Umbraco.Archetype/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Archetype")] [assembly: AssemblyDescription("Archetype's supporting code library for Umbraco")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Imulus")] +[assembly: AssemblyCompany("Kevin Giszewski LLC")] [assembly: AssemblyProduct("Archetype")] [assembly: AssemblyCopyright("MIT Licensed")] [assembly: AssemblyTrademark("")] diff --git a/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs b/app/Umbraco/Umbraco.Archetype/Properties/VersionInfo.cs index 97f5ded..6b51d14 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.15.1")] -[assembly: AssemblyFileVersion("1.15.1")] +[assembly: AssemblyVersion("1.16.0")] +[assembly: AssemblyFileVersion("1.16.0")] diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js index a718175..d015699 100644 --- a/app/controllers/config.controller.js +++ b/app/controllers/config.controller.js @@ -1,4 +1,4 @@ -angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, dialogService, archetypePropertyEditorResource) { +angular.module("umbraco").controller("Imulus.ArchetypeConfigController", function ($scope, $http, assetsService, dialogService, archetypePropertyEditorResource, archetypeGlobalConfigService, notificationsService) { //$scope.model.value = ""; //console.log($scope.model.value); @@ -16,6 +16,17 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio archetypePropertyEditorResource.getDllVersion().then(function(data){ $scope.dllVersion = data.dllVersion; }); + + archetypeGlobalConfigService.checkForUpdates().then(function(data) { + if(data.isUpdateAvailable) { + notificationsService.add({ + headline: data.headline, + type: data.type, + message: data.message, + url: data.url + }); + } + }); //ini the render model initConfigRenderModel(); diff --git a/app/controllers/config.dialog.controller.js b/app/controllers/config.dialog.controller.js index 511f37d..5f5fc06 100644 --- a/app/controllers/config.dialog.controller.js +++ b/app/controllers/config.dialog.controller.js @@ -1,4 +1,5 @@ angular.module('umbraco').controller('ArchetypeConfigOptionsController', function ($scope) { + //handles a fieldset group add $scope.addFieldsetGroup = function () { $scope.dialogData.model.fieldsetGroups.push({ name: "" }); diff --git a/app/controllers/config.global.controller.js b/app/controllers/config.global.controller.js new file mode 100644 index 0000000..948ad93 --- /dev/null +++ b/app/controllers/config.global.controller.js @@ -0,0 +1,21 @@ +angular.module('umbraco').controller('ArchetypeConfigGlobalOptionsController', function ($scope, archetypeGlobalConfigService) { + $scope.globalSettings = {}; + + $scope.confirmCheckNewVersionChange = function() { + archetypeGlobalConfigService.setCheckForUpdates($scope.globalSettings.checkForNewVersion); + } + + function getGlobalSettings() + { + archetypeGlobalConfigService.globalSettings().then(function(data) { + $scope.globalSettings.checkForNewVersion = data.isCheckingForUpdates; + }); + } + + init(); + + function init() + { + getGlobalSettings(); + } +}); \ No newline at end of file diff --git a/app/langs/en-gb.js b/app/langs/en-gb.js index 85889b5..d141e13 100644 --- a/app/langs/en-gb.js +++ b/app/langs/en-gb.js @@ -11,7 +11,7 @@ "maxFieldsets": "Max Fieldsets", "maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.", "enableMultipleFieldsets": "Enable Multiple Fieldsets?", - "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.", + "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this Archetype.", "hideFieldsetToolbar": "Hide Fieldset Toolbar?", "hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.", "customWrapperClass": "Custom Wrapper Class", @@ -23,7 +23,7 @@ "toggleDeveloperMode": "Toggle Developer Mode", "toggleDeveloperModeDescription": "Turn on for developer options.", "configModel": "Config Model", - "configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.", + "configModelDescription": "Be careful editing the text below, it controls the schema for this Archetype.", "helpText": "Help Text", "defaultValue": "Default Value", "dataType": "DataType", diff --git a/app/langs/en-us.js b/app/langs/en-us.js index bdde762..65401c4 100644 --- a/app/langs/en-us.js +++ b/app/langs/en-us.js @@ -11,7 +11,7 @@ "maxFieldsets": "Max Fieldsets", "maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.", "enableMultipleFieldsets": "Enable Multiple Fieldsets?", - "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.", + "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this Archetype.", "hideFieldsetToolbar": "Hide Fieldset Toolbar?", "hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.", "customWrapperClass": "Custom Wrapper Class", @@ -23,7 +23,7 @@ "toggleDeveloperMode": "Toggle Developer Mode", "toggleDeveloperModeDescription": "Turn on for developer options.", "configModel": "Config Model", - "configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.", + "configModelDescription": "Be careful editing the text below, it controls the schema for this Archetype.", "helpText": "Help Text", "defaultValue": "Default Value", "dataType": "DataType", diff --git a/app/langs/en.js b/app/langs/en.js index bdde762..65401c4 100644 --- a/app/langs/en.js +++ b/app/langs/en.js @@ -11,7 +11,7 @@ "maxFieldsets": "Max Fieldsets", "maxFieldsetsDescription": "How many Fieldsets are allowed? Entering '1' will disable the controls. Default is unlimited.", "enableMultipleFieldsets": "Enable Multiple Fieldsets?", - "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this archetype.", + "enableMultipleFieldsetsDescription": "Allows multiple types of fieldsets within this Archetype.", "hideFieldsetToolbar": "Hide Fieldset Toolbar?", "hideFieldsetToolbarDescription": "Hides the fieldset toolbar that appears when more than one fieldset model appears.", "customWrapperClass": "Custom Wrapper Class", @@ -23,7 +23,7 @@ "toggleDeveloperMode": "Toggle Developer Mode", "toggleDeveloperModeDescription": "Turn on for developer options.", "configModel": "Config Model", - "configModelDescription": "Be careful editing the text below, it controls the schema for this archetype.", + "configModelDescription": "Be careful editing the text below, it controls the schema for this Archetype.", "helpText": "Help Text", "defaultValue": "Default Value", "dataType": "DataType", diff --git a/app/less/archetype.less b/app/less/archetype.less index 0c87813..190b47f 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -357,6 +357,7 @@ } } } + .settings { padding: 14px; background-color: #f8f8f8; @@ -391,6 +392,7 @@ .archetypeEditorControls { float: right; } + .archetypeEditorControls, .archetypeFieldsetGroups { i { cursor: pointer; @@ -429,6 +431,26 @@ .manual-link { color: blue; } + + .donate-link { + font-weight: 700; + } + + .sponsors { + padding-bottom: 10px; + margin-bottom: 5px; + margin-left: 5px; + display: inline-table; + float: right; + + a { + float: none; + } + + h4 { + border-bottom: 1px solid #ccc; + } + } ul { list-style: none; @@ -449,6 +471,8 @@ .archetypeFieldsets { margin-left: 0; + border-top: 5px solid; + padding-top: 5px; } .archetypeFieldsetWrapper { diff --git a/app/services/archetypeGlobalConfigService.js b/app/services/archetypeGlobalConfigService.js new file mode 100644 index 0000000..a732ed0 --- /dev/null +++ b/app/services/archetypeGlobalConfigService.js @@ -0,0 +1,19 @@ +angular.module('umbraco.services').factory('archetypeGlobalConfigService', function ($q, $http, umbRequestHelper) { + return { + globalSettings: function () { + return umbRequestHelper.resourcePromise( + $http.get("backoffice/ArchetypeApi/ArchetypeDataType/globalSettings"), 'Failed to get whether or not we are checking for updates!' + ); + }, + setCheckForUpdates: function (isChecking) { + return umbRequestHelper.resourcePromise( + $http.post("backoffice/ArchetypeApi/ArchetypeDataType/SetCheckForUpdates", isChecking), 'Failed to update check status!' + ); + }, + checkForUpdates: function () { + return umbRequestHelper.resourcePromise( + $http.post("backoffice/ArchetypeApi/ArchetypeDataType/checkForUpdates", { }), 'Failed to check for updates!' + ); + } + } +}); \ No newline at end of file diff --git a/app/views/archetype.config.developer.dialog.html b/app/views/archetype.config.developer.dialog.html index 96e4f44..19a3851 100644 --- a/app/views/archetype.config.developer.dialog.html +++ b/app/views/archetype.config.developer.dialog.html @@ -11,9 +11,11 @@
- +
+ +
- +
diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index 94f6f97..dbd033f 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -1,8 +1,17 @@ {{VERSION_HTML}}
-

Archetype{{dllVersion}}

-

At a minimum your Archetype needs at least one fieldset with at least one property. You can configure it to allow for multiple types of fieldsets within a single Archetype and you can even add another Archetype as a property. Please use the link below for the full manual:

-

Archetype Manual

+

Archetype{{dllVersion}}

+

At a minimum your Archetype needs at least one fieldset with at least one property. Please use the link below for the full manual. We would really love a donation if you find Archetype useful. Your company can also sponsor a sprint!

+

+ Archetype Manual | + Terms of Service | + Quick Start Video | + Twitter | + GitHub | + Become a sponsor | + +

+
  • diff --git a/assets/tonic_logo_50.png b/assets/tonic_logo_50.png new file mode 100644 index 0000000..29eb5e4 Binary files /dev/null and b/assets/tonic_logo_50.png differ diff --git a/config/meta.json b/config/meta.json index 6c5dc6f..b13e405 100644 --- a/config/meta.json +++ b/config/meta.json @@ -1,9 +1,9 @@ { "name": "Archetype", - "version": "1.15.1", - "url": "http://github.com/imulus/archetype/", - "author": "Imulus - Kevin Giszewski - Tom Fulton - Lee Kelleher - Matt Brailsford - Kenn Jacobsen - Et. Al.", - "authorUrl": "http://imulus.com/", + "version": "1.16.0", + "url": "http://github.com/kgiszewski/archetype/", + "author": "Kevin Giszewski - Tom Fulton - Lee Kelleher - Matt Brailsford - Kenn Jacobsen - Nicholas Westby - Et. Al.", + "authorUrl": "http://github.com/kgiszewski/archetype/", "license": "MIT", "licenseUrl": "http://opensource.org/licenses/MIT" } \ No newline at end of file