mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Make DisplayName required for ContentPart and ContentType
Work Items: 16622 --HG-- branch : dev
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
@@ -22,6 +23,7 @@ namespace Orchard.ContentTypes.ViewModels {
|
||||
public string Prefix { get { return "PartDefinition"; } }
|
||||
public string Name { get; set; }
|
||||
private string _displayName;
|
||||
[Required]
|
||||
public string DisplayName {
|
||||
get { return !string.IsNullOrWhiteSpace(_displayName) ? _displayName : Name.TrimEnd("Part").CamelFriendly(); }
|
||||
set { _displayName = value; }
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
@@ -22,6 +23,7 @@ namespace Orchard.ContentTypes.ViewModels {
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
public string DisplayName { get; set; }
|
||||
public SettingsDictionary Settings { get; set; }
|
||||
public IEnumerable<EditPartFieldViewModel> Fields { get; set; }
|
||||
|
Reference in New Issue
Block a user