Пример #1
0
        public void Register()
        {
            RegisterPartials();

            Application.Current.Use(new HtmlFromJsonProvider());
            Application.Current.Use(new PartialToStandaloneHtmlProvider());

            Handle.GET("/website/help?topic={?}", (string topic) =>
            {
                var json = new CmsHelp();
                return(json);
            });

            Handle.GET("/website/cleardata", () =>
            {
                DataHelper helper = new DataHelper();

                helper.ClearData();

                return(200);
            });

            Handle.GET("/website/resetdata", () =>
            {
                DataHelper helper = new DataHelper();

                helper.ClearData();
                helper.GenerateData();

                return(200);
            });

            Handle.GET("/website", () =>
            {
                return(Self.GET("/website/cms"));
            });

            Handle.GET("/website/cms", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms");

                    return master;
                }));
            });

            Handle.GET("/website/cms/surfaces", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms/surfaces");

                    return master;
                }));
            });

            Handle.GET("/website/cms/blendingpoints", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms/blendingpoints");

                    return master;
                }));
            });

            Handle.GET("/website/cms/catchingrules", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms/catchingrules");

                    return master;
                }));
            });

            Handle.GET("/website/cms/pinningrules", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms/pinningrules");

                    return master;
                }));
            });
        }