Esempio n. 1
0
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            var projectTypeDisplayNamePluralized = Models.FieldDefinition.ProjectType.GetFieldDefinitionLabelPluralized();

            PageTitle = projectTypeDisplayNamePluralized;

            var hasProjectTypeManagePermissions = new ProjectTypeManageFeature().HasPermissionByPerson(currentPerson);
            var projectTypeDisplayName          = Models.FieldDefinition.ProjectType.GetFieldDefinitionLabel();

            GridSpec = new IndexGridSpec(currentPerson)
            {
                ObjectNameSingular  = projectTypeDisplayName,
                ObjectNamePlural    = projectTypeDisplayNamePluralized,
                SaveFiltersInCookie = true
            };

            if (hasProjectTypeManagePermissions)
            {
                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(SitkaRoute <ProjectTypeController> .BuildUrlFromExpression(t => t.New()), string.Format("Create a new {0}", projectTypeDisplayName));
            }

            GridName    = "projectTypesGrid";
            GridDataUrl = SitkaRoute <ProjectTypeController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());

            EditSortOrderUrl = SitkaRoute <ProjectTypeController> .BuildUrlFromExpression(tc => tc.EditSortOrder());
        }
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle = $"Full {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} List";

            GridSpec = new ProjectIndexGridSpec(currentPerson, true, true, new Dictionary <int, vTotalTreatedAcresByProject>())
            {
                ObjectNameSingular = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()}", ObjectNamePlural = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true
            };

            if (new ProjectCreateNewFeature().HasPermissionByPerson(CurrentPerson))
            {
                GridSpec.CustomExcelDownloadUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.IndexExcelDownload());
            }
            else if (currentPerson.RoleID == Models.Role.ProjectSteward.RoleID)
            {
                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.DenyCreateProject()), $"New {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}");
            }

            GridName    = "projectsGrid";
            GridDataUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());

            ProposeNewProjectUrl = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.InstructionsProposal(null));

            ProjectUpdatesUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.MyProjectsRequiringAnUpdate());

            DisplayActionButtons = !currentPerson.IsAnonymousOrUnassigned;
        }
        public EditViewData(Person currentPerson,
                            IEnumerable <MeasurementUnitType> measurementUnitTypes,
                            List <ProjectCustomAttributeDataType> projectCustomAttributeDataTypes,
                            string submitUrl,
                            Models.FirmaPage instructionsFirmaPage,
                            Models.ProjectCustomAttributeType projectCustomAttributeType)
            : base(currentPerson)
        {
            EntityName = "Attribute Type";
            PageTitle  =
                $"{(projectCustomAttributeType != null ? "Edit" : "New")} Attribute Type";
            YesNos = BooleanFormats.GetYesNoSelectList();
            ProjectCustomAttributeDataTypes = projectCustomAttributeDataTypes.ToSelectListWithEmptyFirstRow(
                x => x.ProjectCustomAttributeDataTypeID.ToString(), x => x.ProjectCustomAttributeDataTypeDisplayName);
            MeasurementUnitTypes = measurementUnitTypes.OrderBy(x => x.MeasurementUnitTypeDisplayName)
                                   .ToSelectListWithEmptyFirstRow(
                x => x.MeasurementUnitTypeID.ToString(), x => x.MeasurementUnitTypeDisplayName,
                ViewUtilities.NoneString);
            ProjectCustomAttributeTypeIndexUrl =
                SitkaRoute <ProjectCustomAttributeTypeController> .BuildUrlFromExpression(x => x.Manage());

            SubmitUrl = submitUrl;

            ViewInstructionsFirmaPage = new ViewPageContentViewData(instructionsFirmaPage, currentPerson);

            ViewDataForAngular = new EditViewDataForAngular(projectCustomAttributeDataTypes);
        }
        public PendingViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle = $"Pending {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}";

            HasProposeProjectPermissions = new ProjectCreateFeature().HasPermissionByPerson(CurrentPerson);
            ProposeNewProjectUrl         = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.InstructionsProposal(null));


            GridSpec = new PendingGridSpec(currentPerson)
            {
                ObjectNameSingular = $"Pending {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}", ObjectNamePlural = $"Pending {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true
            };

            if (new ProjectCreateNewFeature().HasPermissionByPerson(CurrentPerson))
            {
                GridSpec.CustomExcelDownloadUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.PendingExcelDownload());
            }
            if (new ProjectCreateFeature().HasPermissionByPerson(CurrentPerson))
            {
                GridSpec.CreateEntityActionPhrase    = $"Propose a New {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}";
                GridSpec.CreateEntityModalDialogForm = null;
            }
            GridName    = "proposalsGrid";
            GridDataUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.PendingGridJsonData());
        }
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle = MultiTenantHelpers.GetPerformanceMeasureNamePluralized();

            var hasPerformanceMeasureManagePermissions = new PerformanceMeasureManageFeature().HasPermissionByPerson(currentPerson);

            HasPerformanceMeasureManagePermissions = hasPerformanceMeasureManagePermissions;
            PerformanceMeasureGridSpec             = new PerformanceMeasureGridSpec(currentPerson)
            {
                ObjectNameSingular  = MultiTenantHelpers.GetPerformanceMeasureName(),
                ObjectNamePlural    = MultiTenantHelpers.GetPerformanceMeasureNamePluralized(),
                SaveFiltersInCookie = true
            };

            if (HasPerformanceMeasureManagePermissions)
            {
                var contentUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.New());

                PerformanceMeasureGridSpec.CreateEntityModalDialogForm = new ModalDialogForm(contentUrl, $"Create a new {Models.FieldDefinition.PerformanceMeasure.GetFieldDefinitionLabel()}");
            }
            PerformanceMeasureGridSpec.CustomExcelDownloadLinkText = $"Download with {Models.FieldDefinition.PerformanceMeasureSubcategory.GetFieldDefinitionLabelPluralized()}";
            PerformanceMeasureGridSpec.CustomExcelDownloadUrl      = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(tc => tc.IndexExcelDownload());

            PerformanceMeasureGridName    = "performanceMeasuresGrid";
            PerformanceMeasureGridDataUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.PerformanceMeasureGridJsonData());

            EditSortOrderUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(x => x.EditSortOrder());
        }
        /// <summary>
        /// Call for page with associated FirmaPage
        /// </summary>
        protected FirmaViewData(Person currentPerson, Models.FirmaPage firmaPage)
        {
            FirmaPage = firmaPage;

            CurrentPerson = currentPerson;
            FirmaHomeUrl  = SitkaRoute <HomeController> .BuildUrlFromExpression(c => c.Index());

            LogInUrl  = FirmaHelpers.GenerateLogInUrlWithReturnUrl();
            LogOutUrl = FirmaHelpers.GenerateLogOutUrlWithReturnUrl();

            RequestSupportUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(c => c.Support());

            MakeFirmaMenu(currentPerson);

            FullProjectListUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Index());

            ProjectSearchUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Search(UrlTemplate.Parameter1String));

            ProjectFindUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Find(string.Empty));

            var currentPersonCanManage = new FirmaPageManageFeature().HasPermission(currentPerson, firmaPage).HasPermission;

            ViewPageContentViewData = firmaPage != null ? new ViewPageContentViewData(firmaPage, currentPersonCanManage) : null;
            CustomFooterViewData    =
                new ViewPageContentViewData(Models.FirmaPage.GetFirmaPageByPageType(FirmaPageType.CustomFooter),
                                            currentPersonCanManage);
            TenantName          = MultiTenantHelpers.GetTenantName();
            TenantDisplayName   = MultiTenantHelpers.GetTenantDisplayName();
            TenantBannerLogoUrl = MultiTenantHelpers.GetTenantBannerLogoUrl();
        }
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            var taxonomyBranchDisplayNamePluralized = Models.FieldDefinition.TaxonomyBranch.GetFieldDefinitionLabelPluralized();

            PageTitle = taxonomyBranchDisplayNamePluralized;

            // only let them sort tier two taxonomy if that's the highest level.
            OfferEditSortOrder = MultiTenantHelpers.IsTaxonomyLevelBranch();

            HasTaxonomyBranchManagePermissions = new TaxonomyBranchManageFeature().HasPermissionByPerson(currentPerson);
            var taxonomyBranchDisplayName = Models.FieldDefinition.TaxonomyBranch.GetFieldDefinitionLabel();

            GridSpec = new IndexGridSpec(currentPerson)
            {
                ObjectNameSingular  = taxonomyBranchDisplayName,
                ObjectNamePlural    = taxonomyBranchDisplayNamePluralized,
                SaveFiltersInCookie = true
            };

            if (HasTaxonomyBranchManagePermissions)
            {
                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(t => t.New()), string.Format("Create a new {0}", taxonomyBranchDisplayName));
            }

            GridName    = "taxonomyBranchesGrid";
            GridDataUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());

            EditSortOrderUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(tc => tc.EditSortOrder());
        }
