public OnlandVisualTrashAssessmentAreaIndexGridSpec(Person currentPerson)
        {
            if (currentPerson.IsManagerOrAdmin())
            {
                Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.GetDeleteUrl(), true, true), 25, DhtmlxGridColumnFilterType.None);
            }

            if (currentPerson.IsJurisdictionEditorOrManagerOrAdmin())
            {
                Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeModalDialogLink(
                        BootstrapHtmlHelpers.MakeGlyphIconWithHiddenText("glyphicon-plus", "Reassess this OVTA Area")
                        .ToString(),
                        x.GetBeginOVTAUrl(), 500, "Begin OVTA", true, "Begin", "Cancel",
                        new List <string>(), null, null), 30, DhtmlxGridColumnFilterType.None);
            }

            Add("Assessment Area Name",
                x => x.GetDisplayNameAsDetailUrl(currentPerson) ?? new HtmlString("Not Set"), 170,
                DhtmlxGridColumnFilterType.Html);

            Add(FieldDefinitionType.BaselineScore.ToGridHeaderString(), x => x.GetBaselineScoreAsHtmlString(), 150,
                DhtmlxGridColumnFilterType.SelectFilterHtmlStrict);
            Add(FieldDefinitionType.ProgressScore.ToGridHeaderString(), x => x.GetProgressScoreAsHtmlString(), 150,
                DhtmlxGridColumnFilterType.SelectFilterHtmlStrict);
            Add("Number of Assessments Completed", x => x.OnlandVisualTrashAssessments.Count, 170,
                DhtmlxGridColumnAggregationType.Total);
            Add("Last Assessment Date", x => x.GetLastAssessmentDate(), 120, DhtmlxGridColumnFormatType.Date);
            Add(FieldDefinitionType.Jurisdiction.ToGridHeaderString("Jurisdiction"), x => x.StormwaterJurisdiction?.GetDisplayNameAsDetailUrl() ?? new HtmlString("Not Set"), 170);
        }
Example #2
0
        public GeospatialAreaMapLayerGridSpec(bool userCanManage)
        {
            var areGeospatialAreasExternallySourced = MultiTenantHelpers.AreGeospatialAreasExternallySourced();

            if (userCanManage)
            {
                if (areGeospatialAreasExternallySourced)
                {
                    var cssClasses = new List <string> {
                        "btn", "btn-xs", "btn-firma"
                    };
                    Add(string.Empty,
                        x => DhtmlxGridHtmlHelpers.MakeModalDialogLink("Sync", x.GetSyncUrl(), 400, "Sync Data",
                                                                       true, "Sync", "Cancel", cssClasses, null, null),
                        60, DhtmlxGridColumnFilterType.None);
                }
                Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeEditIconAsModalDialogLinkBootstrap(x.GetEditMapLayerUrl(), "Edit Geospatial Area Map Layer"), 30, DhtmlxGridColumnFilterType.None);
            }
            Add("Display Name", x => x.GeospatialAreaTypeNamePluralized, 250);
            Add(FieldDefinitionEnum.GeospatialAreaMapLayerDisplayAsReferenceLayer.ToType().ToGridHeaderString(), x => x.DisplayOnAllProjectMaps ? "Yes" : "No", 175);
            Add(FieldDefinitionEnum.GeospatialAreaTypeOnByDefaultOnProjectMap.ToType().ToGridHeaderString(), x => x.OnByDefaultOnProjectMap ? "Yes" : "No", 175);
            if (areGeospatialAreasExternallySourced)
            {
                Add("Service Url", x => x.ServiceUrl, 450);
            }
        }
