コード例 #1
0
        public IndexViewData(FirmaSession currentFirmaSession) : base(currentFirmaSession, null)
        {
            PageTitle = "Custom Pages";

            GridSpec = new CustomPageGridSpec(new FirmaPageViewListFeature().HasPermissionByFirmaSession(currentFirmaSession))
            {
                ObjectNameSingular  = "Custom Page",
                ObjectNamePlural    = "Custom Pages",
                SaveFiltersInCookie = true
            };

            var hasCustomPageManagePermissions = new CustomPageManageFeature().HasPermissionByFirmaSession(currentFirmaSession);

            GridName    = "customPagesGrid";
            GridDataUrl = SitkaRoute <CustomPageController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());

            CustomPageUrl = SitkaRoute <CustomPageController> .BuildUrlFromExpression(x => x.CustomPageDetails(UrlTemplate.Parameter1Int));

            HasCustomPageManagePermissions = hasCustomPageManagePermissions;
            NewUrl = SitkaRoute <CustomPageController> .BuildUrlFromExpression(t => t.New());
        }
コード例 #2
0
        public IndexViewData(Person currentPerson) : base(currentPerson, null)
        {
            PageTitle = "Manage Custom Pages";

            GridSpec = new CustomPageGridSpec(new FirmaPageViewListFeature().HasPermissionByPerson(currentPerson))
            {
                ObjectNameSingular  = "Custom Page",
                ObjectNamePlural    = "Custom Pages",
                SaveFiltersInCookie = true
            };

            var hasCustomPageManagePermissions = new CustomPageManageFeature().HasPermissionByPerson(currentPerson);

            if (hasCustomPageManagePermissions)
            {
                var contentUrl = SitkaRoute <CustomPageController> .BuildUrlFromExpression(t => t.New());

                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(contentUrl, $"Create a new Custom Page");
            }
            GridName    = "customPagesGrid";
            GridDataUrl = SitkaRoute <CustomPageController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());

            CustomPageUrl = SitkaRoute <CustomPageController> .BuildUrlFromExpression(x => x.CustomPageDetails(UrlTemplate.Parameter1Int));
        }