Merge pull request #2115 from umbraco/temp-U4-10220

fixes: U4-10220 Missing the ability to create Content Templates (blue…
This commit is contained in:
Claus
2017-08-10 15:57:46 +02:00
committed by GitHub
4 changed files with 80 additions and 2 deletions

View File

@@ -0,0 +1,35 @@
/**
* @ngdoc controller
* @name Umbraco.Editors.ContentBlueprint.CreateController
* @function
*
* @description
* The controller for creating content blueprints
*/
function ContentBlueprintCreateController($scope, $location, contentTypeResource, navigationService) {
var vm = this;
var node = $scope.dialogOptions.currentNode;
vm.createBlueprint = createBlueprint;
function onInit() {
vm.loading = true;
contentTypeResource.getAll()
.then(function (documentTypes) {
vm.documentTypes = documentTypes;
vm.loading = false;
});
}
function createBlueprint(documentType) {
$location.path("/settings/contentBlueprints/edit/" + node.id).search("create", "true").search("doctype", documentType.alias);
navigationService.hideMenu();
}
onInit();
}
angular.module("umbraco").controller("Umbraco.Editors.ContentBlueprint.CreateController", ContentBlueprintCreateController);

View File

@@ -0,0 +1,41 @@
<div ng-controller="Umbraco.Editors.ContentBlueprint.CreateController as vm">
<div class="umbracoDialog umb-dialog-body with-footer" ng-cloak>
<div class="umb-pane">
<h5><localize key="create_createUnder">Create an item under</localize> {{currentNode.name}}</h5>
<p class="abstract" style="margin-bottom: 20px;"><localize key="create_createContentBlueprint">Select the document type you want to make a content template for</localize></p>
<umb-load-indicator ng-if="vm.loading"></umb-load-indicator>
<ul class="umb-actions umb-actions-child">
<li ng-repeat="documentType in vm.documentTypes | orderBy:'name':false">
<a href="" ng-click="vm.createBlueprint(documentType)" prevent-default>
<i class="large {{documentType.icon}}"></i>
<span class="menu-label">
{{documentType.name}}
<small>
{{documentType.description}}
</small>
</span>
</a>
</li>
</ul>
</div>
</div>
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar">
<umb-button
label-key="buttons_somethingElse"
action="nav.hideDialog(true)"
type="button"
button-style="info">
</umb-button>
</div>
</div>

View File

@@ -225,6 +225,7 @@
<area alias="create">
<key alias="chooseNode">Where do you want to create the new %0%</key>
<key alias="createUnder">Create an item under</key>
<key alias="createContentBlueprint">Select the document type you want to make a content template for</key>
<key alias="updateData">Choose a type and a title</key>
<key alias="noDocumentTypes" version="7.0"><![CDATA[There are no allowed document types available. You must enable these in the settings section under <strong>"document types"</strong>.]]></key>
<key alias="noMediaTypes" version="7.0"><![CDATA[There are no allowed media types available. You must enable these in the settings section under <strong>"media types"</strong>.]]></key>

View File

@@ -100,8 +100,9 @@ namespace Umbraco.Web.Trees
var menu = new MenuItemCollection();
if (id == Constants.System.Root.ToInvariantString())
{
// root actions
{
// root actions
menu.Items.Add<ActionNew>(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias)));
menu.Items.Add<RefreshNode, ActionRefresh>(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true);
return menu;
}