forked from OrchardCMS/OrchardCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a way to hide ContentTypeDefinitionSettings (OrchardCMS#15472)
Co-authored-by: Zoltán Lehóczky <[email protected]>
- Loading branch information
1 parent
ba718ab
commit 5b91276
Showing
7 changed files
with
172 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/OrchardCore.Modules/OrchardCore.ContentTypes/ViewModels/ContentTypeSettingsViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
using Microsoft.AspNetCore.Mvc.ModelBinding; | ||
using OrchardCore.ContentManagement.Metadata.Models; | ||
|
||
namespace OrchardCore.ContentTypes.ViewModels | ||
{ | ||
public class ContentTypeSettingsViewModel | ||
{ | ||
public bool Creatable { get; set; } | ||
|
||
public bool Listable { get; set; } | ||
|
||
public bool Draftable { get; set; } | ||
|
||
public bool Versionable { get; set; } | ||
|
||
public bool Securable { get; set; } | ||
|
||
public string Stereotype { get; set; } | ||
|
||
public string Description { get; set; } | ||
|
||
[BindNever] | ||
public ContentTypeDefinitionDriverOptions Options { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...Core.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionDriverOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace OrchardCore.ContentManagement.Metadata.Models; | ||
|
||
public class ContentTypeDefinitionDriverOptions | ||
{ | ||
public bool ShowCreatable { get; set; } | ||
|
||
public bool ShowListable { get; set; } | ||
|
||
public bool ShowDraftable { get; set; } | ||
|
||
public bool ShowVersionable { get; set; } | ||
|
||
public bool ShowSecurable { get; set; } | ||
} |
21 changes: 21 additions & 0 deletions
21
...rchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace OrchardCore.ContentManagement.Metadata.Models; | ||
|
||
/// <summary> | ||
/// Offers a method for configuring content type definitions to either display or conceal global settings from appearing on the UI. | ||
/// </summary> | ||
public class ContentTypeDefinitionOptions | ||
{ | ||
/// <summary> | ||
/// Configure the driver options for all content types that share the same Stereotype. | ||
/// In this dictionary, the 'key' denotes the Stereotype, while the 'value' corresponds to the driver options. | ||
/// </summary> | ||
public Dictionary<string, ContentTypeDefinitionDriverOptions> Stereotypes { get; } = []; | ||
|
||
/// <summary> | ||
/// Configure the driver options for each content type. | ||
/// In this dictionary, the 'key' denotes the content type, while the 'value' corresponds to the driver options. | ||
/// </summary> | ||
public Dictionary<string, ContentTypeDefinitionDriverOptions> ContentTypes { get; } = []; | ||
} |