Merge branch 'temp-U4-7178-media-library' of https://github.com/umbraco/Umbraco-CMS into temp-U4-7178-media-library

This commit is contained in:
Per Ploug
2015-10-21 10:02:32 +02:00
6 changed files with 55 additions and 24 deletions

View File

@@ -5,6 +5,20 @@
function link(scope, el, attr, ctrl) {
scope.contentItemSortingOptions = {
distance: 10,
tolerance: "pointer",
opacity: 0.7,
scroll: true,
cursor: "move",
zIndex: 6000,
placeholder: "umb-content-grid__placeholder",
start: function(e, ui) {
ui.placeholder.height(ui.item.height());
ui.placeholder.width(ui.item.width());
}
};
scope.clickItem = function(item) {
if(scope.onClick) {
scope.onClick(item);

View File

@@ -10,8 +10,12 @@
flex: 0 1 200px;
cursor: pointer;
position: relative;
margin-right: 20px;
margin-bottom: 20px;
margin: 10px;
border: 1px solid #ffffff;
}
.umb-content-grid__item:hover {
border: 1px solid @blue;
}
.umb-content-grid__item:hover .umb-content-grid__action {
@@ -20,7 +24,7 @@
.umb-content-grid__icon-container {
background: lighten(@grayLight, 7%);
height: 100px;
height: 75px;
display: flex;
align-items: center;
justify-content: center;
@@ -38,7 +42,7 @@
.umb-content-grid__content {
box-sizing: border-box;
padding: 20px;
padding: 15px;
}
.umb-content-grid__item-name {
@@ -59,17 +63,13 @@
list-style: none;
margin-bottom: 0;
margin-left: 0;
font-size: 12px;
font-size: 11px;
}
.umb-content-grid__details-list.-light {
color: @grayLight;
}
.umb-content-grid__details-item {
margin-bottom: 3px;
}
.umb-content-grid__details-label {
font-weight: bold;
display: inline-block;
@@ -113,3 +113,18 @@
animation-duration: 0.2s;
animation-timing-function: ease-in-out;
}
.umb-content-grid__placeholder {
background: @grayLighter;
border: 2px dashed @grayLight;
box-sizing: border-box;
margin: 10px;
}
.umb-content-grid__no-items {
font-size: 16px;
font-weight: bold;
color: @grayLight;
padding-top: 50px;
padding-bottom: 50px;
}

View File

@@ -1,4 +1,4 @@
<div class="umb-content-grid">
<div class="umb-content-grid" ui-sortable="contentItemSortingOptions" ng-model="content">
<div
class="umb-content-grid__item"
@@ -27,4 +27,6 @@
</div>
<div ng-if="!content" class="umb-content-grid__no-items">There are no items to show</div>
</div>

View File

@@ -4,7 +4,6 @@
ng-if="entityType !== 'media'">
<umb-content-grid
ng-if="listViewResultSet.items.length > 0"
content="listViewResultSet.items"
content-properties="options.includeProperties"
on-click="vm.clickContentItem"

View File

@@ -68,18 +68,19 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
{ alias: 'updateDate', header: 'Last edited', isSystem: 1 },
{ alias: 'updater', header: 'Last edited by', isSystem: 1 }
],
layout: {
layouts: $scope.model.config.layouts,
activeLayout: getFirstAllowedLayout($scope.model.config.layouts)
},
allowBulkPublish: true,
allowBulkUnpublish: true,
allowBulkMove: true,
allowBulkDelete: true,
};
// set active layout
$scope.layout.activeLayout = getFirstAllowedLayout($scope.model.config.layouts);
//update all of the system includeProperties to enable sorting
_.each($scope.options.includeProperties, function(e, i) {
if (e.isSystem) {
//NOTE: special case for contentTypeAlias, it's a system property that cannot be sorted
@@ -88,7 +89,7 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
if (e.alias != "contentTypeAlias") {
e.allowSorting = true;
}
//localize the header
var key = getLocalizedKey(e.alias);
localizationService.localize(key).then(function (v) {
@@ -184,7 +185,7 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
//$location.search("page", $scope.options.pageNumber);
}
};
/*Loads the search results, based on parameters set in prev,next,sort and so on*/
/*Pagination is done by an array of objects, due angularJS's funky way of monitoring state
@@ -441,9 +442,9 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
var alias = e.alias;
// First try to pull the value directly from the alias (e.g. updatedBy)
// First try to pull the value directly from the alias (e.g. updatedBy)
var value = result[alias];
// If this returns an object, look for the name property of that (e.g. owner.name)
if (value === Object(value)) {
value = value['name'];
@@ -515,4 +516,4 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
}
angular.module("umbraco").controller("Umbraco.PropertyEditors.ListViewController", listViewController);
angular.module("umbraco").controller("Umbraco.PropertyEditors.ListViewController", listViewController);

View File

@@ -52,9 +52,9 @@
<umb-editor-sub-header-section ng-if="!isAnythingSelected()">
<umb-layout-selector
ng-if="model.config.layouts"
layouts="model.config.layouts"
active-layout="layout.activeLayout">
ng-if="options.layout.layouts"
layouts="options.layout.layouts"
active-layout="options.layout.activeLayout">
</umb-layout-selector>
</umb-editor-sub-header-section>
@@ -120,7 +120,7 @@
</umb-editor-sub-header>
<div ng-include="layout.activeLayout.path"></div>
<div ng-include="options.layout.activeLayout.path"></div>
<div class="pagination" ng-show="pagination.length > 1">