Esempio n. 8
0
        public MyOrganizationsProjectsViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            //TODO: It shouldn't be possible to reach this if Person.Organization is null...
            var organizationNamePossessive = currentPerson.Organization.OrganizationNamePossessive;

            PageTitle = $"{organizationNamePossessive} {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}";

            ProjectsGridName = "myOrganizationsProjectListGrid";
            ProjectsGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true)
            {
                ObjectNameSingular  = $"{organizationNamePossessive} {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{organizationNamePossessive} {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };
            ProjectsGridDataUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.MyOrganizationsProjectsGridJsonData());

            ProposalsGridName   = "myOrganizationsProposalsGrid";
            ProposalsesGridSpec = new ProposalsGridSpec(currentPerson)
            {
                ObjectNameSingular  = $"{organizationNamePossessive} {Models.FieldDefinition.Application.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{organizationNamePossessive} {Models.FieldDefinition.Application.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };
            ProposalsGridDataUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.MyOrganizationsProposalsGridJsonData());

            ProposeNewProjectUrl = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(tc => tc.InstructionsProposal(null));
        }
        public InteractionEventIndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle = $"Full {Models.FieldDefinition.InteractionEvent.GetFieldDefinitionLabelPluralized()} List";

            InteractionEventGridSpec    = new InteractionEventGridSpec(currentPerson);
            InteractionEventGridName    = "interactionEventsGridName";
            InteractionEventGridDataUrl = SitkaRoute <InteractionEventController> .BuildUrlFromExpression(tc => tc.InteractionEventGridJsonData());
        }
