Skip to content

Instantly share code, notes, and snippets.

@davidgrenier
Created October 11, 2013 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidgrenier/6937467 to your computer and use it in GitHub Desktop.
Save davidgrenier/6937467 to your computer and use it in GitHub Desktop.
type PagePath =
| [<Require(typeof<kendo.Resources.Culture.French>)>] FR
| [<Require(typeof<kendo.Resources.Culture.English>)>] EN
@davidgrenier
Copy link
Author

open kendo.Resources

type Action =
    | [<CompiledName "">] EN
    | FR

[<Require(typeof<Themes.Silver>); Require(typeof<Culture.French>)>]
type FrenchPage() =
    inherit Web.Control()

    [<JS>]
    override this.Body = Client.page() :> _

[<Require(typeof<Themes.Silver>); Require(typeof<Culture.English>)>]
type EnglishPage() =
    inherit Web.Control()

    [<JS>]
    override this.Body = Client.page() :> _

[<Sealed>]
type Site() =
    interface IWebsite<Action> with
        member this.Sitelet =
            function
            | page ->
                Content.PageContent <| fun _ ->
                    let page =
                        match page with
                        | EN -> Div [new EnglishPage()]
                        | FR -> Div [new FrenchPage()]
                    {
                        Page.Default with
                            Title = Some "Kendo samples"
                            Body = [page]
                    }
            |> Sitelet.Infer
        member this.Actions = []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment