private static HtmlBuilder EditorExtensions( this HtmlBuilder hb, GroupModel groupModel, SiteSettings ss) { return(hb); }
/// <summary> /// Fixed: /// </summary> private static HtmlBuilder Editor( this HtmlBuilder hb, SiteSettings ss, GroupModel groupModel) { var commentsColumn = ss.GetColumn("Comments"); var commentsColumnPermissionType = commentsColumn.ColumnPermissionType(); var showComments = ss.ShowComments(commentsColumnPermissionType); var tabsCss = showComments ? null : "max"; return(hb.Div(id: "Editor", action: () => hb .Form( attributes: new HtmlAttributes() .Id("GroupForm") .Class("main-form confirm-reload") .Action(groupModel.GroupId != 0 ? Locations.Action("Groups", groupModel.GroupId) : Locations.Action("Groups")), action: () => hb .RecordHeader( ss: ss, baseModel: groupModel, tableName: "Groups") .Div( id: "EditorComments", action: () => hb .Comments( comments: groupModel.Comments, column: commentsColumn, verType: groupModel.VerType, columnPermissionType: commentsColumnPermissionType), _using: showComments) .Div(id: "EditorTabsContainer", css: tabsCss, action: () => hb .EditorTabs(groupModel: groupModel) .FieldSetGeneral( ss: ss, groupModel: groupModel) .FieldSetMembers(groupModel: groupModel) .FieldSet( attributes: new HtmlAttributes() .Id("FieldSetHistories") .DataAction("Histories") .DataMethod("post"), _using: groupModel.MethodType != BaseModel.MethodTypes.New) .MainCommands( ss: ss, siteId: 0, verType: groupModel.VerType, referenceId: groupModel.GroupId, updateButton: true, mailButton: true, deleteButton: true, extensions: () => hb .MainCommandExtensions( groupModel: groupModel, ss: ss))) .Hidden(controlId: "BaseUrl", value: Locations.BaseUrl()) .Hidden( controlId: "MethodType", value: groupModel.MethodType.ToString().ToLower()) .Hidden( controlId: "Groups_Timestamp", css: "always-send", value: groupModel.Timestamp) .Hidden( controlId: "SwitchTargets", css: "always-send", value: groupModel.SwitchTargets?.Join(), _using: !Request.IsAjax())) .OutgoingMailsForm("Groups", groupModel.GroupId, groupModel.Ver) .CopyDialog("Groups", groupModel.GroupId) .OutgoingMailDialog() .EditorExtensions(groupModel: groupModel, ss: ss))); }
private static HtmlBuilder MainCommandExtensions( this HtmlBuilder hb, SiteSettings ss, GroupModel groupModel) { return(hb); }
public static HtmlBuilder TdValue( this HtmlBuilder hb, SiteSettings ss, Column column, GroupModel groupModel) { if (!column.GridDesign.IsNullOrEmpty()) { return(hb.TdCustomValue( ss: ss, gridDesign: column.GridDesign, groupModel: groupModel)); } else { var mine = groupModel.Mine(); switch (column.Name) { case "GroupId": return(ss.ReadColumnAccessControls.Allowed(column, ss.PermissionType, mine) ? hb.Td(column: column, value: groupModel.GroupId) : hb.Td(column: column, value: string.Empty)); case "Ver": return(ss.ReadColumnAccessControls.Allowed(column, ss.PermissionType, mine) ? hb.Td(column: column, value: groupModel.Ver) : hb.Td(column: column, value: string.Empty)); case "GroupName": return(ss.ReadColumnAccessControls.Allowed(column, ss.PermissionType, mine) ? hb.Td(column: column, value: groupModel.GroupName) : hb.Td(column: column, value: string.Empty)); case "Body": return(ss.ReadColumnAccessControls.Allowed(column, ss.PermissionType, mine) ? hb.Td(column: column, value: groupModel.Body) : hb.Td(column: column, value: string.Empty)); case "Comments": return(ss.ReadColumnAccessControls.Allowed(column, ss.PermissionType, mine) ? hb.Td(column: column, value: groupModel.Comments) : hb.Td(column: column, value: string.Empty)); case "Creator": return(ss.ReadColumnAccessControls.Allowed(column, ss.PermissionType, mine) ? hb.Td(column: column, value: groupModel.Creator) : hb.Td(column: column, value: string.Empty)); case "Updator": return(ss.ReadColumnAccessControls.Allowed(column, ss.PermissionType, mine) ? hb.Td(column: column, value: groupModel.Updator) : hb.Td(column: column, value: string.Empty)); case "CreatedTime": return(ss.ReadColumnAccessControls.Allowed(column, ss.PermissionType, mine) ? hb.Td(column: column, value: groupModel.CreatedTime) : hb.Td(column: column, value: string.Empty)); case "UpdatedTime": return(ss.ReadColumnAccessControls.Allowed(column, ss.PermissionType, mine) ? hb.Td(column: column, value: groupModel.UpdatedTime) : hb.Td(column: column, value: string.Empty)); default: return(hb); } } }