diff --git a/app/controllers/controller.js b/app/controllers/controller.js index 84824f9..2ace9dc 100644 --- a/app/controllers/controller.js +++ b/app/controllers/controller.js @@ -557,13 +557,13 @@ angular.module("umbraco").controller("Imulus.ArchetypeController", function ($sc $scope.activeSubmitWatcher++; return $scope.activeSubmitWatcher; } - $scope.submitWatcherOnSubmit = function () { + $scope.submitWatcherOnSubmit = function (args) { _.each($scope.model.value.fieldsets, function(fieldset) { // extract the publish configuration from the fieldsets (and convert local datetimes to UTC) fieldset.releaseDate = toUtc(fieldset.releaseDateModel.value); fieldset.expireDate = toUtc(fieldset.expireDateModel.value); }); - $scope.$broadcast("archetypeFormSubmitting"); + $scope.$broadcast("archetypeFormSubmitting", args); } function toUtc(date) { diff --git a/app/directives/archetypeproperty.js b/app/directives/archetypeproperty.js index 3a9b177..62045e1 100644 --- a/app/directives/archetypeproperty.js +++ b/app/directives/archetypeproperty.js @@ -115,14 +115,16 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c }); scope.$on('archetypeFormSubmitting', function (ev, args) { - // validate all fieldset properties - _.each(scope.fieldset.properties, function (property) { - archetypeService.validateProperty(scope.fieldset, property, configFieldsetModel); - }); + if(args.action !== 'save') { + // validate all fieldset properties + _.each(scope.fieldset.properties, function (property) { + archetypeService.validateProperty(scope.fieldset, property, configFieldsetModel); + }); - var validationKey = "validation-f" + scope.fieldsetIndex; + var validationKey = "validation-f" + scope.fieldsetIndex; - ngModelCtrl.$setValidity(validationKey, scope.fieldset.isValid); + ngModelCtrl.$setValidity(validationKey, scope.fieldset.isValid); + } // did the value change (if it did, it most likely did so during the "formSubmitting" event) var property = archetypeService.getFieldsetProperty(scope); diff --git a/app/directives/archetypesubmitwatcher.js b/app/directives/archetypesubmitwatcher.js index d2b06c7..75b4ac0 100644 --- a/app/directives/archetypesubmitwatcher.js +++ b/app/directives/archetypesubmitwatcher.js @@ -3,9 +3,10 @@ angular.module("umbraco.directives").directive('archetypeSubmitWatcher', functio // call the load callback on scope to obtain the ID of this submit watcher var id = scope.loadCallback(); scope.$on("formSubmitting", function (ev, args) { + // on the "formSubmitting" event, call the submit callback on scope to notify the Archetype controller to do it's magic if (id == scope.activeSubmitWatcher) { - scope.submitCallback(); + scope.submitCallback(args); } }); } diff --git a/app/less/archetype.less b/app/less/archetype.less index 8ee8518..1cadf0e 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -413,8 +413,10 @@ .archetypeFieldsetOption { margin-bottom: 15px; + margin-right: 15px; input[type=text]{ - max-width: 300px; + max-width: 100%; + width: 100%; } } @@ -425,15 +427,20 @@ height: 130px; } - .archetypeOptions label{ - width: 400px; + .archetypeOptions { + .btn { + margin-bottom: 5px; + } + + label{ + width: 400px; + } } .archetypePropertiesWrapper { border: 1px solid #ddd; padding: 8px; margin: -40px 10px 10px 140px; - max-width: 475px; ul { padding: 0; @@ -446,12 +453,13 @@ background-color: #eee; input[type=text] { - max-width: 190px; - width: auto; + max-width: 100%; + width: 100%; } select { - max-width: 160px; + max-width: 100%; + width: 100%; } } @@ -464,6 +472,10 @@ label { width: 100%; } + + input[type=text] { + width: 100%; + } input[type=checkbox] { margin-top: 0; @@ -511,8 +523,10 @@ .archetypePropertyCollapser { margin-top: 10px; + div { margin-bottom: 10px; + margin-right: 15px; } } diff --git a/app/services/archetypeLabelService.js b/app/services/archetypeLabelService.js index 91f8b72..f33760c 100644 --- a/app/services/archetypeLabelService.js +++ b/app/services/archetypeLabelService.js @@ -31,6 +31,8 @@ angular.module('umbraco.services').factory('archetypeLabelService', function (ar return coreMediaPicker(value, scope, datatype); case "Umbraco.DropDown": return coreDropdown(value, scope, datatype); + case "RJP.MultiUrlPicker": + return rjpMultiUrlPicker(value, scope, {}); default: return ""; } @@ -149,6 +151,18 @@ angular.module('umbraco.services').factory('archetypeLabelService', function (ar return strippedText.substring(0, args.contentLength) + suffix; } + function rjpMultiUrlPicker(values, scope, args) { + var names = []; + + _.each(values, function (value) { + if (value.name) { + names.push(value.name); + } + }); + + return names.join(", "); + } + return { getFieldsetTitle: function(scope, fieldsetConfigModel, fieldsetIndex) {