Esempio n. 10
0
        public InvoiceIndexViewData(Person currentPerson, Models.FirmaPage firmaPage, bool atLeastOneInvoiceHasAFile) : base(currentPerson, firmaPage)
        {
            PageTitle = $"Full Invoice List";

            InvoiceGridSpec    = new InvoiceGridSpec(currentPerson, atLeastOneInvoiceHasAFile);
            InvoiceGridName    = "invoicesGridName";
            InvoiceGridDataUrl = SitkaRoute <InvoiceController> .BuildUrlFromExpression(tc => tc.InvoiceGridJsonData());
        }
        public AgreementIndexViewData(Person currentPerson, Models.FirmaPage firmaPage, bool atLeastOneAgreementHasFile) : base(currentPerson, firmaPage)
        {
            PageTitle = $"Full Agreement List";

            AgreementGridSpec    = new AgreementGridSpec(currentPerson, atLeastOneAgreementHasFile, true, true);
            AgreementGridName    = "agreementsGridName";
            AgreementGridDataUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(tc => tc.AgreementGridJsonData());
        }
Esempio n. 12
0
        public ManageViewData(Person currentPerson,
                              Models.FirmaPage firmaPage,
                              string customNotificationUrl,
                              ProjectUpdateStatusGridSpec projectsRequiringUpdateGridSpec,
                              string projectsRequiringUpdateGridDataUrl,
                              PeopleReceivingReminderGridSpec peopleReceivingReminderGridSpec,
                              string peopleReceivingReminderGridDataUrl, int projectsWithNoContactCount,
                              ProjectUpdateConfiguration projectUpdateConfiguration) : base(currentPerson, firmaPage)
        {
            var reportingYear = FirmaDateUtilities.CalculateCurrentYearToUseForRequiredReporting();

            PageTitle     = $"Manage {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Updates";
            ReportingYear = reportingYear;

            ProjectsRequiringUpdateGridDataUrl = projectsRequiringUpdateGridDataUrl;
            ProjectsRequiringUpdateGridSpec    = projectsRequiringUpdateGridSpec;
            ProjectsRequiringUpdateGridName    = "projectsRequiringAnUpdateGrid";

            PeopleReceivingReminderGridDataUrl = peopleReceivingReminderGridDataUrl;
            ProjectsWithNoContactCount         = projectsWithNoContactCount;

            ProjectUpdateConfiguration = projectUpdateConfiguration ?? ProjectUpdateConfiguration.CreateNewBlank();

            PeopleReceivingReminderGridSpec = peopleReceivingReminderGridSpec;
            PeopleReceivingReminderGridName = "peopleReceivingAnReminderGrid";

            KickOffIntroPreviewUrl =
                SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.KickOffIntroPreview());

            ReminderIntroPreviewUrl =
                SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.ReminderIntroPreview());

            CloseOutIntroPreviewUrl =
                SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.CloseOutIntroPreview());

            var getPersonIDFunctionString =
                $"function() {{ return Sitka.{PeopleReceivingReminderGridName}.getValuesFromCheckedGridRows({0}, \'PersonID\', \'PersonIDList\'); }}";

            var modalDialogFormLink = ModalDialogFormHelper.ModalDialogFormLink(
                "<span class=\"glyphicon glyphicon-envelope\" style=\"margin-right:5px\"></span>Send Notification to Selected People",
                customNotificationUrl,
                "Send Notification to Selected People",
                700,
                "Send",
                "Cancel",
                new List <string>(),
                null,
                getPersonIDFunctionString);

            PeopleReceivingReminderGridSpec.ArbitraryHtml = new List <string> {
                modalDialogFormLink.ToString()
            };

            EditProjectUpdateConfigurationUrl =
                SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.EditProjectUpdateConfiguration());
        }
