Skip to content

Code and documentation cleanup #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Change log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).

# 2.1.0
### Features

* #45 - Feature Request : Querystring Parameters. Thanks to @mattbrailsford
* #45 - Feature Request: query string parameters. Thanks to @mattbrailsford
* No more "Could not find persisted pre-value for field (minNumberOfItems|maxNumberOfItems)" warnings in the Umbraco log

### Bugfixes
Expand All @@ -15,14 +14,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
# 2.0.1
### Bugfixes

* #54 - Multi Url Picker cant add nodes
* #54 - Multi URL Picker can't add nodes

# 2.0.0
### Features

* Updated styling to match Umbraco v7.6
* Added Udi support
* New data types with `max number of items` set to 1 will return a single `Link` or `null`.
* Added UDI support
* New data types with `max number of items` set to 1 will return a single `Link` or `null`
Existing data types will continue to return `IEnumerable<Link>`

### Breaking
Expand Down Expand Up @@ -52,16 +51,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
# 1.2.0
### Features

* #14 - Use url as name when Page Title is left empty
* #14 - Use URL as name when page title is left empty

# 1.1.0
### Features

* #8 - Hide handle when only one item.
* #8 - Hide handle when only one item

### Bugfixes

* #11 - Validation problem with min/max and external links.
* #11 - Validation problem with min/max and external links
* #13 - Gracefully handle when the recycling bin is chosen

# 1.0.0
Expand All @@ -73,7 +72,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Breaking

* Upgraded to Umbraco v7.1.2
* Removed Pick multiple items field
* Removed 'Pick multiple items' field

# 0.2.0
### Features
Expand Down
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,51 @@
# Multi Url Picker for Umbraco 7
# Multi URL Picker for Umbraco 7

