-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #424: reflecting nested types from quotation
- Loading branch information
Showing
5 changed files
with
209 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
// $begin{copyright} | ||
// | ||
// This file is part of WebSharper | ||
// | ||
// Copyright (c) 2008-2014 IntelliFactory | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you | ||
// may not use this file except in compliance with the License. You may | ||
// obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
// implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
// | ||
// $end{copyright} | ||
|
||
/// Client-side (JavaScript) code. | ||
module Website.Client | ||
|
||
open WebSharper | ||
open WebSharper.JavaScript | ||
|
||
[<JavaScript>] | ||
let EntryPoint () = | ||
Console.Log("Loaded OK") | ||
// $begin{copyright} | ||
// | ||
// This file is part of WebSharper | ||
// | ||
// Copyright (c) 2008-2014 IntelliFactory | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you | ||
// may not use this file except in compliance with the License. You may | ||
// obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
// implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
// | ||
// $end{copyright} | ||
|
||
/// Client-side (JavaScript) code. | ||
module Website.Client | ||
|
||
open WebSharper | ||
open WebSharper.JavaScript | ||
open WebSharper.Html.Client | ||
|
||
[<JavaScript>] | ||
let EntryPoint () = | ||
Console.Log("Loaded OK") | ||
Span [] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,84 @@ | ||
// $begin{copyright} | ||
// | ||
// This file is part of WebSharper | ||
// | ||
// Copyright (c) 2008-2014 IntelliFactory | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you | ||
// may not use this file except in compliance with the License. You may | ||
// obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
// implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
// | ||
// $end{copyright} | ||
|
||
/// Utilities for server-side markup generation. | ||
module Website.Skin | ||
|
||
open System | ||
open System.Web | ||
open WebSharper | ||
open WebSharper.Html.Server | ||
open WebSharper.Sitelets | ||
|
||
let Footer = | ||
[ | ||
Text (String.Format("Copyright (c) 2008-{0} IntelliFactory", DateTime.Now.Year)) | ||
] | ||
|
||
type Page = | ||
{ | ||
Body : list<Content.HtmlElement> | ||
Footer : list<Content.HtmlElement> | ||
Menu : list<Content.HtmlElement> | ||
Project : string | ||
Title : string | ||
Version : string | ||
} | ||
|
||
static member Default(title) = | ||
{ | ||
Footer = Footer | ||
Body = [Div [Style "display:none"] -< [new Controls.EntryPoint()]] | ||
Menu = [] | ||
Project = "Site" | ||
Title = title | ||
Version = Config.Version | ||
} | ||
|
||
let MainTemplate = | ||
Content.Template<Page>("~/Main.html") | ||
.With("body", fun x -> x.Body) | ||
.With("menu", fun x -> x.Menu) | ||
.With("footer", fun x -> x.Footer) | ||
.With("project", fun x -> x.Project) | ||
.With("title", fun x -> x.Title) | ||
.With("version", fun x -> x.Version) | ||
|
||
let FrontTempalte = | ||
Content.Template<Page>("~/Front.html") | ||
.With("body", fun x -> x.Body) | ||
.With("menu", fun x -> x.Menu) | ||
.With("footer", fun x -> x.Footer) | ||
.With("project", fun x -> x.Project) | ||
.With("title", fun x -> x.Title) | ||
.With("version", fun x -> x.Version) | ||
|
||
let RenderFront (ctx: Context<_>) = | ||
let front = FrontTempalte.Compile(ctx.RootFolder) | ||
fun x -> front.Run(x, ctx.RootFolder) | ||
|
||
let WithTemplate title menu body : Content<_> = | ||
Content.WithTemplate MainTemplate <| fun context -> | ||
let p = Page.Default title | ||
{ | ||
p with | ||
Menu = p.Menu @ menu context | ||
Body = p.Body @ body context | ||
} | ||
// $begin{copyright} | ||
// | ||
// This file is part of WebSharper | ||
// | ||
// Copyright (c) 2008-2014 IntelliFactory | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you | ||
// may not use this file except in compliance with the License. You may | ||
// obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
// implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
// | ||
// $end{copyright} | ||
|
||
/// Utilities for server-side markup generation. | ||
module Website.Skin | ||
|
||
open System | ||
open System.Web | ||
open WebSharper | ||
open WebSharper.Html.Server | ||
open WebSharper.Sitelets | ||
|
||
let Footer = | ||
[ | ||
Text (String.Format("Copyright (c) 2008-{0} IntelliFactory", DateTime.Now.Year)) | ||
] | ||
|
||
type Page = | ||
{ | ||
Body : list<Content.HtmlElement> | ||
Footer : list<Content.HtmlElement> | ||
Menu : list<Content.HtmlElement> | ||
Project : string | ||
Title : string | ||
Version : string | ||
} | ||
|
||
static member Default(title) = | ||
{ | ||
Footer = Footer | ||
Body = [Div [Style "display:none"] -< [ClientSide <@ Client.EntryPoint() @>]] | ||
Menu = [] | ||
Project = "Site" | ||
Title = title | ||
Version = Config.Version | ||
} | ||
|
||
let MainTemplate = | ||
Content.Template<Page>("~/Main.html") | ||
.With("body", fun x -> x.Body) | ||
.With("menu", fun x -> x.Menu) | ||
.With("footer", fun x -> x.Footer) | ||
.With("project", fun x -> x.Project) | ||
.With("title", fun x -> x.Title) | ||
.With("version", fun x -> x.Version) | ||
|
||
let FrontTempalte = | ||
Content.Template<Page>("~/Front.html") | ||
.With("body", fun x -> x.Body) | ||
.With("menu", fun x -> x.Menu) | ||
.With("footer", fun x -> x.Footer) | ||
.With("project", fun x -> x.Project) | ||
.With("title", fun x -> x.Title) | ||
.With("version", fun x -> x.Version) | ||
|
||
let RenderFront (ctx: Context<_>) = | ||
let front = FrontTempalte.Compile(ctx.RootFolder) | ||
fun x -> front.Run(x, ctx.RootFolder) | ||
|
||
let WithTemplate title menu body : Content<_> = | ||
Content.WithTemplate MainTemplate <| fun context -> | ||
let p = Page.Default title | ||
{ | ||
p with | ||
Menu = p.Menu @ menu context | ||
Body = p.Body @ body context | ||
} |
Oops, something went wrong.