Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #49 from umco/develop
Browse files Browse the repository at this point in the history
Preparing v2.0.0 release
  • Loading branch information
leekelleher authored Jul 20, 2018
2 parents 634a201 + b375134 commit ecf105e
Show file tree
Hide file tree
Showing 16 changed files with 269 additions and 307 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image: Visual Studio 2017

# version format
version: 1.2.0.{build}
version: 2.0.0.{build}

# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta
Expand Down
2 changes: 1 addition & 1 deletion build/package.proj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PropertyGroup>
<ProjectName>Our.Umbraco.StackedContent</ProjectName>
<PackageName>Stacked Content</PackageName>
<MinUmbracoVersion>7.4.0</MinUmbracoVersion>
<MinUmbracoVersion>7.7.0</MinUmbracoVersion>
<Readme>Stacked Content is an Umbraco property-editor for creating stacked content blocks.</Readme>
<AuthorName>Matt Brailsford, Lee Kelleher</AuthorName>
<AuthorUrl>https://github.com/umco/umbraco-stacked-content/graphs/contributors</AuthorUrl>
Expand Down
7 changes: 7 additions & 0 deletions src/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="AppVeyor CI - Inner Content builds" value="https://ci.appveyor.com/nuget/umbraco-inner-content-w59jhwr5br60" />
<add key="MyGet: Umbraco Community Packages" value="https://www.myget.org/F/umbraco-packages/api/v3/index.json" />
</packageSources>
</configuration>
9 changes: 9 additions & 0 deletions src/Our.Umbraco.StackedContent.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Scripts", "Build Scri
..\build\package.xml = ..\build\package.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{5F00E80B-E36C-4E38-AA70-674B10FCEDBF}"
ProjectSection(SolutionItems) = preProject
NuGet.config = NuGet.config
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -39,5 +44,9 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{95F00400-1FCA-4D98-9643-ACBC2203C1D0} = {52A49C4D-441F-4D54-A23F-444AF47DB250}
{5F00E80B-E36C-4E38-AA70-674B10FCEDBF} = {52A49C4D-441F-4D54-A23F-444AF47DB250}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8EB27366-AEDB-4CCA-BA9F-287BD20233E9}
EndGlobalSection
EndGlobal
221 changes: 14 additions & 207 deletions src/Our.Umbraco.StackedContent/Our.Umbraco.StackedContent.csproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using System.Collections.Generic;
using Our.Umbraco.InnerContent.PropertyEditors;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;

