diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbutton.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbutton.directive.js index e26f622d2e..1d52c4e451 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbutton.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbutton.directive.js @@ -65,6 +65,8 @@ Use this directive to render an umbraco button. The directive can be used to gen @param {string=} icon Set a button icon. @param {string=} size Set a button icon ("xs", "m", "l", "xl"). @param {boolean=} disabled Set to true to disable the button. +@param {string=} addEllipsis Adds an ellipsis character (…) to the button label which means the button will open a dialog or prompt the user for more information. + **/ (function () { @@ -90,14 +92,15 @@ Use this directive to render an umbraco button. The directive can be used to gen icon: "@?", disabled: " 1 ? "buttons_saveAndPublishMany" : "buttons_saveAndPublish", + labelKey: "buttons_saveAndPublish", handler: args.methods.saveAndPublish, hotKey: "ctrl+p", hotKeyWhenHidden: true, - alias: "saveAndPublish" + alias: "saveAndPublish", + addEllipsis: args.content.variants && args.content.variants.length > 1 ? "true" : "false" }; case "H": //send to publish @@ -175,7 +176,8 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica handler: args.methods.sendToPublish, hotKey: "ctrl+p", hotKeyWhenHidden: true, - alias: "sendToPublish" + alias: "sendToPublish", + addEllipsis: args.content.variants && args.content.variants.length > 1 ? "true" : "false" }; case "A": //save @@ -185,7 +187,8 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica handler: args.methods.save, hotKey: "ctrl+s", hotKeyWhenHidden: true, - alias: "save" + alias: "save", + addEllipsis: args.content.variants && args.content.variants.length > 1 ? "true" : "false" }; case "Z": //unpublish diff --git a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less b/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less index 388d3587c1..4bcc60d5f3 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less @@ -9,6 +9,10 @@ left: auto; } +.umb-button-group__sub-buttons>li>a { + display: flex; +} + .umb-button-group { .umb-button__button { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html index d46c80ddc5..3810630fa9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html @@ -12,7 +12,8 @@ shortcut="{{defaultButton.hotKey}}" shortcut-when-hidden="{{defaultButton.hotKeyWhenHidden}}" size="{{size}}" - icon="{{icon}}"> + icon="{{icon}}" + add-ellipsis={{defaultButton.addEllipsis}}> @@ -23,6 +24,7 @@
  • {{subButton.labelKey}} + ...
  • diff --git a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button.html b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button.html index a214a5a58f..68d4adef5a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button.html @@ -10,24 +10,21 @@ - {{vm.label}} - {{vm.label}} + {{vm.buttonLabel}} diff --git a/src/Umbraco.Web.UI.Client/src/views/content/overlays/sendtopublish.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/overlays/sendtopublish.controller.js new file mode 100644 index 0000000000..6816e1430d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/content/overlays/sendtopublish.controller.js @@ -0,0 +1,85 @@ +(function () { + "use strict"; + + function SendToPublishController($scope, localizationService) { + + var vm = this; + vm.loading = true; + + vm.modifiedVariantFilter = modifiedVariantFilter; + vm.unmodifiedVariantFilter = unmodifiedVariantFilter; + vm.changeSelection = changeSelection; + + function onInit() { + + vm.variants = $scope.model.variants; + + // set dialog title + if (!$scope.model.title) { + localizationService.localize("content_sendForApproval").then(function (value) { + $scope.model.title = value; + }); + } + + + if (vm.variants.length !== 0) { + //now sort it so that the current one is at the top + vm.variants = _.sortBy(vm.variants, function (v) { + return v.active ? 0 : 1; + }); + + var active = _.find(vm.variants, function (v) { + return v.active; + }); + + if (active) { + //ensure that the current one is selected + active.sendToPublish = true; + } + + } else { + //disable save button if we have nothing to save + $scope.model.disableSubmitButton = true; + } + + vm.loading = false; + + } + + function changeSelection() { + var firstSelected = _.find(vm.variants, function (v) { + return v.sendToPublish; + }); + $scope.model.disableSubmitButton = !firstSelected; //disable submit button if there is none selected + } + + function modifiedVariantFilter(variant) { + //determine a variant is 'modified' (meaning it will show up as able to send for approval) + // * it's editor is in a $dirty state + // * it is in Draft state + // * it is published with pending changes + return (variant.active || variant.isDirty || variant.state === "Draft" || variant.state === "PublishedPendingChanges"); + } + + function unmodifiedVariantFilter(variant) { + //determine a variant is 'unmodified' (meaning it will NOT show up as able to send for approval) + // * it's editor is in a $dirty state + // * it has been published + // * it is not created for that specific language + return (variant.state === "Published" && !variant.isDirty && !variant.active || variant.state === "NotCreated" && !variant.isDirty && !variant.active); + } + + //when this dialog is closed, reset all 'sendToPublish' flags + $scope.$on('$destroy', function () { + for (var i = 0; i < vm.variants.length; i++) { + vm.variants[i].sendToPublish = false; + } + }); + + onInit(); + + } + + angular.module("umbraco").controller("Umbraco.Overlays.SendToPublishController", SendToPublishController); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/content/overlays/sendtopublish.html b/src/Umbraco.Web.UI.Client/src/views/content/overlays/sendtopublish.html new file mode 100644 index 0000000000..197c172c8d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/content/overlays/sendtopublish.html @@ -0,0 +1,65 @@ +
    + +
    +

    +
    + +
    + +
    + +
    + +
    + +
    + +
    + + +
    + +
    + +
    +
    {{publishVariantSelectorForm.publishVariantSelector.errorMsg}}
    +
    + +
    +
    {{notification.message}}
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +

    +
    + +
    +
    +
    + {{ variant.language.name }} + * +
    + +
    +
    +
    + +
    diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js index 84b58cac94..afc00bb7e2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js @@ -17,6 +17,7 @@ // insert buttons vm.page.insertDefaultButton = { labelKey: "general_insert", + addEllipsis: "true", handler: function() { vm.openInsertOverlay(); } @@ -24,18 +25,21 @@ vm.page.insertSubButtons = [ { labelKey: "template_insertPageField", + addEllipsis: "true", handler: function () { vm.openPageFieldOverlay(); } }, { labelKey: "template_insertMacro", + addEllipsis: "true", handler: function () { vm.openMacroOverlay() } }, { labelKey: "template_insertDictionaryItem", + addEllipsis: "true", handler: function () { vm.openDictionaryItemOverlay(); } diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html index e28b76d785..ecdd68fee8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html @@ -39,7 +39,8 @@ size="xs" action="vm.openQueryBuilderOverlay()" icon="icon-wand" - label-key="template_queryBuilder"> + label-key="template_queryBuilder" + add-ellipsis="true"> diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js index 64ca0331af..ff14ea0ebd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js @@ -17,6 +17,7 @@ // insert buttons vm.page.insertDefaultButton = { labelKey: "general_insert", + addEllipsis: "true", handler: function() { vm.openInsertOverlay(); } @@ -24,18 +25,21 @@ vm.page.insertSubButtons = [ { labelKey: "template_insertPageField", + addEllipsis: "true", handler: function () { vm.openPageFieldOverlay(); } }, { labelKey: "template_insertMacro", + addEllipsis: "true", handler: function () { vm.openMacroOverlay() } }, { labelKey: "template_insertDictionaryItem", + addEllipsis: "true", handler: function () { vm.openDictionaryItemOverlay(); } diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html index a222234e80..b17fc333d6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html @@ -40,7 +40,8 @@ size="xs" action="vm.openQueryBuilderOverlay()" icon="icon-wand" - label-key="template_queryBuilder"> + label-key="template_queryBuilder" + add-ellipsis="true"> diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js index 2d7df19424..e925f6e41e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js @@ -21,6 +21,7 @@ // insert buttons vm.page.insertDefaultButton = { labelKey: "general_insert", + addEllipsis: "true", handler: function() { vm.openInsertOverlay(); } @@ -28,24 +29,28 @@ vm.page.insertSubButtons = [ { labelKey: "template_insertPageField", + addEllipsis: "true", handler: function () { vm.openPageFieldOverlay(); } }, { labelKey: "template_insertPartialView", + addEllipsis: "true", handler: function () { vm.openPartialOverlay(); } }, { labelKey: "template_insertDictionaryItem", + addEllipsis: "true", handler: function () { vm.openDictionaryItemOverlay(); } }, { labelKey: "template_insertMacro", + addEllipsis: "true", handler: function () { vm.openMacroOverlay() } diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html index 5576d2713f..9811fa3133 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html @@ -66,7 +66,8 @@ size="xs" action="vm.openQueryBuilderOverlay()" icon="icon-wand" - label-key="template_queryBuilder"> + label-key="template_queryBuilder" + add-ellipsis="true"> + label-key="template_insertSections" + add-ellipsis="true"> diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index 39d37059d7..e362e401d3 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -126,12 +126,10 @@ Edit relations Return to list Save - Save and close Publish - Publish… Save and schedule - Save and send for approval + Send for approval Save list view Preview Preview is disabled because there's no template assigned @@ -266,10 +264,12 @@ This value is hidden. What languages would you like to publish? What languages would you like to save? + What languages would you like to send for approval? Published Languages Unmodified Languages Ready to Publish? Ready to Save? + Send for approval Create a new Content Template from '%0%'