[![NuGet release](https://img.shields.io/nuget/v/RJP.UmbracoMultiUrlPicker.svg)](https://www.nuget.org/packages/RJP.UmbracoMultiUrlPicker)
[![NuGet release](https://img.shields.io/nuget/v/RJP.UmbracoMultiUrlPicker.svg)](https://www.nuget.org/packages/RJP.UmbracoMultiUrlPicker)
[![Our Umbraco project page](https://img.shields.io/badge/our-umbraco-orange.svg)](https://our.umbraco.org/projects/backoffice-extensions/multi-url-picker)

Allows editors to pick and sort multiple urls, it uses Umbraco's link picker which supports internal and external links and media.
Allows editors to pick and sort multiple URLs, it uses Umbraco's link picker which supports internal and external links and media.

## Installation

Install the NuGet [package](https://www.nuget.org/packages/RJP.UmbracoMultiUrlPicker).
Install the [NuGet package](https://www.nuget.org/packages/RJP.UmbracoMultiUrlPicker):

```powershell
PM> Install-Package RJP.UmbracoMultiUrlPicker
```

or

Install the [package](http://our.umbraco.org/projects/backoffice-extensions/multi-url-picker) from the Umbraco package repository.
Install the [Umbraco package](http://our.umbraco.org/projects/backoffice-extensions/multi-url-picker) from the Umbraco package repository.

## Usage

Add a new property to your document type and select the `Multi Url Picker` property editor in the `pickers` category.
Add a new property to your document type and select the `Multi URL Picker` property editor in the `pickers` category.

If you're using the models builder, you can access the property on your model e.g. `Model.Links` if your property alias is `links`.
If you're using the Models Builder, you can access the property on your model as `IEnumerable<Link>` (e.g. `Model.Links` if your property alias is `links`):

```csharp
@{ var links = Model.Links.ToList(); }

@if (links.Count > 0)
{
<ul>
@foreach (var item in links)
{
<li><a href="@item.Url" target="@item.Target">@item.Name</a></li>
}
<ul>
@foreach (var link in links)
{
<li><a href="@link.Url" target="@link.Target">@link.Name</a></li>
}
</ul>
}
```

If `Max number of items` is configured to 1
Or, if `Maximum number of items` is configured to 1, as `Link`:

```csharp
@if(Model.Link != null)
@{ var link = Model.Link; }
@if (link != null)
{
<a href="@Model.Link.Url" target="@Model.Link.Target">@Model.Link.Name</a>
<a href="@link.Url" target="@link.Target">@link.Name</a>
}

```

## Changelog
See the [changelog here](CHANGELOG.md)

See the [changelog here](CHANGELOG.md).
30 changes: 27 additions & 3 deletions RJP.MultiUrlPicker.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2015
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{F960CEAB-2C15-4617-9BA9-68E8CEBD9920}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{F960CEAB-2C15-4617-9BA9-68E8CEBD9920}"
ProjectSection(SolutionItems) = preProject
CHANGELOG.md = CHANGELOG.md
LICENSE = LICENSE
Expand All @@ -12,6 +12,27 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{F960CEAB
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJP.MultiUrlPicker", "src\RJP.MultiUrlPicker\RJP.MultiUrlPicker.csproj", "{2553C499-3593-43ED-95D6-39B03CC61ED1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RJP.MultiUrlPicker.Web.UI", "RJP.MultiUrlPicker.Web.UI", "{261C0142-E82A-4B60-B8A9-3A78A6A66C81}"
ProjectSection(SolutionItems) = preProject
src\RJP.MultiUrlPicker.Web.UI\MultiUrlPicker.html = src\RJP.MultiUrlPicker.Web.UI\MultiUrlPicker.html
src\RJP.MultiUrlPicker.Web.UI\MultiUrlPicker.js = src\RJP.MultiUrlPicker.Web.UI\MultiUrlPicker.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{537BC621-7AE3-4BCB-976A-E4BCA95EBDD8}"
ProjectSection(SolutionItems) = preProject
build.cmd = build.cmd
build.fsx = build.fsx
build\nuspec\RJP.UmbracoMultiUrlPicker.nuspec = build\nuspec\RJP.UmbracoMultiUrlPicker.nuspec
build\version.txt = build\version.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{93AF4399-1CA6-43DE-8632-C4D42745839D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -26,4 +47,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CB76B347-638E-4CDF-903E-B532D7D50E21}
EndGlobalSection
EndGlobal
38 changes: 19 additions & 19 deletions build/nuspec/RJP.UmbracoMultiUrlPicker.nuspec
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>RJP.UmbracoMultiUrlPicker</id>
<version>$version$</version>
<title>Umbraco Multi Url Picker</title>
<authors>Rasmus John Pedersen</authors>
<owners>Rasmus John Pedersen</owners>
<licenseUrl>https://github.com/rasmusjp/umbraco-multi-url-picker/raw/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/rasmusjp/umbraco-multi-url-picker</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Allows editors to pick and sort multiple urls, it uses Umbraco's link picker which supports internal and external links and media.</description>
<releaseNotes />
<copyright>Copyright 2014 Rasmus John Pedersen</copyright>
<tags>umbraco, urlpicker, multiurlpicker</tags>
<dependencies>
<dependency id="UmbracoCms.Core" version="[7.6.0, 8.0.0)"/>
</dependencies>
<metadata>
<id>RJP.UmbracoMultiUrlPicker</id>
<version>$version$</version>
<title>Umbraco Multi URL Picker</title>
<authors>Rasmus John Pedersen</authors>
<owners>Rasmus John Pedersen</owners>
<licenseUrl>https://github.com/rasmusjp/umbraco-multi-url-picker/raw/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/rasmusjp/umbraco-multi-url-picker</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Allows editors to pick and sort multiple URLs, it uses Umbraco's link picker which supports internal and external links and media.</description>
<releaseNotes />
<copyright>Copyright 2014 Rasmus John Pedersen</copyright>
<tags>umbraco, urlpicker, multiurlpicker</tags>
<dependencies>
<dependency id="UmbracoCms.Core" version="[7.6.0, 8.0.0)"/>
</dependencies>
</metadata>
<files>
<file src="..\..\artifacts\RJP.MultiUrlPicker\RJP.MultiUrlPicker.dll" target="lib\net45" />
<file src="..\..\src\RJP.MultiUrlPicker.Web.UI\**\*" target="content\App_Plugins\RJP.MultiUrlPicker" />
<file src="..\..\artifacts\RJP.MultiUrlPicker\RJP.MultiUrlPicker.dll" target="lib\net45" />
<file src="..\..\src\RJP.MultiUrlPicker.Web.UI\**\*" target="content\App_Plugins\RJP.MultiUrlPicker" />
</files>
</package>
3 changes: 1 addition & 2 deletions src/RJP.MultiUrlPicker.Web.UI/MultiUrlPicker.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div ng-controller="RJP.MultiUrlPickerController as ctrl" class="umb-editor umb-contentpicker">
<div ng-controller="RJP.MultiUrlPickerController as ctrl" class="umb-editor umb-contentpicker">
<ng-form name="multiUrlPickerForm">
<div ui-sortable="ctrl.sortableOptions" ng-model="ctrl.renderModel">
<div ng-repeat="link in ctrl.renderModel">
Expand All @@ -17,7 +17,6 @@

<a ng-show="!model.config.maxNumberOfItems || ctrl.renderModel.length < model.config.maxNumberOfItems"
class="umb-node-preview-add"
href
ng-click="ctrl.openLinkPicker()"
prevent-default>
<localize key="general_add">Add</localize>
Expand Down
Loading