Merge branch 'list-view-properties' of https://github.com/pynej/Umbraco-CMS into pynej-list-view-properties

Conflicts:
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html
This commit is contained in:
Shannon
2014-09-11 16:07:58 +10:00
parent d3bfb5e94d
commit 03cf0113d5
4 changed files with 75 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
function listViewController($rootScope, $scope, $routeParams, $injector, notificationsService, iconHelper, dialogService) {
function listViewController($rootScope, $scope, $routeParams, $injector, notificationsService, iconHelper, dialogService, editorState) {
//this is a quick check to see if we're in create mode, if so just exit - we cannot show children for content
// that isn't created yet, if we continue this will use the parent id in the route params which isn't what
@@ -31,11 +31,13 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
// Set "default default" options (i.e. those if no container configuration has been saved)
$scope.options = {
pageSize: 10,
pageSize: $scope.model.config.pageSize ? $scope.model.config.pageSize : 10,
pageNumber: 1,
filter: '',
orderBy: 'updateDate',
orderDirection: "desc",
orderBy: $scope.model.config.orderBy ? $scope.model.config.orderBy : 'UpdateDate',
orderDirection: $scope.model.config.orderDirection ? $scope.model.config.orderDirection : "desc"
//orderBy: 'updateDate',
//orderDirection: "desc",
allowBulkPublish: true,
allowBulkUnpublish: true,
allowBulkDelete: true,
@@ -360,6 +362,19 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
}
};
$scope.includeProperties = $scope.model.config.includeProperties ? _.map($scope.model.config.includeProperties, function (i) {
if (!i.label)
i.label = i.value.replace(/([A-Z]?[a-z]+)/g, '$1 ').trim(' ');
if (typeof (i.isProperty) == "undefined")
i.isProperty = !i.value.match("contentTypeAlias|createDate|icon|owner|published|sortOrder|updateDat|updator");
if (!i.isProperty && !i.sortBy)
i.sortBy = i.value.substring(0, 1).toUpperCase() + i.value.slice(1);
// TODO: Add sort logic for custom properties.
//else if (!i.sortBy)
// ;
return i;
}) : {};
}
angular.module("umbraco").controller("Umbraco.PropertyEditors.ListViewController", listViewController);

View File

@@ -62,6 +62,13 @@
</a>
</td>
<!-- <td ng-repeat="property in includeProperties">
<a href="#" ng-click="sort('{{property.sortBy}}')" prevent-default ng-hide="!property.sortBy">
{{property.label}}
<i class="icon-sort"></i></a>
<span ng-hide="property.sortBy">{{property.label}}</span>
</td> -->
<td>
<form class="pull-right" novalidate>
<i class="icon-search"></i>
@@ -95,6 +102,13 @@
{{getPropertyValue(column.alias, result)}}
</td>
</td>
<td ng-repeat="property in includeProperties">
{{result[property.value]}}
<div ng-repeat="props in result.properties | filter: { alias: property.value }">
{{props.value}}
</div>
<td></td>
</tr>
</tbody>

View File

@@ -0,0 +1,12 @@
<div>
<label class="radio">
<input type="radio" name="orderDirection" value="asc" ng-model="model.value" />
Ascending <code>[a-z]</code>
</label>
<label class="radio">
<input type="radio" name="orderDirection" value="desc" ng-model="model.value" />
Descending <code>[z-a]</code>
</label>
<span class="help-inline" val-msg-for="orderDirection" val-toggle-msg="required">Required</span>
</div>