Merge pull request #2833 from umbraco/temp8-126
fixes: Update UI on the dictionary editor to match V8 styles
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
* @description
|
||||
* The controller for editing dictionary items
|
||||
*/
|
||||
function DictionaryEditController($scope, $routeParams, dictionaryResource, treeService, navigationService, appState, editorState, contentEditingHelper, formHelper, notificationsService, localizationService) {
|
||||
function DictionaryEditController($scope, $routeParams, $location, dictionaryResource, navigationService, appState, editorState, contentEditingHelper, formHelper, notificationsService, localizationService) {
|
||||
|
||||
var vm = this;
|
||||
|
||||
//setup scope vars
|
||||
@@ -18,6 +19,10 @@ function DictionaryEditController($scope, $routeParams, dictionaryResource, tree
|
||||
vm.page.menu.currentSection = appState.getSectionState("currentSection");
|
||||
vm.page.menu.currentNode = null;
|
||||
vm.description = "";
|
||||
vm.showBackButton = true;
|
||||
|
||||
vm.save = saveDictionary;
|
||||
vm.back = back;
|
||||
|
||||
function loadDictionary() {
|
||||
|
||||
@@ -26,9 +31,7 @@ function DictionaryEditController($scope, $routeParams, dictionaryResource, tree
|
||||
//we are editing so get the content item from the server
|
||||
dictionaryResource.getById($routeParams.id)
|
||||
.then(function (data) {
|
||||
|
||||
bindDictionary(data);
|
||||
|
||||
vm.page.loading = false;
|
||||
});
|
||||
}
|
||||
@@ -100,7 +103,9 @@ function DictionaryEditController($scope, $routeParams, dictionaryResource, tree
|
||||
}
|
||||
}
|
||||
|
||||
vm.save = saveDictionary;
|
||||
function back() {
|
||||
$location.path("settings/dictionary/list");
|
||||
}
|
||||
|
||||
$scope.$watch("vm.content.name", function (newVal, oldVal) {
|
||||
//when the value changes, we need to set the name dirty
|
||||
|
||||
@@ -18,9 +18,10 @@ function DictionaryListController($scope, $location, dictionaryResource, localiz
|
||||
|
||||
dictionaryResource.getList()
|
||||
.then(function (data) {
|
||||
|
||||
vm.items = data;
|
||||
|
||||
angular.forEach(vm.items, function(item){
|
||||
item.style = { "paddingLeft": item.level * 10 };
|
||||
});
|
||||
vm.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,14 +12,20 @@
|
||||
name-locked="vm.page.nameLocked"
|
||||
hide-icon="true"
|
||||
hide-description="true"
|
||||
hide-alias="true">
|
||||
hide-alias="true"
|
||||
on-back="vm.back()"
|
||||
show-back-button="vm.showBackButton">
|
||||
</umb-editor-header>
|
||||
|
||||
<umb-editor-container class="form-horizontal">
|
||||
<p ng-bind-html="vm.description"></p>
|
||||
<umb-property ng-repeat="translation in vm.content.translations" property="translation.property">
|
||||
<textarea ng-model="translation.translation"></textarea>
|
||||
</umb-property>
|
||||
<umb-box>
|
||||
<umb-box-content>
|
||||
<p ng-bind-html="vm.description"></p>
|
||||
<umb-property ng-repeat="translation in vm.content.translations" property="translation.property">
|
||||
<textarea ng-model="translation.translation"></textarea>
|
||||
</umb-property>
|
||||
</umb-box-content>
|
||||
</umb-box>
|
||||
</umb-editor-container>
|
||||
|
||||
<umb-editor-footer>
|
||||
|
||||
@@ -11,36 +11,27 @@
|
||||
name-locked="true">
|
||||
</umb-editor-header>
|
||||
<umb-editor-container>
|
||||
<div>
|
||||
<div class="umb-table" ng-if="vm.items">
|
||||
<div class="umb-table-head">
|
||||
<div class="umb-table-row">
|
||||
<div class="umb-table-cell umb-table__name not-fixed">
|
||||
<span><localize key="general_name">Name</localize></span>
|
||||
</div>
|
||||
<div class="umb-table-cell" ng-repeat="column in vm.items[0].translations">
|
||||
|
||||
<span ng-bind="column.displayName"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="umb-table-body">
|
||||
<div class="umb-table-row"
|
||||
ng-repeat="item in vm.items">
|
||||
<div class="umb-table-cell umb-table__name not-fixed">
|
||||
<a title="{{ item.name }}" class="umb-table-body__link" prevent-default
|
||||
ng-click="vm.clickItem(item.id)"
|
||||
ng-bind="item.name" style="padding-left:{{item.level*10}}px">
|
||||
</a>
|
||||
</div>
|
||||
<div class="umb-table-cell" ng-repeat="column in item.translations">
|
||||
<i class="{{column.hasTranslation ? 'icon-check color-green' : 'icon-alert color-red'}}"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-hover" ng-if="vm.items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><localize key="general_name">Name</localize></th>
|
||||
<th ng-repeat="column in vm.items[0].translations">{{column.displayName}}</th>
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="item in vm.items track by item.id" ng-click="vm.clickItem(item.id)" style="cursor: pointer;">
|
||||
<td>
|
||||
<span class="bold" ng-style="item.style">{{item.name}}</span>
|
||||
</td>
|
||||
<td ng-repeat="column in item.translations">
|
||||
<i ng-if="column.hasTranslation" class="icon-check color-green"></i>
|
||||
<i ng-if="!column.hasTranslation" class="icon-alert color-red"></i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</umb-editor-container>
|
||||
</umb-editor-view>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user