Example #3
0
 public CustomPageGridSpec(bool hasManagePermissions)
 {
     if (hasManagePermissions)
     {
         Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.DeleteUrl, true, true, true), 30, DhtmlxGridColumnFilterType.None);
         Add(string.Empty, a => DhtmlxGridHtmlHelpers.MakeLtInfoEditIconAsModalDialogLinkBootstrap(new ModalDialogForm(SitkaRoute <CustomPageController> .BuildUrlFromExpression(t => t.Edit(a)),
                                                                                                                       "Edit")),
             30, DhtmlxGridColumnFilterType.None);
         Add(string.Empty, a => DhtmlxGridHtmlHelpers.MakeModalDialogLink("<span>Edit Content</span>",
                                                                          SitkaRoute <CustomPageController> .BuildUrlFromExpression(y => y.EditInDialog(a)),
                                                                          800,
                                                                          $"Edit Content for {a.CustomPageDisplayName}",
                                                                          true,
                                                                          "Save",
                                                                          "Cancel",
                                                                          new List <string> {
             "gridButton"
         },
                                                                          null,
                                                                          null), 80, DhtmlxGridColumnFilterType.None);
     }
     Add("Page Name", a => a.CustomPageDisplayType != CustomPageDisplayType.Disabled ? UrlTemplate.MakeHrefString(a.AboutPageUrl, a.CustomPageDisplayName) : new HtmlString($"{a.CustomPageDisplayName}"), 180, DhtmlxGridColumnFilterType.Text);
     Add("Has Content", a => a.HasPageContent.ToYesNo(), 85, DhtmlxGridColumnFilterType.SelectFilterStrict);
     Add(Models.FieldDefinition.CustomPageDisplayType.ToGridHeaderString(), a => a.CustomPageDisplayType.CustomPageDisplayTypeDisplayName, 110, DhtmlxGridColumnFilterType.SelectFilterStrict);
     Add("Navigation Section", a => a.CustomPageNavigationSection.CustomPageNavigationSectionName, 110, DhtmlxGridColumnFilterType.SelectFilterStrict);
     Add("CustomPageID", a => a.CustomPageID, 0);
 }
