mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-23 05:12:09 +08:00
* Fix bug where closing comments multiple times would result in inconsistent database. * Rename a few classes/fields in Comments module to follow coding convention (Record suffix, Utc suffix for dates) * Move classes to their own file * Create a HasCommentContainer handler to enable displaying comment counts (approved/pending) for container (i.e. blog) --HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045899
26 lines
809 B
C#
26 lines
809 B
C#
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using Orchard.ContentManagement;
|
|
|
|
namespace Orchard.Comments.Models {
|
|
public class HasComments : ContentPart<HasCommentsRecord> {
|
|
public HasComments() {
|
|
Comments = new List<Comment>();
|
|
PendingComments = new List<Comment>();
|
|
}
|
|
|
|
public IList<Comment> Comments { get; set; }
|
|
public IList<Comment> PendingComments { get; set; }
|
|
|
|
public bool CommentsShown {
|
|
get { return Record.CommentsShown; }
|
|
set { Record.CommentsShown = value; }
|
|
}
|
|
|
|
public bool CommentsActive {
|
|
get { return Record.CommentsActive; }
|
|
set { Record.CommentsActive = value; }
|
|
}
|
|
}
|
|
} |