Esempio n. 13
0
 public ProjectMapViewData(Person currentPerson, Models.FirmaPage firmaPage, ProjectLocationsMapInitJson projectLocationsMapInitJson, ProjectLocationsMapViewData projectLocationsMapViewData, Dictionary <ProjectLocationFilterTypeSimple, IEnumerable <SelectListItem> > projectLocationFilterTypesAndValues, string projectLocationsUrl, string filteredProjectsWithLocationAreasUrl, List <ProjectMapLocationJson> projectMapLocationJsons) : base(currentPerson, firmaPage)
 {
     PageTitle = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Map";
     ProjectLocationsMapInitJson         = projectLocationsMapInitJson;
     ProjectLocationFilterTypesAndValues = projectLocationFilterTypesAndValues;
     ProjectLocationsMapViewData         = projectLocationsMapViewData;
     ProjectLocationsUrl = projectLocationsUrl;
     FilteredProjectsWithLocationAreasUrl = filteredProjectsWithLocationAreasUrl;
     ProjectMapViewDataForAngular         = new ProjectMapViewDataForAngular(projectLocationsMapInitJson, projectLocationsMapInitJson.ProjectLocationsLayerGeoJson, projectMapLocationJsons);
 }
 public TaxonomyViewData(Person currentPerson, Models.FirmaPage firmaPage,
                         List <FancyTreeNode> topLevelTaxonomyTierAsFancyTreeNodes) : base(currentPerson, firmaPage)
 {
     TopLevelTaxonomyTierAsFancyTreeNodes = topLevelTaxonomyTierAsFancyTreeNodes;
     PageTitle = MultiTenantHelpers.GetTaxonomySystemName();
     TaxonomyTrunkDisplayName  = Models.FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabel();
     TaxonomyBranchDisplayName = Models.FieldDefinition.TaxonomyBranch.GetFieldDefinitionLabel();
     ProjectTypeDisplayName    = Models.FieldDefinition.ProjectType.GetFieldDefinitionLabel();
     TaxonomyLevel             = MultiTenantHelpers.GetTaxonomyLevel();
 }
 public IndexViewData(Person currentPerson, MapInitJson mapInitJson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
 {
     PageTitle   = $"{Models.FieldDefinition.PriorityLandscape.GetFieldDefinitionLabelPluralized()}";
     MapInitJson = mapInitJson;
     GridSpec    = new IndexGridSpec(currentPerson)
     {
         ObjectNameSingular = $"{Models.FieldDefinition.PriorityLandscape.GetFieldDefinitionLabel()}", ObjectNamePlural = $"{Models.FieldDefinition.PriorityLandscape.GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true
     };
     GridName    = "priorityLandscapesGrid";
     GridDataUrl = SitkaRoute <PriorityLandscapeController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());
 }
 public IndexViewData(Person currentPerson, MapInitJson mapInitJson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
 {
     PageTitle   = Models.FieldDefinition.DNRUplandRegion.GetFieldDefinitionLabelPluralized();
     MapInitJson = mapInitJson;
     GridSpec    = new IndexGridSpec(currentPerson)
     {
         ObjectNameSingular = Models.FieldDefinition.DNRUplandRegion.FieldDefinitionDisplayName, ObjectNamePlural = Models.FieldDefinition.DNRUplandRegion.GetFieldDefinitionLabelPluralized(), SaveFiltersInCookie = true
     };
     GridName    = "regionsGrid";
     GridDataUrl = SitkaRoute <DNRUplandRegionController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());
 }
 public ProjectMapViewData(Person currentPerson, Models.FirmaPage firmaPage, ProjectLocationsMapInitJson projectLocationsMapInitJson, ProjectLocationsMapViewData projectLocationsMapViewData, Dictionary <ProjectLocationFilterTypeSimple, IEnumerable <SelectListItem> > projectLocationFilterTypesAndValues, string projectLocationsUrl, string filteredProjectsWithLocationAreasUrl, List <ProjectMapLocationJson> projectMapLocationJsons) : base(currentPerson, firmaPage)
 {
     PageTitle = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Map";
     ProjectLocationsMapInitJson         = projectLocationsMapInitJson;
     ProjectLocationFilterTypesAndValues = projectLocationFilterTypesAndValues;
     ProjectLocationsMapViewData         = projectLocationsMapViewData;
     ProjectLocationsUrl = projectLocationsUrl;
     FilteredProjectsWithLocationAreasUrl = filteredProjectsWithLocationAreasUrl;
     ProjectMapViewDataForAngular         = new ProjectMapViewDataForAngular(projectLocationsMapInitJson, projectLocationsMapInitJson.ProjectLocationsLayerGeoJson, projectMapLocationJsons);
     GeocodeAddressUrl = SitkaRoute <ResultsController> .BuildAbsoluteUrlHttpsFromExpression(x => x.GeocodeAddress(null, null));;
 }
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle = "DNR Cost Share Treatments";
            GridSpec  = new LandownerCostShareIndexGridSpec(currentPerson)
            {
                ObjectNameSingular  = Models.FieldDefinition.GrantAllocationAwardLandownerCostShareLineItem.GetFieldDefinitionLabel(),
                ObjectNamePlural    = Models.FieldDefinition.GrantAllocationAwardLandownerCostShareLineItem.GetFieldDefinitionLabelPluralized(),
                SaveFiltersInCookie = true
            };

            GridName    = "landownerCostShareLineItemGrid";
            GridDataUrl = SitkaRoute <GrantAllocationAwardLandownerCostShareLineItemController> .BuildUrlFromExpression(tac => tac.IndexGridJsonData());
        }
 public FeaturedListViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
 {
     PageTitle = $"Featured {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}";
     GridName  = "featuredListGrid";
     GridSpec  = new FeaturesListProjectGridSpec(currentPerson)
     {
         ObjectNameSingular          = $"Featured {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}",
         ObjectNamePlural            = $"Featured {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}",
         SaveFiltersInCookie         = true,
         CreateEntityModalDialogForm = new ModalDialogForm(SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.EditFeaturedProjects()), $"Edit Featured {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}"),
         CreateEntityActionPhrase    = $"Add/Remove Featured {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}"
     };
     GridDataUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(tc => tc.FeaturedListGridJsonData());
 }
        public GrantIndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle = $"Full Grant List";

            GrantGridSpec    = new GrantGridSpec(currentPerson);
            GrantGridName    = "grantsGridName";
            GrantGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantGridJsonData());

            GrantAllocationGridSpec    = new GrantAllocationGridSpec(currentPerson, GrantAllocationGridSpec.GrantAllocationGridCreateButtonType.Hidden, null);
            GrantAllocationGridName    = "grantAllocationsGridName";
            GrantAllocationGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.AllGrantAllocationGridJsonData());

            GrantAllocationNoDataGridSpec    = new GrantAllocationGridSpec(currentPerson, GrantAllocationGridSpec.GrantAllocationGridCreateButtonType.Hidden, null);
            GrantAllocationNoDataGridName    = "grantAllocationsNoDataGridName";
            GrantAllocationNoDataGridDataUrl = SitkaRoute <GrantController> .BuildUrlFromExpression(tc => tc.GrantAllocationGridWithoutAnyJsonData());
        }
        public ManageExcelUploadsAndEtlViewData(Person currentPerson,
                                                Models.FirmaPage firmaPage,
                                                string uploadLoaNortheastSpreadSheetUrl,
                                                string uploadLoaSoutheastSpreadSheetUrl,
                                                string doPublishingProcessingPostUrl,
                                                string uploadLoaFormID,
                                                List <TabularDataImport> tabularDataImports
                                                ) : base(currentPerson, firmaPage)
        {
            PageTitle = $"Upload Loa Tabular Data";
            UploadLoaNortheastSpreadSheetUrl = uploadLoaNortheastSpreadSheetUrl;
            UploadLoaSoutheastSpreadSheetUrl = uploadLoaSoutheastSpreadSheetUrl;
            UploadLoaFormID = uploadLoaFormID;
            DoPublishingProcessingPostUrl = doPublishingProcessingPostUrl;

            LatestTabularDataImportForLoaNortheast = TabularDataImport.GetLatestImportProcessingForGivenType(tabularDataImports, TabularDataImportTableType.LoaNortheast);
            LatestTabularDataImportForLoaSoutheast = TabularDataImport.GetLatestImportProcessingForGivenType(tabularDataImports, TabularDataImportTableType.LoaSoutheast);
        }
