Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit 6ccfa4c

Browse files
committed
changes select box for picking document type, to a list of items.
1 parent fc5fff5 commit 6ccfa4c

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

src/Our.Umbraco.DocTypeGridEditor/Web/Controllers/DocTypeGridEditorApiController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public IEnumerable<object> GetContentTypes([ModelBinder] string[] allowedContent
3636
guid = x.Key,
3737
name = x.Name,
3838
alias = x.Alias,
39+
description = x.Description,
3940
icon = x.Icon
4041
});
4142
}

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
199199

200200
$scope.model.nameExp = nameExp;
201201

202-
$scope.selectDocType = function () {
202+
$scope.selectDocType = function (alias) {
203203
$scope.dialogMode = "edit";
204-
$scope.model.dialogData.docTypeAlias = $scope.selectedDocType.alias;
204+
$scope.model.dialogData.docTypeAlias = alias;
205205
loadNode();
206206
};
207207

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.dialog.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
<div class="dtge-dialog " ng-controller="Our.Umbraco.DocTypeGridEditor.Dialogs.DocTypeGridEditorDialog">
22

33
<div ng-switch="dialogMode">
4-
5-
<umb-control-group label="Choose a content type" ng-switch-when="selectDocType">
6-
<select class="umb-editor" ng-change="selectDocType()" name="selectDocType" ng-model="$parent.$parent.selectedDocType" ng-options="dt as dt.name for dt in docTypes" required>
7-
<option value=""><localize key="choose" />...</option>
8-
</select>
9-
</umb-control-group>
4+
<div ng-switch-when="selectDocType">
5+
<h5>Select a content type</h5>
6+
<ul class="umb-actions umb-actions-child">
7+
<li data-element="action-create-{{docType.alias}}" ng-repeat="docType in docTypes | orderBy:'name':false">
8+
<a ng-click="selectDocType(docType.alias)">
9+
<i class="large {{docType.icon}}"></i>
10+
<span class="menu-label">
11+
{{docType.name}}
12+
<small>
13+
{{docType.description}}
14+
</small>
15+
</span>
16+
</a>
17+
</li>
18+
</ul>
19+
</div>
1020

1121
<div ng-switch-when="edit">
1222

0 commit comments

Comments
 (0)