/// <summary> /// Fixed: /// </summary> public static string Index(SiteSettings ss) { var invalid = GroupValidators.OnEntry(ss); switch (invalid) { case Error.Types.None: break; default: return(HtmlTemplates.Error(invalid)); } var hb = new HtmlBuilder(); var view = Views.GetBySession(ss); var gridData = GetGridData(ss, view); var viewMode = ViewModes.GetBySession(ss.SiteId); return(hb.Template( ss: ss, verType: Versions.VerTypes.Latest, methodType: BaseModel.MethodTypes.Index, referenceType: "Groups", script: Libraries.Scripts.JavaScripts.ViewMode(viewMode), title: Displays.Groups() + " - " + Displays.List(), action: () => { hb .Form( attributes: new HtmlAttributes() .Id("GroupForm") .Class("main-form") .Action(Locations.Action("Groups")), action: () => hb .ViewFilters(ss: ss, view: view) .Aggregations( ss: ss, aggregations: gridData.Aggregations) .Div(id: "ViewModeContainer", action: () => hb .Grid( ss: ss, gridData: gridData, view: view)) .MainCommands( ss: ss, siteId: ss.SiteId, verType: Versions.VerTypes.Latest) .Div(css: "margin-bottom") .Hidden(controlId: "TableName", value: "Groups") .Hidden(controlId: "BaseUrl", value: Locations.BaseUrl()) .Hidden( controlId: "GridOffset", value: Parameters.General.GridPageSize.ToString())) .Div(attributes: new HtmlAttributes() .Id("ImportSettingsDialog") .Class("dialog") .Title(Displays.Import())) .Div(attributes: new HtmlAttributes() .Id("ExportSettingsDialog") .Class("dialog") .Title(Displays.ExportSettings())); }).ToString()); }
/// <summary> /// Fixed: /// </summary> public static HtmlBuilder OutgoingMailsForm( this HtmlBuilder hb, Context context, SiteSettings ss, string referenceType, long referenceId, int referenceVer) { return(hb.Form( attributes: new HtmlAttributes() .Id("OutgoingMailsForm") .Action(Locations.Action( context: context, table: context.Controller, id: referenceId, controller: "OutgoingMails")), action: () => new OutgoingMailCollection( context: context, where : Rds.OutgoingMailsWhere() .ReferenceType(referenceType) .ReferenceId(referenceId) .ReferenceVer(referenceVer, _operator: "<="), orderBy: Rds.OutgoingMailsOrderBy() .OutgoingMailId(SqlOrderBy.Types.desc)) .ForEach(outgoingMailModel => hb .OutgoingMailListItem( context: context, ss: ss, outgoingMailModel: outgoingMailModel)))); }
public static HtmlBuilder DropDownSearchDialog( this HtmlBuilder hb, string controller, long id) { return(hb.Div( attributes: new HtmlAttributes() .Id("DropDownSearchDialog") .Class("dialog"), action: () => hb .Form( attributes: new HtmlAttributes() .Id("DropDownSearchDialogForm") .Action(Locations.Action(controller, id)), action: () => hb .FieldSelectable( controlId: "DropDownSearchResults", fieldCss: "field-vertical w600", controlContainerCss: "container-selectable", controlWrapperCss: " h300", commandOptionPositionIsTop: true, commandOptionAction: () => hb .Div(css: "command-left", action: () => hb .TextBox( controlId: "DropDownSearchText", controlCss: " auto-postback always-send w200", action: "SearchDropDown", method: "post") .Button( text: Displays.Search(), controlCss: "button-icon", onClick: "$p.send($('#DropDownSearchText'));", icon: "ui-icon-search"))) .Hidden( controlId: "DropDownSearchTarget", css: "always-send") .Hidden( controlId: "DropDownSearchOnEditor", css: "always-send") .Hidden( controlId: "DropDownSearchMultiple", css: "always-send") .Hidden( controlId: "DropDownSearchResultsOffset", value: "0", css: "always-send") .P(css: "message-dialog") .Div(css: "command-center", action: () => hb .Button( text: Displays.Select(), controlCss: "button-icon", onClick: "$p.send($(this));", icon: "ui-icon-disk", action: "SelectSearchDropDown", method: "post") .Button( text: Displays.Cancel(), controlCss: "button-icon", onClick: "$p.closeDialog($(this));", icon: "ui-icon-cancel"))))); }
/// <summary> /// Fixed: /// </summary> public static string Index(SiteSettings ss) { var hb = new HtmlBuilder(); var view = Views.GetBySession(ss); var groupCollection = GroupCollection(ss, view); return(hb.Template( ss: ss, verType: Versions.VerTypes.Latest, methodType: BaseModel.MethodTypes.Index, referenceType: "Groups", title: Displays.Groups() + " - " + Displays.List(), action: () => { hb .Form( attributes: new HtmlAttributes() .Id("GroupForm") .Class("main-form") .Action(Locations.Action("Groups")), action: () => hb .Aggregations( ss: ss, aggregations: groupCollection.Aggregations) .Div(id: "ViewModeContainer", action: () => hb .Grid( ss: ss, groupCollection: groupCollection, view: view)) .MainCommands( ss: ss, siteId: ss.SiteId, verType: Versions.VerTypes.Latest) .Div(css: "margin-bottom") .Hidden(controlId: "TableName", value: "Groups") .Hidden(controlId: "BaseUrl", value: Locations.BaseUrl()) .Hidden( controlId: "GridOffset", value: Parameters.General.GridPageSize.ToString())) .Div(attributes: new HtmlAttributes() .Id("ImportSettingsDialog") .Class("dialog") .Title(Displays.Import())) .Div(attributes: new HtmlAttributes() .Id("ExportSettingsDialog") .Class("dialog") .Title(Displays.ExportSettings())); }).ToString()); }
private static string DropDownSearchDialogFormAction(Context context, long id) { switch (context.Controller) { case "items": case "publishes": return(Locations.ItemAction( context: context, id: id)); default: return(Locations.Action( context: context, controller: context.Controller)); } }
/// <summary> /// Fixed: /// </summary> public static HtmlBuilder OutgoingMailsForm( this HtmlBuilder hb, string referenceType, long referenceId, int referenceVer) { return(hb.Form( attributes: new HtmlAttributes() .Id("OutgoingMailsForm") .Action(Locations.Action(Routes.Controller(), referenceId, "OutgoingMails")), action: () => new OutgoingMailCollection( where : Rds.OutgoingMailsWhere() .ReferenceType(referenceType) .ReferenceId(referenceId) .ReferenceVer(referenceVer, _operator: "<="), orderBy: Rds.OutgoingMailsOrderBy() .OutgoingMailId(SqlOrderBy.Types.desc)) .ForEach(outgoingMailModel => hb .OutgoingMailListItem(outgoingMailModel)))); }
public static HtmlBuilder CopyDialog( this HtmlBuilder hb, Context context, string referenceType, long id) { return(hb.Div( attributes: new HtmlAttributes() .Id("CopyDialog") .Class("dialog") .Title(Displays.CopySettings(context: context)), action: () => hb .Form( attributes: new HtmlAttributes() .Id("CopyDialogForm") .Action(Locations.Action( context: context, controller: referenceType, id: id)), action: () => hb .FieldCheckBox( controlId: "CopyWithComments", labelText: Displays.CopyWithComments(context: context), _checked: true, fieldCss: "field-wide", controlContainerCss: "m-l50", controlCss: " always-send", labelPositionIsRight: true) .P(css: "message-dialog") .Div(css: "command-center", action: () => hb .Button( text: Displays.Copy(context: context), controlCss: "button-icon", onClick: "$p.copy($(this));", icon: "ui-icon-copy", action: "Copy", method: "post") .Button( text: Displays.Cancel(context: context), controlCss: "button-icon", onClick: "$p.closeDialog($(this));", icon: "ui-icon-cancel"))))); }
/// <summary> /// Fixed: /// </summary> public static ResponseCollection EditorResponse( this ResponseCollection res, SiteSettings ss, string reference, long id) { var exportSettingModel = ExportSetting(ss.ReferenceType, id); SetSessions(exportSettingModel); var hb = new HtmlBuilder(); return(res .Html("#ExportSettingsDialog", hb .Form( attributes: new HtmlAttributes() .Id("ExportSettingsForm") .Action(Locations.Action( reference, id, "ExportSettings")), action: () => hb .Columns( exportSettingModel.ExportColumns, exportSettingModel.GetSiteSettings()) .Settings(ss.ReferenceType, id) .P(css: "message-dialog") .Commands()))); }
/// <summary> /// Fixed: /// </summary> private static HtmlBuilder Editor( this HtmlBuilder hb, Context context, SiteSettings ss, TenantModel tenantModel) { var commentsColumn = ss.GetColumn(context: context, columnName: "Comments"); var commentsColumnPermissionType = commentsColumn .ColumnPermissionType(context: context); var showComments = false; var tabsCss = showComments ? null : "max"; return(hb.Div(id: "Editor", action: () => hb .Form( attributes: new HtmlAttributes() .Id("TenantForm") .Class("main-form confirm-reload") .Action(Locations.Action( context: context, controller: "Tenants", id: tenantModel.TenantId)), action: () => hb .RecordHeader( context: context, ss: ss, baseModel: tenantModel, tableName: "Tenants") .Div( id: "EditorComments", action: () => hb .Comments( context: context, ss: ss, comments: tenantModel.Comments, column: commentsColumn, verType: tenantModel.VerType, columnPermissionType: commentsColumnPermissionType), _using: showComments) .Div(id: "EditorTabsContainer", css: tabsCss, action: () => hb .EditorTabs( context: context, tenantModel: tenantModel) .FieldSetGeneral(context: context, ss: ss, tenantModel: tenantModel) .FieldSet( attributes: new HtmlAttributes() .Id("FieldSetHistories") .DataAction("Histories") .DataMethod("post"), _using: tenantModel.MethodType != BaseModel.MethodTypes.New) .MainCommands( context: context, ss: ss, siteId: 0, verType: tenantModel.VerType, referenceId: tenantModel.TenantId, updateButton: true, mailButton: true, deleteButton: true, extensions: () => hb .MainCommandExtensions( context: context, tenantModel: tenantModel, ss: ss))) .Hidden( controlId: "BaseUrl", value: Locations.BaseUrl(context: context)) .Hidden( controlId: "MethodType", value: tenantModel.MethodType.ToString().ToLower()) .Hidden( controlId: "Tenants_Timestamp", css: "always-send", value: tenantModel.Timestamp) .Hidden( controlId: "SwitchTargets", css: "always-send", value: tenantModel.SwitchTargets?.Join(), _using: !context.Ajax)) .OutgoingMailsForm( context: context, ss: ss, referenceType: "Tenants", referenceId: tenantModel.TenantId, referenceVer: tenantModel.Ver) .CopyDialog( context: context, referenceType: "Tenants", id: tenantModel.TenantId) .OutgoingMailDialog() .EditorExtensions( context: context, tenantModel: tenantModel, ss: ss))); }
/// <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))); }
/// <summary> /// Fixed: /// </summary> public static string Editor(Context context, string reference, long id) { var ss = SiteSettingsUtilities.GetByReference( context: context, reference: reference, referenceId: id); if (context.ContractSettings.Mail == false) { return(Error.Types.Restricted.MessageJson(context: context)); } if (MailAddressUtilities.Get( context: context, userId: context.UserId) == string.Empty) { return(new ResponseCollection() .CloseDialog() .Message(Messages.MailAddressHasNotSet(context: context)) .ToJson()); } var invalid = OutgoingMailValidators.OnEditing( context: context, ss: ss); switch (invalid) { case Error.Types.None: break; default: return(invalid.MessageJson(context: context)); } var outgoingMailModel = new OutgoingMailModel().Get( context: context, where : Rds.OutgoingMailsWhere().OutgoingMailId( context.Forms.Long("OutgoingMails_OutgoingMailId"))); var hb = new HtmlBuilder(); return(new ResponseCollection() .Html("#OutgoingMailDialog", hb .Div(id: "MailEditorTabsContainer", action: () => hb .Ul(id: "MailEditorTabs", action: () => hb .Li(action: () => hb .A( href: "#FieldSetMailEditor", text: Displays.Mail(context: context))) .Li(action: () => hb .A( href: "#FieldSetAddressBook", text: Displays.AddressBook(context: context)))) .FieldSet(id: "FieldSetMailEditor", action: () => hb .Form( attributes: new HtmlAttributes() .Id("OutgoingMailForm") .Action(Locations.Action( context: context, table: reference, id: id, controller: "OutgoingMails")), action: () => hb .Editor( context: context, ss: ss, outgoingMailModel: outgoingMailModel))) .FieldSet(id: "FieldSetAddressBook", action: () => hb .Form( attributes: new HtmlAttributes() .Id("OutgoingMailDestinationForm") .Action(Locations.Action( context: context, table: reference, id: id, controller: "OutgoingMails")), action: () => hb .Destinations(context: context, ss: ss))))) .Invoke("initOutgoingMailDialog") .Focus("#OutgoingMails_Body") .ToJson()); }