Esempio n. 22
0
        public JobIndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle = "Socrata Import Jobs";

            var hasTagManagePermissions = new FirmaAdminFeature().HasPermissionByPerson(currentPerson);

            GridSpec = new JobIndexGridSpec(hasTagManagePermissions);

            if (hasTagManagePermissions)
            {
                // Job execution is done with buttons, and, eventually, should be done via Hangfire.

                //var contentUrl = SitkaRoute<TagController>.BuildUrlFromExpression(t => t.New());
                //GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(contentUrl, "Create a new Tag");
            }

            GridName    = "SocrataJobsGrid";
            GridDataUrl = SitkaRoute <JobController> .BuildUrlFromExpression(tc => tc.JobIndexGridJsonData());
        }
        public ManageViewData(Person currentPerson, Models.FirmaPage neptunePage)
            : base(currentPerson, neptunePage)
        {
            EntityName = "Attribute Type";
            PageTitle  = "All Attribute Types";

            NewProjectCustomAttributeTypeUrl = SitkaRoute <ProjectCustomAttributeTypeController> .BuildUrlFromExpression(t => t.New());

            GridSpec = new ProjectCustomAttributeTypeGridSpec
            {
                ObjectNameSingular  = "Attribute Type",
                ObjectNamePlural    = "Attribute Types",
                SaveFiltersInCookie = true
            };

            GridName    = "projectCustomAttributeTypeGrid";
            GridDataUrl = SitkaRoute <ProjectCustomAttributeTypeController> .BuildUrlFromExpression(tc => tc.ProjectCustomAttributeTypeGridJsonData());

            HasManagePermissions = new FirmaAdminFeature().HasPermissionByPerson(CurrentPerson);
        }
