diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.controller.js
index 65b3aed589..43587839ab 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.controller.js
@@ -5,6 +5,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.UrlListController"
$scope.renderModel = _.map($scope.model.value.split(","), function (item) {
return {
url: item,
+ linkText: $scope.model.linkText,
urlTarget: ($scope.config && $scope.config.target) ? $scope.config.target : "_blank"
};
});
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.html
index f26f4dd9c1..6766e7b39c 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.html
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.html
@@ -1,7 +1,15 @@
\ No newline at end of file
diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDisplay.cs
index a563910d4f..bd995f827b 100644
--- a/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDisplay.cs
+++ b/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDisplay.cs
@@ -35,5 +35,8 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "validation")]
public PropertyTypeValidation Validation { get; set; }
+
+ [DataMember(Name = "linkText")]
+ public string LinkText { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs
index 0c7dbffd49..f332f7bd8d 100644
--- a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs
+++ b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs
@@ -2,22 +2,16 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
-using System.Linq.Expressions;
-using System.Runtime.Serialization;
-using System.Threading;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using AutoMapper;
-using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Mapping;
-using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Trees;
-using umbraco;
using Umbraco.Web.Routing;
using umbraco.BusinessLogic.Actions;
@@ -78,7 +72,8 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(display => display.Tabs, expression => expression.ResolveUsing())
.ForMember(display => display.AllowedActions, expression => expression.ResolveUsing(
new ActionButtonsResolver(new Lazy(() => applicationContext.Services.UserService))))
- .AfterMap((media, display) => AfterMap(media, display, applicationContext.Services.DataTypeService, applicationContext.Services.TextService));
+ .AfterMap((media, display) => AfterMap(media, display, applicationContext.Services.DataTypeService, applicationContext.Services.TextService,
+ applicationContext.Services.ContentTypeService, applicationContext.Services.UserService));
//FROM IContent TO ContentItemBasic
config.CreateMap>()
@@ -119,7 +114,10 @@ namespace Umbraco.Web.Models.Mapping
///
///
///
- private static void AfterMap(IContent content, ContentItemDisplay display, IDataTypeService dataTypeService, ILocalizedTextService localizedText)
+ ///
+ ///
+ private static void AfterMap(IContent content, ContentItemDisplay display, IDataTypeService dataTypeService, ILocalizedTextService localizedText,
+ IContentTypeService contentTypeService, IUserService userService)
{
//map the tree node url
if (HttpContext.Current != null)
@@ -142,8 +140,29 @@ namespace Umbraco.Web.Models.Mapping
TabsAndPropertiesResolver.AddListView(display, "content", dataTypeService);
}
+ var currentDocumentType = contentTypeService.GetContentType(display.ContentTypeAlias);
+ var currentDocumentTypeName = currentDocumentType == null ? String.Empty : currentDocumentType.Name;
+ var docTypeValue = String.Empty;
+
+#if (DEBUG)
+ var currentUser = userService.GetUserById(UmbracoContext.Current.Security.CurrentUser.Id);
+ if (currentUser.AllowedSections.Any(x => x.Equals("settings")))
+ {
+ var currentDocumentTypeId = currentDocumentType == null ? String.Empty : currentDocumentType.Id.ToString(CultureInfo.InvariantCulture);
+ docTypeValue = string.Format("#/settings/framed/%252Fumbraco%252Fsettings%252FeditNodeTypeNew.aspx%253Fid%253D{0}", currentDocumentTypeId);
+ }
+#endif
+
TabsAndPropertiesResolver.MapGenericProperties(
content, display,
+ new ContentPropertyDisplay
+ {
+ Alias = string.Format("{0}doctype", Constants.PropertyEditors.InternalGenericPropertiesPrefix),
+ Label = localizedText.Localize("content/documentType"),
+ Value = docTypeValue,
+ LinkText = currentDocumentTypeName,
+ View = "urllist" //TODO: Hard coding this because the templatepicker doesn't necessarily need to be a resolvable (real) property editor
+ },
new ContentPropertyDisplay
{
Alias = string.Format("{0}releasedate", Constants.PropertyEditors.InternalGenericPropertiesPrefix),
diff --git a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs
index 325b8df3e3..8948bcc371 100644
--- a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs
+++ b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs
@@ -4,7 +4,6 @@ using System.Linq;
using AutoMapper;
using Umbraco.Core;
using Umbraco.Core.Dictionary;
-using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
@@ -91,13 +90,6 @@ namespace Umbraco.Web.Models.Mapping
Description = ui.Text("content", "updateDateDesc"),
Value = display.UpdateDate.ToIsoString(),
View = labelEditor
- },
- new ContentPropertyDisplay
- {
- Alias = string.Format("{0}doctype", Constants.PropertyEditors.InternalGenericPropertiesPrefix),
- Label = ui.Text("content", "documentType"),
- Value = TranslateItem(display.ContentTypeName, CreateDictionary()),
- View = labelEditor
}
};