Beispiel #1
0
        private string GetChildResponse(ProductComment comment)
        {
            string mod = string.Empty;
            string del = string.Empty;

            if (comment.IsModerator)
            {
                mod = "<b class='mod'>Quản trị viên</b>";
            }
            if (ProductPermission.CanDeleteComment)
            {
                del = "<div class='miniclose'></div>";
            }

            string report = string.Empty;

            if (comment.Status == 0)
            {
                report = "<span id='report-" + comment.CommentId + "' class='cmreport' onclick='journalReport(this);'>Báo vi phạm</span>";
            }

            return("<li id='cmt-" + comment.CommentId.ToString() + "'>" + del + "<i class='iconcom'></i><div class='jsummary'><strong>" + HttpUtility.HtmlEncode(comment.FullName) + "</strong>" + mod + "<div>" + Server.HtmlEncode(comment.ContentText).Replace("\n", "<br/>").Replace("\r\n", "<br />") + "</div><a href='#' id='like-" + comment.CommentId + "' class='cmlike'>Thích<i class='iconcom-likecomm'></i><span>" + comment.HelpfulYesTotal + "</span></a><abbr title='" + DateTimeHelper.Format(comment.CreatedUtc, SiteUtils.GetUserTimeZone(), "g", SiteUtils.GetUserTimeOffset()) + "'>" + CommentHelper.GetTimeAgo(comment.CreatedUtc, SiteUtils.GetUserTimeZone(), SiteUtils.GetUserTimeOffset(), new System.Globalization.CultureInfo("vi-VN")) + "</abbr>" + report + "</div></li>");
        }
Beispiel #2
0
        private string GetResponse(ProductComment comment, TimeZoneInfo timeZone, double timeOffset, bool closejidDiv = true)
        {
            StringBuilder results = new StringBuilder();

            string mod = string.Empty;

            if (comment.IsModerator)
            {
                mod = "<b class='mod'>Quản trị viên</b>";
            }

            if (comment.CommentType == (int)ProductCommentType.Rating)
            {
                mod += string.Format("<div class=\"ratingview\"><div style=\"width:{0}%\"></div></div>", comment.Rating * 20);
            }

            string report = string.Empty;

            if (comment.Status == 0)
            {
                report = "<span id='report-" + comment.CommentId + "' class='cmreport' onclick='journalReport(this);'>Báo vi phạm</span>";
            }

            results.Append("<div id='jid-" + comment.CommentId + "' class='journalrow'>");//div jid
            results.Append("<div class='author'><i class='iconcom'></i></div>");

            results.Append("<div class='journalitem'>");//div journalitem
            if (ProductPermission.CanDeleteComment)
            {
                results.Append("<div class='minidel' onclick='journalDelete(this);'></div>");
            }
            results.Append("<div class='journalsummary'><strong>" + Server.HtmlEncode(comment.FullName) + "</strong>" + mod + "<div>" + Server.HtmlEncode(comment.ContentText).Replace("\n", "<br/>").Replace("\r\n", "<br />") + "</div></div>");
            results.Append("<div class='journalfooter'><a href='#' id='cmtbtn-" + comment.CommentId + "' class='cmreply'>Trả lời</a> <a href='#' id='like-" + comment.CommentId + "' class='cmlike'>Thích <i class='iconcom-likecomm'></i> <span>" + comment.HelpfulYesTotal + "</span></a> <abbr title='" + DateTimeHelper.Format(Convert.ToDateTime(comment.CreatedUtc), timeZone, "g", timeOffset) + "'>" + CommentHelper.GetTimeAgo(comment.CreatedUtc, timeZone, timeOffset, new System.Globalization.CultureInfo("vi-VN")) + "</abbr>" + report + "</div>");
            results.Append("</div>");//end div journalitem

            if (closejidDiv)
            {
                results.Append("<ul class='jcmt' id='jcmt-" + comment.CommentId + "'><li class='cmteditarea' id='jcmt-" + comment.CommentId + "-txtrow'><textarea id='jcmt-" + comment.CommentId + "-txt' class='cmteditor'></textarea><div class='editorPlaceholder'>Mời bạn thảo luận hoặc đánh giá về sản phẩm này</div></li><li class='cmtbtn'><div class='cmtinfo'><input type='text' maxlength='100' placeholder='Mời bạn nhập tên (Bắt buộc)' class='cmtname'> <input type='text' maxlength='100' placeholder='Mời bạn nhập email (Không bắt buộc)' class='cmtemail'> <a href='#'>Gửi bình luận</a></div></li></ul>");
                results.Append("</div>");//end div jid
            }

            return(results.ToString());
        }