Esempio n. 24
0
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle = "Tags";

            var hasTagManagePermissions = new FirmaAdminFeature().HasPermissionByPerson(currentPerson);

            GridSpec = new IndexGridSpec(hasTagManagePermissions)
            {
                ObjectNameSingular = "Tag", ObjectNamePlural = "Tags", SaveFiltersInCookie = true
            };

            if (hasTagManagePermissions)
            {
                var contentUrl = SitkaRoute <TagController> .BuildUrlFromExpression(t => t.New());

                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(contentUrl, "Create a new Tag");
            }

            GridName    = "TagsGrid";
            GridDataUrl = SitkaRoute <TagController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());
        }
Esempio n. 25
0
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage)
            : base(currentPerson, firmaPage)
        {
            PageTitle = $"{Models.FieldDefinition.Program.GetFieldDefinitionLabelPluralized()}";

            GridSpec = new ProgramGridSpec(currentPerson, null)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Program.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Program.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            //if (hasProgramManagePermissions)
            //{
            //    var contentUrl = SitkaRoute<ProgramController>.BuildUrlFromExpression(t => t.New());
            //    GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(contentUrl, $"Create a new {Models.FieldDefinition.Organization.GetFieldDefinitionLabel()}");
            //}

            GridName    = "programsGrid";
            GridDataUrl = SitkaRoute <ProgramController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());
        }
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPageHomePage, Models.FirmaPage firmaPageAdditionalInfo, Models.FirmaPage firmaPageMapInfo,
                             FeaturedProjectsViewData featuredProjectsViewData, ProjectLocationsMapViewData projectLocationsMapViewData, ProjectLocationsMapInitJson projectLocationsMapInitJson,
                             List <Models.FirmaHomePageImage> firmaHomePageImages) : base(currentPerson, firmaPageHomePage)
        {
            PageTitle = MultiTenantHelpers.GetToolDisplayName();

            CustomHomePageTextViewData = new ViewPageContentViewData(firmaPageHomePage, new FirmaPageManageFeature().HasPermission(currentPerson, firmaPageHomePage).HasPermission);
            CustomHomePageAdditionalInfoTextViewData = new ViewPageContentViewData(firmaPageAdditionalInfo, new FirmaPageManageFeature().HasPermission(currentPerson, firmaPageAdditionalInfo).HasPermission);
            CustomHomePageMapTextViewData            = new ViewPageContentViewData(firmaPageMapInfo, new FirmaPageManageFeature().HasPermission(currentPerson, firmaPageMapInfo).HasPermission);
            FeaturedProjectsViewData = featuredProjectsViewData;
            FullMapUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(x => x.ProjectMap());

            ProjectLocationsMapViewData = projectLocationsMapViewData;
            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            FirmaHomePageCarouselImages = firmaHomePageImages;
            ProposeNewProjectUrl        = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.InstructionsProposal(null));

            ProjectUpdatesUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.MyProjectsRequiringAnUpdate());

            DisplayActionButtons = !currentPerson.IsAnonymousOrUnassigned;
        }