namespace Our.Umbraco.StackedContent.PropertyEditors
{
internal class StackedContentPreValueEditor : SimpleInnerContentPreValueEditor
{
public StackedContentPreValueEditor()
: base()
{
Fields.AddRange(new[]
{
new PreValueField
{
Key = "maxItems",
Name = "Max Items",
View = "number",
Description = "Set the maximum number of items allowed in this stack."
},
new PreValueField
{
Key = "singleItemMode",
Name = "Single Item Mode",
View = "boolean",
Description = "Set whether to work in single item mode (only the first defined Content Type will be used)."
},
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."
},
new PreValueField
{
Key = "enablePreview",
Name = "Enable Preview",
View = "boolean",
Description = "Select to enable a preview of the items in the stack."
},
new PreValueField
{
Key = "enableCopy",
Name = "Enable Copy",
View = "boolean",
Description = "Select to enable copying (and pasting) of items in the stack."
}
});
}

public override IDictionary<string, object> ConvertDbToEditor(IDictionary<string, object> defaultPreVals, PreValueCollection persistedPreVals)
{
// NOTE: For v1.0, we switched around the default option for the preview feature.
// For backwards-compatibility, we check if the legacy "disablePreview" value is available and handle accordingly.
if (persistedPreVals.IsDictionaryBased && persistedPreVals.PreValuesAsDictionary.ContainsKey("disablePreview"))
{
var enablePreview = persistedPreVals.PreValuesAsDictionary["disablePreview"].Value == "1" ? "0" : "1";
if (persistedPreVals.PreValuesAsDictionary.ContainsKey("enablePreview"))
{
persistedPreVals.PreValuesAsDictionary["enablePreview"].Value = enablePreview;
}
else
{
persistedPreVals.PreValuesAsDictionary.Add("enablePreview", new PreValue(enablePreview));
}
}

return base.ConvertDbToEditor(defaultPreVals, persistedPreVals);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,31 @@

namespace Our.Umbraco.StackedContent.PropertyEditors
{
[PropertyEditor(PropertyEditorAlias, "Stacked Content", "/App_Plugins/StackedContent/views/stackedcontent.html", Group = "rich content", Icon = "icon-umb-contour", ValueType = "JSON")]
[PropertyEditor(PropertyEditorAlias, PropertyEditorName, PropertyEditorValueTypes.Json, PropertyEditorViewPath, Group = "rich content", Icon = "icon-umb-contour")]
public class StackedContentPropertyEditor : SimpleInnerContentPropertyEditor
{
public const string PropertyEditorAlias = "Our.Umbraco.StackedContent";
public const string PropertyEditorName = "Stacked Content";
public const string PropertyEditorViewPath = "~/App_Plugins/StackedContent/views/stackedcontent.html";

public StackedContentPropertyEditor()
: base()
{
DefaultPreValues.Add("maxItems", 0);
DefaultPreValues.Add("singleItemMode", "0");
DefaultPreValues.Add("disablePreview", "0");
}

protected override PropertyValueEditor CreateValueEditor()
{
return new SimpleInnerContentPropertyValueEditor(base.CreateValueEditor());
DefaultPreValues.Add("hideLabel", "0");
DefaultPreValues.Add("enablePreview", "0");
DefaultPreValues.Add("enableCopy", "0");
}

protected override PreValueEditor CreatePreValueEditor()
{
return new StackedContentPreValueEditor();
}

internal class StackedContentPreValueEditor : SimpleInnerContentPreValueEditor
protected override PropertyValueEditor CreateValueEditor()
{
[PreValueField("maxItems", "Max Items", "number", Description = "Set the maximum number of items allowed in this stack.")]
public string MaxItems { get; set; }

[PreValueField("singleItemMode", "Single Item Mode", "boolean", Description = "Set whether to work in single item mode (only the first defined Content Type will be used).")]
public string SingleItemMode { 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; }

[PreValueField("disablePreview", "Disable Preview", "boolean", Description = "Set whether to disable the preview of the items in the stack.")]
public string DisablePreview { get; set; }
return new SimpleInnerContentPropertyValueEditor(base.CreateValueEditor());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Our.Umbraco.InnerContent.Converters;
using Our.Umbraco.InnerContent.ValueConverters;
using Our.Umbraco.StackedContent.PropertyEditors;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;

namespace Our.Umbraco.StackedContent.Converters
namespace Our.Umbraco.StackedContent.ValueConverters
{
public class StackedContentValueConverter : InnerContentValueConverter, IPropertyValueConverterMeta
{
Expand Down
4 changes: 2 additions & 2 deletions src/Our.Umbraco.StackedContent/Web/Helpers/ViewHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal static string RenderPartial(string partialName, object model)
routeData.Values.Add("controller", "DummyController");

var controllerContext = new ControllerContext(new RequestContext(httpContext, routeData), new DummyController());

var viewResult = ViewEngine.FindPartialView(controllerContext, partialName, false);
if (viewResult.View == null)
{
Expand All @@ -54,4 +54,4 @@ internal static string RenderPartial(string partialName, object model)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
color: #00aea2;
}

.stacked-content .placeholder a:hover {
text-decoration: none;
}

.stack__buttons {
position: absolute;
right: -12px;
Expand Down Expand Up @@ -144,6 +148,7 @@

.stack__button,
.stack__add-button,
.stack__paste-button,
.stack__buttons .umb_confirm-action__overlay-action {
display: inline-block;
background-color: #625a74;
Expand All @@ -163,6 +168,7 @@

.stack__button:hover,
.stack__add-button:hover,
.stack__paste-button:hover,
.stack__buttons .umb_confirm-action__overlay-action.-cancel:hover,
.stack__buttons .umb_confirm-action__overlay-action.-confirm:hover {
color: white !important;
Expand All @@ -186,22 +192,25 @@
border-radius: 0;
}

.stack__add-button {
.stack__add-button,
.stack__paste-button {
background-color: #00aea2;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
z-index: 20;
}

.stack__add-bar {
position: relative;
height: 10px;
height: 30px;
z-index: 15;
text-align: center;
margin: -10px 0;
}

.stack__add-bar .stack__add-button {
position: absolute;
left: 50%;
top: 50%;
margin: -15px 0 0 -15px;
.stack__add-bar .stack__add-button,
.stack__add-bar .stack__paste-button {
opacity: 0;
transition: opacity .0s ease-in-out;
-moz-transition: opacity .0s ease-in-out;
Expand All @@ -211,17 +220,13 @@
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.25);
}

.stack__add-bar:hover {
margin: -10px 0;
height: 30px;
}

.stack__item:first-child .stack__add-bar--top:hover {
.stack__item:first-child .stack__add-bar--top {
margin: 0 0 -10px;
height: 20px;
}

.stack__add-bar:hover .stack__add-button {
.stack__add-bar:hover .stack__add-button,
.stack__add-bar:hover .stack__paste-button {
opacity: 1;
transition-duration: .25s;
-moz-transition-duration: .25s;
Expand Down
Loading

0 comments on commit ecf105e

Please sign in to comment.