Validating Title and Slug lengths

http://orchard.codeplex.com/workitem/16707

--HG--
branch : dev
This commit is contained in:
Sebastien Ros 2010-11-15 18:03:14 -08:00
parent 7bafff2dfb
commit f750c1172e
5 changed files with 5 additions and 2 deletions

View File

@ -9,7 +9,6 @@ using Orchard.Core.Routable.Services;
using Orchard.Core.Routable.ViewModels;
using Orchard.Localization;
using Orchard.Services;
using Orchard.UI.Notify;
namespace Orchard.Core.Routable.Drivers {
public class RoutePartDriver : ContentPartDriver<RoutePart> {

View File

@ -10,7 +10,7 @@ namespace Orchard.Core.Routable {
table => table
.ContentPartVersionRecord()
.Column<string>("Title", column => column.WithLength(1024))
.Column<string>("Slug")
.Column<string>("Slug", column => column.WithLength(1024))
.Column<string>("Path", column => column.WithLength(2048))
);

View File

@ -3,6 +3,7 @@ using Orchard.ContentManagement.Aspects;
namespace Orchard.Core.Routable.Models {
public class RoutePart : ContentPart<RoutePartRecord>, IRoutableAspect {
public string Title {
get { return Record.Title; }
set { Record.Title = value; }

View File

@ -6,6 +6,7 @@ namespace Orchard.Core.Routable.Models {
[StringLength(1024)]
public virtual string Title { get; set; }
[StringLength(1024)]
public virtual string Slug { get; set; }
[StringLength(2048)]

View File

@ -8,7 +8,9 @@ namespace Orchard.Core.Routable.ViewModels {
public string ContentType { get; set; }
[Required]
[StringLength(1024)]
public string Title { get; set; }
[StringLength(1024)]
public string Slug { get; set; }
public int? ContainerId { get; set; }
public bool PromoteToHomePage { get; set; }