.NET 6 (#32)
- Convert back-end to .NET 6 - Upgrade Giraffe, convert routing to endpoint style - Refactor code to take advantage of F# advances
This commit was merged in pull request #32.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module PrayerTracker.Views.Church
|
||||
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open PrayerTracker.Entities
|
||||
open PrayerTracker.ViewModels
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
module PrayerTracker.Views.CommonFunctions
|
||||
|
||||
open Giraffe
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open Microsoft.AspNetCore.Antiforgery
|
||||
open Microsoft.AspNetCore.Html
|
||||
open Microsoft.AspNetCore.Http
|
||||
open Microsoft.AspNetCore.Mvc.Localization
|
||||
open Microsoft.Extensions.Localization
|
||||
@@ -125,6 +126,13 @@ let _onsubmit = attr "onsubmit"
|
||||
let _scoped = flag "scoped"
|
||||
|
||||
|
||||
/// The name this function used to have when the view engine was part of Giraffe
|
||||
let renderHtmlNode = RenderView.AsString.htmlNode
|
||||
|
||||
/// Render an HTML node, then return the value as an HTML string
|
||||
let renderHtmlString = renderHtmlNode >> HtmlString
|
||||
|
||||
|
||||
/// Utility methods to help with time zones (and localization of their names)
|
||||
module TimeZones =
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/// Views associated with the home page, or those that don't fit anywhere else
|
||||
module PrayerTracker.Views.Home
|
||||
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open Microsoft.AspNetCore.Html
|
||||
open PrayerTracker.ViewModels
|
||||
open System.IO
|
||||
@@ -204,7 +204,7 @@ let termsOfService vi =
|
||||
let raw = rawLocText sw
|
||||
let ppLink =
|
||||
a [ _href "/web/legal/privacy-policy" ] [ str (s.["Privacy Policy"].Value.ToLower ()) ]
|
||||
|> (renderHtmlNode >> HtmlString)
|
||||
|> renderHtmlString
|
||||
|
||||
[ p [ _class "pt-right-text" ] [ small [] [ em [] [ raw l.["(as of May 24, 2018)"] ] ] ]
|
||||
h3 [] [ str "1. "; raw l.["Acceptance of Terms"] ]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/// Layout items for PrayerTracker
|
||||
module PrayerTracker.Views.Layout
|
||||
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open PrayerTracker
|
||||
open PrayerTracker.ViewModels
|
||||
open System
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module PrayerTracker.Views.PrayerRequest
|
||||
|
||||
open Giraffe
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open Microsoft.AspNetCore.Http
|
||||
open NodaTime
|
||||
open PrayerTracker
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -18,13 +18,14 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Giraffe" Version="4.0.1" />
|
||||
<PackageReference Include="MailKit" Version="2.5.1" />
|
||||
<PackageReference Include="Giraffe" Version="5.0.0" />
|
||||
<PackageReference Include="Giraffe.ViewEngine" Version="1.4.0" />
|
||||
<PackageReference Include="MailKit" Version="2.15.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module PrayerTracker.Views.SmallGroup
|
||||
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open Microsoft.Extensions.Localization
|
||||
open PrayerTracker
|
||||
open PrayerTracker.Entities
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module PrayerTracker.Views.User
|
||||
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open PrayerTracker.Entities
|
||||
open PrayerTracker.ViewModels
|
||||
|
||||
|
||||
@@ -557,7 +557,7 @@ module UserLogOn =
|
||||
}
|
||||
|
||||
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
|
||||
/// This represents a list of requests
|
||||
type RequestList =
|
||||
@@ -651,7 +651,7 @@ with
|
||||
|> ul []
|
||||
br []
|
||||
]
|
||||
|> renderHtmlNodes
|
||||
|> RenderView.AsString.htmlNodes
|
||||
|
||||
/// Generate this list as plain text
|
||||
member this.asText (s : IStringLocalizer) =
|
||||
|
||||
Reference in New Issue
Block a user