public IndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage) { var taxonomyTrunkPluralized = FieldDefinitionEnum.TaxonomyTrunk.ToType().GetFieldDefinitionLabelPluralized(); PageTitle = taxonomyTrunkPluralized; HasTaxonomyTrunkManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByFirmaSession(currentFirmaSession); OfferEditSortOrder = MultiTenantHelpers.IsTaxonomyLevelTrunk() || MultiTenantHelpers.IsTaxonomyLevelTrunk(); IsNotTaxonomyLevelLeaf = !MultiTenantHelpers.IsTaxonomyLevelLeaf(); var taxonomyTrunkDisplayName = FieldDefinitionEnum.TaxonomyTrunk.ToType().GetFieldDefinitionLabel(); GridSpec = new IndexGridSpec(currentFirmaSession) { ObjectNameSingular = taxonomyTrunkDisplayName, ObjectNamePlural = taxonomyTrunkPluralized, SaveFiltersInCookie = true }; GridName = "taxonomyTrunksGrid"; GridDataUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData()); NewUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(t => t.New()); EditSortOrderUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(tc => tc.EditSortOrder()); TaxonomyTrunkDisplayName = taxonomyTrunkDisplayName; }
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()); }