This repository has been archived by the owner on Dec 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from umco/develop
Preparing v1.0.0 beta2 release
- Loading branch information
Showing
14 changed files
with
426 additions
and
747 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
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
50 changes: 39 additions & 11 deletions
50
src/Our.Umbraco.PropertyList/PropertyEditors/PropertyListPreValueEditor.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,19 +1,47 @@ | ||
using Umbraco.Core.PropertyEditors; | ||
using Umbraco.Core.IO; | ||
using Umbraco.Core.PropertyEditors; | ||
|
||
namespace Our.Umbraco.PropertyList.PropertyEditors | ||
{ | ||
internal class PropertyListPreValueEditor : PreValueEditor | ||
{ | ||
[PreValueField("dataType", "Data Type", "~/App_Plugins/PropertyList/views/propertylist.datatypepicker.html", Description = "Select a data type.")] | ||
public string DataType { get; set; } | ||
public PropertyListPreValueEditor() | ||
: base() | ||
{ | ||
// In terms of inheritance, we'd like the "dataType" field to always be at the top. | ||
Fields.Insert(0, new PreValueField | ||
{ | ||
Key = "dataType", | ||
Name = "Data Type", | ||
View = IOHelper.ResolveUrl("~/App_Plugins/PropertyList/views/propertylist.datatypepicker.html"), | ||
Description = "Select a data type." | ||
}); | ||
|
||
[PreValueField("minItems", "Min Items", "number", Description = "Set the minimum number of items allowed.")] | ||
public string MinItems { get; set; } | ||
|
||
[PreValueField("maxItems", "Max Items", "number", Description = "Set the maximum number of items allowed.")] | ||
public string MaxItems { get; set; } | ||
|
||
[PreValueField("hideLabel", "Hide Label", "boolean", Description = "Set whether to hide the editor label and have the list take up the full width of the editor window.")] | ||
public string HideLabel { get; set; } | ||
// The rest of the fields can be added at the bottom. | ||
Fields.AddRange(new[] | ||
{ | ||
new PreValueField | ||
{ | ||
Key = "minItems", | ||
Name = "Min Items", | ||
View = "number", | ||
Description = "Set the minimum number of items allowed." | ||
}, | ||
new PreValueField | ||
{ | ||
Key = "maxItems", | ||
Name = "Max Items", | ||
View = "number", | ||
Description = "Set the maximum number of items allowed." | ||
}, | ||
new PreValueField | ||
{ | ||
Key = "hideLabel", | ||
Name = "Hide Label", | ||
View = "boolean", | ||
Description = "Set whether to hide the editor label and have the list take up the full width of the editor window." | ||
} | ||
}); | ||
} | ||
} | ||
} |
29 changes: 5 additions & 24 deletions
29
src/Our.Umbraco.PropertyList/PropertyEditors/PropertyListPropertyEditor.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
Oops, something went wrong.