Esempio n. 27
0
        public IndexViewData(Person currentPerson, MapInitJson mapInitJson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle   = Models.FieldDefinition.FocusArea.GetFieldDefinitionLabelPluralized();
            MapInitJson = mapInitJson;
            GridSpec    = new IndexGridSpec(currentPerson)
            {
                ObjectNameSingular = Models.FieldDefinition.FocusArea.GetFieldDefinitionLabel(), ObjectNamePlural = Models.FieldDefinition.FocusArea.GetFieldDefinitionLabelPluralized(), SaveFiltersInCookie = true
            };
            var hasFocusAreaManagePermissions = new FocusAreaManageFeature().HasPermissionByPerson(currentPerson);


            if (hasFocusAreaManagePermissions)
            {
                var contentUrl = SitkaRoute <FocusAreaController> .BuildUrlFromExpression(t => t.New());

                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(contentUrl, $"Create a new {Models.FieldDefinition.FocusArea.GetFieldDefinitionLabel()}");
            }


            GridName    = "focusAreasGrid";
            GridDataUrl = SitkaRoute <FocusAreaController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());
        }
Esempio n. 28
0
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            var taxonomyTrunkPluralized = Models.FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabelPluralized();

            PageTitle = taxonomyTrunkPluralized;

            HasTaxonomyTrunkManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByPerson(currentPerson);
            var taxonomyTrunkDisplayName = Models.FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabel();

            GridSpec = new IndexGridSpec(currentPerson)
            {
                ObjectNameSingular = taxonomyTrunkDisplayName, ObjectNamePlural = taxonomyTrunkPluralized, SaveFiltersInCookie = true
            };
            if (HasTaxonomyTrunkManagePermissions)
            {
                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(t => t.New()), $"Create a new {taxonomyTrunkDisplayName}");
            }

            GridName    = "taxonomyTrunksGrid";
            GridDataUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());

            EditSortOrderUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(tc => tc.EditSortOrder());
        }
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPage)
            : base(currentPerson, firmaPage)
        {
            PageTitle = $"{Models.FieldDefinition.Organization.GetFieldDefinitionLabelPluralized()}";

            var hasOrganizationManagePermissions = new OrganizationManageFeature().HasPermissionByPerson(currentPerson);

            GridSpec = new IndexGridSpec(currentPerson, hasOrganizationManagePermissions)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Organization.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Organization.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            if (hasOrganizationManagePermissions)
            {
                var contentUrl = SitkaRoute <OrganizationController> .BuildUrlFromExpression(t => t.New());

                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(contentUrl, $"Create a new {Models.FieldDefinition.Organization.GetFieldDefinitionLabel()}");
            }

            GridName    = "organizationsGrid";
            GridDataUrl = SitkaRoute <OrganizationController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());
        }
 public InstructionsProposalViewData(Person currentPerson, Models.Project project, ProposalSectionsStatus proposalSectionsStatus, Models.FirmaPage firmaPage, bool isNewProjectCreate) : base(currentPerson, project, "Instructions", proposalSectionsStatus)
 {
     InstructionsViewPageContentViewData = new ViewPageContentViewData(firmaPage, new FirmaPageManageFeature().HasPermission(currentPerson, firmaPage).HasPermission);
     IsNewProjectCreate = isNewProjectCreate;
 }