private static HtmlExpressionBase AltOxiteDefaultPartialHeader(object itemList, int totalCount) { var expr = new GenericOpenTagExpression("ul"); if (itemList is IEnumerable<PostDisplay>) expr.Class("posts"); if (itemList is IEnumerable<TagDisplay>) expr.Class("tags"); if (itemList is IEnumerable<CommentDisplay>) expr.Class("commented"); // For Debug View if (itemList is IEnumerable<ControllerActionDisplay>) expr.Class("controlleraction"); if (itemList is IEnumerable<DebugSingleLineDisplay>) { expr = new GenericOpenTagExpression("ol"); expr.Class("behavior"); } return expr; }
private static HtmlExpressionBase FohjinDefaultPartialHeader(object itemList, int totalCount) { GenericOpenTagExpression expr = new GenericOpenTagExpression("ul"); if (itemList is IEnumerable<PostDisplay> || itemList is IEnumerable<TagPostDisplay>) { expr = new GenericOpenTagExpression("div"); expr.Class("blog_post"); return expr; } // For Debug View if (itemList is IEnumerable<ControllerActionDisplay>) expr.Class("controlleraction"); if (itemList is IEnumerable<DebugSingleLineDisplay>) { expr = new GenericOpenTagExpression("ol"); expr.Class("behavior"); } return expr; }
private static HtmlExpressionBase AltOxiteDefaultPartialBeforeEachItem(object item, int index, int total) { var expr = new GenericOpenTagExpression("li"); if (index == 0) expr.Class("first"); if (index >= (total - 1)) expr.Class("last"); if (item is CommentDisplay) { if (index % 2 != 0) expr.Class("odd"); var comment = (CommentDisplay) item; if (comment.User != null) expr.Class(!comment.User.IsAuthenticated ? "anon" : comment.User.ID == comment.Post.User.ID ? "author" : "user"); } return expr; }
private static HtmlExpressionBase FohjinDefaultPartialBeforeEachItem(object item, int index, int total) { GenericOpenTagExpression expr = new GenericOpenTagExpression("li"); if (item is PostDisplay || item is TagPostDisplay) { expr = new GenericOpenTagExpression("div"); if (index == (total - 1)) expr.Class("last"); return expr; } if (item is CommentDisplay) { expr = new GenericOpenTagExpression("div"); expr.Class("comment-field"); expr.Class("curvy_corner_all"); return expr; } if (item is CommentDisplay) { if (index % 2 != 0) expr.Class("odd"); var comment = (CommentDisplay) item; if (comment.User != null) expr.Class(!comment.User.IsAuthenticated ? "anon" : comment.User.ID == comment.Post.User.ID ? "author" : "user"); } return expr; }