Example #4
0
 public CustomPageGridSpec(bool hasManagePermissions)
 {
     if (hasManagePermissions)
     {
         Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.GetDeleteUrl(), true, true), 30, DhtmlxGridColumnFilterType.None);
         Add(string.Empty, a => DhtmlxGridHtmlHelpers.MakeLtInfoEditIconAsModalDialogLinkBootstrap(new ModalDialogForm(SitkaRoute <CustomPageController> .BuildUrlFromExpression(t => t.Edit(a)),
                                                                                                                       850, "Edit")),
             30, DhtmlxGridColumnFilterType.None);
         Add(string.Empty, a => DhtmlxGridHtmlHelpers.MakeModalDialogLink("<span>Edit Content</span>",
                                                                          SitkaRoute <CustomPageController> .BuildUrlFromExpression(y => y.EditInDialog(a)),
                                                                          800,
                                                                          $"Edit Content for {a.CustomPageDisplayName}",
                                                                          true,
                                                                          "Save",
                                                                          "Cancel",
                                                                          new List <string> {
             "gridButton"
         },
                                                                          null,
                                                                          null), 80, DhtmlxGridColumnFilterType.None);
     }
     Add("Menu", a => a.FirmaMenuItem.GetFirmaMenuItemDisplayName(), 110, DhtmlxGridColumnFilterType.Text);
     Add("Page Name", a => !a.IsDisabled() ? UrlTemplate.MakeHrefString(a.GetAboutPageUrl(), a.CustomPageDisplayName) : new HtmlString($"{a.CustomPageDisplayName}"), 180, DhtmlxGridColumnFilterType.Text);
     Add("Has Content", a => a.HasPageContent().ToYesNo(), 85, DhtmlxGridColumnFilterType.SelectFilterStrict);
     Add(FieldDefinitionEnum.CustomPageViewableBy.ToType().ToGridHeaderString(), a => a.GetViewableRolesAsListOfStrings(), 400, DhtmlxGridColumnFilterType.Text);
     Add("CustomPageID", a => a.CustomPageID, 0);
 }
        public OnlandVisualTrashAssessmentIndexGridSpec(Person currentPerson, bool showName)
        {
            Add(string.Empty, x => x.GetDetailUrlForGrid(currentPerson), 40, DhtmlxGridColumnFilterType.None);

            if (currentPerson.IsManagerOrAdmin())
            {
                Add(string.Empty, x => DhtmlxGridHtmlHelpers.MakeDeleteIconAndLinkBootstrap(x.GetDeleteUrl(), true, true), 25, DhtmlxGridColumnFilterType.None);
            }

            if (currentPerson.IsJurisdictionEditorOrManagerOrAdmin())
            {
                Add(string.Empty, x => x.GetEditUrlForGrid(currentPerson), 80, DhtmlxGridColumnFilterType.None);
                Add(string.Empty, x => x.OnlandVisualTrashAssessmentArea != null
                    ? DhtmlxGridHtmlHelpers.MakeModalDialogLink(
                        BootstrapHtmlHelpers.MakeGlyphIconWithHiddenText("glyphicon-plus", "Reassess this OVTA Area")
                        .ToString(),
                        x.OnlandVisualTrashAssessmentArea.GetBeginOVTAUrl(), 500, "Begin OVTA", true, "Begin", "Cancel",
                        new List <string>(), null, null)
                    : new HtmlString(""), 30, DhtmlxGridColumnFilterType.None);
            }

            if (showName)
            {
                Add("Assessment Area Name",
                    x => x.OnlandVisualTrashAssessmentArea?.GetDisplayNameAsDetailUrl(currentPerson) ?? new HtmlString("Not Set"), 170,
                    DhtmlxGridColumnFilterType.Html);
            }

            Add(FieldDefinitionType.AssessmentScore.ToGridHeaderString(), x => x.OnlandVisualTrashAssessmentScore?.OnlandVisualTrashAssessmentScoreDisplayName, 100,
                DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Assessment Type", x => x.ToBaselineProgress(), 75,
                DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add("Last Assessment Date", x => x.CompletedDate, 120, DhtmlxGridColumnFormatType.Date);
            Add("Status", x => x.OnlandVisualTrashAssessmentStatus.OnlandVisualTrashAssessmentStatusDisplayName, 120, DhtmlxGridColumnFilterType.SelectFilterStrict);
            Add(FieldDefinitionType.Jurisdiction.ToGridHeaderString("Jurisdiction"), x => x.StormwaterJurisdiction?.GetDisplayNameAsDetailUrl() ?? new HtmlString("Not Set"), 170);

            Add("Created By", x => x.CreatedByPerson.GetFullNameFirstLastAsUrl(), 115,
                DhtmlxGridColumnFilterType.SelectFilterHtmlStrict);
            Add("Created On", x => x.CreatedDate, 120, DhtmlxGridColumnFormatType.Date);
        }
Example #6
0
        private void AddSubmitColumn()
        {
            Add("Submit",
                x =>
            {
                // get the current batch if any
                var latestNotApprovedUpdateBatch = x.GetLatestNotApprovedUpdateBatch();
                if (latestNotApprovedUpdateBatch != null)
                {
                    if (latestNotApprovedUpdateBatch.IsReadyToSubmit)
                    {
                        var submitText = latestNotApprovedUpdateBatch.IsReturned ? "Re-Submit" : "Submit";
                        var submitLink = DhtmlxGridHtmlHelpers.MakeModalDialogLink(
                            $"<span style=\"display:none\">Ready to</span> {submitText}",
                            SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(y => y.Submit(x)),
                            500,
                            $"{submitText} {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} {x.DisplayName}",
                            true,
                            "Continue",
                            "Cancel",
                            new List <string> {
                            "btn", "btn-xs", "btn-firma"
                        },
                            null,
                            null);
                        return(submitLink);
                    }
                    if (latestNotApprovedUpdateBatch.IsSubmitted)
                    {
                        return(new HtmlString("<span style='display:none'>Already </span>Submitted"));
                    }
                }

                return(new HtmlString("Not Ready<span style='display:none'> to Submit</span>"));
            },
                100);
        }