Get the generic property tab rendering properly with a url list as well.
This commit is contained in:
@@ -59,6 +59,12 @@
|
||||
label: "Generic Properties",
|
||||
id: 0,
|
||||
properties: [
|
||||
{
|
||||
label: 'Id',
|
||||
value: 1234,
|
||||
view: "readonlyvalue",
|
||||
alias: "_umb_id"
|
||||
},
|
||||
{
|
||||
label: 'Created by',
|
||||
description: 'Original author',
|
||||
@@ -68,36 +74,50 @@
|
||||
},
|
||||
{
|
||||
label: 'Created',
|
||||
description: 'Time this document was created',
|
||||
description: 'Date/time this document was created',
|
||||
value: new Date().toIsoDateTimeString(),
|
||||
view: "readonlyvalue",
|
||||
alias: "_umb_createdate"
|
||||
},
|
||||
{
|
||||
label: 'Updated',
|
||||
description: 'Time this document was last updated',
|
||||
description: 'Date/time this document was created',
|
||||
value: new Date().toIsoDateTimeString(),
|
||||
view: "readonlyvalue",
|
||||
alias: "_umb_updatedate"
|
||||
},
|
||||
{
|
||||
label: 'Id',
|
||||
value: 1234,
|
||||
view: "readonlyvalue",
|
||||
alias: "_umb_id"
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Document Type',
|
||||
value: "Home page",
|
||||
view: "readonlyvalue",
|
||||
alias: "_umb_doctype"
|
||||
alias: "_umb_doctype"
|
||||
},
|
||||
{
|
||||
label: 'Template',
|
||||
value: "1234",
|
||||
label: 'Publish at',
|
||||
description: 'Date/time to publish this document',
|
||||
value: new Date().toIsoDateTimeString(),
|
||||
view: "datepicker",
|
||||
alias: "_umb_releasedate"
|
||||
},
|
||||
{
|
||||
label: 'Unpublish at',
|
||||
description: 'Date/time to un-publish this document',
|
||||
value: new Date().toIsoDateTimeString(),
|
||||
view: "datepicker",
|
||||
alias: "_umb_removedate"
|
||||
},
|
||||
{
|
||||
label: 'Template',
|
||||
value: "1234",
|
||||
view: "templatepicker",
|
||||
alias: "_umb_template"
|
||||
},
|
||||
{
|
||||
label: 'Link to document',
|
||||
value: ["/testing" + id, "http://localhost/testing" + id, "http://mydomain.com/testing" + id].join(),
|
||||
view: "urllist",
|
||||
alias: "_umb_template"
|
||||
},
|
||||
{
|
||||
alias: "test", label: "Stuff", view: "test", value: "",
|
||||
config: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ng-form name="contentForm" ng-show="contentLoaded">
|
||||
<div ng-form name="contentForm" ng-show="contentLoaded">
|
||||
<umb-panel ng-controller="Umbraco.Editors.Content.EditController" val-show-validation>
|
||||
|
||||
<umb-header tabs="content.tabs">
|
||||
@@ -48,4 +48,4 @@
|
||||
</umb-tab-view>
|
||||
|
||||
</umb-panel>
|
||||
</ng-form>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
angular.module('umbraco').controller("Umbraco.Editors.ReadOnlyValueController",
|
||||
function($rootScope, $scope, $filter){
|
||||
if ($scope.model.config && $scope.model.config.filter && $scope.model.config.format) {
|
||||
$scope.displayvalue = $filter($scope.model.config.filter)($scope.model.value, $scope.model.config.filter);
|
||||
}else{
|
||||
|
||||
if ($scope.model.config && $scope.model.config.filter) {
|
||||
if ($scope.model.config.format) {
|
||||
$scope.displayvalue = $filter($scope.model.config.filter)($scope.model.value, $scope.model.config.format);
|
||||
}
|
||||
else {
|
||||
$scope.displayvalue = $filter($scope.model.config.filter)($scope.model.value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$scope.displayvalue = $scope.model.value;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
angular.module('umbraco').controller("Umbraco.Editors.UrlListController",
|
||||
function($rootScope, $scope, $filter) {
|
||||
|
||||
$scope.renderModel = _.map($scope.model.value.split(","), function(item) {
|
||||
return {
|
||||
url: item,
|
||||
urlTarget : ($scope.config && $scope.config.target) ? $scope.config.target : "_blank"
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
<div ng-controller="Umbraco.Editors.UrlListController">
|
||||
<ul>
|
||||
<li ng-repeat="value in renderModel">
|
||||
<a href="{{value.url}}" target="{{value.urlTarget}}">{{value.url}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
Reference in New Issue
Block a user