WIP on DotLiquid support
This commit is contained in:
@@ -248,7 +248,7 @@ module WebLog =
|
||||
subtitle = None
|
||||
defaultPage = ""
|
||||
postsPerPage = 10
|
||||
themePath = "Default"
|
||||
themePath = "default"
|
||||
urlBase = ""
|
||||
timeZone = ""
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="SupportTypes.fs" />
|
||||
<Compile Include="DataTypes.fs" />
|
||||
<Compile Include="ViewModels.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -9,7 +9,7 @@ module private Helpers =
|
||||
/// Create a new ID (short GUID)
|
||||
// https://www.madskristensen.net/blog/A-shorter-and-URL-friendly-GUID
|
||||
let newId() =
|
||||
Convert.ToBase64String(Guid.NewGuid().ToByteArray()).Replace('/', '_').Replace('+', '-')[..22]
|
||||
Convert.ToBase64String(Guid.NewGuid().ToByteArray()).Replace('/', '_').Replace('+', '-').Substring (0, 22)
|
||||
|
||||
|
||||
/// An identifier for a category
|
||||
|
||||
32
src/MyWebLog.Domain/ViewModels.fs
Normal file
32
src/MyWebLog.Domain/ViewModels.fs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace MyWebLog.ViewModels
|
||||
|
||||
open MyWebLog
|
||||
|
||||
/// Base model class for myWebLog views
|
||||
type MyWebLogModel (webLog : WebLog) =
|
||||
|
||||
/// The details for the web log
|
||||
member val WebLog = webLog with get
|
||||
|
||||
|
||||
/// The model to use to allow a user to log on
|
||||
[<CLIMutable>]
|
||||
type LogOnModel =
|
||||
{ /// The user's e-mail address
|
||||
emailAddress : string
|
||||
|
||||
/// The user's password
|
||||
password : string
|
||||
}
|
||||
|
||||
|
||||
/// The model used to render a single page
|
||||
type SinglePageModel =
|
||||
{ /// The page to be rendered
|
||||
page : Page
|
||||
|
||||
/// The web log to which the page belongs
|
||||
webLog : WebLog
|
||||
}
|
||||
/// Is this the home page?
|
||||
member this.isHome with get () = PageId.toString this.page.id = this.webLog.defaultPage
|
||||
Reference in New Issue
Block a user