mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-23 05:12:09 +08:00
Fixing up the rest of blog create with the new templating (thanks to help from Louis). :)
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043561
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Orchard.Core.Common.Models;
|
using Orchard.Core.Common.Models;
|
||||||
using Orchard.Models;
|
using Orchard.Models;
|
||||||
|
|
||||||
@@ -6,10 +7,27 @@ namespace Orchard.Blogs.Models {
|
|||||||
public readonly static ContentType ContentType = new ContentType { Name = "blog", DisplayName = "Blog" };
|
public readonly static ContentType ContentType = new ContentType { Name = "blog", DisplayName = "Blog" };
|
||||||
|
|
||||||
public int Id { get { return ContentItem.Id; } }
|
public int Id { get { return ContentItem.Id; } }
|
||||||
public string Name { get { return this.As<RoutableAspect>().Title; } }
|
|
||||||
public string Slug { get { return this.As<RoutableAspect>().Slug; } }
|
[Required]
|
||||||
public string Description { get { return Record.Description; } }
|
public string Name {
|
||||||
|
get { return this.As<RoutableAspect>().Title; }
|
||||||
|
set { this.As<RoutableAspect>().Record.Title = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO: (erikpo) Need a data type for slug
|
||||||
|
[Required]
|
||||||
|
public string Slug {
|
||||||
|
get { return this.As<RoutableAspect>().Slug; }
|
||||||
|
set { this.As<RoutableAspect>().Record.Slug = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Description {
|
||||||
|
get { return Record.Description; }
|
||||||
|
set { Record.Description = value; }
|
||||||
|
}
|
||||||
|
|
||||||
//public bool Enabled { get { return Record.Enabled; } }
|
//public bool Enabled { get { return Record.Enabled; } }
|
||||||
|
|
||||||
public int PostCount { get { return Record.PostCount; } }
|
public int PostCount { get { return Record.PostCount; } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Orchard.Blogs.Models;
|
using Orchard.Blogs.Models;
|
||||||
using Orchard.Models.ViewModels;
|
using Orchard.Models.ViewModels;
|
||||||
using Orchard.Mvc.ViewModels;
|
using Orchard.Mvc.ViewModels;
|
||||||
@@ -6,17 +5,5 @@ using Orchard.Mvc.ViewModels;
|
|||||||
namespace Orchard.Blogs.ViewModels {
|
namespace Orchard.Blogs.ViewModels {
|
||||||
public class CreateBlogViewModel : AdminViewModel {
|
public class CreateBlogViewModel : AdminViewModel {
|
||||||
public ItemEditorViewModel<Blog> Blog { get; set; }
|
public ItemEditorViewModel<Blog> Blog { get; set; }
|
||||||
|
|
||||||
//[Required]
|
|
||||||
//public string Name { get; set; }
|
|
||||||
|
|
||||||
////TODO: (erikpo) Need a data type for slug
|
|
||||||
//[Required]
|
|
||||||
//public string Slug { get; set; }
|
|
||||||
|
|
||||||
//public string Description { get; set; }
|
|
||||||
|
|
||||||
//[Required]
|
|
||||||
//public bool Enabled { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user