Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
bb79b38738 | |||
fdb8f2ebf1 | |||
0f9837c257 | |||
51ad71074c | |||
377e19ca78 | |||
259cc91a11 | |||
131012b320 | |||
|
cd41aef0ba | ||
|
8aa3e41f50 | ||
39af0fb9a5 | |||
dd5f32e320 | |||
370fbb0c3e | |||
14608de5be | |||
ec6eea21c8 | |||
|
3b0d304595 | ||
50a91cd725 | |||
13ace6ca61 | |||
58519f9a4d | |||
6b1a5e31b5 | |||
|
d332322200 | ||
|
1d4e66b863 | ||
|
8c3cce2fd8 | ||
|
0de3eac7be | ||
1a07c673c7 | |||
665d80261d |
12
.config/dotnet-tools.json
Normal file
12
.config/dotnet-tools.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"fake-cli": {
|
||||
"version": "5.23.0",
|
||||
"commands": [
|
||||
"fake"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -332,5 +332,7 @@ ASALocalRun/
|
||||
### --- ###
|
||||
src/PrayerTracker/appsettings.json
|
||||
docs/_site
|
||||
**/*.db*
|
||||
|
||||
.ionide
|
||||
.ionide
|
||||
.vscode
|
||||
|
44
build.fsx
Normal file
44
build.fsx
Normal file
@ -0,0 +1,44 @@
|
||||
#r "paket:
|
||||
nuget Fake.DotNet.Cli
|
||||
nuget Fake.DotNet.Testing.Expecto
|
||||
nuget Fake.IO.FileSystem
|
||||
nuget Fake.Core.Target //"
|
||||
#load ".fake/build.fsx/intellisense.fsx"
|
||||
open Fake.Core
|
||||
open Fake.DotNet
|
||||
open Fake.DotNet.Testing
|
||||
open Fake.IO
|
||||
open Fake.IO.Globbing.Operators
|
||||
open Fake.Core.TargetOperators
|
||||
|
||||
Target.initEnvironment ()
|
||||
|
||||
/// The root path to the projects within this solution
|
||||
let projPath = "src/PrayerTracker"
|
||||
|
||||
Target.create "Clean" (fun _ ->
|
||||
!! "src/**/bin"
|
||||
++ "src/**/obj"
|
||||
|> Shell.cleanDirs
|
||||
)
|
||||
|
||||
Target.create "Test" (fun _ ->
|
||||
let testPath = $"{projPath}.Tests"
|
||||
DotNet.build (fun opts -> { opts with NoLogo = true }) $"{testPath}/PrayerTracker.Tests.fsproj"
|
||||
Expecto.run
|
||||
(fun opts -> { opts with WorkingDirectory = $"{testPath}/bin/Release/net7.0" })
|
||||
[ "PrayerTracker.Tests.dll" ])
|
||||
|
||||
Target.create "Publish" (fun _ ->
|
||||
DotNet.publish
|
||||
(fun opts -> { opts with Runtime = Some "linux-x64"; SelfContained = Some false; NoLogo = true })
|
||||
$"{projPath}/PrayerTracker.fsproj")
|
||||
|
||||
Target.create "All" ignore
|
||||
|
||||
"Clean"
|
||||
==> "Test"
|
||||
==> "Publish"
|
||||
==> "All"
|
||||
|
||||
Target.runOrDefault "All"
|
233
build.fsx.lock
Normal file
233
build.fsx.lock
Normal file
@ -0,0 +1,233 @@
|
||||
STORAGE: NONE
|
||||
RESTRICTION: || (== net6.0) (== netstandard2.0)
|
||||
NUGET
|
||||
remote: https://api.nuget.org/v3/index.json
|
||||
BlackFox.VsWhere (1.1)
|
||||
FSharp.Core (>= 4.2.3)
|
||||
Microsoft.Win32.Registry (>= 4.7)
|
||||
Fake.Core.CommandLineParsing (5.23)
|
||||
FParsec (>= 1.1.1)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Core.Context (5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Core.Environment (5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Core.FakeVar (5.23)
|
||||
Fake.Core.Context (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Core.Process (5.23)
|
||||
Fake.Core.Environment (>= 5.23)
|
||||
Fake.Core.FakeVar (>= 5.23)
|
||||
Fake.Core.String (>= 5.23)
|
||||
Fake.Core.Trace (>= 5.23)
|
||||
Fake.IO.FileSystem (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
System.Collections.Immutable (>= 5.0)
|
||||
Fake.Core.SemVer (5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Core.String (5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Core.Target (5.23)
|
||||
Fake.Core.CommandLineParsing (>= 5.23)
|
||||
Fake.Core.Context (>= 5.23)
|
||||
Fake.Core.Environment (>= 5.23)
|
||||
Fake.Core.FakeVar (>= 5.23)
|
||||
Fake.Core.Process (>= 5.23)
|
||||
Fake.Core.String (>= 5.23)
|
||||
Fake.Core.Trace (>= 5.23)
|
||||
FSharp.Control.Reactive (>= 5.0.2)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Core.Tasks (5.23)
|
||||
Fake.Core.Trace (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Core.Trace (5.23)
|
||||
Fake.Core.Environment (>= 5.23)
|
||||
Fake.Core.FakeVar (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Core.Xml (5.23)
|
||||
Fake.Core.String (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.DotNet.Cli (5.23)
|
||||
Fake.Core.Environment (>= 5.23)
|
||||
Fake.Core.Process (>= 5.23)
|
||||
Fake.Core.String (>= 5.23)
|
||||
Fake.Core.Trace (>= 5.23)
|
||||
Fake.DotNet.MSBuild (>= 5.23)
|
||||
Fake.DotNet.NuGet (>= 5.23)
|
||||
Fake.IO.FileSystem (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Mono.Posix.NETStandard (>= 1.0)
|
||||
Newtonsoft.Json (>= 13.0.1)
|
||||
Fake.DotNet.MSBuild (5.23)
|
||||
BlackFox.VsWhere (>= 1.1)
|
||||
Fake.Core.Environment (>= 5.23)
|
||||
Fake.Core.Process (>= 5.23)
|
||||
Fake.Core.String (>= 5.23)
|
||||
Fake.Core.Trace (>= 5.23)
|
||||
Fake.IO.FileSystem (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
MSBuild.StructuredLogger (>= 2.1.545)
|
||||
Fake.DotNet.NuGet (5.23)
|
||||
Fake.Core.Environment (>= 5.23)
|
||||
Fake.Core.Process (>= 5.23)
|
||||
Fake.Core.SemVer (>= 5.23)
|
||||
Fake.Core.String (>= 5.23)
|
||||
Fake.Core.Tasks (>= 5.23)
|
||||
Fake.Core.Trace (>= 5.23)
|
||||
Fake.Core.Xml (>= 5.23)
|
||||
Fake.IO.FileSystem (>= 5.23)
|
||||
Fake.Net.Http (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Newtonsoft.Json (>= 13.0.1)
|
||||
NuGet.Protocol (>= 5.11)
|
||||
Fake.DotNet.Testing.Expecto (5.23)
|
||||
Fake.Core.Process (>= 5.23)
|
||||
Fake.Core.String (>= 5.23)
|
||||
Fake.Core.Trace (>= 5.23)
|
||||
Fake.IO.FileSystem (>= 5.23)
|
||||
Fake.Testing.Common (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.IO.FileSystem (5.23)
|
||||
Fake.Core.String (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Net.Http (5.23)
|
||||
Fake.Core.Trace (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
Fake.Testing.Common (5.23)
|
||||
Fake.Core.Trace (>= 5.23)
|
||||
FSharp.Core (>= 6.0)
|
||||
FParsec (1.1.1)
|
||||
FSharp.Core (>= 4.3.4)
|
||||
FSharp.Control.Reactive (5.0.5)
|
||||
FSharp.Core (>= 4.7.2)
|
||||
System.Reactive (>= 5.0 < 6.0)
|
||||
FSharp.Core (6.0.5)
|
||||
Microsoft.Build (17.2)
|
||||
Microsoft.Build.Framework (>= 17.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0))
|
||||
Microsoft.NET.StringTools (>= 1.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0))
|
||||
Microsoft.Win32.Registry (>= 4.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
|
||||
System.Collections.Immutable (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0))
|
||||
System.Configuration.ConfigurationManager (>= 4.7) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0))
|
||||
System.Reflection.Metadata (>= 1.6) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
|
||||
System.Security.Principal.Windows (>= 4.7) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
|
||||
System.Text.Encoding.CodePages (>= 4.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
|
||||
System.Text.Json (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0))
|
||||
System.Threading.Tasks.Dataflow (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0))
|
||||
Microsoft.Build.Framework (17.2)
|
||||
Microsoft.Win32.Registry (>= 4.3)
|
||||
System.Security.Permissions (>= 4.7)
|
||||
Microsoft.Build.Tasks.Core (17.2)
|
||||
Microsoft.Build.Framework (>= 17.2)
|
||||
Microsoft.Build.Utilities.Core (>= 17.2)
|
||||
Microsoft.NET.StringTools (>= 1.0)
|
||||
Microsoft.Win32.Registry (>= 4.3)
|
||||
System.CodeDom (>= 4.4)
|
||||
System.Collections.Immutable (>= 5.0)
|
||||
System.Reflection.Metadata (>= 1.6)
|
||||
System.Resources.Extensions (>= 4.6)
|
||||
System.Security.Cryptography.Pkcs (>= 4.7)
|
||||
System.Security.Cryptography.Xml (>= 4.7)
|
||||
System.Security.Permissions (>= 4.7)
|
||||
System.Threading.Tasks.Dataflow (>= 6.0)
|
||||
Microsoft.Build.Utilities.Core (17.2)
|
||||
Microsoft.Build.Framework (>= 17.2)
|
||||
Microsoft.NET.StringTools (>= 1.0)
|
||||
Microsoft.Win32.Registry (>= 4.3)
|
||||
System.Collections.Immutable (>= 5.0)
|
||||
System.Configuration.ConfigurationManager (>= 4.7)
|
||||
System.Security.Permissions (>= 4.7) - restriction: == netstandard2.0
|
||||
System.Text.Encoding.CodePages (>= 4.0.1) - restriction: == netstandard2.0
|
||||
Microsoft.NET.StringTools (1.0)
|
||||
System.Memory (>= 4.5.4)
|
||||
System.Runtime.CompilerServices.Unsafe (>= 5.0)
|
||||
Microsoft.NETCore.Platforms (6.0.5) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard1.2)) (&& (== net6.0) (< netstandard1.3)) (&& (== net6.0) (< netstandard1.5)) (== netstandard2.0)
|
||||
Microsoft.NETCore.Targets (5.0) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard1.2)) (&& (== net6.0) (< netstandard1.3)) (&& (== net6.0) (< netstandard1.5)) (== netstandard2.0)
|
||||
Microsoft.Win32.Registry (5.0)
|
||||
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= monoandroid) (< netstandard1.3)) (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
|
||||
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
|
||||
System.Security.AccessControl (>= 5.0)
|
||||
System.Security.Principal.Windows (>= 5.0)
|
||||
Microsoft.Win32.SystemEvents (6.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
|
||||
Mono.Posix.NETStandard (1.0)
|
||||
MSBuild.StructuredLogger (2.1.669)
|
||||
Microsoft.Build (>= 16.10)
|
||||
Microsoft.Build.Framework (>= 16.10)
|
||||
Microsoft.Build.Tasks.Core (>= 16.10)
|
||||
Microsoft.Build.Utilities.Core (>= 16.10)
|
||||
Newtonsoft.Json (13.0.1)
|
||||
NuGet.Common (6.3)
|
||||
NuGet.Frameworks (>= 6.3)
|
||||
NuGet.Configuration (6.3)
|
||||
NuGet.Common (>= 6.3)
|
||||
System.Security.Cryptography.ProtectedData (>= 4.4)
|
||||
NuGet.Frameworks (6.3)
|
||||
NuGet.Packaging (6.3)
|
||||
Newtonsoft.Json (>= 13.0.1)
|
||||
NuGet.Configuration (>= 6.3)
|
||||
NuGet.Versioning (>= 6.3)
|
||||
System.Security.Cryptography.Cng (>= 5.0)
|
||||
System.Security.Cryptography.Pkcs (>= 5.0)
|
||||
NuGet.Protocol (6.3)
|
||||
NuGet.Packaging (>= 6.3)
|
||||
NuGet.Versioning (6.3)
|
||||
System.Buffers (4.5.1) - restriction: || (&& (== net6.0) (>= monoandroid) (< netstandard1.3)) (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
|
||||
System.CodeDom (6.0)
|
||||
System.Collections.Immutable (6.0)
|
||||
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
|
||||
System.Runtime.CompilerServices.Unsafe (>= 6.0)
|
||||
System.Configuration.ConfigurationManager (6.0)
|
||||
System.Security.Cryptography.ProtectedData (>= 6.0)
|
||||
System.Security.Permissions (>= 6.0)
|
||||
System.Drawing.Common (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
|
||||
Microsoft.Win32.SystemEvents (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
|
||||
System.Formats.Asn1 (6.0)
|
||||
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
|
||||
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
|
||||
System.Memory (4.5.5)
|
||||
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
|
||||
System.Numerics.Vectors (>= 4.4) - restriction: || (&& (== net6.0) (< netcoreapp2.0)) (== netstandard2.0)
|
||||
System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
|
||||
System.Numerics.Vectors (4.5) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
|
||||
System.Reactive (5.0)
|
||||
System.Runtime.InteropServices.WindowsRuntime (>= 4.3) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
|
||||
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
|
||||
System.Reflection.Metadata (6.0.1)
|
||||
System.Collections.Immutable (>= 6.0)
|
||||
System.Resources.Extensions (6.0)
|
||||
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
|
||||
System.Runtime (4.3.1) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
|
||||
Microsoft.NETCore.Platforms (>= 1.1.1)
|
||||
Microsoft.NETCore.Targets (>= 1.1.3)
|
||||
System.Runtime.CompilerServices.Unsafe (6.0)
|
||||
System.Runtime.InteropServices.WindowsRuntime (4.3) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
|
||||
System.Runtime (>= 4.3)
|
||||
System.Security.AccessControl (6.0)
|
||||
System.Security.Principal.Windows (>= 5.0) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
|
||||
System.Security.Cryptography.Cng (5.0)
|
||||
System.Formats.Asn1 (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.0))
|
||||
System.Security.Cryptography.Pkcs (6.0.1)
|
||||
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
|
||||
System.Formats.Asn1 (>= 6.0)
|
||||
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
|
||||
System.Security.Cryptography.Cng (>= 5.0) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
|
||||
System.Security.Cryptography.ProtectedData (6.0)
|
||||
System.Security.Cryptography.Xml (6.0.1)
|
||||
System.Memory (>= 4.5.4) - restriction: == netstandard2.0
|
||||
System.Security.AccessControl (>= 6.0)
|
||||
System.Security.Cryptography.Pkcs (>= 6.0.1)
|
||||
System.Security.Permissions (6.0)
|
||||
System.Security.AccessControl (>= 6.0)
|
||||
System.Windows.Extensions (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
|
||||
System.Security.Principal.Windows (5.0)
|
||||
System.Text.Encoding.CodePages (6.0)
|
||||
System.Runtime.CompilerServices.Unsafe (>= 6.0)
|
||||
System.Text.Encodings.Web (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0))
|
||||
System.Runtime.CompilerServices.Unsafe (>= 6.0)
|
||||
System.Text.Json (6.0.5) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net472)) (&& (== netstandard2.0) (>= net6.0))
|
||||
System.Runtime.CompilerServices.Unsafe (>= 6.0)
|
||||
System.Text.Encodings.Web (>= 6.0)
|
||||
System.Threading.Tasks.Dataflow (6.0)
|
||||
System.Threading.Tasks.Extensions (4.5.4) - restriction: || (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
|
||||
System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (< netstandard1.0)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= wp8)) (== netstandard2.0)
|
||||
System.Windows.Extensions (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
|
||||
System.Drawing.Common (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
|
@ -1 +0,0 @@
|
||||
docs.prayer.bitbadger.solutions
|
24
docs/Gemfile
24
docs/Gemfile
@ -1,24 +0,0 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
# Hello! This is where you manage which Jekyll version is used to run.
|
||||
# When you want to use a different version, change it below, save the
|
||||
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
|
||||
#
|
||||
# bundle exec jekyll serve
|
||||
#
|
||||
# This will help ensure the proper Jekyll version is running.
|
||||
# Happy Jekylling!
|
||||
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
||||
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
||||
gem "github-pages", group: :jekyll_plugins
|
||||
|
||||
# If you have any plugins, put them here!
|
||||
group :jekyll_plugins do
|
||||
end
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
|
||||
# Performance-booster for watching directories on Windows
|
||||
gem "wdm", "~> 0.1.0" if Gem.win_platform?
|
||||
|
@ -1,257 +0,0 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (4.2.11.1)
|
||||
i18n (~> 0.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.11.1)
|
||||
colorator (1.1.0)
|
||||
commonmarker (0.17.13)
|
||||
ruby-enum (~> 0.5)
|
||||
concurrent-ruby (1.1.5)
|
||||
dnsruby (1.61.3)
|
||||
addressable (~> 2.5)
|
||||
em-websocket (0.5.1)
|
||||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
ethon (0.12.0)
|
||||
ffi (>= 1.3.0)
|
||||
eventmachine (1.2.7)
|
||||
eventmachine (1.2.7-x64-mingw32)
|
||||
execjs (2.7.0)
|
||||
faraday (0.17.0)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ffi (1.11.1)
|
||||
ffi (1.11.1-x64-mingw32)
|
||||
forwardable-extended (2.6.0)
|
||||
gemoji (3.0.1)
|
||||
github-pages (201)
|
||||
activesupport (= 4.2.11.1)
|
||||
github-pages-health-check (= 1.16.1)
|
||||
jekyll (= 3.8.5)
|
||||
jekyll-avatar (= 0.6.0)
|
||||
jekyll-coffeescript (= 1.1.1)
|
||||
jekyll-commonmark-ghpages (= 0.1.6)
|
||||
jekyll-default-layout (= 0.1.4)
|
||||
jekyll-feed (= 0.11.0)
|
||||
jekyll-gist (= 1.5.0)
|
||||
jekyll-github-metadata (= 2.12.1)
|
||||
jekyll-mentions (= 1.4.1)
|
||||
jekyll-optional-front-matter (= 0.3.0)
|
||||
jekyll-paginate (= 1.1.0)
|
||||
jekyll-readme-index (= 0.2.0)
|
||||
jekyll-redirect-from (= 0.14.0)
|
||||
jekyll-relative-links (= 0.6.0)
|
||||
jekyll-remote-theme (= 0.4.0)
|
||||
jekyll-sass-converter (= 1.5.2)
|
||||
jekyll-seo-tag (= 2.5.0)
|
||||
jekyll-sitemap (= 1.2.0)
|
||||
jekyll-swiss (= 0.4.0)
|
||||
jekyll-theme-architect (= 0.1.1)
|
||||
jekyll-theme-cayman (= 0.1.1)
|
||||
jekyll-theme-dinky (= 0.1.1)
|
||||
jekyll-theme-hacker (= 0.1.1)
|
||||
jekyll-theme-leap-day (= 0.1.1)
|
||||
jekyll-theme-merlot (= 0.1.1)
|
||||
jekyll-theme-midnight (= 0.1.1)
|
||||
jekyll-theme-minimal (= 0.1.1)
|
||||
jekyll-theme-modernist (= 0.1.1)
|
||||
jekyll-theme-primer (= 0.5.3)
|
||||
jekyll-theme-slate (= 0.1.1)
|
||||
jekyll-theme-tactile (= 0.1.1)
|
||||
jekyll-theme-time-machine (= 0.1.1)
|
||||
jekyll-titles-from-headings (= 0.5.1)
|
||||
jemoji (= 0.10.2)
|
||||
kramdown (= 1.17.0)
|
||||
liquid (= 4.0.0)
|
||||
listen (= 3.1.5)
|
||||
mercenary (~> 0.3)
|
||||
minima (= 2.5.0)
|
||||
nokogiri (>= 1.10.4, < 2.0)
|
||||
rouge (= 3.11.0)
|
||||
terminal-table (~> 1.4)
|
||||
github-pages-health-check (1.16.1)
|
||||
addressable (~> 2.3)
|
||||
dnsruby (~> 1.60)
|
||||
octokit (~> 4.0)
|
||||
public_suffix (~> 3.0)
|
||||
typhoeus (~> 1.3)
|
||||
html-pipeline (2.12.0)
|
||||
activesupport (>= 2)
|
||||
nokogiri (>= 1.4)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (0.9.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
jekyll (3.8.5)
|
||||
addressable (~> 2.4)
|
||||
colorator (~> 1.0)
|
||||
em-websocket (~> 0.5)
|
||||
i18n (~> 0.7)
|
||||
jekyll-sass-converter (~> 1.0)
|
||||
jekyll-watch (~> 2.0)
|
||||
kramdown (~> 1.14)
|
||||
liquid (~> 4.0)
|
||||
mercenary (~> 0.3.3)
|
||||
pathutil (~> 0.9)
|
||||
rouge (>= 1.7, < 4)
|
||||
safe_yaml (~> 1.0)
|
||||
jekyll-avatar (0.6.0)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-coffeescript (1.1.1)
|
||||
coffee-script (~> 2.2)
|
||||
coffee-script-source (~> 1.11.1)
|
||||
jekyll-commonmark (1.3.1)
|
||||
commonmarker (~> 0.14)
|
||||
jekyll (>= 3.7, < 5.0)
|
||||
jekyll-commonmark-ghpages (0.1.6)
|
||||
commonmarker (~> 0.17.6)
|
||||
jekyll-commonmark (~> 1.2)
|
||||
rouge (>= 2.0, < 4.0)
|
||||
jekyll-default-layout (0.1.4)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-feed (0.11.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-gist (1.5.0)
|
||||
octokit (~> 4.2)
|
||||
jekyll-github-metadata (2.12.1)
|
||||
jekyll (~> 3.4)
|
||||
octokit (~> 4.0, != 4.4.0)
|
||||
jekyll-mentions (1.4.1)
|
||||
html-pipeline (~> 2.3)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-optional-front-matter (0.3.0)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-paginate (1.1.0)
|
||||
jekyll-readme-index (0.2.0)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-redirect-from (0.14.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-relative-links (0.6.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-remote-theme (0.4.0)
|
||||
addressable (~> 2.0)
|
||||
jekyll (~> 3.5)
|
||||
rubyzip (>= 1.2.1, < 3.0)
|
||||
jekyll-sass-converter (1.5.2)
|
||||
sass (~> 3.4)
|
||||
jekyll-seo-tag (2.5.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-sitemap (1.2.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-swiss (0.4.0)
|
||||
jekyll-theme-architect (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-cayman (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-dinky (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-hacker (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-leap-day (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-merlot (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-midnight (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-minimal (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-modernist (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-primer (0.5.3)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-github-metadata (~> 2.9)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-slate (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-tactile (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-time-machine (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-titles-from-headings (0.5.1)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-watch (2.2.1)
|
||||
listen (~> 3.0)
|
||||
jemoji (0.10.2)
|
||||
gemoji (~> 3.0)
|
||||
html-pipeline (~> 2.2)
|
||||
jekyll (~> 3.0)
|
||||
kramdown (1.17.0)
|
||||
liquid (4.0.0)
|
||||
listen (3.1.5)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
ruby_dep (~> 1.2)
|
||||
mercenary (0.3.6)
|
||||
mini_portile2 (2.4.0)
|
||||
minima (2.5.0)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-feed (~> 0.9)
|
||||
jekyll-seo-tag (~> 2.1)
|
||||
minitest (5.12.2)
|
||||
multipart-post (2.1.1)
|
||||
nokogiri (1.10.8)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
nokogiri (1.10.8-x64-mingw32)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
octokit (4.14.0)
|
||||
sawyer (~> 0.8.0, >= 0.5.3)
|
||||
pathutil (0.16.2)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (3.1.1)
|
||||
rb-fsevent (0.10.3)
|
||||
rb-inotify (0.10.0)
|
||||
ffi (~> 1.0)
|
||||
rouge (3.11.0)
|
||||
ruby-enum (0.7.2)
|
||||
i18n
|
||||
ruby_dep (1.5.0)
|
||||
rubyzip (2.0.0)
|
||||
safe_yaml (1.0.5)
|
||||
sass (3.7.4)
|
||||
sass-listen (~> 4.0.0)
|
||||
sass-listen (4.0.0)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
sawyer (0.8.2)
|
||||
addressable (>= 2.3.5)
|
||||
faraday (> 0.8, < 2.0)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
thread_safe (0.3.6)
|
||||
typhoeus (1.3.1)
|
||||
ethon (>= 0.9.0)
|
||||
tzinfo (1.2.5)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo-data (1.2019.3)
|
||||
tzinfo (>= 1.0.0)
|
||||
unicode-display_width (1.6.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
x64-mingw32
|
||||
|
||||
DEPENDENCIES
|
||||
github-pages
|
||||
tzinfo-data
|
||||
|
||||
BUNDLED WITH
|
||||
2.0.2
|
@ -1,11 +0,0 @@
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "en"
|
||||
values:
|
||||
layout: "en"
|
||||
-
|
||||
scope:
|
||||
path: "es"
|
||||
values:
|
||||
layout: "es"
|
@ -1,41 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ page.title }} « PrayerTracker Help</title>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link href="https://prayer.bitbadger.solutions/css/app.css" rel="stylesheet">
|
||||
<link href="/css/help.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<header class="pt-title-bar">
|
||||
<section class="pt-title-bar-left"><span class="pt-title-bar-home"><a href="/" title="Home">PrayerTracker</a></span></section>
|
||||
<section class="pt-title-bar-right">Help</section>
|
||||
</header>
|
||||
<div id="pt-body">
|
||||
<header id="pt-language">
|
||||
<div>
|
||||
Language: English •
|
||||
<a href="{{ page.url | replace_first: "/en", "/es" }}">Esta pagina en espaƱol</a>
|
||||
</div>
|
||||
</header>
|
||||
<h2 id="pt-page-title">{{ page.title }}</h2>
|
||||
<div class="pt-content">
|
||||
{{ content }}
|
||||
<div class="pt-close-window">
|
||||
<p class="pt-center-text">
|
||||
<a href="#" title="Click to Close This Window" onclick="window.close();return false">
|
||||
<i class="material-icons">cancel</i> Close Window
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="pt-help-index">
|
||||
<p class="pt-center-text">
|
||||
<a href="/en/" title="Help Index">« Back to Help Index</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,44 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ page.title }} « Ayuda de SeguidorOración</title>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link href="https://prayer.bitbadger.solutions/css/app.css" rel="stylesheet">
|
||||
<link href="/css/help.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<header class="pt-title-bar">
|
||||
<section class="pt-title-bar-left"><span class="pt-title-bar-home"><a href="/" title="Home">SeguidorOración</a></span></section>
|
||||
<section class="pt-title-bar-right">Ayuda</section>
|
||||
</header>
|
||||
<div id="pt-body">
|
||||
<header id="pt-language">
|
||||
<div>
|
||||
Lengua: EspaƱol •
|
||||
<a href="{{ page.url | replace_first: "/es", "/en" }}">This page in English</a>
|
||||
</div>
|
||||
</header>
|
||||
<h2 id="pt-page-title">{{ page.title }}</h2>
|
||||
<div class="pt-content">
|
||||
{{ content }}
|
||||
{% if page.skip_footer %}
|
||||
{% else %}
|
||||
<div class="pt-close-window">
|
||||
<p class="pt-center-text">
|
||||
<a href="#" title="Haga Clic para Cerrar Esta Ventana" onclick="window.close();return false">
|
||||
<i class="material-icons">cancel</i> Cerrar Esta Ventana
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="pt-help-index">
|
||||
<p class="pt-center-text">
|
||||
<a href="/es/" title="Ćndice de ayuda">« Volver al Ćndice de ayuda</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,26 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ page.title }} « PrayerTracker Help / Ayuda de SeguidorOración</title>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link href="https://prayer.bitbadger.solutions/css/app.css" rel="stylesheet">
|
||||
<link href="/css/help.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<header class="pt-title-bar">
|
||||
<section class="pt-title-bar-left"><span class="pt-title-bar-home"><a href="/" title="Home">PrayerTracker / SeguidorOración</a></span></section>
|
||||
<section class="pt-title-bar-right">Help / Ayuda</section>
|
||||
</header>
|
||||
<div id="pt-body">
|
||||
<header id="pt-language">
|
||||
<div> </div>
|
||||
</header>
|
||||
<h2 id="pt-page-title">{{ page.title }}</h2>
|
||||
<div class="pt-content pt-center-text">
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,43 +0,0 @@
|
||||
/**
|
||||
* PrayerTracker Help styling
|
||||
*/
|
||||
.pt-content {
|
||||
background-color: white;
|
||||
padding: 0 .25em;
|
||||
}
|
||||
.pt-title-bar-home {
|
||||
height: 2rem;
|
||||
}
|
||||
.pt-title-bar-left {
|
||||
color: white;
|
||||
font-size: 1.25rem;
|
||||
font-weight: bold;
|
||||
margin-left: .5rem;
|
||||
}
|
||||
.pt-title-bar-right {
|
||||
color: white;
|
||||
color: rgba(255, 255, 255, .75);
|
||||
font-size: 1.1rem;
|
||||
font-variant: small-caps;
|
||||
margin-right: 1rem;
|
||||
align-self: center;
|
||||
}
|
||||
h2 {
|
||||
margin-top: 0;
|
||||
padding-left: .5rem;
|
||||
border-bottom: solid 1px #444;
|
||||
}
|
||||
.pt-close-window, .pt-help-index {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
.pt-help-index {
|
||||
display: none;
|
||||
}
|
||||
@media screen and (min-width:451px) {
|
||||
.pt-close-window {
|
||||
display: none;
|
||||
}
|
||||
.pt-help-index {
|
||||
display: block;
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
---
|
||||
title: Help
|
||||
skip_footer: true
|
||||
---
|
||||
|
||||
Throughout PrayerTracker, you'll see an icon (a question mark in a circle) next to the title on each page. Clicking this will open a new, small window with directions on using that page. If you are looking for a quick overview of PrayerTracker, start with the āAdd / Edit a Requestā and āChange Preferencesā entries.
|
||||
|
||||
----
|
||||
|
||||
<p class="pt-center-text"><strong>Help Topics</strong></p>
|
||||
|
||||
[Change Preferences](./small-group/preferences.html)
|
||||
|
||||
[Send Announcement](./small-group/announcement.html)
|
||||
|
||||
[Maintain Group Members](./small-group/members.html)
|
||||
|
||||
[Add / Edit a Request](./requests/edit.html)
|
||||
|
||||
[Maintain Requests](./requests/maintain.html)
|
||||
|
||||
[View Request List](./requests/view.html)
|
||||
|
||||
[Log On](./user/log-on.html)
|
||||
|
||||
[Change Your Password](./user/password.html)
|
@ -1,27 +0,0 @@
|
||||
---
|
||||
title: Add / Edit a Request
|
||||
---
|
||||
|
||||
This page allows you to enter or update a new prayer request.
|
||||
|
||||
## Request Type
|
||||
|
||||
There are 5 request types in PrayerTracker. āCurrent Requestsā are your regular requests that people may have regarding things happening over the next week or so. āLong-Term Requestsā are requests that may occur repeatedly or continue indefinitely. āPraise Reportsā are like āCurrent Requestsā, but they are answers to prayer to share with your group. āExpectingā is for those who are pregnant. āAnnouncementsā are like āCurrent Requestsā, but instead of a request, they are simply passing information along about something coming up.
|
||||
|
||||
The order above is the order in which the request types appear on the list. āLong-Term Requestsā and āExpectingā are not subject to the automatic expiration (set on the āChange Preferencesā page) that the other requests are.
|
||||
|
||||
## Date
|
||||
|
||||
For new requests, this is a box with a calendar date picker. Click or tab into the box to display the calendar, which will be preselected to today's date. For existing requests, there will be a check box labeled āCheck to not update the dateā. This can be used if you are correcting spelling or punctuation, and do not have an actual update to make to the request.
|
||||
|
||||
## Requestor / Subject
|
||||
|
||||
For requests or praises, this field is for the name of the person who made the request or offered the praise report. For announcements, this should contain the subject of the announcement. For all types, it is optional; I used to have an announcement with no subject that ran every week, telling where to send requests and updates.
|
||||
|
||||
## Expiration
|
||||
|
||||
āExpire Normallyā means that the request is subject to the expiration days in the group preferences. āRequest Never Expiresā can be used to make a request never expire (note that this is redundant for āLong-Term Requestsā and āExpectingā). If you are editing an existing request, a third option appears. āExpire Immediatelyā will make the request expire when it is saved. Apart from the icons on the request maintenance page, this is the only way to expire āLong-Term Requestsā and āExpectingā requests, but it can be used for any request type.
|
||||
|
||||
## Request
|
||||
|
||||
This is the text of the request. The editor provides many formatting capabilities, including āSpell Check as you Typeā (enabled by default), āPaste from Wordā, and āPaste Plainā, as well as āSourceā view, if you want to edit the HTML yourself. It also supports undo and redo, and the editor supports full-screen mode. Hover over each icon to see what each button does.
|
@ -1,29 +0,0 @@
|
||||
---
|
||||
title: Maintain Requests
|
||||
---
|
||||
|
||||
From this page, you can add, edit, and delete your current requests. You can also restore requests that may have expired, but should be made active once again.
|
||||
|
||||
## Add a New Request
|
||||
|
||||
To add a request, click the icon or text in the center of the page, below the title and above the list of requests for your group.
|
||||
|
||||
## Search Requests
|
||||
|
||||
If you are looking for a particular requests, enter some text in the search box and click āSearchā. PrayerTracker will search the Requestor/Subject and Request Text fields (case-insensitively) of both active and inactive requests. The results will be displayed in the same format as the original Maintain Requests page, so the buttons described below will work the same for those requests as well. They will also be displayed in pages, if there are a lot of results; the number per page is configurable by small group.
|
||||
|
||||
## Edit Request
|
||||
|
||||
To edit a request, click the blue pencil icon; it's the first icon under the āActionsā column heading.
|
||||
|
||||
## Expire a Request
|
||||
|
||||
For active requests, the second icon is an eye with a slash through it; clicking this icon will expire the request immediately. This is equivalent to editing the request, selecting āExpire Immediatelyā, and saving it.
|
||||
|
||||
## Restore an Inactive Request
|
||||
|
||||
When the page is first displayed, it does not display inactive requests. However, clicking the link at the bottom of the page will refresh the page with the inactive requests shown. The middle icon will look like an eye; clicking it will restore the request as an active request. The last updated date will be current, and the request is set to expire normally.
|
||||
|
||||
## Delete a Request
|
||||
|
||||
Deleting a request is contrary to the intent of PrayerTracker, as you can retrieve requests that have expired. However, if there is a request that needs to be deleted, clicking the blue trash can icon in the āActionsā column will allow you to do it. Use this option carefully, as these deletions cannot be undone; once a request is deleted, it is gone for good.
|
@ -1,17 +0,0 @@
|
||||
---
|
||||
title: View Request List
|
||||
---
|
||||
|
||||
From this page, you can view the request list (for today or for the next Sunday), view a printable version of the list, and e-mail the list to the members of your group. (NOTE: If you are logged in as a group member, the only option you will see is to view a printable list.)
|
||||
|
||||
## List for Next Sunday
|
||||
|
||||
This will modify the date for the list, so it will look like it is currently next Sunday. This can be used, for example, to see what requests will expire, or allow you to print a list with Sunday's date on Saturday evening. Note that this link does not appear if it is Sunday.
|
||||
|
||||
## View Printable
|
||||
|
||||
Clicking this link will display the list in a format that is suitable for printing; it does not have the normal PrayerTracker header across the top. Once you have clicked the link, you can print it using your browser's standard āPrintā functionality.
|
||||
|
||||
## Send Via E-mail
|
||||
|
||||
Clicking this link will send the list you are currently viewing to your group members. The page will remind you that you are about to do that, and ask for your confirmation. If you proceed, you will see a page that shows to whom the list was sent, and what the list looked like. You may safely use your browser's āBackā button to navigate away from the page.
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
title: Send Announcement
|
||||
---
|
||||
|
||||
## Announcement Text
|
||||
|
||||
This is the text of the announcement you would like to send. It functions the same way as the text box on the [āEdit Requestā page](../requests/edit.html#request).
|
||||
|
||||
## Add to Request List
|
||||
|
||||
Without this box checked, the text of the announcement will only be e-mailed to your group members. If you check this box, however, the text of the announcement will be added to your prayer list under the section you have selected.
|
@ -1,17 +0,0 @@
|
||||
---
|
||||
title: Maintain Group Members
|
||||
---
|
||||
|
||||
From this page, you can add, edit, and delete the e-mail addresses for your group.
|
||||
|
||||
## Add a New Group Member
|
||||
|
||||
To add an e-mail address, click the icon or text in the center of the page, below the title and above the list of addresses for your group.
|
||||
|
||||
## Edit Group Member
|
||||
|
||||
To edit an e-mail address, click the blue pencil icon; it's the first icon under the āActionsā column heading. This will allow you to update the name and/or the e-mail address for that member.
|
||||
|
||||
## Delete a Group Member
|
||||
|
||||
To delete an e-mail address, click the blue trash can icon in the āActionsā column. Note that once an e-mail address has been deleted, it is gone. (Of course, if you delete it in error, you can enter it again using the āAddā instructions above.)
|
@ -1,70 +0,0 @@
|
||||
---
|
||||
title: Change Preferences
|
||||
---
|
||||
|
||||
This page allows you to change how your prayer request list looks and behaves. Each section is addressed below.
|
||||
|
||||
## Requests Expire After
|
||||
|
||||
When a regular request goes this many days without being updated, it expires and no longer appears on the request list. Note that the categories āLong-Term Requestsā and āExpectingā never expire automatically.
|
||||
|
||||
## Requests āNewā For
|
||||
|
||||
Requests that have been updated within this many days are identified by a hollow circle for their bullet, as opposed to a filled circle for other requests. All categories respect this setting. If you do a typo correction on a request, if you do not check the box to update the date, this setting will change the bullet. (NOTE: In the plain-text e-mail, new requests are bulleted with a ā+ā symbol, and old are bulleted with a ā-ā symbol.)
|
||||
|
||||
## Long-Term Requests Alerted for Update
|
||||
|
||||
Requests that have not been updated in this many weeks are identified by an italic font on the āMaintain Requestsā page, to remind you to seek updates on these requests so that your prayers can stay relevant and current.
|
||||
|
||||
## Request Sorting
|
||||
|
||||
By default, requests are sorted within each group by the last updated date, with the most recent on top. If you would prefer to have the list sorted by requestor or subject rather than by date, select āSort by Requestor Nameā instead.
|
||||
|
||||
## E-mail āFromā Name and Address
|
||||
|
||||
PrayerTracker must put an name and e-mail address in the āfromā position of each e-mail it sends. The default name is āPrayerTrackerā, and the default e-mail address is āprayer@djs-consulting.comā. This will work, but any bounced e-mails and out-of-office replies will be sent to that address (which is not even a real address). Changing at least the e-mail address to your address will ensure that you receive these e-mails, and can prune your e-mail list accordingly.
|
||||
|
||||
## E-mail Format
|
||||
|
||||
This is the default e-mail format for your group. The PrayerTracker default is HTML, which sends the list just as you see it online. However, some e-mail clients may not display this properly, so you can choose to default the email to a plain-text format, which does not have colors, italics, or other formatting. The setting on this page is the group default; you can select a format for each recipient on the āMaintain Group Membersā page.
|
||||
|
||||
## Colors
|
||||
|
||||
You can customize the colors that are used for the headings and lines in your request list. You can select one of the 16 named colors in the drop down lists, or you can āmix your ownā using red, green, and blue (RGB) values between 0 and 255. There is a link on the bottom of the page to a color list with more names and their RGB values, if you're really feeling artistic. The background color cannot be changed.
|
||||
|
||||
## Fonts for List
|
||||
|
||||
This is a comma-separated list of fonts that will be used for your request list. A warning is good here; just because you have an obscure font and like the way that it looks does not mean that others have that same font. It is generally best to stick with the fonts that come with Windows - fonts like āArialā, āTimes New Romanā, āTahomaā, and āComic Sans MSā. You should also end the font list with either āserifā or āsans-serifā, which will use the browser's default serif (like āTimes New Romanā) or sans-serif (like āArialā) font.
|
||||
|
||||
## Heading / List Text Size
|
||||
|
||||
This is the point size to use for each. The default for the heading is 16pt, and the default for the text is 12pt.
|
||||
|
||||
## Making a āLarge Printā List
|
||||
|
||||
If your group is comprised mostly of people who prefer large print, the following settings will make your list look like the typical large-print publication:
|
||||
|
||||
> _Fonts_<br>
|
||||
> — 'Times New Roman',serif
|
||||
>
|
||||
> _Heading Text Size_<br>
|
||||
> — 18pt
|
||||
>
|
||||
> _List Text Size_<br>
|
||||
> — 16pt
|
||||
|
||||
## Time Zone
|
||||
|
||||
This is the time zone that you would like to use for your group. If you do not see your time zone listed, just [contact Daniel](mailto:daniel@djs-consulting.com?subject=PrayerTracker%20Time%20Zone) and tell him what time zone you need.
|
||||
|
||||
## Request List Visibility
|
||||
|
||||
The group's request list can be either public, private, or password-protected. Public lists are available without logging in, and private lists are only available online to administrators (though the list can still be sent via e-mail by an administrator). Password-protected lists allow group members to log in and view the current request list online, using the āGroup Log Onā link and providing this password. As this is a shared password, it is stored in plain text, so you can easily see what it is. If you select āPassword Protectedā but do not enter a password, the list remains private, which is also the default value. (Changing this password will force all members of the group who logged in with the āRemember Meā box checked to provide the new password.)
|
||||
|
||||
## Page Size
|
||||
|
||||
As small groups use PrayerTracker, they accumulate many expired requests. When lists of requests that include expired requests, the results will be broken up into pages. The default value is 100 requests per page, but may be set as low as 10 or as high as 255.
|
||||
|
||||
## "As of" Date Display
|
||||
|
||||
PrayerTracker can display the last date a request was updated, at the end of the request text. By default, it does not. If you select a short date, it will show "(as of 10/11/2015)" (for October 11, 2015); if you select a long date, it will show "(as of Sunday, October 11, 2015)".
|
@ -1,13 +0,0 @@
|
||||
---
|
||||
title: Log On
|
||||
---
|
||||
|
||||
This page allows you to log on to PrayerTracker. There are two different levels of access for PrayerTracker - user and group.
|
||||
|
||||
## User Log On
|
||||
|
||||
Enter your e-mail address and password into the appropriate boxes, then select your group. If you want PrayerTracker to remember you on your computer, click the āRemember Meā box before clicking the āLog Onā button.
|
||||
|
||||
## Group Log On
|
||||
|
||||
If your group has defined a password to use to allow you to view their request list online, select your group from the drop down list, then enter the group password into the appropriate box. If you want PrayerTracker to remember your group, click the āRemember Meā box before clicking the āLog Onā button.
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
title: Change Your Password
|
||||
---
|
||||
|
||||
This page will let you change your password. Enter your existing password in the top box, then enter your new password in the bottom two boxes. Entering your existing password is a security measure; with the āRemember Meā box on the log in page, this will prevent someone else who may be using your computer from being able to simply go to the site and change your password.
|
||||
|
||||
"If you cannot remember your existing password, we cannot retrieve it, but we can set it to something known so that you can then change it to your password. [Click here to request help resetting your password](mailto:daniel@djs-consulting.com?subject=PrayerTracker%20Password%20Help).
|
@ -1,26 +0,0 @@
|
||||
---
|
||||
title: Ayuda
|
||||
skip_footer: true
|
||||
---
|
||||
|
||||
En todo el sistema, verĆ” un icono (un signo de interrogación en un cĆrculo) junto al tĆtulo de cada pĆ”gina. Al hacer clic en esta opción, se abrirĆ” una nueva y pequeƱa ventana con instrucciones sobre cómo usar esa pĆ”gina. Si estĆ” buscando una descripción rĆ”pida de SeguidorOración, comience con las entradas "Agregar / Editar una Petición" y "Cambiar las Preferencias".
|
||||
|
||||
----
|
||||
|
||||
<p class="pt-center-text"><strong>Los Temas de Ayuda</strong></p>
|
||||
|
||||
[Cambiar las Preferencias](./small-group/preferences.html)
|
||||
|
||||
[Enviar un Anuncio](./small-group/announcement.html)
|
||||
|
||||
[Mantener los Miembros del Grupo](./small-group/members.html)
|
||||
|
||||
[Agregar / Editar una Petición](./requests/edit.html)
|
||||
|
||||
[Mantener las Peticiones](./requests/maintain.html)
|
||||
|
||||
[Ver la Lista de Peticiones](./requests/view.html)
|
||||
|
||||
[Iniciar Sesión](./user/log-on.html)
|
||||
|
||||
[Cambiar Su ContraseƱa](./user/password.html)
|
@ -1,27 +0,0 @@
|
||||
---
|
||||
title: Agregar / Editar una Petición
|
||||
---
|
||||
|
||||
Esta pÔgina le permite introducir o actualizar una petición de oración nueva.
|
||||
|
||||
## Tipo de Petición
|
||||
|
||||
Hay 5 tipos de peticiones en SeguidorOración. āPeticiones Actualesā son sus peticiones habituales que la gente pueda tener acerca de las cosas que suceden durante la próxima semana o asĆ. āPeticiones a Largo Plazoā son peticiones que pueden ocurrir varias veces, o continuar indefinidamente. āInformes de Alabanzaā son como āPeticiones Actualesā, pero son respuestas a la oración para compartir con su grupo. āEmbarazadaā es para aquellos que estĆ”n embarazadas. āAnunciosā son como āPeticiones Actualesā, pero en lugar de una petición, simplemente se pasa la información a lo largo de algo por venir.
|
||||
|
||||
El orden anterior es el orden en que los tipos de peticiones aparecen en la lista. āPeticiones a Largo Plazoā y āEmbarazadaā no estĆ”n sujetos a la caducidad automĆ”tica (establecida en el āCambiar las Preferenciasā de la pĆ”gina) que las peticiones son otros.
|
||||
|
||||
## Fecha
|
||||
|
||||
Para nuevas peticiones, se trata de una caja con un selector de fechas del calendario. Haga clic en la pestaƱa o en la caja para mostrar el calendario, que serĆ” preseleccionada para la fecha de hoy. Para peticiones existentes, habrĆ” una casilla de verificación āSeleccionar para no actualizar la fechaā. Esto puede ser usado si corrige la ortografĆa ni la puntuacion, y no tienen una actualización real de hacer la petición.
|
||||
|
||||
## Peticionario / Sujeto
|
||||
|
||||
Para las peticiones o alabanzas, este campo es el nombre de la persona que hizo la petición o que ofrece el informe de alabanza. Para los anuncios, este debe contener el objeto del anuncio. Para todos los tipos, es opcional, yo solĆa tener un anuncio con ningĆŗn tema que iba todas las semanas, diciendo a dónde enviar peticiones y actualizaciones.
|
||||
|
||||
## Expiración
|
||||
|
||||
āExpirarĆ” Normalmenteā significa que la petición estĆ” sujeta a los dĆas de vencimiento de las preferencias del grupo. āPetición no Expira Nuncaā se puede utilizar para hacer una petición que no caduque nunca (nótese que esto es redundante para los tipos āPeticiones a Largo Plazoā y āEmbarazadaā). Si estĆ” editando una petición existente, aparece una tercera opción. āExpirarĆ” Inmediatamenteā harĆ” que la petición expirarĆ” cuando se guarda. Aparte de los iconos de la pĆ”gina de mantenimiento de las peticiones, Ć©sta es la Ćŗnica otra forma de expirar peticiones del tipos āPeticiones a Largo Plazoā y āEmbarazadaā, pero puede ser utilizada para cualquier tipo de petición.
|
||||
|
||||
## Petición
|
||||
|
||||
Este es el texto de la petición. El editor ofrece muchas capacidades de formato, como "El Corrector OrtogrÔfico al Escribir" (habilitado predeterminado), "Pegar desde Word" y "Pegar sin formato", asà como "Código Fuente" punto de vista, si quieres editar el código HTML usted mismo. También es compatible con deshacer y rehacer, y el editor soporta modo de pantalla completa. Pase el ratón sobre cada icono para ver qué hace cada botón.
|
@ -1,29 +0,0 @@
|
||||
---
|
||||
title: Mantener las Peticiones
|
||||
---
|
||||
|
||||
Desde esta pƔgina, usted puede agregar, editar y borrar sus peticiones actuales. TambiƩn puede restaurar peticiones que han caducado, sino que debe ser activa, una vez mƔs.
|
||||
|
||||
## Agregar una Nueva Petición
|
||||
|
||||
Para agregar una petición, haga clic en el icono o el texto en el centro de la pĆ”gina, debajo del tĆtulo y por encima de la lista de peticiones para su grupo.
|
||||
|
||||
## Busca las Peticiones
|
||||
|
||||
Si estĆ” buscando una solicitud en particular, ingrese un texto en el cuadro de bĆŗsqueda y haga clic en āBuscarā. SeguidorOración buscarĆ” los campos de Solicitante / Asunto y Texto de solicitud (sin distinción de mayĆŗsculas y minĆŗsculas) de solicitudes activas e inactivas. Los resultados se mostrarĆ”n en el mismo formato que la pĆ”gina de solicitudes de mantenimiento original, por lo que los botones que se describen a continuación funcionarĆ”n igual para esas solicitudes. TambiĆ©n se mostrarĆ”n en las pĆ”ginas, si hay muchos resultados; el nĆŗmero por pĆ”gina es configurable por grupos pequeƱos.
|
||||
|
||||
## Editar la Petición
|
||||
|
||||
Para editar una petición, haga clic en el icono de lĆ”piz azul, el primer icono bajo el tĆtulo de columna āAccionesā.
|
||||
|
||||
## Expirar una petición
|
||||
|
||||
Para las peticiones activas, el segundo icono es un ojo con una barra a través de él; Si hace clic en este icono, la petición se cancelarÔ inmediatamente. Esto equivale a editar la petición, seleccionar "ExpirarÔ Inmediatamente" y guardarla.
|
||||
|
||||
## Restaurar una Petición Inactivo
|
||||
|
||||
Cuando la pĆ”gina se muestra por primera vez, que no muestra peticiones inactivos. Sin embargo, al hacer clic en el vĆnculo en la parte inferior de la pĆ”gina se actualizarĆ” la pĆ”gina con las peticiones se muestran inactivos. El icono del centro se verĆ” como un ojo; Haciendo clic en Ć©l, restaurarĆ” la petición como una petición activa. La Ćŗltima fecha actualizada serĆ” actual, y la petición se establece para caducar normalmente.
|
||||
|
||||
## Eliminar una Petición
|
||||
|
||||
Eliminación de una petición es contraria a la intención de SeguidorOración, como se puede recuperar peticiones que han expirado. Sin embargo, si hay una solicitud que debe ser eliminado, haga clic en el icono azul de la papelera en la columna āAccionesā le permitirĆ” hacerlo. Utilice esta opción con cuidado, ya que estas supresiones no se puede deshacer, una vez a la petición se ha borrado, ha desaparecido para siempre.
|
@ -1,17 +0,0 @@
|
||||
---
|
||||
title: Ver la Lista de Peticiones
|
||||
---
|
||||
|
||||
Desde esta pÔgina, puede ver la lista de peticiones (para hoy o para el próximo Domingo), ver una versión imprimible de la lista, y por correo electrónico la lista de los miembros de su grupo. (NOTA: Si usted estÔ registrado como miembro de la clase, la única opción que se ve es para ver una lista para imprimir.)
|
||||
|
||||
## Lista para el Próximo Domingo
|
||||
|
||||
Esto modificarÔ la fecha de la lista, por lo que se verÔ como es en la actualidad el próximo Domingo. Esto puede ser usado, por ejemplo, para ver lo que peticiones de caducidad, ni le permite imprimir una lista con la fecha del Domingo en la noche del SÔbado. Tenga en cuenta que este enlace no aparece si es Domingo.
|
||||
|
||||
## Versión Imprimible
|
||||
|
||||
Hacer clic en este vĆnculo, se muestra la lista en un formato que sea adecuado para imprimir, sino que no tiene el encabezado normal de SeguidorOración en la parte superior. Una vez que haya hecho clic en el enlace, se puede imprimir con el navegador estĆ”ndar de āImprimirā funcionalidad.
|
||||
|
||||
## Enviar por correo electrónico
|
||||
|
||||
Al hacer clic en este enlace le enviarĆ” la lista que estĆ” viendo en ese momento a los miembros del grupo. La pĆ”gina te recordarĆ” que estĆ”s a punto de hacerlo, y pedir su confirmación. Si continĆŗa, usted verĆ” una pĆ”gina que muestra a la que la lista fue enviado, y lo que la lista parecĆa. Usted puede utilizar con seguridad de su navegador botón āAtrĆ”sā para navegar fuera de la pĆ”gina.
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
title: Enviar un Anuncio
|
||||
---
|
||||
|
||||
## Texto del Anuncio
|
||||
|
||||
Este es el texto del anuncio que desea enviar. Funciona de la misma forma que el cuadro de texto en [la pĆ”gina āEditar la Peticiónā](../requests/edit.html#peticion).
|
||||
|
||||
## Agregar a la Lista de Peticiones En
|
||||
|
||||
Sin esta caja marcada, el texto del anuncio sólo serÔ por correo electrónico a los miembros del su grupo. Si marca esta caja, sin embargo, el texto del anuncio serÔ añadido a su lista de oración en la sección que ha seleccionado.
|
@ -1,17 +0,0 @@
|
||||
---
|
||||
title: Mantener los Miembros del Grupo
|
||||
---
|
||||
|
||||
Desde esta pÔgina, usted puede agregar, editar y eliminar las direcciones de correo electrónico para su grupo.
|
||||
|
||||
## AƱadir un Nuevo Miembro del Grupo
|
||||
|
||||
Para agregar una dirección de correo electrónico, haga clic en el icono o el texto en el centro de la pĆ”gina, debajo del tĆtulo y por encima de la lista de direcciones para su grupo.
|
||||
|
||||
## Editar el Miembro del Grupo
|
||||
|
||||
Para editar una dirección de correo electrónico, haga clic en el icono de lĆ”piz azul, es el primer icono bajo el tĆtulo de columna āAccionesā. Esto le permitirĆ” actualizar el nombre y / o la dirección de correo electrónico para ese miembro.
|
||||
|
||||
## Eliminar un Miembro del Grupo
|
||||
|
||||
Para eliminar una dirección de correo electrónico, haga clic en el icono azul de la papelera en la columna āAccionesā. Tenga en cuenta que una vez que la dirección de correo electrónico se ha eliminado, se ha ido. (Por supuesto, si usted lo elimine por error, se puede entrar de nuevo utilizando la opción āAgregarā instrucciones de arriba.)
|
@ -1,70 +0,0 @@
|
||||
---
|
||||
title: Cambiar las Preferencias
|
||||
---
|
||||
|
||||
Esta pÔgina le permite cambiar la forma en que su lista de peticiones de la oración se ve y se comporta. Cada sección se aborda mÔs adelante.
|
||||
|
||||
## Peticiones Expiran DespuƩs de
|
||||
|
||||
Cuando una petición regular va esta cantidad de dĆas sin actualizar, caduca y ya no aparece en la lista de peticiones. Tenga en cuenta que las categorĆas āPeticiones a Largo Plazoā y āEmbarazadaā no expirarĆ” automĆ”ticamente.
|
||||
|
||||
## Peticiones āNuevasā Para
|
||||
|
||||
Peticiones que han sido actualizadas dentro de esta cantidad de dĆas se identifican por un cĆrculo hueco para su bala, en oposición a un cĆrculo relleno para otras peticiones. Todas las categorĆas respetar esta opción. Si usted hace una corrección de errata en una petición, si no marque la caja para actualizar la fecha, este valor va a cambiar la bala. (NOTA: En el texto sin formato de correo electrónico, las nuevas solicitudes se identifican con un sĆmbolo ā+ā, y pide a los viejos se identifican con un sĆmbolo ā-ā.)
|
||||
|
||||
## Peticiones a Largo Plazo Alertó para la Actualización
|
||||
|
||||
Peticiones que no han sido actualizados en esta semana muchos se identifican con un tipo de letra cursiva en la pĆ”gina āMantener las Peticionesā, para recordarle que debe buscar novedades en estas peticiones para que vuestras oraciones pueden permanecer relevante y actual.
|
||||
|
||||
## Orden de Peticiones
|
||||
|
||||
De forma predeterminada, las solicitudes se ordenan dentro de cada grupo por la Ćŗltima fecha de actualización, con el mĆ”s reciente en la parte superior. Si prefiere tener la lista ordenada por el solicitante o el sujeto en vez de por fecha, seleccione āOrdenar por Nombre del Solicitanteā en su lugar.
|
||||
|
||||
## Correo Electrónico āDeā Nombre y Dirección
|
||||
|
||||
SeguidorOración debe poner el nombre y la dirección de correo electrónico en el ādeā posición de cada correo electrónico que envĆa. El nombre predeterminado es āPrayerTrackerā, y el valor predeterminado dirección de correo electrónico es āprayer@djs-consulting.comā. Esto funciona, pero los mensajes devueltos, y las respuestas de fuera de la oficina serĆ”n enviados a esa dirección (que no es ni siquiera una dirección real). Cambiar por lo menos la dirección de correo electrónico a su dirección se asegurarĆ” de que usted recibe estos correos electrónicos, y se puede podar su lista de correo electrónico en consecuencia.
|
||||
|
||||
## Formato de Correo Electrónico
|
||||
|
||||
Este es el valor predeterminado formato de correo electrónico para su grupo. El valor predeterminado de SeguidorOración es HTML, el cual envĆa la lista al igual que usted lo ve en el sitio. Sin embargo, algunos clientes de correo electrónico no puede mostrar esto correctamente, para que pueda elegir el correo electrónico a un formato de texto plano predeterminadas, que no tiene colores, cursiva, u otro formato. La configuración en esta pĆ”gina es el valor predeterminado del grupo, se puede seleccionar un formato para cada destinatario de la pĆ”gina āMantener los Miembros del Grupoā.
|
||||
|
||||
## Colores
|
||||
|
||||
Usted puede personalizar los colores que se utilizan para las partidas y lĆneas en su lista de peticiones. Puede seleccionar uno de los 16 colores con nombre en las listas desplegables, o puede āmezclar su propiaā en colores rojo, verde y azul (RGB) valores entre 0 y 255. Hay un enlace en la parte inferior de la pĆ”gina para una lista de colores con mĆ”s nombres y sus valores RGB, si realmente estĆ”s sintiendo artĆstica. El color de fondo no puede ser cambiado.
|
||||
|
||||
## Fuentes de la Lista
|
||||
|
||||
Esta es una lista separada por comas de fuentes que se utilizarĆ”n para su lista de peticiones. Una advertencia de que es bueno aquĆ, sólo porque usted tiene una fuente oscura y gusta la forma en que se vea no significa que los demĆ”s tienen de que la misma fuente. Generalmente es mejor quedarse con las fuentes que vienen con Windows - Fuentes como āArialā, āTimes New Romanā, āTahomaā, y āComic Sans MSā. TambiĆ©n debe poner fin a la lista de fuentes, ya sea con āserifā o el āsans-serifā, que utilizarĆ” el fuente serif predeterminado (como āTimes New Romanā) o el fuente sans-serif predeterminado (como āArialā).
|
||||
|
||||
## TamaƱo del Texto de Partida y Lista
|
||||
|
||||
Este es el tamaƱo de punto a utilizar para cada uno. El valor predeterminado para el tĆtulo es 16 puntos, y el valor por defecto para el texto es 12 puntos.
|
||||
|
||||
## Realización de una Lista de āLetra Grandeā
|
||||
|
||||
Si el grupo estĆ” compuesta en su mayorĆa de la gente que prefiere letras grandes, los siguientes ajustes harĆ”n que su lista de parecerse a la tĆpica la publicación āLetra Grandeā:
|
||||
|
||||
> _Fuentes_<br>
|
||||
> — 'Times New Roman',serif
|
||||
>
|
||||
> _Partida el TamaƱo del Texto_<br>
|
||||
> — 18pt
|
||||
>
|
||||
> _Lista el TamaƱo del Texto_<br>
|
||||
> — 16pt
|
||||
|
||||
## Zona Horaria
|
||||
|
||||
Esta es la zona horaria que desea utilizar para su clase. Si no puede ver la zona horaria en la lista, ponte en [contacto con Daniel](mailto:daniel@djs-consulting.com?subject=Zona%20Horaria%20por%20SeguidorOración) y decirle lo que la zona horaria que usted necesita.
|
||||
|
||||
## La Visibilidad del la Lista de las Peticiones
|
||||
|
||||
La lista de peticiones del grupo puede ser pĆŗblica, privada o protegida por contraseƱa. Las listas pĆŗblicas estĆ”n disponibles sin iniciar sesión, y listas privadas sólo estĆ”n disponibles en lĆnea a los administradores (aunque la lista todavĆa puede ser enviado por correo electrónico por el administrador). Protegidos con contraseƱa listas permiten miembros del grupo iniciar sesión y ver la lista de peticiones actual en el sito, utilizando el "Iniciar Sesión como Grupo" enlace y proporcionar la contraseƱa. Como se trata de una contraseƱa compartida, se almacena en texto plano, asĆ que usted puede ver fĆ”cilmente lo que es. Si selecciona "Protegido por ContraseƱa" pero no introduce una contraseƱa, la lista sigue siendo privado, que tambiĆ©n es el valor predeterminado. (Cambiar esta contraseƱa obligarĆ” a todos los miembros del grupo que se iniciar sesión en el "AcuĆ©rdate de MĆ" caja marcada para proporcionar la nueva contraseƱa.)
|
||||
|
||||
## TamaƱo de PƔgina
|
||||
|
||||
A medida que los grupos pequeños utilizan SeguidorOración, acumulan muchas solicitudes caducadas. Cuando las listas de solicitudes que incluyen solicitudes caducadas, los resultados se dividirÔn en pÔginas. El valor predeterminado es de 100 solicitudes por pÔgina, pero se puede establecer tan bajo como 10 o tan alto como 255.
|
||||
|
||||
## Visualización de la Fecha āComo deā
|
||||
|
||||
SeguidorOración puede mostrar la última fecha en que se actualizó una solicitud, al final del texto de solicitud. Por defecto, no lo hace. Si selecciona una fecha corta, se mostrarÔ "(como de 11/10/2015)" (para el 11 de octubre de 2015); si selecciona una fecha larga, se mostrarÔ "(como de domingo, 11 de octubre de 2015)".
|
@ -1,13 +0,0 @@
|
||||
---
|
||||
title: Iniciar Sesión
|
||||
---
|
||||
|
||||
Esta pÔgina le permite acceder a SeguidorOración. Hay dos diferentes niveles de acceso para SeguidorOración - el usuario y el grupo.
|
||||
|
||||
## Iniciar Sesión como Usuario
|
||||
|
||||
Introduzca su dirección de correo electrónico y contraseƱa en las cajas apropiadas y seleccione su grupo. Si desea que SeguidorOración que le recuerde en su ordenador, haga clic en āAcuĆ©rdate de MĆā caja antes de pulsar el āIniciar Sesiónā botón.
|
||||
|
||||
## Iniciar Sesión como Grupo
|
||||
|
||||
Si el grupo se ha definido una contraseƱa para usar que le permite ver su lista de peticiones en lĆnea, seleccionar el grupo en la lista desplegable y introduzca la contraseƱa del grupo en la caja correspondiente. Si desea que SeguidorOración recuerde su grupo, haga clic en āAcuĆ©rdate de MĆā caja antes de pulsar el āIniciar Sesiónā botón.
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
title: Cambiar Su ContraseƱa
|
||||
---
|
||||
|
||||
Esta pĆ”gina le permitirĆ” cambiar su contraseƱa. Ingrese su contraseƱa actual en la caja superior y introduzca la nueva contraseƱa en la parte inferior dos cajas. Al entrar su contraseƱa actual es una medida de seguridad, con el āAcuĆ©rdate de MĆā caja de la pĆ”gina inicio de sesión, esto evitarĆ” que otra persona que pueda estar usando su computadora de la posibilidad de simplemente ir a el sitio y cambiar la contraseƱa.
|
||||
|
||||
Si no recuerdas tu contraseña actual, no podemos recuperar, pero podemos ponerlo en algo que se conoce de modo que usted puede cambiarlo a su contraseña. [Haga clic aquà para solicitar ayuda para restablecer su contraseña](mailto:daniel@djs-consulting.com?subject=Ayuda%20de%20Contraseña%20de%20SeguidorOración).
|
@ -1,8 +0,0 @@
|
||||
---
|
||||
title: Help / Ayuda
|
||||
layout: home
|
||||
---
|
||||
|
||||
## [English](/en)
|
||||
|
||||
## [EspaƱol](/es)
|
7
fake.sh
Executable file
7
fake.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
dotnet tool restore
|
||||
dotnet fake "$@"
|
3
src/.dockerignore
Normal file
3
src/.dockerignore
Normal file
@ -0,0 +1,3 @@
|
||||
**/bin/*
|
||||
**/obj/*
|
||||
**/appsettings.*
|
@ -1,9 +1,11 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>7.5.0.0</AssemblyVersion>
|
||||
<FileVersion>7.5.0.0</FileVersion>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<AssemblyVersion>8.4.0.0</AssemblyVersion>
|
||||
<FileVersion>8.4.0.0</FileVersion>
|
||||
<Authors>danieljsummers</Authors>
|
||||
<Company>Bit Badger Solutions</Company>
|
||||
<Version>7.5.0</Version>
|
||||
<Version>8.4.0</Version>
|
||||
<DebugType>Embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
25
src/Dockerfile
Normal file
25
src/Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
|
||||
WORKDIR /pt
|
||||
COPY ./PrayerTracker.sln ./
|
||||
COPY ./Directory.Build.props ./
|
||||
COPY ./PrayerTracker/PrayerTracker.fsproj ./PrayerTracker/
|
||||
COPY ./PrayerTracker.Data/PrayerTracker.Data.fsproj ./PrayerTracker.Data/
|
||||
COPY ./PrayerTracker.Tests/PrayerTracker.Tests.fsproj ./PrayerTracker.Tests/
|
||||
COPY ./PrayerTracker.UI/PrayerTracker.UI.fsproj ./PrayerTracker.UI/
|
||||
RUN dotnet restore
|
||||
|
||||
COPY . ./
|
||||
WORKDIR /pt/PrayerTracker.Tests
|
||||
RUN dotnet run
|
||||
|
||||
WORKDIR /pt/PrayerTracker
|
||||
RUN dotnet publish -c Release -r linux-x64
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine as final
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache icu-libs
|
||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
||||
COPY --from=build /pt/PrayerTracker/bin/Release/net8.0/linux-x64/publish/ ./
|
||||
|
||||
EXPOSE 80
|
||||
CMD [ "dotnet", "/app/PrayerTracker.dll" ]
|
589
src/PrayerTracker.Data/Access.fs
Normal file
589
src/PrayerTracker.Data/Access.fs
Normal file
@ -0,0 +1,589 @@
|
||||
namespace PrayerTracker.Data
|
||||
|
||||
open NodaTime
|
||||
open Npgsql
|
||||
open Npgsql.FSharp
|
||||
open PrayerTracker.Entities
|
||||
|
||||
/// Helper functions for the PostgreSQL data implementation
|
||||
[<AutoOpen>]
|
||||
module private Helpers =
|
||||
|
||||
/// Map a row to a Church instance
|
||||
let mapToChurch (row : RowReader) =
|
||||
{ Id = ChurchId (row.uuid "id")
|
||||
Name = row.string "church_name"
|
||||
City = row.string "city"
|
||||
State = row.string "state"
|
||||
HasVpsInterface = row.bool "has_vps_interface"
|
||||
InterfaceAddress = row.stringOrNone "interface_address"
|
||||
}
|
||||
|
||||
/// Map a row to a ListPreferences instance
|
||||
let mapToListPreferences (row : RowReader) =
|
||||
{ SmallGroupId = SmallGroupId (row.uuid "small_group_id")
|
||||
DaysToKeepNew = row.int "days_to_keep_new"
|
||||
DaysToExpire = row.int "days_to_expire"
|
||||
LongTermUpdateWeeks = row.int "long_term_update_weeks"
|
||||
EmailFromName = row.string "email_from_name"
|
||||
EmailFromAddress = row.string "email_from_address"
|
||||
Fonts = row.string "fonts"
|
||||
HeadingColor = row.string "heading_color"
|
||||
LineColor = row.string "line_color"
|
||||
HeadingFontSize = row.int "heading_font_size"
|
||||
TextFontSize = row.int "text_font_size"
|
||||
GroupPassword = row.string "group_password"
|
||||
IsPublic = row.bool "is_public"
|
||||
PageSize = row.int "page_size"
|
||||
TimeZoneId = TimeZoneId (row.string "time_zone_id")
|
||||
RequestSort = RequestSort.fromCode (row.string "request_sort")
|
||||
DefaultEmailType = EmailFormat.fromCode (row.string "default_email_type")
|
||||
AsOfDateDisplay = AsOfDateDisplay.fromCode (row.string "as_of_date_display")
|
||||
}
|
||||
|
||||
/// Map a row to a Member instance
|
||||
let mapToMember (row : RowReader) =
|
||||
{ Id = MemberId (row.uuid "id")
|
||||
SmallGroupId = SmallGroupId (row.uuid "small_group_id")
|
||||
Name = row.string "member_name"
|
||||
Email = row.string "email"
|
||||
Format = row.stringOrNone "email_format" |> Option.map EmailFormat.fromCode
|
||||
}
|
||||
|
||||
/// Map a row to a Prayer Request instance
|
||||
let mapToPrayerRequest (row : RowReader) =
|
||||
{ Id = PrayerRequestId (row.uuid "id")
|
||||
UserId = UserId (row.uuid "user_id")
|
||||
SmallGroupId = SmallGroupId (row.uuid "small_group_id")
|
||||
EnteredDate = row.fieldValue<Instant> "entered_date"
|
||||
UpdatedDate = row.fieldValue<Instant> "updated_date"
|
||||
Requestor = row.stringOrNone "requestor"
|
||||
Text = row.string "request_text"
|
||||
NotifyChaplain = row.bool "notify_chaplain"
|
||||
RequestType = PrayerRequestType.fromCode (row.string "request_type")
|
||||
Expiration = Expiration.fromCode (row.string "expiration")
|
||||
}
|
||||
|
||||
/// Map a row to a Small Group instance
|
||||
let mapToSmallGroup (row : RowReader) =
|
||||
{ Id = SmallGroupId (row.uuid "id")
|
||||
ChurchId = ChurchId (row.uuid "church_id")
|
||||
Name = row.string "group_name"
|
||||
Preferences = ListPreferences.empty
|
||||
}
|
||||
|
||||
/// Map a row to a Small Group information set
|
||||
let mapToSmallGroupInfo (row : RowReader) =
|
||||
{ Id = Giraffe.ShortGuid.fromGuid (row.uuid "id")
|
||||
Name = row.string "group_name"
|
||||
ChurchName = row.string "church_name"
|
||||
TimeZoneId = TimeZoneId (row.string "time_zone_id")
|
||||
IsPublic = row.bool "is_public"
|
||||
}
|
||||
|
||||
/// Map a row to a Small Group list item
|
||||
let mapToSmallGroupItem (row : RowReader) =
|
||||
Giraffe.ShortGuid.fromGuid (row.uuid "id"), $"""{row.string "church_name"} | {row.string "group_name"}"""
|
||||
|
||||
/// Map a row to a Small Group instance with populated list preferences
|
||||
let mapToSmallGroupWithPreferences (row : RowReader) =
|
||||
{ mapToSmallGroup row with
|
||||
Preferences = mapToListPreferences row
|
||||
}
|
||||
|
||||
/// Map a row to a User instance
|
||||
let mapToUser (row : RowReader) =
|
||||
{ Id = UserId (row.uuid "id")
|
||||
FirstName = row.string "first_name"
|
||||
LastName = row.string "last_name"
|
||||
Email = row.string "email"
|
||||
IsAdmin = row.bool "is_admin"
|
||||
PasswordHash = row.string "password_hash"
|
||||
LastSeen = row.fieldValueOrNone<Instant> "last_seen"
|
||||
}
|
||||
|
||||
|
||||
open BitBadger.Documents.Postgres
|
||||
|
||||
/// Functions to manipulate churches
|
||||
module Churches =
|
||||
|
||||
/// Get a list of all churches
|
||||
let all () =
|
||||
Custom.list "SELECT * FROM pt.church ORDER BY church_name" [] mapToChurch
|
||||
|
||||
/// Delete a church by its ID
|
||||
let deleteById (churchId : ChurchId) = backgroundTask {
|
||||
let idParam = [ [ "@churchId", Sql.uuid churchId.Value ] ]
|
||||
let where = "WHERE small_group_id IN (SELECT id FROM pt.small_group WHERE church_id = @churchId)"
|
||||
let! _ =
|
||||
Configuration.dataSource ()
|
||||
|> Sql.fromDataSource
|
||||
|> Sql.executeTransactionAsync
|
||||
[ $"DELETE FROM pt.prayer_request {where}", idParam
|
||||
$"DELETE FROM pt.user_small_group {where}", idParam
|
||||
$"DELETE FROM pt.list_preference {where}", idParam
|
||||
"DELETE FROM pt.small_group WHERE church_id = @churchId", idParam
|
||||
"DELETE FROM pt.church WHERE id = @churchId", idParam ]
|
||||
()
|
||||
}
|
||||
|
||||
/// Save a church's information
|
||||
let save (church : Church) =
|
||||
Custom.nonQuery
|
||||
"INSERT INTO pt.church (
|
||||
id, church_name, city, state, has_vps_interface, interface_address
|
||||
) VALUES (
|
||||
@id, @name, @city, @state, @hasVpsInterface, @interfaceAddress
|
||||
) ON CONFLICT (id) DO UPDATE
|
||||
SET church_name = EXCLUDED.church_name,
|
||||
city = EXCLUDED.city,
|
||||
state = EXCLUDED.state,
|
||||
has_vps_interface = EXCLUDED.has_vps_interface,
|
||||
interface_address = EXCLUDED.interface_address"
|
||||
[ "@id", Sql.uuid church.Id.Value
|
||||
"@name", Sql.string church.Name
|
||||
"@city", Sql.string church.City
|
||||
"@state", Sql.string church.State
|
||||
"@hasVpsInterface", Sql.bool church.HasVpsInterface
|
||||
"@interfaceAddress", Sql.stringOrNone church.InterfaceAddress ]
|
||||
|
||||
/// Find a church by its ID
|
||||
let tryById (churchId : ChurchId) =
|
||||
Custom.single "SELECT * FROM pt.church WHERE id = @id" [ "@id", Sql.uuid churchId.Value ] mapToChurch
|
||||
|
||||
|
||||
/// Functions to manipulate small group members
|
||||
module Members =
|
||||
|
||||
/// Count members for the given small group
|
||||
let countByGroup (groupId : SmallGroupId) =
|
||||
Custom.scalar "SELECT COUNT(id) AS mbr_count FROM pt.member WHERE small_group_id = @groupId"
|
||||
[ "@groupId", Sql.uuid groupId.Value ] (fun row -> row.int "mbr_count")
|
||||
|
||||
/// Delete a small group member by its ID
|
||||
let deleteById (memberId : MemberId) =
|
||||
Custom.nonQuery "DELETE FROM pt.member WHERE id = @id" [ "@id", Sql.uuid memberId.Value ]
|
||||
|
||||
/// Retrieve all members for a given small group
|
||||
let forGroup (groupId : SmallGroupId) =
|
||||
Custom.list "SELECT * FROM pt.member WHERE small_group_id = @groupId ORDER BY member_name"
|
||||
[ "@groupId", Sql.uuid groupId.Value ] mapToMember
|
||||
|
||||
/// Save a small group member
|
||||
let save (mbr : Member) =
|
||||
Custom.nonQuery
|
||||
"INSERT INTO pt.member (
|
||||
id, small_group_id, member_name, email, email_format
|
||||
) VALUES (
|
||||
@id, @groupId, @name, @email, @format
|
||||
) ON CONFLICT (id) DO UPDATE
|
||||
SET member_name = EXCLUDED.member_name,
|
||||
email = EXCLUDED.email,
|
||||
email_format = EXCLUDED.email_format"
|
||||
[ "@id", Sql.uuid mbr.Id.Value
|
||||
"@groupId", Sql.uuid mbr.SmallGroupId.Value
|
||||
"@name", Sql.string mbr.Name
|
||||
"@email", Sql.string mbr.Email
|
||||
"@format", Sql.stringOrNone (mbr.Format |> Option.map EmailFormat.toCode) ]
|
||||
|
||||
/// Retrieve a small group member by its ID
|
||||
let tryById (memberId : MemberId) =
|
||||
Custom.single "SELECT * FROM pt.member WHERE id = @id" [ "@id", Sql.uuid memberId.Value ] mapToMember
|
||||
|
||||
|
||||
/// Options to retrieve a list of requests
|
||||
type PrayerRequestOptions =
|
||||
{ /// The small group for which requests should be retrieved
|
||||
SmallGroup : SmallGroup
|
||||
|
||||
/// The clock instance to use for date/time manipulation
|
||||
Clock : IClock
|
||||
|
||||
/// The date for which the list is being retrieved
|
||||
ListDate : LocalDate option
|
||||
|
||||
/// Whether only active requests should be retrieved
|
||||
ActiveOnly : bool
|
||||
|
||||
/// The page number, for paged lists
|
||||
PageNumber : int
|
||||
}
|
||||
|
||||
|
||||
/// Functions to manipulate prayer requests
|
||||
module PrayerRequests =
|
||||
|
||||
/// Central place to append sort criteria for prayer request queries
|
||||
let private orderBy sort =
|
||||
match sort with
|
||||
| SortByDate -> "updated_date DESC, entered_date DESC, requestor"
|
||||
| SortByRequestor -> "requestor, updated_date DESC, entered_date DESC"
|
||||
|
||||
/// Paginate a prayer request query
|
||||
let private paginate (pageNbr : int) pageSize =
|
||||
if pageNbr > 0 then $"LIMIT {pageSize} OFFSET {(pageNbr - 1) * pageSize}" else ""
|
||||
|
||||
/// Count the number of prayer requests for a church
|
||||
let countByChurch (churchId : ChurchId) =
|
||||
Custom.scalar
|
||||
"SELECT COUNT(id) AS req_count
|
||||
FROM pt.prayer_request
|
||||
WHERE small_group_id IN (SELECT id FROM pt.small_group WHERE church_id = @churchId)"
|
||||
[ "@churchId", Sql.uuid churchId.Value ] (fun row -> row.int "req_count")
|
||||
|
||||
/// Count the number of prayer requests for a small group
|
||||
let countByGroup (groupId : SmallGroupId) =
|
||||
Custom.scalar "SELECT COUNT(id) AS req_count FROM pt.prayer_request WHERE small_group_id = @groupId"
|
||||
[ "@groupId", Sql.uuid groupId.Value ] (fun row -> row.int "req_count")
|
||||
|
||||
/// Delete a prayer request by its ID
|
||||
let deleteById (reqId : PrayerRequestId) =
|
||||
Custom.nonQuery "DELETE FROM pt.prayer_request WHERE id = @id" [ "@id", Sql.uuid reqId.Value ]
|
||||
|
||||
/// Get all (or active) requests for a small group as of now or the specified date
|
||||
let forGroup (opts : PrayerRequestOptions) =
|
||||
let theDate = defaultArg opts.ListDate (SmallGroup.localDateNow opts.Clock opts.SmallGroup)
|
||||
let where, parameters =
|
||||
if opts.ActiveOnly then
|
||||
let asOf = NpgsqlParameter (
|
||||
"@asOf",
|
||||
(theDate.AtStartOfDayInZone(SmallGroup.timeZone opts.SmallGroup)
|
||||
- Duration.FromDays opts.SmallGroup.Preferences.DaysToExpire)
|
||||
.ToInstant ())
|
||||
" AND ( updated_date > @asOf
|
||||
OR expiration = @manual
|
||||
OR request_type = @longTerm
|
||||
OR request_type = @expecting)
|
||||
AND expiration <> @forced",
|
||||
[ "@asOf", Sql.parameter asOf
|
||||
"@manual", Sql.string (Expiration.toCode Manual)
|
||||
"@longTerm", Sql.string (PrayerRequestType.toCode LongTermRequest)
|
||||
"@expecting", Sql.string (PrayerRequestType.toCode Expecting)
|
||||
"@forced", Sql.string (Expiration.toCode Forced) ]
|
||||
else "", []
|
||||
Custom.list
|
||||
$"SELECT *
|
||||
FROM pt.prayer_request
|
||||
WHERE small_group_id = @groupId {where}
|
||||
ORDER BY {orderBy opts.SmallGroup.Preferences.RequestSort}
|
||||
{paginate opts.PageNumber opts.SmallGroup.Preferences.PageSize}"
|
||||
(("@groupId", Sql.uuid opts.SmallGroup.Id.Value) :: parameters) mapToPrayerRequest
|
||||
|
||||
/// Save a prayer request
|
||||
let save (req : PrayerRequest) =
|
||||
Custom.nonQuery
|
||||
"INSERT into pt.prayer_request (
|
||||
id, request_type, user_id, small_group_id, entered_date, updated_date, requestor, request_text,
|
||||
notify_chaplain, expiration
|
||||
) VALUES (
|
||||
@id, @type, @userId, @groupId, @entered, @updated, @requestor, @text,
|
||||
@notifyChaplain, @expiration
|
||||
) ON CONFLICT (id) DO UPDATE
|
||||
SET request_type = EXCLUDED.request_type,
|
||||
updated_date = EXCLUDED.updated_date,
|
||||
requestor = EXCLUDED.requestor,
|
||||
request_text = EXCLUDED.request_text,
|
||||
notify_chaplain = EXCLUDED.notify_chaplain,
|
||||
expiration = EXCLUDED.expiration"
|
||||
[ "@id", Sql.uuid req.Id.Value
|
||||
"@type", Sql.string (PrayerRequestType.toCode req.RequestType)
|
||||
"@userId", Sql.uuid req.UserId.Value
|
||||
"@groupId", Sql.uuid req.SmallGroupId.Value
|
||||
"@entered", Sql.parameter (NpgsqlParameter ("@entered", req.EnteredDate))
|
||||
"@updated", Sql.parameter (NpgsqlParameter ("@updated", req.UpdatedDate))
|
||||
"@requestor", Sql.stringOrNone req.Requestor
|
||||
"@text", Sql.string req.Text
|
||||
"@notifyChaplain", Sql.bool req.NotifyChaplain
|
||||
"@expiration", Sql.string (Expiration.toCode req.Expiration) ]
|
||||
|
||||
/// Search prayer requests for the given term
|
||||
let searchForGroup group searchTerm pageNbr =
|
||||
Custom.list
|
||||
$"SELECT * FROM pt.prayer_request WHERE small_group_id = @groupId AND request_text ILIKE @search
|
||||
UNION
|
||||
SELECT * FROM pt.prayer_request WHERE small_group_id = @groupId AND COALESCE(requestor, '') ILIKE @search
|
||||
ORDER BY {orderBy group.Preferences.RequestSort}
|
||||
{paginate pageNbr group.Preferences.PageSize}"
|
||||
[ "@groupId", Sql.uuid group.Id.Value; "@search", Sql.string $"%%%s{searchTerm}%%" ] mapToPrayerRequest
|
||||
|
||||
/// Retrieve a prayer request by its ID
|
||||
let tryById (reqId : PrayerRequestId) =
|
||||
Custom.single "SELECT * FROM pt.prayer_request WHERE id = @id" [ "@id", Sql.uuid reqId.Value ]
|
||||
mapToPrayerRequest
|
||||
|
||||
/// Update the expiration for the given prayer request
|
||||
let updateExpiration (req : PrayerRequest) withTime =
|
||||
let sql, parameters =
|
||||
if withTime then
|
||||
", updated_date = @updated",
|
||||
[ "@updated", Sql.parameter (NpgsqlParameter ("@updated", req.UpdatedDate)) ]
|
||||
else "", []
|
||||
Custom.nonQuery $"UPDATE pt.prayer_request SET expiration = @expiration{sql} WHERE id = @id"
|
||||
([ "@expiration", Sql.string (Expiration.toCode req.Expiration)
|
||||
"@id", Sql.uuid req.Id.Value ]
|
||||
|> List.append parameters)
|
||||
|
||||
|
||||
/// Functions to retrieve small group information
|
||||
module SmallGroups =
|
||||
|
||||
/// Count the number of small groups for a church
|
||||
let countByChurch (churchId : ChurchId) =
|
||||
Custom.scalar "SELECT COUNT(id) AS group_count FROM pt.small_group WHERE church_id = @churchId"
|
||||
[ "@churchId", Sql.uuid churchId.Value ] (fun row -> row.int "group_count")
|
||||
|
||||
/// Delete a small group by its ID
|
||||
let deleteById (groupId : SmallGroupId) = backgroundTask {
|
||||
let idParam = [ [ "@groupId", Sql.uuid groupId.Value ] ]
|
||||
let! _ =
|
||||
Configuration.dataSource ()
|
||||
|> Sql.fromDataSource
|
||||
|> Sql.executeTransactionAsync
|
||||
[ "DELETE FROM pt.prayer_request WHERE small_group_id = @groupId", idParam
|
||||
"DELETE FROM pt.user_small_group WHERE small_group_id = @groupId", idParam
|
||||
"DELETE FROM pt.list_preference WHERE small_group_id = @groupId", idParam
|
||||
"DELETE FROM pt.small_group WHERE id = @groupId", idParam ]
|
||||
()
|
||||
}
|
||||
|
||||
/// Get information for all small groups
|
||||
let infoForAll () =
|
||||
Custom.list
|
||||
"SELECT sg.id, sg.group_name, c.church_name, lp.time_zone_id, lp.is_public
|
||||
FROM pt.small_group sg
|
||||
INNER JOIN pt.church c ON c.id = sg.church_id
|
||||
INNER JOIN pt.list_preference lp ON lp.small_group_id = sg.id
|
||||
ORDER BY sg.group_name"
|
||||
[] mapToSmallGroupInfo
|
||||
|
||||
/// Get a list of small group IDs along with a description that includes the church name
|
||||
let listAll () =
|
||||
Custom.list
|
||||
"SELECT g.group_name, g.id, c.church_name
|
||||
FROM pt.small_group g
|
||||
INNER JOIN pt.church c ON c.id = g.church_id
|
||||
ORDER BY c.church_name, g.group_name"
|
||||
[] mapToSmallGroupItem
|
||||
|
||||
/// Get a list of small group IDs and descriptions for groups with a group password
|
||||
let listProtected () =
|
||||
Custom.list
|
||||
"SELECT g.group_name, g.id, c.church_name, lp.is_public
|
||||
FROM pt.small_group g
|
||||
INNER JOIN pt.church c ON c.id = g.church_id
|
||||
INNER JOIN pt.list_preference lp ON lp.small_group_id = g.id
|
||||
WHERE COALESCE(lp.group_password, '') <> ''
|
||||
ORDER BY c.church_name, g.group_name"
|
||||
[] mapToSmallGroupItem
|
||||
|
||||
/// Get a list of small group IDs and descriptions for groups that are public or have a group password
|
||||
let listPublicAndProtected () =
|
||||
Custom.list
|
||||
"SELECT g.group_name, g.id, c.church_name, lp.time_zone_id, lp.is_public
|
||||
FROM pt.small_group g
|
||||
INNER JOIN pt.church c ON c.id = g.church_id
|
||||
INNER JOIN pt.list_preference lp ON lp.small_group_id = g.id
|
||||
WHERE lp.is_public = TRUE
|
||||
OR COALESCE(lp.group_password, '') <> ''
|
||||
ORDER BY c.church_name, g.group_name"
|
||||
[] mapToSmallGroupInfo
|
||||
|
||||
/// Log on for a small group (includes list preferences)
|
||||
let logOn (groupId : SmallGroupId) password =
|
||||
Custom.single
|
||||
"SELECT sg.*, lp.*
|
||||
FROM pt.small_group sg
|
||||
INNER JOIN pt.list_preference lp ON lp.small_group_id = sg.id
|
||||
WHERE sg.id = @id
|
||||
AND lp.group_password = @password"
|
||||
[ "@id", Sql.uuid groupId.Value; "@password", Sql.string password ] mapToSmallGroupWithPreferences
|
||||
|
||||
/// Save a small group
|
||||
let save (group : SmallGroup) isNew = backgroundTask {
|
||||
let! _ =
|
||||
Configuration.dataSource ()
|
||||
|> Sql.fromDataSource
|
||||
|> Sql.executeTransactionAsync [
|
||||
"INSERT INTO pt.small_group (
|
||||
id, church_id, group_name
|
||||
) VALUES (
|
||||
@id, @churchId, @name
|
||||
) ON CONFLICT (id) DO UPDATE
|
||||
SET church_id = EXCLUDED.church_id,
|
||||
group_name = EXCLUDED.group_name",
|
||||
[ [ "@id", Sql.uuid group.Id.Value
|
||||
"@churchId", Sql.uuid group.ChurchId.Value
|
||||
"@name", Sql.string group.Name ] ]
|
||||
if isNew then
|
||||
"INSERT INTO pt.list_preference (small_group_id) VALUES (@id)",
|
||||
[ [ "@id", Sql.uuid group.Id.Value ] ]
|
||||
]
|
||||
()
|
||||
}
|
||||
|
||||
/// Save a small group's list preferences
|
||||
let savePreferences (pref : ListPreferences) =
|
||||
Custom.nonQuery
|
||||
"UPDATE pt.list_preference
|
||||
SET days_to_keep_new = @daysToKeepNew,
|
||||
days_to_expire = @daysToExpire,
|
||||
long_term_update_weeks = @longTermUpdateWeeks,
|
||||
email_from_name = @emailFromName,
|
||||
email_from_address = @emailFromAddress,
|
||||
fonts = @fonts,
|
||||
heading_color = @headingColor,
|
||||
line_color = @lineColor,
|
||||
heading_font_size = @headingFontSize,
|
||||
text_font_size = @textFontSize,
|
||||
request_sort = @requestSort,
|
||||
group_password = @groupPassword,
|
||||
default_email_type = @defaultEmailType,
|
||||
is_public = @isPublic,
|
||||
time_zone_id = @timeZoneId,
|
||||
page_size = @pageSize,
|
||||
as_of_date_display = @asOfDateDisplay
|
||||
WHERE small_group_id = @groupId"
|
||||
[ "@groupId", Sql.uuid pref.SmallGroupId.Value
|
||||
"@daysToKeepNew", Sql.int pref.DaysToKeepNew
|
||||
"@daysToExpire", Sql.int pref.DaysToExpire
|
||||
"@longTermUpdateWeeks", Sql.int pref.LongTermUpdateWeeks
|
||||
"@emailFromName", Sql.string pref.EmailFromName
|
||||
"@emailFromAddress", Sql.string pref.EmailFromAddress
|
||||
"@fonts", Sql.string pref.Fonts
|
||||
"@headingColor", Sql.string pref.HeadingColor
|
||||
"@lineColor", Sql.string pref.LineColor
|
||||
"@headingFontSize", Sql.int pref.HeadingFontSize
|
||||
"@textFontSize", Sql.int pref.TextFontSize
|
||||
"@requestSort", Sql.string (RequestSort.toCode pref.RequestSort)
|
||||
"@groupPassword", Sql.string pref.GroupPassword
|
||||
"@defaultEmailType", Sql.string (EmailFormat.toCode pref.DefaultEmailType)
|
||||
"@isPublic", Sql.bool pref.IsPublic
|
||||
"@timeZoneId", Sql.string (TimeZoneId.toString pref.TimeZoneId)
|
||||
"@pageSize", Sql.int pref.PageSize
|
||||
"@asOfDateDisplay", Sql.string (AsOfDateDisplay.toCode pref.AsOfDateDisplay) ]
|
||||
|
||||
/// Get a small group by its ID
|
||||
let tryById (groupId : SmallGroupId) =
|
||||
Custom.single "SELECT * FROM pt.small_group WHERE id = @id" [ "@id", Sql.uuid groupId.Value ] mapToSmallGroup
|
||||
|
||||
/// Get a small group by its ID with its list preferences populated
|
||||
let tryByIdWithPreferences (groupId : SmallGroupId) =
|
||||
Custom.single
|
||||
"SELECT sg.*, lp.*
|
||||
FROM pt.small_group sg
|
||||
INNER JOIN pt.list_preference lp ON lp.small_group_id = sg.id
|
||||
WHERE sg.id = @id"
|
||||
[ "@id", Sql.uuid groupId.Value ] mapToSmallGroupWithPreferences
|
||||
|
||||
|
||||
/// Functions to manipulate users
|
||||
module Users =
|
||||
|
||||
/// Retrieve all PrayerTracker users
|
||||
let all () =
|
||||
Custom.list "SELECT * FROM pt.pt_user ORDER BY last_name, first_name" [] mapToUser
|
||||
|
||||
/// Count the number of users for a church
|
||||
let countByChurch (churchId : ChurchId) =
|
||||
Custom.scalar
|
||||
"SELECT COUNT(u.id) AS user_count
|
||||
FROM pt.pt_user u
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM pt.user_small_group usg
|
||||
INNER JOIN pt.small_group sg ON sg.id = usg.small_group_id
|
||||
WHERE usg.user_id = u.id
|
||||
AND sg.church_id = @churchId)"
|
||||
[ "@churchId", Sql.uuid churchId.Value ] (fun row -> row.int "user_count")
|
||||
|
||||
/// Count the number of users for a small group
|
||||
let countByGroup (groupId : SmallGroupId) =
|
||||
Custom.scalar "SELECT COUNT(user_id) AS user_count FROM pt.user_small_group WHERE small_group_id = @groupId"
|
||||
[ "@groupId", Sql.uuid groupId.Value ] (fun row -> row.int "user_count")
|
||||
|
||||
/// Delete a user by its database ID
|
||||
let deleteById (userId : UserId) =
|
||||
Custom.nonQuery "DELETE FROM pt.pt_user WHERE id = @id" [ "@id", Sql.uuid userId.Value ]
|
||||
|
||||
/// Get the IDs of the small groups for which the given user is authorized
|
||||
let groupIdsByUserId (userId : UserId) =
|
||||
Custom.list "SELECT small_group_id FROM pt.user_small_group WHERE user_id = @id"
|
||||
[ "@id", Sql.uuid userId.Value ] (fun row -> SmallGroupId (row.uuid "small_group_id"))
|
||||
|
||||
/// Get a list of users authorized to administer the given small group
|
||||
let listByGroupId (groupId : SmallGroupId) =
|
||||
Custom.list
|
||||
"SELECT u.*
|
||||
FROM pt.pt_user u
|
||||
INNER JOIN pt.user_small_group usg ON usg.user_id = u.id
|
||||
WHERE usg.small_group_id = @groupId
|
||||
ORDER BY u.last_name, u.first_name"
|
||||
[ "@groupId", Sql.uuid groupId.Value ] mapToUser
|
||||
|
||||
/// Save a user's information
|
||||
let save (user : User) =
|
||||
Custom.nonQuery
|
||||
"INSERT INTO pt.pt_user (
|
||||
id, first_name, last_name, email, is_admin, password_hash
|
||||
) VALUES (
|
||||
@id, @firstName, @lastName, @email, @isAdmin, @passwordHash
|
||||
) ON CONFLICT (id) DO UPDATE
|
||||
SET first_name = EXCLUDED.first_name,
|
||||
last_name = EXCLUDED.last_name,
|
||||
email = EXCLUDED.email,
|
||||
is_admin = EXCLUDED.is_admin,
|
||||
password_hash = EXCLUDED.password_hash"
|
||||
[ "@id", Sql.uuid user.Id.Value
|
||||
"@firstName", Sql.string user.FirstName
|
||||
"@lastName", Sql.string user.LastName
|
||||
"@email", Sql.string user.Email
|
||||
"@isAdmin", Sql.bool user.IsAdmin
|
||||
"@passwordHash", Sql.string user.PasswordHash ]
|
||||
|
||||
/// Find a user by its e-mail address and authorized small group
|
||||
let tryByEmailAndGroup email (groupId : SmallGroupId) =
|
||||
Custom.single
|
||||
"SELECT u.*
|
||||
FROM pt.pt_user u
|
||||
INNER JOIN pt.user_small_group usg ON usg.user_id = u.id AND usg.small_group_id = @groupId
|
||||
WHERE u.email = @email"
|
||||
[ "@email", Sql.string email; "@groupId", Sql.uuid groupId.Value ] mapToUser
|
||||
|
||||
/// Find a user by their database ID
|
||||
let tryById (userId : UserId) =
|
||||
Custom.single "SELECT * FROM pt.pt_user WHERE id = @id" [ "@id", Sql.uuid userId.Value ] mapToUser
|
||||
|
||||
/// Update a user's last seen date/time
|
||||
let updateLastSeen (userId : UserId) (now : Instant) =
|
||||
Custom.nonQuery "UPDATE pt.pt_user SET last_seen = @now WHERE id = @id"
|
||||
[ "@id", Sql.uuid userId.Value; "@now", Sql.parameter (NpgsqlParameter ("@now", now)) ]
|
||||
|
||||
/// Update a user's password hash
|
||||
let updatePassword (user : User) =
|
||||
Custom.nonQuery "UPDATE pt.pt_user SET password_hash = @passwordHash WHERE id = @id"
|
||||
[ "@id", Sql.uuid user.Id.Value; "@passwordHash", Sql.string user.PasswordHash ]
|
||||
|
||||
/// Update a user's authorized small groups
|
||||
let updateSmallGroups (userId : UserId) groupIds = backgroundTask {
|
||||
let! existingGroupIds = groupIdsByUserId userId
|
||||
let toAdd =
|
||||
groupIds |> List.filter (fun it -> existingGroupIds |> List.exists (fun grpId -> grpId = it) |> not)
|
||||
let toDelete =
|
||||
existingGroupIds |> List.filter (fun it -> groupIds |> List.exists (fun grpId -> grpId = it) |> not)
|
||||
let queries = seq {
|
||||
if not (List.isEmpty toAdd) then
|
||||
"INSERT INTO pt.user_small_group VALUES (@userId, @smallGroupId)",
|
||||
toAdd |> List.map (fun it -> [ "@userId", Sql.uuid userId.Value; "@smallGroupId", Sql.uuid it.Value ])
|
||||
if not (List.isEmpty toDelete) then
|
||||
"DELETE FROM pt.user_small_group WHERE user_id = @userId AND small_group_id = @smallGroupId",
|
||||
toDelete
|
||||
|> List.map (fun it -> [ "@userId", Sql.uuid userId.Value; "@smallGroupId", Sql.uuid it.Value ])
|
||||
}
|
||||
if not (Seq.isEmpty queries) then
|
||||
let! _ =
|
||||
Configuration.dataSource ()
|
||||
|> Sql.fromDataSource
|
||||
|> Sql.executeTransactionAsync (List.ofSeq queries)
|
||||
()
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
namespace PrayerTracker
|
||||
|
||||
open Microsoft.EntityFrameworkCore
|
||||
open PrayerTracker.Entities
|
||||
|
||||
/// EF Core data context for PrayerTracker
|
||||
[<AllowNullLiteral>]
|
||||
type AppDbContext (options : DbContextOptions<AppDbContext>) =
|
||||
inherit DbContext (options)
|
||||
|
||||
[<DefaultValue>]
|
||||
val mutable private churches : DbSet<Church>
|
||||
[<DefaultValue>]
|
||||
val mutable private members : DbSet<Member>
|
||||
[<DefaultValue>]
|
||||
val mutable private prayerRequests : DbSet<PrayerRequest>
|
||||
[<DefaultValue>]
|
||||
val mutable private preferences : DbSet<ListPreferences>
|
||||
[<DefaultValue>]
|
||||
val mutable private smallGroups : DbSet<SmallGroup>
|
||||
[<DefaultValue>]
|
||||
val mutable private timeZones : DbSet<TimeZone>
|
||||
[<DefaultValue>]
|
||||
val mutable private users : DbSet<User>
|
||||
[<DefaultValue>]
|
||||
val mutable private userGroupXref : DbSet<UserSmallGroup>
|
||||
|
||||
/// Churches
|
||||
member this.Churches
|
||||
with get() = this.churches
|
||||
and set v = this.churches <- v
|
||||
|
||||
/// Small group members
|
||||
member this.Members
|
||||
with get() = this.members
|
||||
and set v = this.members <- v
|
||||
|
||||
/// Prayer requests
|
||||
member this.PrayerRequests
|
||||
with get() = this.prayerRequests
|
||||
and set v = this.prayerRequests <- v
|
||||
|
||||
/// Request list preferences (by class)
|
||||
member this.Preferences
|
||||
with get() = this.preferences
|
||||
and set v = this.preferences <- v
|
||||
|
||||
/// Small groups
|
||||
member this.SmallGroups
|
||||
with get() = this.smallGroups
|
||||
and set v = this.smallGroups <- v
|
||||
|
||||
/// Time zones
|
||||
member this.TimeZones
|
||||
with get() = this.timeZones
|
||||
and set v = this.timeZones <- v
|
||||
|
||||
/// Users
|
||||
member this.Users
|
||||
with get() = this.users
|
||||
and set v = this.users <- v
|
||||
|
||||
/// User / small group cross-reference
|
||||
member this.UserGroupXref
|
||||
with get() = this.userGroupXref
|
||||
and set v = this.userGroupXref <- v
|
||||
|
||||
/// F#-style async for saving changes
|
||||
member this.AsyncSaveChanges () =
|
||||
this.SaveChangesAsync () |> Async.AwaitTask
|
||||
|
||||
override __.OnModelCreating (modelBuilder : ModelBuilder) =
|
||||
base.OnModelCreating modelBuilder
|
||||
|
||||
modelBuilder.HasDefaultSchema "pt" |> ignore
|
||||
|
||||
[ Church.configureEF
|
||||
ListPreferences.configureEF
|
||||
Member.configureEF
|
||||
PrayerRequest.configureEF
|
||||
SmallGroup.configureEF
|
||||
TimeZone.configureEF
|
||||
User.configureEF
|
||||
UserSmallGroup.configureEF
|
||||
]
|
||||
|> List.iter (fun x -> x modelBuilder)
|
@ -1,381 +0,0 @@
|
||||
[<AutoOpen>]
|
||||
module PrayerTracker.DataAccess
|
||||
|
||||
open FSharp.Control.Tasks.ContextInsensitive
|
||||
open Microsoft.EntityFrameworkCore
|
||||
open PrayerTracker.Entities
|
||||
open System.Collections.Generic
|
||||
open System.Linq
|
||||
|
||||
[<AutoOpen>]
|
||||
module private Helpers =
|
||||
|
||||
open Microsoft.FSharpLu
|
||||
open System.Threading.Tasks
|
||||
|
||||
/// Central place to append sort criteria for prayer request queries
|
||||
let reqSort sort (q : IQueryable<PrayerRequest>) =
|
||||
match sort with
|
||||
| SortByDate ->
|
||||
query {
|
||||
for req in q do
|
||||
sortByDescending req.updatedDate
|
||||
thenByDescending req.enteredDate
|
||||
thenBy req.requestor
|
||||
}
|
||||
| SortByRequestor ->
|
||||
query {
|
||||
for req in q do
|
||||
sortBy req.requestor
|
||||
thenByDescending req.updatedDate
|
||||
thenByDescending req.enteredDate
|
||||
}
|
||||
|
||||
/// Convert a possibly-null object to an option, wrapped as a task
|
||||
let toOptionTask<'T> (item : 'T) = (Option.fromObject >> Task.FromResult) item
|
||||
|
||||
|
||||
type AppDbContext with
|
||||
|
||||
(*-- DISCONNECTED DATA EXTENSIONS --*)
|
||||
|
||||
/// Add an entity entry to the tracked data context with the status of Added
|
||||
member this.AddEntry<'TEntity when 'TEntity : not struct> (e : 'TEntity) =
|
||||
this.Entry<'TEntity>(e).State <- EntityState.Added
|
||||
|
||||
/// Add an entity entry to the tracked data context with the status of Updated
|
||||
member this.UpdateEntry<'TEntity when 'TEntity : not struct> (e : 'TEntity) =
|
||||
this.Entry<'TEntity>(e).State <- EntityState.Modified
|
||||
|
||||
/// Add an entity entry to the tracked data context with the status of Deleted
|
||||
member this.RemoveEntry<'TEntity when 'TEntity : not struct> (e : 'TEntity) =
|
||||
this.Entry<'TEntity>(e).State <- EntityState.Deleted
|
||||
|
||||
(*-- CHURCH EXTENSIONS --*)
|
||||
|
||||
/// Find a church by its Id
|
||||
member this.TryChurchById cId =
|
||||
query {
|
||||
for ch in this.Churches.AsNoTracking () do
|
||||
where (ch.churchId = cId)
|
||||
exactlyOneOrDefault
|
||||
}
|
||||
|> toOptionTask
|
||||
|
||||
/// Find all churches
|
||||
member this.AllChurches () =
|
||||
task {
|
||||
let q =
|
||||
query {
|
||||
for ch in this.Churches.AsNoTracking () do
|
||||
sortBy ch.name
|
||||
}
|
||||
let! churches = q.ToListAsync ()
|
||||
return List.ofSeq churches
|
||||
}
|
||||
|
||||
(*-- MEMBER EXTENSIONS --*)
|
||||
|
||||
/// Get a small group member by its Id
|
||||
member this.TryMemberById mId =
|
||||
query {
|
||||
for mbr in this.Members.AsNoTracking () do
|
||||
where (mbr.memberId = mId)
|
||||
select mbr
|
||||
exactlyOneOrDefault
|
||||
}
|
||||
|> toOptionTask
|
||||
|
||||
/// Find all members for a small group
|
||||
member this.AllMembersForSmallGroup gId =
|
||||
task {
|
||||
let q =
|
||||
query {
|
||||
for mbr in this.Members.AsNoTracking () do
|
||||
where (mbr.smallGroupId = gId)
|
||||
sortBy mbr.memberName
|
||||
}
|
||||
let! mbrs = q.ToListAsync ()
|
||||
return List.ofSeq mbrs
|
||||
}
|
||||
|
||||
/// Count members for a small group
|
||||
member this.CountMembersForSmallGroup gId =
|
||||
this.Members.CountAsync (fun m -> m.smallGroupId = gId)
|
||||
|
||||
(*-- PRAYER REQUEST EXTENSIONS --*)
|
||||
|
||||
/// Get a prayer request by its Id
|
||||
member this.TryRequestById reqId =
|
||||
query {
|
||||
for req in this.PrayerRequests.AsNoTracking () do
|
||||
where (req.prayerRequestId = reqId)
|
||||
exactlyOneOrDefault
|
||||
}
|
||||
|> toOptionTask
|
||||
|
||||
/// Get all (or active) requests for a small group as of now or the specified date
|
||||
// TODO: why not make this an async list like the rest of these methods?
|
||||
member this.AllRequestsForSmallGroup (grp : SmallGroup) clock listDate activeOnly pageNbr : PrayerRequest seq =
|
||||
let theDate = match listDate with Some dt -> dt | _ -> grp.localDateNow clock
|
||||
query {
|
||||
for req in this.PrayerRequests.AsNoTracking () do
|
||||
where (req.smallGroupId = grp.smallGroupId)
|
||||
}
|
||||
|> function
|
||||
| q when activeOnly ->
|
||||
let asOf = theDate.AddDays(-(float grp.preferences.daysToExpire)).Date
|
||||
query {
|
||||
for req in q do
|
||||
where ( ( req.updatedDate > asOf
|
||||
|| req.expiration = Manual
|
||||
|| req.requestType = LongTermRequest
|
||||
|| req.requestType = Expecting)
|
||||
&& req.expiration <> Forced)
|
||||
}
|
||||
| q -> q
|
||||
|> reqSort grp.preferences.requestSort
|
||||
|> function
|
||||
| q ->
|
||||
match activeOnly with
|
||||
| true -> upcast q
|
||||
| false ->
|
||||
upcast query {
|
||||
for req in q do
|
||||
skip ((pageNbr - 1) * grp.preferences.pageSize)
|
||||
take grp.preferences.pageSize
|
||||
}
|
||||
|
||||
/// Count prayer requests for the given small group Id
|
||||
member this.CountRequestsBySmallGroup gId =
|
||||
this.PrayerRequests.CountAsync (fun pr -> pr.smallGroupId = gId)
|
||||
|
||||
/// Count prayer requests for the given church Id
|
||||
member this.CountRequestsByChurch cId =
|
||||
this.PrayerRequests.CountAsync (fun pr -> pr.smallGroup.churchId = cId)
|
||||
|
||||
/// Get all (or active) requests for a small group as of now or the specified date
|
||||
// TODO: same as above...
|
||||
member this.SearchRequestsForSmallGroup (grp : SmallGroup) (searchTerm : string) pageNbr : PrayerRequest seq =
|
||||
let pgSz = grp.preferences.pageSize
|
||||
let toSkip = (pageNbr - 1) * pgSz
|
||||
let sql =
|
||||
""" SELECT * FROM pt."PrayerRequest" WHERE "SmallGroupId" = {0} AND "Text" ILIKE {1}
|
||||
UNION
|
||||
SELECT * FROM pt."PrayerRequest" WHERE "SmallGroupId" = {0} AND COALESCE("Requestor", '') ILIKE {1}"""
|
||||
let like = sprintf "%%%s%%"
|
||||
this.PrayerRequests.FromSqlRaw(sql, grp.smallGroupId, like searchTerm).AsNoTracking ()
|
||||
|> reqSort grp.preferences.requestSort
|
||||
|> function
|
||||
| q ->
|
||||
upcast query {
|
||||
for req in q do
|
||||
skip toSkip
|
||||
take pgSz
|
||||
}
|
||||
|
||||
(*-- SMALL GROUP EXTENSIONS --*)
|
||||
|
||||
/// Find a small group by its Id
|
||||
member this.TryGroupById gId =
|
||||
query {
|
||||
for grp in this.SmallGroups.AsNoTracking().Include (fun sg -> sg.preferences) do
|
||||
where (grp.smallGroupId = gId)
|
||||
exactlyOneOrDefault
|
||||
}
|
||||
|> toOptionTask
|
||||
|
||||
/// Get small groups that are public or password protected
|
||||
member this.PublicAndProtectedGroups () =
|
||||
task {
|
||||
let smallGroups = this.SmallGroups.AsNoTracking().Include(fun sg -> sg.preferences).Include (fun sg -> sg.church)
|
||||
let q =
|
||||
query {
|
||||
for grp in smallGroups do
|
||||
where ( grp.preferences.isPublic
|
||||
|| (grp.preferences.groupPassword <> null && grp.preferences.groupPassword <> ""))
|
||||
sortBy grp.church.name
|
||||
thenBy grp.name
|
||||
}
|
||||
let! grps = q.ToListAsync ()
|
||||
return List.ofSeq grps
|
||||
}
|
||||
|
||||
/// Get small groups that are password protected
|
||||
member this.ProtectedGroups () =
|
||||
task {
|
||||
let q =
|
||||
query {
|
||||
for grp in this.SmallGroups.AsNoTracking().Include (fun sg -> sg.church) do
|
||||
where (grp.preferences.groupPassword <> null && grp.preferences.groupPassword <> "")
|
||||
sortBy grp.church.name
|
||||
thenBy grp.name
|
||||
}
|
||||
let! grps = q.ToListAsync ()
|
||||
return List.ofSeq grps
|
||||
}
|
||||
|
||||
/// Get all small groups
|
||||
member this.AllGroups () =
|
||||
task {
|
||||
let! grps =
|
||||
this.SmallGroups.AsNoTracking()
|
||||
.Include(fun sg -> sg.church)
|
||||
.Include(fun sg -> sg.preferences)
|
||||
.Include(fun sg -> sg.preferences.timeZone)
|
||||
.OrderBy(fun sg -> sg.name)
|
||||
.ToListAsync ()
|
||||
return List.ofSeq grps
|
||||
}
|
||||
|
||||
/// Get a small group list by their Id, with their church prepended to their name
|
||||
member this.GroupList () =
|
||||
task {
|
||||
let q =
|
||||
query {
|
||||
for grp in this.SmallGroups.AsNoTracking().Include (fun sg -> sg.church) do
|
||||
sortBy grp.church.name
|
||||
thenBy grp.name
|
||||
}
|
||||
let! grps = q.ToListAsync ()
|
||||
return grps
|
||||
|> Seq.map (fun grp -> grp.smallGroupId.ToString "N", $"{grp.church.name} | {grp.name}")
|
||||
|> List.ofSeq
|
||||
}
|
||||
|
||||
/// Log on a small group
|
||||
member this.TryGroupLogOnByPassword gId pw =
|
||||
task {
|
||||
match! this.TryGroupById gId with
|
||||
| None -> return None
|
||||
| Some grp ->
|
||||
match pw = grp.preferences.groupPassword with
|
||||
| true -> return Some grp
|
||||
| _ -> return None
|
||||
}
|
||||
|
||||
/// Check a cookie log on for a small group
|
||||
member this.TryGroupLogOnByCookie gId pwHash (hasher : string -> string) =
|
||||
task {
|
||||
match! this.TryGroupById gId with
|
||||
| None -> return None
|
||||
| Some grp ->
|
||||
match pwHash = hasher grp.preferences.groupPassword with
|
||||
| true -> return Some grp
|
||||
| _ -> return None
|
||||
}
|
||||
|
||||
/// Count small groups for the given church Id
|
||||
member this.CountGroupsByChurch cId =
|
||||
this.SmallGroups.CountAsync (fun sg -> sg.churchId = cId)
|
||||
|
||||
(*-- TIME ZONE EXTENSIONS --*)
|
||||
|
||||
/// Get a time zone by its Id
|
||||
member this.TryTimeZoneById tzId =
|
||||
query {
|
||||
for tz in this.TimeZones do
|
||||
where (tz.timeZoneId = tzId)
|
||||
exactlyOneOrDefault
|
||||
}
|
||||
|> toOptionTask
|
||||
|
||||
/// Get all time zones
|
||||
member this.AllTimeZones () =
|
||||
task {
|
||||
let q =
|
||||
query {
|
||||
for tz in this.TimeZones do
|
||||
sortBy tz.sortOrder
|
||||
}
|
||||
let! tzs = q.ToListAsync ()
|
||||
return List.ofSeq tzs
|
||||
}
|
||||
|
||||
(*-- USER EXTENSIONS --*)
|
||||
|
||||
/// Find a user by its Id
|
||||
member this.TryUserById uId =
|
||||
query {
|
||||
for usr in this.Users.AsNoTracking () do
|
||||
where (usr.userId = uId)
|
||||
exactlyOneOrDefault
|
||||
}
|
||||
|> toOptionTask
|
||||
|
||||
/// Find a user by its e-mail address and authorized small group
|
||||
member this.TryUserByEmailAndGroup email gId =
|
||||
query {
|
||||
for usr in this.Users.AsNoTracking () do
|
||||
where (usr.emailAddress = email && usr.smallGroups.Any (fun xref -> xref.smallGroupId = gId))
|
||||
exactlyOneOrDefault
|
||||
}
|
||||
|> toOptionTask
|
||||
|
||||
/// Find a user by its Id (tracked entity), eagerly loading the user's groups
|
||||
member this.TryUserByIdWithGroups uId =
|
||||
query {
|
||||
for usr in this.Users.AsNoTracking().Include (fun u -> u.smallGroups) do
|
||||
where (usr.userId = uId)
|
||||
exactlyOneOrDefault
|
||||
}
|
||||
|> toOptionTask
|
||||
|
||||
/// Get a list of all users
|
||||
member this.AllUsers () =
|
||||
task {
|
||||
let q =
|
||||
query {
|
||||
for usr in this.Users.AsNoTracking () do
|
||||
sortBy usr.lastName
|
||||
thenBy usr.firstName
|
||||
}
|
||||
let! usrs = q.ToListAsync ()
|
||||
return List.ofSeq usrs
|
||||
}
|
||||
|
||||
/// Get all PrayerTracker users as members (used to send e-mails)
|
||||
member this.AllUsersAsMembers () =
|
||||
task {
|
||||
let q =
|
||||
query {
|
||||
for usr in this.Users.AsNoTracking () do
|
||||
sortBy usr.lastName
|
||||
thenBy usr.firstName
|
||||
select { Member.empty with email = usr.emailAddress; memberName = usr.fullName }
|
||||
}
|
||||
let! usrs = q.ToListAsync ()
|
||||
return List.ofSeq usrs
|
||||
}
|
||||
|
||||
/// Find a user based on their credentials
|
||||
member this.TryUserLogOnByPassword email pwHash gId =
|
||||
query {
|
||||
for usr in this.Users.AsNoTracking () do
|
||||
where ( usr.emailAddress = email
|
||||
&& usr.passwordHash = pwHash
|
||||
&& usr.smallGroups.Any (fun xref -> xref.smallGroupId = gId))
|
||||
exactlyOneOrDefault
|
||||
}
|
||||
|> toOptionTask
|
||||
|
||||
/// Find a user based on credentials stored in a cookie
|
||||
member this.TryUserLogOnByCookie uId gId pwHash =
|
||||
task {
|
||||
match! this.TryUserByIdWithGroups uId with
|
||||
| None -> return None
|
||||
| Some usr ->
|
||||
match pwHash = usr.passwordHash && usr.smallGroups |> Seq.exists (fun xref -> xref.smallGroupId = gId) with
|
||||
| true ->
|
||||
this.Entry<User>(usr).State <- EntityState.Detached
|
||||
return Some { usr with passwordHash = ""; salt = None; smallGroups = List<UserSmallGroup>() }
|
||||
| _ -> return None
|
||||
}
|
||||
|
||||
/// Count the number of users for a small group
|
||||
member this.CountUsersBySmallGroup gId =
|
||||
this.Users.CountAsync (fun u -> u.smallGroups.Any (fun xref -> xref.smallGroupId = gId))
|
||||
|
||||
/// Count the number of users for a church
|
||||
member this.CountUsersByChurch cId =
|
||||
this.Users.CountAsync (fun u -> u.smallGroups.Any (fun xref -> xref.smallGroup.churchId = cId))
|
193
src/PrayerTracker.Data/DistributedCache.fs
Normal file
193
src/PrayerTracker.Data/DistributedCache.fs
Normal file
@ -0,0 +1,193 @@
|
||||
namespace PrayerTracker.Data
|
||||
|
||||
open System.Threading
|
||||
open System.Threading.Tasks
|
||||
open Microsoft.Extensions.Caching.Distributed
|
||||
open NodaTime
|
||||
open Npgsql
|
||||
open Npgsql.FSharp
|
||||
|
||||
/// Helper types and functions for the cache
|
||||
[<AutoOpen>]
|
||||
module private CacheHelpers =
|
||||
|
||||
open System
|
||||
|
||||
/// The cache entry
|
||||
type Entry =
|
||||
{ /// The ID of the cache entry
|
||||
Id : string
|
||||
|
||||
/// The value to be cached
|
||||
Payload : byte[]
|
||||
|
||||
/// When this entry will expire
|
||||
ExpireAt : Instant
|
||||
|
||||
/// The duration by which the expiration should be pushed out when being refreshed
|
||||
SlidingExpiration : Duration option
|
||||
|
||||
/// The must-expire-by date/time for the cache entry
|
||||
AbsoluteExpiration : Instant option
|
||||
}
|
||||
|
||||
/// Run a task synchronously
|
||||
let sync<'T> (it : Task<'T>) = it |> (Async.AwaitTask >> Async.RunSynchronously)
|
||||
|
||||
/// Get the current instant
|
||||
let getNow () = SystemClock.Instance.GetCurrentInstant ()
|
||||
|
||||
/// Create a parameter for the expire-at time
|
||||
let expireParam (it : Instant) =
|
||||
"@expireAt", Sql.parameter (NpgsqlParameter ("@expireAt", it))
|
||||
|
||||
/// Create a parameter for a possibly-missing NodaTime type
|
||||
let optParam<'T> name (it : 'T option) =
|
||||
let p = NpgsqlParameter ($"@%s{name}", if Option.isSome it then box it.Value else DBNull.Value)
|
||||
p.ParameterName, Sql.parameter p
|
||||
|
||||
|
||||
open BitBadger.Documents.Postgres
|
||||
|
||||
/// A distributed cache implementation in PostgreSQL used to handle sessions for myWebLog
|
||||
type DistributedCache () =
|
||||
|
||||
// ~~~ INITIALIZATION ~~~
|
||||
|
||||
do
|
||||
task {
|
||||
let! exists =
|
||||
Custom.scalar
|
||||
$"SELECT EXISTS
|
||||
(SELECT 1 FROM pg_tables WHERE schemaname = 'public' AND tablename = 'session')
|
||||
AS does_exist"
|
||||
[] (fun row -> row.bool "does_exist")
|
||||
if not exists then
|
||||
do! Custom.nonQuery
|
||||
"CREATE TABLE session (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
payload BYTEA NOT NULL,
|
||||
expire_at TIMESTAMPTZ NOT NULL,
|
||||
sliding_expiration INTERVAL,
|
||||
absolute_expiration TIMESTAMPTZ);
|
||||
CREATE INDEX idx_session_expiration ON session (expire_at)" []
|
||||
} |> sync
|
||||
|
||||
// ~~~ SUPPORT FUNCTIONS ~~~
|
||||
|
||||
/// Get an entry, updating it for sliding expiration
|
||||
let getEntry key = backgroundTask {
|
||||
let idParam = "@id", Sql.string key
|
||||
let! tryEntry =
|
||||
Custom.single "SELECT * FROM session WHERE id = @id" [ idParam ]
|
||||
(fun row ->
|
||||
{ Id = row.string "id"
|
||||
Payload = row.bytea "payload"
|
||||
ExpireAt = row.fieldValue<Instant> "expire_at"
|
||||
SlidingExpiration = row.fieldValueOrNone<Duration> "sliding_expiration"
|
||||
AbsoluteExpiration = row.fieldValueOrNone<Instant> "absolute_expiration" })
|
||||
match tryEntry with
|
||||
| Some entry ->
|
||||
let now = getNow ()
|
||||
let slideExp = defaultArg entry.SlidingExpiration Duration.MinValue
|
||||
let absExp = defaultArg entry.AbsoluteExpiration Instant.MinValue
|
||||
let needsRefresh, item =
|
||||
if entry.ExpireAt = absExp then false, entry
|
||||
elif slideExp = Duration.MinValue && absExp = Instant.MinValue then false, entry
|
||||
elif absExp > Instant.MinValue && entry.ExpireAt.Plus slideExp > absExp then
|
||||
true, { entry with ExpireAt = absExp }
|
||||
else true, { entry with ExpireAt = now.Plus slideExp }
|
||||
if needsRefresh then
|
||||
do! Custom.nonQuery "UPDATE session SET expire_at = @expireAt WHERE id = @id"
|
||||
[ expireParam item.ExpireAt; idParam ]
|
||||
return if item.ExpireAt > now then Some entry else None
|
||||
| None -> return None
|
||||
}
|
||||
|
||||
/// The last time expired entries were purged (runs every 30 minutes)
|
||||
let mutable lastPurge = Instant.MinValue
|
||||
|
||||
/// Purge expired entries every 30 minutes
|
||||
let purge () = backgroundTask {
|
||||
let now = getNow ()
|
||||
if lastPurge.Plus (Duration.FromMinutes 30L) < now then
|
||||
do! Custom.nonQuery "DELETE FROM session WHERE expire_at < @expireAt" [ expireParam now ]
|
||||
lastPurge <- now
|
||||
}
|
||||
|
||||
/// Remove a cache entry
|
||||
let removeEntry key =
|
||||
Custom.nonQuery "DELETE FROM session WHERE id = @id" [ "@id", Sql.string key ]
|
||||
|
||||
/// Save an entry
|
||||
let saveEntry (opts : DistributedCacheEntryOptions) key payload =
|
||||
let now = getNow ()
|
||||
let expireAt, slideExp, absExp =
|
||||
if opts.SlidingExpiration.HasValue then
|
||||
let slide = Duration.FromTimeSpan opts.SlidingExpiration.Value
|
||||
now.Plus slide, Some slide, None
|
||||
elif opts.AbsoluteExpiration.HasValue then
|
||||
let exp = Instant.FromDateTimeOffset opts.AbsoluteExpiration.Value
|
||||
exp, None, Some exp
|
||||
elif opts.AbsoluteExpirationRelativeToNow.HasValue then
|
||||
let exp = now.Plus (Duration.FromTimeSpan opts.AbsoluteExpirationRelativeToNow.Value)
|
||||
exp, None, Some exp
|
||||
else
|
||||
// Default to 2 hour sliding expiration
|
||||
let slide = Duration.FromHours 2
|
||||
now.Plus slide, Some slide, None
|
||||
Custom.nonQuery
|
||||
"INSERT INTO session (
|
||||
id, payload, expire_at, sliding_expiration, absolute_expiration
|
||||
) VALUES (
|
||||
@id, @payload, @expireAt, @slideExp, @absExp
|
||||
) ON CONFLICT (id) DO UPDATE
|
||||
SET payload = EXCLUDED.payload,
|
||||
expire_at = EXCLUDED.expire_at,
|
||||
sliding_expiration = EXCLUDED.sliding_expiration,
|
||||
absolute_expiration = EXCLUDED.absolute_expiration"
|
||||
[ "@id", Sql.string key
|
||||
"@payload", Sql.bytea payload
|
||||
expireParam expireAt
|
||||
optParam "slideExp" slideExp
|
||||
optParam "absExp" absExp ]
|
||||
|
||||
// ~~~ IMPLEMENTATION FUNCTIONS ~~~
|
||||
|
||||
/// Retrieve the data for a cache entry
|
||||
let get key (_ : CancellationToken) = backgroundTask {
|
||||
match! getEntry key with
|
||||
| Some entry ->
|
||||
do! purge ()
|
||||
return entry.Payload
|
||||
| None -> return null
|
||||
}
|
||||
|
||||
/// Refresh an entry
|
||||
let refresh key (cancelToken : CancellationToken) = backgroundTask {
|
||||
let! _ = get key cancelToken
|
||||
()
|
||||
}
|
||||
|
||||
/// Remove an entry
|
||||
let remove key (_ : CancellationToken) = backgroundTask {
|
||||
do! removeEntry key
|
||||
do! purge ()
|
||||
}
|
||||
|
||||
/// Set an entry
|
||||
let set key value options (_ : CancellationToken) = backgroundTask {
|
||||
do! saveEntry options key value
|
||||
do! purge ()
|
||||
}
|
||||
|
||||
interface IDistributedCache with
|
||||
member this.Get key = get key CancellationToken.None |> sync
|
||||
member this.GetAsync (key, token) = get key token
|
||||
member this.Refresh key = refresh key CancellationToken.None |> sync
|
||||
member this.RefreshAsync (key, token) = refresh key token
|
||||
member this.Remove key = remove key CancellationToken.None |> sync
|
||||
member this.RemoveAsync (key, token) = remove key token
|
||||
member this.Set (key, value, options) = set key value options CancellationToken.None |> sync
|
||||
member this.SetAsync (key, value, options, token) = set key value options token
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,513 +0,0 @@
|
||||
namespace PrayerTracker.Migrations
|
||||
|
||||
open Microsoft.EntityFrameworkCore
|
||||
open Microsoft.EntityFrameworkCore.Infrastructure
|
||||
open Microsoft.EntityFrameworkCore.Migrations
|
||||
open Microsoft.EntityFrameworkCore.Migrations.Operations
|
||||
open Microsoft.EntityFrameworkCore.Migrations.Operations.Builders
|
||||
open Npgsql.EntityFrameworkCore.PostgreSQL.Metadata
|
||||
open PrayerTracker
|
||||
open PrayerTracker.Entities
|
||||
open System
|
||||
|
||||
|
||||
type ChurchTable =
|
||||
{ churchId : OperationBuilder<AddColumnOperation>
|
||||
city : OperationBuilder<AddColumnOperation>
|
||||
hasInterface : OperationBuilder<AddColumnOperation>
|
||||
interfaceAddress : OperationBuilder<AddColumnOperation>
|
||||
name : OperationBuilder<AddColumnOperation>
|
||||
st : OperationBuilder<AddColumnOperation>
|
||||
}
|
||||
|
||||
type ListPreferencesTable =
|
||||
{ smallGroupId : OperationBuilder<AddColumnOperation>
|
||||
daysToExpire : OperationBuilder<AddColumnOperation>
|
||||
daysToKeepNew : OperationBuilder<AddColumnOperation>
|
||||
defaultEmailType : OperationBuilder<AddColumnOperation>
|
||||
emailFromAddress : OperationBuilder<AddColumnOperation>
|
||||
emailFromName : OperationBuilder<AddColumnOperation>
|
||||
groupPassword : OperationBuilder<AddColumnOperation>
|
||||
headingColor : OperationBuilder<AddColumnOperation>
|
||||
headingFontSize : OperationBuilder<AddColumnOperation>
|
||||
isPublic : OperationBuilder<AddColumnOperation>
|
||||
lineColor : OperationBuilder<AddColumnOperation>
|
||||
listFonts : OperationBuilder<AddColumnOperation>
|
||||
longTermUpdateWeeks : OperationBuilder<AddColumnOperation>
|
||||
requestSort : OperationBuilder<AddColumnOperation>
|
||||
textFontSize : OperationBuilder<AddColumnOperation>
|
||||
timeZoneId : OperationBuilder<AddColumnOperation>
|
||||
pageSize : OperationBuilder<AddColumnOperation>
|
||||
asOfDateDisplay : OperationBuilder<AddColumnOperation>
|
||||
}
|
||||
|
||||
type MemberTable =
|
||||
{ memberId : OperationBuilder<AddColumnOperation>
|
||||
email : OperationBuilder<AddColumnOperation>
|
||||
format : OperationBuilder<AddColumnOperation>
|
||||
memberName : OperationBuilder<AddColumnOperation>
|
||||
smallGroupId : OperationBuilder<AddColumnOperation>
|
||||
}
|
||||
|
||||
type PrayerRequestTable =
|
||||
{ prayerRequestId : OperationBuilder<AddColumnOperation>
|
||||
enteredDate : OperationBuilder<AddColumnOperation>
|
||||
expiration : OperationBuilder<AddColumnOperation>
|
||||
notifyChaplain : OperationBuilder<AddColumnOperation>
|
||||
requestType : OperationBuilder<AddColumnOperation>
|
||||
requestor : OperationBuilder<AddColumnOperation>
|
||||
smallGroupId : OperationBuilder<AddColumnOperation>
|
||||
text : OperationBuilder<AddColumnOperation>
|
||||
updatedDate : OperationBuilder<AddColumnOperation>
|
||||
userId : OperationBuilder<AddColumnOperation>
|
||||
}
|
||||
|
||||
type SmallGroupTable =
|
||||
{ smallGroupId : OperationBuilder<AddColumnOperation>
|
||||
churchId : OperationBuilder<AddColumnOperation>
|
||||
name : OperationBuilder<AddColumnOperation>
|
||||
}
|
||||
|
||||
type TimeZoneTable =
|
||||
{ timeZoneId : OperationBuilder<AddColumnOperation>
|
||||
description : OperationBuilder<AddColumnOperation>
|
||||
isActive : OperationBuilder<AddColumnOperation>
|
||||
sortOrder : OperationBuilder<AddColumnOperation>
|
||||
}
|
||||
|
||||
type UserSmallGroupTable =
|
||||
{ userId : OperationBuilder<AddColumnOperation>
|
||||
smallGroupId : OperationBuilder<AddColumnOperation>
|
||||
}
|
||||
|
||||
type UserTable =
|
||||
{ userId : OperationBuilder<AddColumnOperation>
|
||||
emailAddress : OperationBuilder<AddColumnOperation>
|
||||
firstName : OperationBuilder<AddColumnOperation>
|
||||
isAdmin : OperationBuilder<AddColumnOperation>
|
||||
lastName : OperationBuilder<AddColumnOperation>
|
||||
passwordHash : OperationBuilder<AddColumnOperation>
|
||||
salt : OperationBuilder<AddColumnOperation>
|
||||
}
|
||||
|
||||
[<DbContext (typeof<AppDbContext>)>]
|
||||
[<Migration "20161217153124_InitialDatabase">]
|
||||
type InitialDatabase () =
|
||||
inherit Migration ()
|
||||
override __.Up (migrationBuilder : MigrationBuilder) =
|
||||
migrationBuilder.EnsureSchema (name = "pt")
|
||||
|> ignore
|
||||
|
||||
migrationBuilder.CreateTable (
|
||||
name = "Church",
|
||||
schema = "pt",
|
||||
columns =
|
||||
(fun table ->
|
||||
{ churchId = table.Column<Guid> (name = "ChurchId", nullable = false)
|
||||
city = table.Column<string> (name = "City", nullable = false)
|
||||
hasInterface = table.Column<bool> (name = "HasVirtualPrayerRoomInterface", nullable = false)
|
||||
interfaceAddress = table.Column<string> (name = "InterfaceAddress", nullable = true)
|
||||
name = table.Column<string> (name = "Name", nullable = false)
|
||||
st = table.Column<string> (name = "ST", nullable = false, maxLength = Nullable<int> 2)
|
||||
}),
|
||||
constraints =
|
||||
fun table ->
|
||||
table.PrimaryKey ("PK_Church", fun x -> upcast x.churchId) |> ignore)
|
||||
|> ignore
|
||||
|
||||
migrationBuilder.CreateTable (
|
||||
name = "TimeZone",
|
||||
schema = "pt",
|
||||
columns =
|
||||
(fun table ->
|
||||
{ timeZoneId = table.Column<string> (name = "TimeZoneId", nullable = false)
|
||||
description = table.Column<string> (name = "Description", nullable = false)
|
||||
isActive = table.Column<bool> (name = "IsActive", nullable = false)
|
||||
sortOrder = table.Column<int> (name = "SortOrder", nullable = false)
|
||||
}),
|
||||
constraints =
|
||||
fun table ->
|
||||
table.PrimaryKey ("PK_TimeZone", fun x -> upcast x.timeZoneId) |> ignore)
|
||||
|> ignore
|
||||
|
||||
migrationBuilder.CreateTable (
|
||||
name = "User",
|
||||
schema = "pt",
|
||||
columns =
|
||||
(fun table ->
|
||||
{ userId = table.Column<Guid> (name = "UserId", nullable = false)
|
||||
emailAddress = table.Column<string> (name = "EmailAddress", nullable = false)
|
||||
firstName = table.Column<string> (name = "FirstName", nullable = false)
|
||||
isAdmin = table.Column<bool> (name = "IsSystemAdmin", nullable = false)
|
||||
lastName = table.Column<string> (name = "LastName", nullable = false)
|
||||
passwordHash = table.Column<string> (name = "PasswordHash", nullable = false)
|
||||
salt = table.Column<Guid> (name = "Salt", nullable = true)
|
||||
}),
|
||||
constraints =
|
||||
fun table ->
|
||||
table.PrimaryKey("PK_User", fun x -> upcast x.userId) |> ignore)
|
||||
|> ignore
|
||||
|
||||
migrationBuilder.CreateTable (
|
||||
name = "SmallGroup",
|
||||
schema = "pt",
|
||||
columns =
|
||||
(fun table ->
|
||||
{ smallGroupId = table.Column<Guid> (name = "SmallGroupId", nullable = false)
|
||||
churchId = table.Column<Guid> (name = "ChurchId", nullable = false)
|
||||
name = table.Column<string> (name = "Name", nullable = false)
|
||||
}),
|
||||
constraints =
|
||||
fun table ->
|
||||
table.PrimaryKey ("PK_SmallGroup", fun x -> upcast x.smallGroupId) |> ignore
|
||||
table.ForeignKey (
|
||||
name = "FK_SmallGroup_Church_ChurchId",
|
||||
column = (fun x -> upcast x.churchId),
|
||||
principalSchema = "pt",
|
||||
principalTable = "Church",
|
||||
principalColumn = "ChurchId",
|
||||
onDelete = ReferentialAction.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
migrationBuilder.CreateTable (
|
||||
name = "ListPreference",
|
||||
schema = "pt",
|
||||
columns =
|
||||
(fun table ->
|
||||
{ smallGroupId = table.Column<Guid> (name = "SmallGroupId", nullable = false)
|
||||
daysToExpire = table.Column<int> (name = "DaysToExpire", nullable = false, defaultValue = 14)
|
||||
daysToKeepNew = table.Column<int> (name = "DaysToKeepNew", nullable = false, defaultValue = 7)
|
||||
defaultEmailType = table.Column<string> (name = "DefaultEmailType", nullable = false, defaultValue = "Html")
|
||||
emailFromAddress = table.Column<string> (name = "EmailFromAddress", nullable = false, defaultValue = "prayer@djs-consulting.com")
|
||||
emailFromName = table.Column<string> (name = "EmailFromName", nullable = false, defaultValue = "PrayerTracker")
|
||||
groupPassword = table.Column<string> (name = "GroupPassword", nullable = false, defaultValue = "")
|
||||
headingColor = table.Column<string> (name = "HeadingColor", nullable = false, defaultValue = "maroon")
|
||||
headingFontSize = table.Column<int> (name = "HeadingFontSize", nullable = false, defaultValue = 16)
|
||||
isPublic = table.Column<bool> (name = "IsPublic", nullable = false, defaultValue = false)
|
||||
lineColor = table.Column<string> (name = "LineColor", nullable = false, defaultValue = "navy")
|
||||
listFonts = table.Column<string> (name = "ListFonts", nullable = false, defaultValue = "Century Gothic,Tahoma,Luxi Sans,sans-serif")
|
||||
longTermUpdateWeeks = table.Column<int> (name = "LongTermUpdateWeeks", nullable = false, defaultValue = 4)
|
||||
requestSort = table.Column<string> (name = "RequestSort", nullable = false, defaultValue = "D", maxLength = Nullable<int> 1)
|
||||
textFontSize = table.Column<int> (name = "TextFontSize", nullable = false, defaultValue = 12)
|
||||
timeZoneId = table.Column<string> (name = "TimeZoneId", nullable = false, defaultValue = "America/Denver")
|
||||
pageSize = table.Column<int> (name = "PageSize", nullable = false, defaultValue = 100)
|
||||
asOfDateDisplay = table.Column<string> (name = "AsOfDateDisplay", nullable = false, defaultValue = "N", maxLength = Nullable<int> 1)
|
||||
}),
|
||||
constraints =
|
||||
fun table ->
|
||||
table.PrimaryKey ("PK_ListPreference", fun x -> upcast x.smallGroupId) |> ignore
|
||||
table.ForeignKey (
|
||||
name = "FK_ListPreference_SmallGroup_SmallGroupId",
|
||||
column = (fun x -> upcast x.smallGroupId),
|
||||
principalSchema = "pt",
|
||||
principalTable = "SmallGroup",
|
||||
principalColumn = "SmallGroupId",
|
||||
onDelete = ReferentialAction.Cascade)
|
||||
|> ignore
|
||||
table.ForeignKey (
|
||||
name = "FK_ListPreference_TimeZone_TimeZoneId",
|
||||
column = (fun x -> upcast x.timeZoneId),
|
||||
principalSchema = "pt",
|
||||
principalTable = "TimeZone",
|
||||
principalColumn = "TimeZoneId",
|
||||
onDelete = ReferentialAction.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
migrationBuilder.CreateTable (
|
||||
name = "Member",
|
||||
schema = "pt",
|
||||
columns =
|
||||
(fun table ->
|
||||
{ memberId = table.Column<Guid> (name = "MemberId", nullable = false)
|
||||
email = table.Column<string> (name = "Email", nullable = false)
|
||||
format = table.Column<string> (name = "Format", nullable = true)
|
||||
memberName = table.Column<string> (name = "MemberName", nullable = false)
|
||||
smallGroupId = table.Column<Guid> (name = "SmallGroupId", nullable = false)
|
||||
}),
|
||||
constraints =
|
||||
fun table ->
|
||||
table.PrimaryKey ("PK_Member", fun x -> upcast x.memberId) |> ignore
|
||||
table.ForeignKey (
|
||||
name = "FK_Member_SmallGroup_SmallGroupId",
|
||||
column = (fun x -> upcast x.smallGroupId),
|
||||
principalSchema = "pt",
|
||||
principalTable = "SmallGroup",
|
||||
principalColumn = "SmallGroupId",
|
||||
onDelete = ReferentialAction.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
migrationBuilder.CreateTable (
|
||||
name = "PrayerRequest",
|
||||
schema = "pt",
|
||||
columns =
|
||||
(fun table ->
|
||||
{ prayerRequestId = table.Column<Guid> (name = "PrayerRequestId", nullable = false)
|
||||
expiration = table.Column<bool> (name = "Expiration", nullable = false)
|
||||
enteredDate = table.Column<DateTime> (name = "EnteredDate", nullable = false)
|
||||
notifyChaplain = table.Column<bool> (name = "NotifyChaplain", nullable = false)
|
||||
requestType = table.Column<string> (name = "RequestType", nullable = false)
|
||||
requestor = table.Column<string> (name = "Requestor", nullable = true)
|
||||
smallGroupId = table.Column<Guid> (name = "SmallGroupId", nullable = false)
|
||||
text = table.Column<string> (name = "Text", nullable = false)
|
||||
updatedDate = table.Column<DateTime> (name = "UpdatedDate", nullable = false)
|
||||
userId = table.Column<Guid> (name = "UserId", nullable = false)
|
||||
}),
|
||||
constraints =
|
||||
fun table ->
|
||||
table.PrimaryKey ("PK_PrayerRequest", fun x -> upcast x.prayerRequestId) |> ignore
|
||||
table.ForeignKey (
|
||||
name = "FK_PrayerRequest_SmallGroup_SmallGroupId",
|
||||
column = (fun x -> upcast x.smallGroupId),
|
||||
principalSchema = "pt",
|
||||
principalTable = "SmallGroup",
|
||||
principalColumn = "SmallGroupId",
|
||||
onDelete = ReferentialAction.Cascade)
|
||||
|> ignore
|
||||
table.ForeignKey (
|
||||
name = "FK_PrayerRequest_User_UserId",
|
||||
column = (fun x -> upcast x.userId),
|
||||
principalSchema = "pt",
|
||||
principalTable = "User",
|
||||
principalColumn = "UserId",
|
||||
onDelete = ReferentialAction.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name = "User_SmallGroup",
|
||||
schema = "pt",
|
||||
columns =
|
||||
(fun table ->
|
||||
{ userId = table.Column<Guid> (name = "UserId", nullable = false)
|
||||
smallGroupId = table.Column<Guid> (name = "SmallGroupId", nullable = false)
|
||||
}),
|
||||
constraints =
|
||||
fun table ->
|
||||
table.PrimaryKey ("PK_User_SmallGroup", fun x -> upcast x) |> ignore
|
||||
table.ForeignKey (
|
||||
name = "FK_User_SmallGroup_SmallGroup_SmallGroupId",
|
||||
column = (fun x -> upcast x.smallGroupId),
|
||||
principalSchema = "pt",
|
||||
principalTable = "SmallGroup",
|
||||
principalColumn = "SmallGroupId",
|
||||
onDelete = ReferentialAction.Cascade)
|
||||
|> ignore
|
||||
table.ForeignKey (
|
||||
name = "FK_User_SmallGroup_User_UserId",
|
||||
column = (fun x -> upcast x.userId),
|
||||
principalSchema = "pt",
|
||||
principalTable = "User",
|
||||
principalColumn = "UserId",
|
||||
onDelete = ReferentialAction.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
migrationBuilder.CreateIndex (name = "IX_ListPreference_TimeZoneId", schema = "pt", table = "ListPreference", column = "TimeZoneId") |> ignore
|
||||
migrationBuilder.CreateIndex (name = "IX_Member_SmallGroupId", schema = "pt", table = "Member", column = "SmallGroupId") |> ignore
|
||||
migrationBuilder.CreateIndex (name = "IX_PrayerRequest_SmallGroupId", schema = "pt", table = "PrayerRequest", column = "SmallGroupId") |> ignore
|
||||
migrationBuilder.CreateIndex (name = "IX_PrayerRequest_UserId", schema = "pt", table = "PrayerRequest", column = "UserId") |> ignore
|
||||
migrationBuilder.CreateIndex (name = "IX_SmallGroup_ChurchId", schema = "pt", table = "SmallGroup", column = "ChurchId") |> ignore
|
||||
migrationBuilder.CreateIndex (name = "IX_User_SmallGroup_SmallGroupId", schema = "pt", table = "User_SmallGroup", column = "SmallGroupId") |> ignore
|
||||
|
||||
override __.Down (migrationBuilder : MigrationBuilder) =
|
||||
migrationBuilder.DropTable (name = "ListPreference", schema = "pt") |> ignore
|
||||
migrationBuilder.DropTable (name = "Member", schema = "pt") |> ignore
|
||||
migrationBuilder.DropTable (name = "PrayerRequest", schema = "pt") |> ignore
|
||||
migrationBuilder.DropTable (name = "User_SmallGroup", schema = "pt") |> ignore
|
||||
migrationBuilder.DropTable (name = "TimeZone", schema = "pt") |> ignore
|
||||
migrationBuilder.DropTable (name = "SmallGroup", schema = "pt") |> ignore
|
||||
migrationBuilder.DropTable (name = "User", schema = "pt") |> ignore
|
||||
migrationBuilder.DropTable (name = "Church", schema = "pt") |> ignore
|
||||
|
||||
|
||||
override __.BuildTargetModel (modelBuilder : ModelBuilder) =
|
||||
modelBuilder
|
||||
.HasDefaultSchema("pt")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||
.HasAnnotation("ProductVersion", "1.1.0-rtm-22752")
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<Church>,
|
||||
fun b ->
|
||||
b.Property<Guid>("churchId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<string>("city").IsRequired() |> ignore
|
||||
b.Property<bool>("hasInterface") |> ignore
|
||||
b.Property<string>("interfaceAddress") |> ignore
|
||||
b.Property<string>("name").IsRequired() |> ignore
|
||||
b.Property<string>("st").IsRequired().HasMaxLength(2) |> ignore
|
||||
b.HasKey("churchId") |> ignore
|
||||
b.ToTable("Church") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<ListPreferences>,
|
||||
fun b ->
|
||||
b.Property<Guid>("smallGroupId") |> ignore
|
||||
b.Property<int>("daysToExpire").ValueGeneratedOnAdd().HasDefaultValue(14) |> ignore
|
||||
b.Property<int>("daysToKeepNew").ValueGeneratedOnAdd().HasDefaultValue(7) |> ignore
|
||||
b.Property<string>("defaultEmailType").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("H") |> ignore
|
||||
b.Property<string>("emailFromAddress").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("prayer@djs-consulting.com") |> ignore
|
||||
b.Property<string>("emailFromName").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("PrayerTracker") |> ignore
|
||||
b.Property<string>("groupPassword").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("") |> ignore
|
||||
b.Property<string>("headingColor").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("maroon") |> ignore
|
||||
b.Property<int>("headingFontSize").ValueGeneratedOnAdd().HasDefaultValue(16) |> ignore
|
||||
b.Property<bool>("isPublic").ValueGeneratedOnAdd().HasDefaultValue(false) |> ignore
|
||||
b.Property<string>("lineColor").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("navy") |> ignore
|
||||
b.Property<string>("listFonts").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("Century Gothic,Tahoma,Luxi Sans,sans-serif") |> ignore
|
||||
b.Property<int>("longTermUpdateWeeks").ValueGeneratedOnAdd().HasDefaultValue(4) |> ignore
|
||||
b.Property<string>("requestSort").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("D").HasMaxLength(1) |> ignore
|
||||
b.Property<int>("textFontSize").ValueGeneratedOnAdd().HasDefaultValue(12) |> ignore
|
||||
b.Property<string>("timeZoneId").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("America/Denver") |> ignore
|
||||
b.Property<int>("pageSize").IsRequired().ValueGeneratedOnAdd().HasDefaultValue(100) |> ignore
|
||||
b.Property<string>("asOfDateDisplay").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("N").HasMaxLength(1) |> ignore
|
||||
b.HasKey("smallGroupId") |> ignore
|
||||
b.HasIndex("timeZoneId") |> ignore
|
||||
b.ToTable("ListPreference") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<Member>,
|
||||
fun b ->
|
||||
b.Property<Guid>("memberId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<string>("email").IsRequired() |> ignore
|
||||
b.Property<string>("format") |> ignore
|
||||
b.Property<string>("memberName").IsRequired() |> ignore
|
||||
b.Property<Guid>("smallGroupId") |> ignore
|
||||
b.HasKey("memberId") |> ignore
|
||||
b.HasIndex("smallGroupId") |> ignore
|
||||
b.ToTable("Member") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<PrayerRequest>,
|
||||
fun b ->
|
||||
b.Property<Guid>("prayerRequestId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<DateTime>("enteredDate").IsRequired() |> ignore
|
||||
b.Property<string>("expiration").IsRequired().HasMaxLength 1 |> ignore
|
||||
b.Property<bool>("notifyChaplain") |> ignore
|
||||
b.Property<string>("requestType").IsRequired().HasMaxLength 1 |> ignore
|
||||
b.Property<string>("requestor") |> ignore
|
||||
b.Property<Guid>("smallGroupId") |> ignore
|
||||
b.Property<string>("text").IsRequired() |> ignore
|
||||
b.Property<DateTime>("updatedDate") |> ignore
|
||||
b.Property<Guid>("userId") |> ignore
|
||||
b.HasKey("prayerRequestId") |> ignore
|
||||
b.HasIndex("smallGroupId") |> ignore
|
||||
b.HasIndex("userId") |> ignore
|
||||
b.ToTable("PrayerRequest") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<SmallGroup>,
|
||||
fun b ->
|
||||
b.Property<Guid>("smallGroupId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<Guid>("churchId") |> ignore
|
||||
b.Property<string>("name").IsRequired() |> ignore
|
||||
b.HasKey("smallGroupId") |> ignore
|
||||
b.HasIndex("churchId") |> ignore
|
||||
b.ToTable("SmallGroup") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<PrayerTracker.Entities.TimeZone>,
|
||||
fun b ->
|
||||
b.Property<string>("timeZoneId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<string>("description").IsRequired() |> ignore
|
||||
b.Property<bool>("isActive") |> ignore
|
||||
b.Property<int>("sortOrder") |> ignore
|
||||
b.HasKey("timeZoneId") |> ignore
|
||||
b.ToTable("TimeZone") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<User>,
|
||||
fun b ->
|
||||
b.Property<Guid>("userId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<string>("emailAddress").IsRequired() |> ignore
|
||||
b.Property<string>("firstName").IsRequired() |> ignore
|
||||
b.Property<bool>("isAdmin") |> ignore
|
||||
b.Property<string>("lastName").IsRequired() |> ignore
|
||||
b.Property<string>("passwordHash").IsRequired() |> ignore
|
||||
b.Property<Guid>("salt") |> ignore
|
||||
b.HasKey("userId") |> ignore
|
||||
b.ToTable("User") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<UserSmallGroup>,
|
||||
fun b ->
|
||||
b.Property<Guid>("userId") |> ignore
|
||||
b.Property<Guid>("smallGroupId") |> ignore
|
||||
b.HasKey("userId", "smallGroupId") |> ignore
|
||||
b.HasIndex("smallGroupId") |> ignore
|
||||
b.ToTable("User_SmallGroup") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<ListPreferences>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.SmallGroup")
|
||||
.WithOne("preferences")
|
||||
.HasForeignKey("PrayerTracker.Entities.ListPreferences", "smallGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore
|
||||
b.HasOne("PrayerTracker.Entities.TimeZone", "timeZone")
|
||||
.WithMany()
|
||||
.HasForeignKey("timeZoneId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<Member>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.SmallGroup", "smallGroup")
|
||||
.WithMany("members")
|
||||
.HasForeignKey("smallGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<PrayerRequest>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.SmallGroup", "smallGroup")
|
||||
.WithMany("prayerRequests")
|
||||
.HasForeignKey("smallGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore
|
||||
b.HasOne("PrayerTracker.Entities.User", "user")
|
||||
.WithMany()
|
||||
.HasForeignKey("userId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<SmallGroup>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.Church", "Church")
|
||||
.WithMany("SmallGroups")
|
||||
.HasForeignKey("ChurchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<UserSmallGroup>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.SmallGroup", "smallGroup")
|
||||
.WithMany("users")
|
||||
.HasForeignKey("smallGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore
|
||||
b.HasOne("PrayerTracker.Entities.User", "user")
|
||||
.WithMany("smallGroups")
|
||||
.HasForeignKey("userId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
@ -1,200 +0,0 @@
|
||||
namespace PrayerTracker.Migrations
|
||||
|
||||
open Microsoft.EntityFrameworkCore
|
||||
open Microsoft.EntityFrameworkCore.Infrastructure
|
||||
open Npgsql.EntityFrameworkCore.PostgreSQL.Metadata
|
||||
open PrayerTracker
|
||||
open PrayerTracker.Entities
|
||||
open System
|
||||
|
||||
[<DbContext (typeof<AppDbContext>)>]
|
||||
type AppDbContextModelSnapshot () =
|
||||
inherit ModelSnapshot ()
|
||||
|
||||
override __.BuildModel (modelBuilder : ModelBuilder) =
|
||||
modelBuilder
|
||||
.HasDefaultSchema("pt")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
||||
.HasAnnotation("ProductVersion", "1.1.0-rtm-22752")
|
||||
|> ignore
|
||||
modelBuilder.Entity (
|
||||
typeof<Church>,
|
||||
fun b ->
|
||||
b.Property<Guid>("churchId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<string>("city").IsRequired() |> ignore
|
||||
b.Property<bool>("hasInterface") |> ignore
|
||||
b.Property<string>("interfaceAddress") |> ignore
|
||||
b.Property<string>("name").IsRequired() |> ignore
|
||||
b.Property<string>("st").IsRequired().HasMaxLength(2) |> ignore
|
||||
b.HasKey("churchId") |> ignore
|
||||
b.ToTable("Church") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<ListPreferences>,
|
||||
fun b ->
|
||||
b.Property<Guid>("smallGroupId") |> ignore
|
||||
b.Property<int>("daysToExpire").ValueGeneratedOnAdd().HasDefaultValue(14) |> ignore
|
||||
b.Property<int>("daysToKeepNew").ValueGeneratedOnAdd().HasDefaultValue(7) |> ignore
|
||||
b.Property<string>("defaultEmailType").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("H").HasMaxLength(1) |> ignore
|
||||
b.Property<string>("emailFromAddress").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("prayer@djs-consulting.com") |> ignore
|
||||
b.Property<string>("emailFromName").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("PrayerTracker") |> ignore
|
||||
b.Property<string>("groupPassword").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("") |> ignore
|
||||
b.Property<string>("headingColor").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("maroon") |> ignore
|
||||
b.Property<int>("headingFontSize").ValueGeneratedOnAdd().HasDefaultValue(16) |> ignore
|
||||
b.Property<bool>("isPublic").ValueGeneratedOnAdd().HasDefaultValue(false) |> ignore
|
||||
b.Property<string>("lineColor").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("navy") |> ignore
|
||||
b.Property<string>("listFonts").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("Century Gothic,Tahoma,Luxi Sans,sans-serif") |> ignore
|
||||
b.Property<int>("longTermUpdateWeeks").ValueGeneratedOnAdd().HasDefaultValue(4) |> ignore
|
||||
b.Property<string>("requestSort").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("D").HasMaxLength(1) |> ignore
|
||||
b.Property<int>("textFontSize").ValueGeneratedOnAdd().HasDefaultValue(12) |> ignore
|
||||
b.Property<string>("timeZoneId").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("America/Denver") |> ignore
|
||||
b.Property<int>("pageSize").IsRequired().ValueGeneratedOnAdd().HasDefaultValue(100) |> ignore
|
||||
b.Property<string>("asOfDateDisplay").IsRequired().ValueGeneratedOnAdd().HasDefaultValue("N").HasMaxLength(1) |> ignore
|
||||
b.HasKey("smallGroupId") |> ignore
|
||||
b.HasIndex("timeZoneId") |> ignore
|
||||
b.ToTable("ListPreference") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<Member>,
|
||||
fun b ->
|
||||
b.Property<Guid>("memberId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<string>("email").IsRequired() |> ignore
|
||||
b.Property<string>("format") |> ignore
|
||||
b.Property<string>("memberName").IsRequired() |> ignore
|
||||
b.Property<Guid>("smallGroupId") |> ignore
|
||||
b.HasKey("memberId") |> ignore
|
||||
b.HasIndex("smallGroupId") |> ignore
|
||||
b.ToTable("Member") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<PrayerRequest>,
|
||||
fun b ->
|
||||
b.Property<Guid>("prayerRequestId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<DateTime>("enteredDate") |> ignore
|
||||
b.Property<string>("expiration").IsRequired().HasMaxLength(1) |> ignore
|
||||
b.Property<bool>("notifyChaplain") |> ignore
|
||||
b.Property<string>("requestType").IsRequired().HasMaxLength(1) |> ignore
|
||||
b.Property<string>("requestor") |> ignore
|
||||
b.Property<Guid>("smallGroupId") |> ignore
|
||||
b.Property<string>("text").IsRequired() |> ignore
|
||||
b.Property<DateTime>("updatedDate") |> ignore
|
||||
b.Property<Guid>("userId") |> ignore
|
||||
b.HasKey("prayerRequestId") |> ignore
|
||||
b.HasIndex("smallGroupId") |> ignore
|
||||
b.HasIndex("userId") |> ignore
|
||||
b.ToTable("PrayerRequest") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<SmallGroup>,
|
||||
fun b ->
|
||||
b.Property<Guid>("smallGroupId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<Guid>("churchId") |> ignore
|
||||
b.Property<string>("name").IsRequired() |> ignore
|
||||
b.HasKey("smallGroupId") |> ignore
|
||||
b.HasIndex("churchId") |> ignore
|
||||
b.ToTable("SmallGroup") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<PrayerTracker.Entities.TimeZone>,
|
||||
fun b ->
|
||||
b.Property<string>("timeZoneId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<string>("description").IsRequired() |> ignore
|
||||
b.Property<bool>("isActive") |> ignore
|
||||
b.Property<int>("sortOrder") |> ignore
|
||||
b.HasKey("timeZoneId") |> ignore
|
||||
b.ToTable("TimeZone") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<User>,
|
||||
fun b ->
|
||||
b.Property<Guid>("userId").ValueGeneratedOnAdd() |> ignore
|
||||
b.Property<string>("emailAddress").IsRequired() |> ignore
|
||||
b.Property<string>("firstName").IsRequired() |> ignore
|
||||
b.Property<bool>("isAdmin") |> ignore
|
||||
b.Property<string>("lastName").IsRequired() |> ignore
|
||||
b.Property<string>("passwordHash").IsRequired() |> ignore
|
||||
b.Property<Guid>("salt") |> ignore
|
||||
b.HasKey("userId") |> ignore
|
||||
b.ToTable("User") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<UserSmallGroup>,
|
||||
fun b ->
|
||||
b.Property<Guid>("userId") |> ignore
|
||||
b.Property<Guid>("smallGroupId") |> ignore
|
||||
b.HasKey("userId", "smallGroupId") |> ignore
|
||||
b.HasIndex("smallGroupId") |> ignore
|
||||
b.ToTable("User_SmallGroup") |> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<ListPreferences>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.SmallGroup")
|
||||
.WithOne("preferences")
|
||||
.HasForeignKey("PrayerTracker.Entities.ListPreferences", "smallGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore
|
||||
b.HasOne("PrayerTracker.Entities.TimeZone", "timeZone")
|
||||
.WithMany()
|
||||
.HasForeignKey("timeZoneId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<Member>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.SmallGroup", "smallGroup")
|
||||
.WithMany("members")
|
||||
.HasForeignKey("smallGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<PrayerRequest>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.SmallGroup", "smallGroup")
|
||||
.WithMany("prayerRequests")
|
||||
.HasForeignKey("smallGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore
|
||||
b.HasOne("PrayerTracker.Entities.User", "user")
|
||||
.WithMany()
|
||||
.HasForeignKey("userId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<SmallGroup>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.Church", "Church")
|
||||
.WithMany("SmallGroups")
|
||||
.HasForeignKey("ChurchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
||||
|
||||
modelBuilder.Entity (
|
||||
typeof<UserSmallGroup>,
|
||||
fun b ->
|
||||
b.HasOne("PrayerTracker.Entities.SmallGroup", "smallGroup")
|
||||
.WithMany("users")
|
||||
.HasForeignKey("smallGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore
|
||||
b.HasOne("PrayerTracker.Entities.User", "user")
|
||||
.WithMany("smallGroups")
|
||||
.HasForeignKey("userId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|> ignore)
|
||||
|> ignore
|
@ -1,23 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Entities.fs" />
|
||||
<Compile Include="AppDbContext.fs" />
|
||||
<Compile Include="DataAccess.fs" />
|
||||
<Compile Include="Migrations\20161217153124_InitialDatabase.fs" />
|
||||
<Compile Include="Migrations\AppDbContextModelSnapshot.fs" />
|
||||
<Compile Include="Access.fs" />
|
||||
<Compile Include="DistributedCache.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FSharp.EFCore.OptionConverter" Version="1.0.0" />
|
||||
<PackageReference Include="Microsoft.FSharpLu" Version="0.11.6" />
|
||||
<PackageReference Include="NodaTime" Version="2.4.7" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.2" />
|
||||
<PackageReference Include="TaskBuilder.fs" Version="2.1.0" />
|
||||
<PackageReference Include="BitBadger.Documents.Postgres" Version="3.1.0" />
|
||||
<PackageReference Include="Giraffe" Version="6.4.0" />
|
||||
<PackageReference Include="NodaTime" Version="3.1.11" />
|
||||
<PackageReference Include="Npgsql.FSharp" Version="5.7.0" />
|
||||
<PackageReference Include="Npgsql.NodaTime" Version="8.0.3" />
|
||||
<PackageReference Update="FSharp.Core" Version="8.0.300" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -7,356 +7,355 @@ open System
|
||||
|
||||
[<Tests>]
|
||||
let asOfDateDisplayTests =
|
||||
testList "AsOfDateDisplay" [
|
||||
test "NoDisplay code is correct" {
|
||||
Expect.equal NoDisplay.code "N" "The code for NoDisplay should have been \"N\""
|
||||
}
|
||||
test "ShortDate code is correct" {
|
||||
Expect.equal ShortDate.code "S" "The code for ShortDate should have been \"S\""
|
||||
}
|
||||
test "LongDate code is correct" {
|
||||
Expect.equal LongDate.code "L" "The code for LongDate should have been \"N\""
|
||||
}
|
||||
test "fromCode N should return NoDisplay" {
|
||||
Expect.equal (AsOfDateDisplay.fromCode "N") NoDisplay "\"N\" should have been converted to NoDisplay"
|
||||
}
|
||||
test "fromCode S should return ShortDate" {
|
||||
Expect.equal (AsOfDateDisplay.fromCode "S") ShortDate "\"S\" should have been converted to ShortDate"
|
||||
}
|
||||
test "fromCode L should return LongDate" {
|
||||
Expect.equal (AsOfDateDisplay.fromCode "L") LongDate "\"L\" should have been converted to LongDate"
|
||||
}
|
||||
test "fromCode X should raise" {
|
||||
Expect.throws (fun () -> AsOfDateDisplay.fromCode "X" |> ignore)
|
||||
"An unknown code should have raised an exception"
|
||||
}
|
||||
testList "AsOfDateDisplay" [
|
||||
test "NoDisplay code is correct" {
|
||||
Expect.equal (AsOfDateDisplay.toCode NoDisplay) "N" "The code for NoDisplay should have been \"N\""
|
||||
}
|
||||
test "ShortDate code is correct" {
|
||||
Expect.equal (AsOfDateDisplay.toCode ShortDate) "S" "The code for ShortDate should have been \"S\""
|
||||
}
|
||||
test "LongDate code is correct" {
|
||||
Expect.equal (AsOfDateDisplay.toCode LongDate) "L" "The code for LongDate should have been \"N\""
|
||||
}
|
||||
test "fromCode N should return NoDisplay" {
|
||||
Expect.equal (AsOfDateDisplay.fromCode "N") NoDisplay "\"N\" should have been converted to NoDisplay"
|
||||
}
|
||||
test "fromCode S should return ShortDate" {
|
||||
Expect.equal (AsOfDateDisplay.fromCode "S") ShortDate "\"S\" should have been converted to ShortDate"
|
||||
}
|
||||
test "fromCode L should return LongDate" {
|
||||
Expect.equal (AsOfDateDisplay.fromCode "L") LongDate "\"L\" should have been converted to LongDate"
|
||||
}
|
||||
test "fromCode X should raise" {
|
||||
Expect.throws (fun () -> AsOfDateDisplay.fromCode "X" |> ignore)
|
||||
"An unknown code should have raised an exception"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let churchTests =
|
||||
testList "Church" [
|
||||
test "empty is as expected" {
|
||||
let mt = Church.empty
|
||||
Expect.equal mt.churchId Guid.Empty "The church ID should have been an empty GUID"
|
||||
Expect.equal mt.name "" "The name should have been blank"
|
||||
Expect.equal mt.city "" "The city should have been blank"
|
||||
Expect.equal mt.st "" "The state should have been blank"
|
||||
Expect.isFalse mt.hasInterface "The church should not show that it has an interface"
|
||||
Expect.isNone mt.interfaceAddress "The interface address should not exist"
|
||||
Expect.isNotNull mt.smallGroups "The small groups navigation property should not be null"
|
||||
Expect.isEmpty mt.smallGroups "There should be no small groups for an empty church"
|
||||
}
|
||||
testList "Church" [
|
||||
test "empty is as expected" {
|
||||
let mt = Church.empty
|
||||
Expect.equal mt.Id.Value Guid.Empty "The church ID should have been an empty GUID"
|
||||
Expect.equal mt.Name "" "The name should have been blank"
|
||||
Expect.equal mt.City "" "The city should have been blank"
|
||||
Expect.equal mt.State "" "The state should have been blank"
|
||||
Expect.isFalse mt.HasVpsInterface "The church should not show that it has an interface"
|
||||
Expect.isNone mt.InterfaceAddress "The interface address should not exist"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let emailFormatTests =
|
||||
testList "EmailFormat" [
|
||||
test "HtmlFormat code is correct" {
|
||||
Expect.equal HtmlFormat.code "H" "The code for HtmlFormat should have been \"H\""
|
||||
}
|
||||
test "PlainTextFormat code is correct" {
|
||||
Expect.equal PlainTextFormat.code "P" "The code for PlainTextFormat should have been \"P\""
|
||||
}
|
||||
test "fromCode H should return HtmlFormat" {
|
||||
Expect.equal (EmailFormat.fromCode "H") HtmlFormat "\"H\" should have been converted to HtmlFormat"
|
||||
}
|
||||
test "fromCode P should return ShortDate" {
|
||||
Expect.equal (EmailFormat.fromCode "P") PlainTextFormat "\"P\" should have been converted to PlainTextFormat"
|
||||
}
|
||||
test "fromCode Z should raise" {
|
||||
Expect.throws (fun () -> EmailFormat.fromCode "Z" |> ignore) "An unknown code should have raised an exception"
|
||||
}
|
||||
testList "EmailFormat" [
|
||||
test "HtmlFormat code is correct" {
|
||||
Expect.equal (EmailFormat.toCode HtmlFormat) "H" "The code for HtmlFormat should have been \"H\""
|
||||
}
|
||||
test "PlainTextFormat code is correct" {
|
||||
Expect.equal (EmailFormat.toCode PlainTextFormat) "P" "The code for PlainTextFormat should have been \"P\""
|
||||
}
|
||||
test "fromCode H should return HtmlFormat" {
|
||||
Expect.equal (EmailFormat.fromCode "H") HtmlFormat "\"H\" should have been converted to HtmlFormat"
|
||||
}
|
||||
test "fromCode P should return ShortDate" {
|
||||
Expect.equal (EmailFormat.fromCode "P") PlainTextFormat
|
||||
"\"P\" should have been converted to PlainTextFormat"
|
||||
}
|
||||
test "fromCode Z should raise" {
|
||||
Expect.throws (fun () -> EmailFormat.fromCode "Z" |> ignore)
|
||||
"An unknown code should have raised an exception"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let expirationTests =
|
||||
testList "Expiration" [
|
||||
test "Automatic code is correct" {
|
||||
Expect.equal Automatic.code "A" "The code for Automatic should have been \"A\""
|
||||
}
|
||||
test "Manual code is correct" {
|
||||
Expect.equal Manual.code "M" "The code for Manual should have been \"M\""
|
||||
}
|
||||
test "Forced code is correct" {
|
||||
Expect.equal Forced.code "F" "The code for Forced should have been \"F\""
|
||||
}
|
||||
test "fromCode A should return Automatic" {
|
||||
Expect.equal (Expiration.fromCode "A") Automatic "\"A\" should have been converted to Automatic"
|
||||
}
|
||||
test "fromCode M should return Manual" {
|
||||
Expect.equal (Expiration.fromCode "M") Manual "\"M\" should have been converted to Manual"
|
||||
}
|
||||
test "fromCode F should return Forced" {
|
||||
Expect.equal (Expiration.fromCode "F") Forced "\"F\" should have been converted to Forced"
|
||||
}
|
||||
test "fromCode V should raise" {
|
||||
Expect.throws (fun () -> Expiration.fromCode "V" |> ignore) "An unknown code should have raised an exception"
|
||||
}
|
||||
testList "Expiration" [
|
||||
test "Automatic code is correct" {
|
||||
Expect.equal (Expiration.toCode Automatic) "A" "The code for Automatic should have been \"A\""
|
||||
}
|
||||
test "Manual code is correct" {
|
||||
Expect.equal (Expiration.toCode Manual) "M" "The code for Manual should have been \"M\""
|
||||
}
|
||||
test "Forced code is correct" {
|
||||
Expect.equal (Expiration.toCode Forced) "F" "The code for Forced should have been \"F\""
|
||||
}
|
||||
test "fromCode A should return Automatic" {
|
||||
Expect.equal (Expiration.fromCode "A") Automatic "\"A\" should have been converted to Automatic"
|
||||
}
|
||||
test "fromCode M should return Manual" {
|
||||
Expect.equal (Expiration.fromCode "M") Manual "\"M\" should have been converted to Manual"
|
||||
}
|
||||
test "fromCode F should return Forced" {
|
||||
Expect.equal (Expiration.fromCode "F") Forced "\"F\" should have been converted to Forced"
|
||||
}
|
||||
test "fromCode V should raise" {
|
||||
Expect.throws (fun () -> Expiration.fromCode "V" |> ignore)
|
||||
"An unknown code should have raised an exception"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let listPreferencesTests =
|
||||
testList "ListPreferences" [
|
||||
test "empty is as expected" {
|
||||
let mt = ListPreferences.empty
|
||||
Expect.equal mt.smallGroupId Guid.Empty "The small group ID should have been an empty GUID"
|
||||
Expect.equal mt.daysToExpire 14 "The default days to expire should have been 14"
|
||||
Expect.equal mt.daysToKeepNew 7 "The default days to keep new should have been 7"
|
||||
Expect.equal mt.longTermUpdateWeeks 4 "The default long term update weeks should have been 4"
|
||||
Expect.equal mt.emailFromName "PrayerTracker" "The default e-mail from name should have been PrayerTracker"
|
||||
Expect.equal mt.emailFromAddress "prayer@djs-consulting.com"
|
||||
"The default e-mail from address should have been prayer@djs-consulting.com"
|
||||
Expect.equal mt.listFonts "Century Gothic,Tahoma,Luxi Sans,sans-serif" "The default list fonts were incorrect"
|
||||
Expect.equal mt.headingColor "maroon" "The default heading text color should have been maroon"
|
||||
Expect.equal mt.lineColor "navy" "The default heding line color should have been navy"
|
||||
Expect.equal mt.headingFontSize 16 "The default heading font size should have been 16"
|
||||
Expect.equal mt.textFontSize 12 "The default text font size should have been 12"
|
||||
Expect.equal mt.requestSort SortByDate "The default request sort should have been by date"
|
||||
Expect.equal mt.groupPassword "" "The default group password should have been blank"
|
||||
Expect.equal mt.defaultEmailType HtmlFormat "The default e-mail type should have been HTML"
|
||||
Expect.isFalse mt.isPublic "The isPublic flag should not have been set"
|
||||
Expect.equal mt.timeZoneId "America/Denver" "The default time zone should have been America/Denver"
|
||||
Expect.equal mt.timeZone.timeZoneId "" "The default preferences should have included an empty time zone"
|
||||
Expect.equal mt.pageSize 100 "The default page size should have been 100"
|
||||
Expect.equal mt.asOfDateDisplay NoDisplay "The as-of date display should have been No Display"
|
||||
}
|
||||
testList "ListPreferences" [
|
||||
test "FontStack is correct for native fonts" {
|
||||
Expect.equal ListPreferences.empty.FontStack
|
||||
"""system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,"Liberation Sans",Cantarell,"Helvetica Neue",sans-serif"""
|
||||
"The expected native font stack was incorrect"
|
||||
}
|
||||
test "FontStack is correct for specific fonts" {
|
||||
Expect.equal { ListPreferences.empty with Fonts = "Arial,sans-serif" }.FontStack "Arial,sans-serif"
|
||||
"The specified fonts were not returned correctly"
|
||||
}
|
||||
test "empty is as expected" {
|
||||
let mt = ListPreferences.empty
|
||||
Expect.equal mt.SmallGroupId.Value Guid.Empty "The small group ID should have been an empty GUID"
|
||||
Expect.equal mt.DaysToExpire 14 "The default days to expire should have been 14"
|
||||
Expect.equal mt.DaysToKeepNew 7 "The default days to keep new should have been 7"
|
||||
Expect.equal mt.LongTermUpdateWeeks 4 "The default long term update weeks should have been 4"
|
||||
Expect.equal mt.EmailFromName "PrayerTracker" "The default e-mail from name should have been PrayerTracker"
|
||||
Expect.equal mt.EmailFromAddress "prayer@bitbadger.solutions"
|
||||
"The default e-mail from address should have been prayer@bitbadger.solutions"
|
||||
Expect.equal mt.Fonts "native" "The default list fonts were incorrect"
|
||||
Expect.equal mt.HeadingColor "maroon" "The default heading text color should have been maroon"
|
||||
Expect.equal mt.LineColor "navy" "The default heading line color should have been navy"
|
||||
Expect.equal mt.HeadingFontSize 16 "The default heading font size should have been 16"
|
||||
Expect.equal mt.TextFontSize 12 "The default text font size should have been 12"
|
||||
Expect.equal mt.RequestSort SortByDate "The default request sort should have been by date"
|
||||
Expect.equal mt.GroupPassword "" "The default group password should have been blank"
|
||||
Expect.equal mt.DefaultEmailType HtmlFormat "The default e-mail type should have been HTML"
|
||||
Expect.isFalse mt.IsPublic "The isPublic flag should not have been set"
|
||||
Expect.equal (TimeZoneId.toString mt.TimeZoneId) "America/Denver"
|
||||
"The default time zone should have been America/Denver"
|
||||
Expect.equal mt.PageSize 100 "The default page size should have been 100"
|
||||
Expect.equal mt.AsOfDateDisplay NoDisplay "The as-of date display should have been No Display"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let memberTests =
|
||||
testList "Member" [
|
||||
test "empty is as expected" {
|
||||
let mt = Member.empty
|
||||
Expect.equal mt.memberId Guid.Empty "The member ID should have been an empty GUID"
|
||||
Expect.equal mt.smallGroupId Guid.Empty "The small group ID should have been an empty GUID"
|
||||
Expect.equal mt.memberName "" "The member name should have been blank"
|
||||
Expect.equal mt.email "" "The member e-mail address should have been blank"
|
||||
Expect.isNone mt.format "The preferred e-mail format should not exist"
|
||||
Expect.equal mt.smallGroup.smallGroupId Guid.Empty "The small group should have been an empty one"
|
||||
}
|
||||
testList "Member" [
|
||||
test "empty is as expected" {
|
||||
let mt = Member.empty
|
||||
Expect.equal mt.Id.Value Guid.Empty "The member ID should have been an empty GUID"
|
||||
Expect.equal mt.SmallGroupId.Value Guid.Empty "The small group ID should have been an empty GUID"
|
||||
Expect.equal mt.Name "" "The member name should have been blank"
|
||||
Expect.equal mt.Email "" "The member e-mail address should have been blank"
|
||||
Expect.isNone mt.Format "The preferred e-mail format should not exist"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let prayerRequestTests =
|
||||
testList "PrayerRequest" [
|
||||
test "empty is as expected" {
|
||||
let mt = PrayerRequest.empty
|
||||
Expect.equal mt.prayerRequestId Guid.Empty "The request ID should have been an empty GUID"
|
||||
Expect.equal mt.requestType CurrentRequest "The request type should have been Current"
|
||||
Expect.equal mt.userId Guid.Empty "The user ID should have been an empty GUID"
|
||||
Expect.equal mt.smallGroupId Guid.Empty "The small group ID should have been an empty GUID"
|
||||
Expect.equal mt.enteredDate DateTime.MinValue "The entered date should have been the minimum"
|
||||
Expect.equal mt.updatedDate DateTime.MinValue "The updated date should have been the minimum"
|
||||
Expect.isNone mt.requestor "The requestor should not exist"
|
||||
Expect.equal mt.text "" "The request text should have been blank"
|
||||
Expect.isFalse mt.notifyChaplain "The notify chaplain flag should not have been set"
|
||||
Expect.equal mt.expiration Automatic "The expiration should have been Automatic"
|
||||
Expect.equal mt.user.userId Guid.Empty "The user should have been an empty one"
|
||||
Expect.equal mt.smallGroup.smallGroupId Guid.Empty "The small group should have been an empty one"
|
||||
}
|
||||
test "isExpired always returns false for expecting requests" {
|
||||
let req = { PrayerRequest.empty with requestType = Expecting }
|
||||
Expect.isFalse (req.isExpired DateTime.Now 0) "An expecting request should never be considered expired"
|
||||
}
|
||||
test "isExpired always returns false for manually-expired requests" {
|
||||
let req = { PrayerRequest.empty with updatedDate = DateTime.Now.AddMonths -1; expiration = Manual }
|
||||
Expect.isFalse (req.isExpired DateTime.Now 4) "A never-expired request should never be considered expired"
|
||||
}
|
||||
test "isExpired always returns false for long term/recurring requests" {
|
||||
let req = { PrayerRequest.empty with requestType = LongTermRequest }
|
||||
Expect.isFalse (req.isExpired DateTime.Now 0) "A recurring/long-term request should never be considered expired"
|
||||
}
|
||||
test "isExpired always returns true for force-expired requests" {
|
||||
let req = { PrayerRequest.empty with updatedDate = DateTime.Now; expiration = Forced }
|
||||
Expect.isTrue (req.isExpired DateTime.Now 5) "A force-expired request should always be considered expired"
|
||||
}
|
||||
test "isExpired returns false for non-expired requests" {
|
||||
let now = DateTime.Now
|
||||
let req = { PrayerRequest.empty with updatedDate = now.AddDays -5. }
|
||||
Expect.isFalse (req.isExpired now 7) "A request updated 5 days ago should not be considered expired"
|
||||
}
|
||||
test "isExpired returns true for expired requests" {
|
||||
let now = DateTime.Now
|
||||
let req = { PrayerRequest.empty with updatedDate = now.AddDays -8. }
|
||||
Expect.isTrue (req.isExpired now 7) "A request updated 8 days ago should be considered expired"
|
||||
}
|
||||
test "isExpired returns true for same-day expired requests" {
|
||||
let now = DateTime.Now
|
||||
let req = { PrayerRequest.empty with updatedDate = now.Date.AddDays(-7.).AddSeconds -1. }
|
||||
Expect.isTrue (req.isExpired now 7) "A request entered a second before midnight should be considered expired"
|
||||
}
|
||||
test "updateRequired returns false for expired requests" {
|
||||
let req = { PrayerRequest.empty with expiration = Forced }
|
||||
Expect.isFalse (req.updateRequired DateTime.Now 7 4) "An expired request should not require an update"
|
||||
}
|
||||
test "updateRequired returns false when an update is not required for an active request" {
|
||||
let now = DateTime.Now
|
||||
let req =
|
||||
{ PrayerRequest.empty with
|
||||
requestType = LongTermRequest
|
||||
updatedDate = now.AddDays -14.
|
||||
}
|
||||
Expect.isFalse (req.updateRequired now 7 4)
|
||||
"An active request updated 14 days ago should not require an update until 28 days"
|
||||
}
|
||||
test "updateRequired returns true when an update is required for an active request" {
|
||||
let now = DateTime.Now
|
||||
let req =
|
||||
{ PrayerRequest.empty with
|
||||
requestType = LongTermRequest
|
||||
updatedDate = now.AddDays -34.
|
||||
}
|
||||
Expect.isTrue (req.updateRequired now 7 4)
|
||||
"An active request updated 34 days ago should require an update (past 28 days)"
|
||||
}
|
||||
let instantNow = SystemClock.Instance.GetCurrentInstant
|
||||
let localDateNow () = (instantNow ()).InUtc().Date
|
||||
testList "PrayerRequest" [
|
||||
test "empty is as expected" {
|
||||
let mt = PrayerRequest.empty
|
||||
Expect.equal mt.Id.Value Guid.Empty "The request ID should have been an empty GUID"
|
||||
Expect.equal mt.RequestType CurrentRequest "The request type should have been Current"
|
||||
Expect.equal mt.UserId.Value Guid.Empty "The user ID should have been an empty GUID"
|
||||
Expect.equal mt.SmallGroupId.Value Guid.Empty "The small group ID should have been an empty GUID"
|
||||
Expect.equal mt.EnteredDate Instant.MinValue "The entered date should have been the minimum"
|
||||
Expect.equal mt.UpdatedDate Instant.MinValue "The updated date should have been the minimum"
|
||||
Expect.isNone mt.Requestor "The requestor should not exist"
|
||||
Expect.equal mt.Text "" "The request text should have been blank"
|
||||
Expect.isFalse mt.NotifyChaplain "The notify chaplain flag should not have been set"
|
||||
Expect.equal mt.Expiration Automatic "The expiration should have been Automatic"
|
||||
}
|
||||
test "isExpired always returns false for expecting requests" {
|
||||
PrayerRequest.isExpired (localDateNow ()) SmallGroup.empty
|
||||
{ PrayerRequest.empty with RequestType = Expecting }
|
||||
|> Flip.Expect.isFalse "An expecting request should never be considered expired"
|
||||
}
|
||||
test "isExpired always returns false for manually-expired requests" {
|
||||
PrayerRequest.isExpired (localDateNow ()) SmallGroup.empty
|
||||
{ PrayerRequest.empty with UpdatedDate = (instantNow ()) - Duration.FromDays 1; Expiration = Manual }
|
||||
|> Flip.Expect.isFalse "A never-expired request should never be considered expired"
|
||||
}
|
||||
test "isExpired always returns false for long term/recurring requests" {
|
||||
PrayerRequest.isExpired (localDateNow ()) SmallGroup.empty
|
||||
{ PrayerRequest.empty with RequestType = LongTermRequest }
|
||||
|> Flip.Expect.isFalse "A recurring/long-term request should never be considered expired"
|
||||
}
|
||||
test "isExpired always returns true for force-expired requests" {
|
||||
PrayerRequest.isExpired (localDateNow ()) SmallGroup.empty
|
||||
{ PrayerRequest.empty with UpdatedDate = (instantNow ()); Expiration = Forced }
|
||||
|> Flip.Expect.isTrue "A force-expired request should always be considered expired"
|
||||
}
|
||||
test "isExpired returns false for non-expired requests" {
|
||||
let now = instantNow ()
|
||||
PrayerRequest.isExpired (now.InUtc().Date) SmallGroup.empty
|
||||
{ PrayerRequest.empty with UpdatedDate = now - Duration.FromDays 5 }
|
||||
|> Flip.Expect.isFalse "A request updated 5 days ago should not be considered expired"
|
||||
}
|
||||
test "isExpired returns true for expired requests" {
|
||||
let now = instantNow ()
|
||||
PrayerRequest.isExpired (now.InUtc().Date) SmallGroup.empty
|
||||
{ PrayerRequest.empty with UpdatedDate = now - Duration.FromDays 15 }
|
||||
|> Flip.Expect.isTrue "A request updated 15 days ago should be considered expired"
|
||||
}
|
||||
test "isExpired returns true for same-day expired requests" {
|
||||
let now = instantNow ()
|
||||
PrayerRequest.isExpired (now.InUtc().Date) SmallGroup.empty
|
||||
{ PrayerRequest.empty with UpdatedDate = now - (Duration.FromDays 14) - (Duration.FromSeconds 1L) }
|
||||
|> Flip.Expect.isTrue "A request entered a second before midnight should be considered expired"
|
||||
}
|
||||
test "updateRequired returns false for expired requests" {
|
||||
PrayerRequest.updateRequired (localDateNow ()) SmallGroup.empty
|
||||
{ PrayerRequest.empty with Expiration = Forced }
|
||||
|> Flip.Expect.isFalse "An expired request should not require an update"
|
||||
}
|
||||
test "updateRequired returns false when an update is not required for an active request" {
|
||||
let now = instantNow ()
|
||||
PrayerRequest.updateRequired (localDateNow ()) SmallGroup.empty
|
||||
{ PrayerRequest.empty with RequestType = LongTermRequest; UpdatedDate = now - Duration.FromDays 14 }
|
||||
|> Flip.Expect.isFalse "An active request updated 14 days ago should not require an update until 28 days"
|
||||
}
|
||||
test "UpdateRequired returns true when an update is required for an active request" {
|
||||
let now = instantNow ()
|
||||
PrayerRequest.updateRequired (localDateNow ()) SmallGroup.empty
|
||||
{ PrayerRequest.empty with RequestType = LongTermRequest; UpdatedDate = now - Duration.FromDays 34 }
|
||||
|> Flip.Expect.isTrue "An active request updated 34 days ago should require an update (past 28 days)"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let prayerRequestTypeTests =
|
||||
testList "PrayerRequestType" [
|
||||
test "CurrentRequest code is correct" {
|
||||
Expect.equal CurrentRequest.code "C" "The code for CurrentRequest should have been \"C\""
|
||||
}
|
||||
test "LongTermRequest code is correct" {
|
||||
Expect.equal LongTermRequest.code "L" "The code for LongTermRequest should have been \"L\""
|
||||
}
|
||||
test "PraiseReport code is correct" {
|
||||
Expect.equal PraiseReport.code "P" "The code for PraiseReport should have been \"P\""
|
||||
}
|
||||
test "Expecting code is correct" {
|
||||
Expect.equal Expecting.code "E" "The code for Expecting should have been \"E\""
|
||||
}
|
||||
test "Announcement code is correct" {
|
||||
Expect.equal Announcement.code "A" "The code for Announcement should have been \"A\""
|
||||
}
|
||||
test "fromCode C should return CurrentRequest" {
|
||||
Expect.equal (PrayerRequestType.fromCode "C") CurrentRequest
|
||||
"\"C\" should have been converted to CurrentRequest"
|
||||
}
|
||||
test "fromCode L should return LongTermRequest" {
|
||||
Expect.equal (PrayerRequestType.fromCode "L") LongTermRequest
|
||||
"\"L\" should have been converted to LongTermRequest"
|
||||
}
|
||||
test "fromCode P should return PraiseReport" {
|
||||
Expect.equal (PrayerRequestType.fromCode "P") PraiseReport "\"P\" should have been converted to PraiseReport"
|
||||
}
|
||||
test "fromCode E should return Expecting" {
|
||||
Expect.equal (PrayerRequestType.fromCode "E") Expecting "\"E\" should have been converted to Expecting"
|
||||
}
|
||||
test "fromCode A should return Announcement" {
|
||||
Expect.equal (PrayerRequestType.fromCode "A") Announcement "\"A\" should have been converted to Announcement"
|
||||
}
|
||||
test "fromCode R should raise" {
|
||||
Expect.throws (fun () -> PrayerRequestType.fromCode "R" |> ignore)
|
||||
"An unknown code should have raised an exception"
|
||||
}
|
||||
testList "PrayerRequestType" [
|
||||
test "CurrentRequest code is correct" {
|
||||
Expect.equal (PrayerRequestType.toCode CurrentRequest) "C"
|
||||
"The code for CurrentRequest should have been \"C\""
|
||||
}
|
||||
test "LongTermRequest code is correct" {
|
||||
Expect.equal (PrayerRequestType.toCode LongTermRequest) "L"
|
||||
"The code for LongTermRequest should have been \"L\""
|
||||
}
|
||||
test "PraiseReport code is correct" {
|
||||
Expect.equal (PrayerRequestType.toCode PraiseReport) "P" "The code for PraiseReport should have been \"P\""
|
||||
}
|
||||
test "Expecting code is correct" {
|
||||
Expect.equal (PrayerRequestType.toCode Expecting) "E" "The code for Expecting should have been \"E\""
|
||||
}
|
||||
test "Announcement code is correct" {
|
||||
Expect.equal (PrayerRequestType.toCode Announcement) "A" "The code for Announcement should have been \"A\""
|
||||
}
|
||||
test "fromCode C should return CurrentRequest" {
|
||||
Expect.equal (PrayerRequestType.fromCode "C") CurrentRequest
|
||||
"\"C\" should have been converted to CurrentRequest"
|
||||
}
|
||||
test "fromCode L should return LongTermRequest" {
|
||||
Expect.equal (PrayerRequestType.fromCode "L") LongTermRequest
|
||||
"\"L\" should have been converted to LongTermRequest"
|
||||
}
|
||||
test "fromCode P should return PraiseReport" {
|
||||
Expect.equal (PrayerRequestType.fromCode "P") PraiseReport
|
||||
"\"P\" should have been converted to PraiseReport"
|
||||
}
|
||||
test "fromCode E should return Expecting" {
|
||||
Expect.equal (PrayerRequestType.fromCode "E") Expecting "\"E\" should have been converted to Expecting"
|
||||
}
|
||||
test "fromCode A should return Announcement" {
|
||||
Expect.equal (PrayerRequestType.fromCode "A") Announcement
|
||||
"\"A\" should have been converted to Announcement"
|
||||
}
|
||||
test "fromCode R should raise" {
|
||||
Expect.throws (fun () -> PrayerRequestType.fromCode "R" |> ignore)
|
||||
"An unknown code should have raised an exception"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let requestSortTests =
|
||||
testList "RequestSort" [
|
||||
test "SortByDate code is correct" {
|
||||
Expect.equal SortByDate.code "D" "The code for SortByDate should have been \"D\""
|
||||
}
|
||||
test "SortByRequestor code is correct" {
|
||||
Expect.equal SortByRequestor.code "R" "The code for SortByRequestor should have been \"R\""
|
||||
}
|
||||
test "fromCode D should return SortByDate" {
|
||||
Expect.equal (RequestSort.fromCode "D") SortByDate "\"D\" should have been converted to SortByDate"
|
||||
}
|
||||
test "fromCode R should return SortByRequestor" {
|
||||
Expect.equal (RequestSort.fromCode "R") SortByRequestor "\"R\" should have been converted to SortByRequestor"
|
||||
}
|
||||
test "fromCode Q should raise" {
|
||||
Expect.throws (fun () -> RequestSort.fromCode "Q" |> ignore) "An unknown code should have raised an exception"
|
||||
}
|
||||
testList "RequestSort" [
|
||||
test "SortByDate code is correct" {
|
||||
Expect.equal (RequestSort.toCode SortByDate) "D" "The code for SortByDate should have been \"D\""
|
||||
}
|
||||
test "SortByRequestor code is correct" {
|
||||
Expect.equal (RequestSort.toCode SortByRequestor) "R" "The code for SortByRequestor should have been \"R\""
|
||||
}
|
||||
test "fromCode D should return SortByDate" {
|
||||
Expect.equal (RequestSort.fromCode "D") SortByDate "\"D\" should have been converted to SortByDate"
|
||||
}
|
||||
test "fromCode R should return SortByRequestor" {
|
||||
Expect.equal (RequestSort.fromCode "R") SortByRequestor
|
||||
"\"R\" should have been converted to SortByRequestor"
|
||||
}
|
||||
test "fromCode Q should raise" {
|
||||
Expect.throws (fun () -> RequestSort.fromCode "Q" |> ignore)
|
||||
"An unknown code should have raised an exception"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let smallGroupTests =
|
||||
testList "SmallGroup" [
|
||||
let now = DateTime (2017, 5, 12, 12, 15, 0, DateTimeKind.Utc)
|
||||
let withFakeClock f () =
|
||||
FakeClock (Instant.FromDateTimeUtc now) |> f
|
||||
yield test "empty is as expected" {
|
||||
let mt = SmallGroup.empty
|
||||
Expect.equal mt.smallGroupId Guid.Empty "The small group ID should have been an empty GUID"
|
||||
Expect.equal mt.churchId Guid.Empty "The church ID should have been an empty GUID"
|
||||
Expect.equal mt.name "" "The name should have been blank"
|
||||
Expect.equal mt.church.churchId Guid.Empty "The church should have been an empty one"
|
||||
Expect.isNotNull mt.members "The members navigation property should not be null"
|
||||
Expect.isEmpty mt.members "There should be no members for an empty small group"
|
||||
Expect.isNotNull mt.prayerRequests "The prayer requests navigation property should not be null"
|
||||
Expect.isEmpty mt.prayerRequests "There should be no prayer requests for an empty small group"
|
||||
Expect.isNotNull mt.users "The users navigation property should not be null"
|
||||
Expect.isEmpty mt.users "There should be no users for an empty small group"
|
||||
}
|
||||
yield! testFixture withFakeClock [
|
||||
"localTimeNow adjusts the time ahead of UTC",
|
||||
fun clock ->
|
||||
let grp = { SmallGroup.empty with preferences = { ListPreferences.empty with timeZoneId = "Europe/Berlin" } }
|
||||
Expect.isGreaterThan (grp.localTimeNow clock) now "UTC to Europe/Berlin should have added hours"
|
||||
"localTimeNow adjusts the time behind UTC",
|
||||
fun clock ->
|
||||
Expect.isLessThan (SmallGroup.empty.localTimeNow clock) now
|
||||
"UTC to America/Denver should have subtracted hours"
|
||||
"localTimeNow returns UTC when the time zone is invalid",
|
||||
fun clock ->
|
||||
let grp = { SmallGroup.empty with preferences = { ListPreferences.empty with timeZoneId = "garbage" } }
|
||||
Expect.equal (grp.localTimeNow clock) now "UTC should have been returned for an invalid time zone"
|
||||
]
|
||||
yield test "localTimeNow fails when clock is not passed" {
|
||||
Expect.throws (fun () -> (SmallGroup.empty.localTimeNow >> ignore) null)
|
||||
"Should have raised an exception for null clock"
|
||||
}
|
||||
yield test "localDateNow returns the date portion" {
|
||||
let now' = DateTime (2017, 5, 12, 1, 15, 0, DateTimeKind.Utc)
|
||||
let clock = FakeClock (Instant.FromDateTimeUtc now')
|
||||
Expect.isLessThan (SmallGroup.empty.localDateNow clock) now.Date "The date should have been a day earlier"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let timeZoneTests =
|
||||
testList "TimeZone" [
|
||||
test "empty is as expected" {
|
||||
let mt = TimeZone.empty
|
||||
Expect.equal mt.timeZoneId "" "The time zone ID should have been blank"
|
||||
Expect.equal mt.description "" "The description should have been blank"
|
||||
Expect.equal mt.sortOrder 0 "The sort order should have been zero"
|
||||
Expect.isFalse mt.isActive "The is-active flag should not have been set"
|
||||
}
|
||||
testList "SmallGroup" [
|
||||
let now = Instant.FromDateTimeUtc (DateTime (2017, 5, 12, 12, 15, 0, DateTimeKind.Utc))
|
||||
let withFakeClock f () =
|
||||
FakeClock now |> f
|
||||
yield test "empty is as expected" {
|
||||
let mt = SmallGroup.empty
|
||||
Expect.equal mt.Id.Value Guid.Empty "The small group ID should have been an empty GUID"
|
||||
Expect.equal mt.ChurchId.Value Guid.Empty "The church ID should have been an empty GUID"
|
||||
Expect.equal mt.Name "" "The name should have been blank"
|
||||
}
|
||||
yield! testFixture withFakeClock [
|
||||
"LocalTimeNow adjusts the time ahead of UTC",
|
||||
fun clock ->
|
||||
let grp =
|
||||
{ SmallGroup.empty with
|
||||
Preferences = { ListPreferences.empty with TimeZoneId = TimeZoneId "Europe/Berlin" }
|
||||
}
|
||||
Expect.isGreaterThan (SmallGroup.localTimeNow clock grp) (now.InUtc().LocalDateTime)
|
||||
"UTC to Europe/Berlin should have added hours"
|
||||
"LocalTimeNow adjusts the time behind UTC",
|
||||
fun clock ->
|
||||
Expect.isLessThan (SmallGroup.localTimeNow clock SmallGroup.empty) (now.InUtc().LocalDateTime)
|
||||
"UTC to America/Denver should have subtracted hours"
|
||||
"LocalTimeNow returns UTC when the time zone is invalid",
|
||||
fun clock ->
|
||||
let grp =
|
||||
{ SmallGroup.empty with
|
||||
Preferences = { ListPreferences.empty with TimeZoneId = TimeZoneId "garbage" }
|
||||
}
|
||||
Expect.equal (SmallGroup.localTimeNow clock grp) (now.InUtc().LocalDateTime)
|
||||
"UTC should have been returned for an invalid time zone"
|
||||
]
|
||||
yield test "localTimeNow fails when clock is not passed" {
|
||||
Expect.throws (fun () -> (SmallGroup.localTimeNow null SmallGroup.empty |> ignore))
|
||||
"Should have raised an exception for null clock"
|
||||
}
|
||||
yield test "LocalDateNow returns the date portion" {
|
||||
let clock = FakeClock (Instant.FromDateTimeUtc (DateTime (2017, 5, 12, 1, 15, 0, DateTimeKind.Utc)))
|
||||
Expect.isLessThan (SmallGroup.localDateNow clock SmallGroup.empty) (now.InUtc().Date)
|
||||
"The date should have been a day earlier"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let userTests =
|
||||
testList "User" [
|
||||
test "empty is as expected" {
|
||||
let mt = User.empty
|
||||
Expect.equal mt.userId Guid.Empty "The user ID should have been an empty GUID"
|
||||
Expect.equal mt.firstName "" "The first name should have been blank"
|
||||
Expect.equal mt.lastName "" "The last name should have been blank"
|
||||
Expect.equal mt.emailAddress "" "The e-mail address should have been blank"
|
||||
Expect.isFalse mt.isAdmin "The is admin flag should not have been set"
|
||||
Expect.equal mt.passwordHash "" "The password hash should have been blank"
|
||||
Expect.isNone mt.salt "The password salt should not exist"
|
||||
Expect.isNotNull mt.smallGroups "The small groups navigation property should not have been null"
|
||||
Expect.isEmpty mt.smallGroups "There should be no small groups for an empty user"
|
||||
}
|
||||
test "fullName concatenates first and last names" {
|
||||
let user = { User.empty with firstName = "Unit"; lastName = "Test" }
|
||||
Expect.equal user.fullName "Unit Test" "The full name should be the first and last, separated by a space"
|
||||
}
|
||||
testList "User" [
|
||||
test "empty is as expected" {
|
||||
let mt = User.empty
|
||||
Expect.equal mt.Id.Value Guid.Empty "The user ID should have been an empty GUID"
|
||||
Expect.equal mt.FirstName "" "The first name should have been blank"
|
||||
Expect.equal mt.LastName "" "The last name should have been blank"
|
||||
Expect.equal mt.Email "" "The e-mail address should have been blank"
|
||||
Expect.isFalse mt.IsAdmin "The is admin flag should not have been set"
|
||||
Expect.equal mt.PasswordHash "" "The password hash should have been blank"
|
||||
}
|
||||
test "Name concatenates first and last names" {
|
||||
let user = { User.empty with FirstName = "Unit"; LastName = "Test" }
|
||||
Expect.equal user.Name "Unit Test" "The full name should be the first and last, separated by a space"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let userSmallGroupTests =
|
||||
testList "UserSmallGroup" [
|
||||
test "empty is as expected" {
|
||||
let mt = UserSmallGroup.empty
|
||||
Expect.equal mt.userId Guid.Empty "The user ID should have been an empty GUID"
|
||||
Expect.equal mt.smallGroupId Guid.Empty "The small group ID should have been an empty GUID"
|
||||
Expect.equal mt.user.userId Guid.Empty "The user should have been an empty one"
|
||||
Expect.equal mt.smallGroup.smallGroupId Guid.Empty "The small group should have been an empty one"
|
||||
}
|
||||
testList "UserSmallGroup" [
|
||||
test "empty is as expected" {
|
||||
let mt = UserSmallGroup.empty
|
||||
Expect.equal mt.UserId.Value Guid.Empty "The user ID should have been an empty GUID"
|
||||
Expect.equal mt.SmallGroupId.Value Guid.Empty "The small group ID should have been an empty GUID"
|
||||
}
|
||||
]
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -15,9 +14,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Expecto" Version="8.13.1" />
|
||||
<PackageReference Include="Expecto.VisualStudio.TestAdapter" Version="10.0.2" />
|
||||
<PackageReference Include="NodaTime.Testing" Version="2.4.7" />
|
||||
<PackageReference Include="Expecto" Version="10.2.1" />
|
||||
<PackageReference Include="NodaTime.Testing" Version="3.1.11" />
|
||||
<PackageReference Update="FSharp.Core" Version="8.0.300" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
[<EntryPoint>]
|
||||
let main argv =
|
||||
runTestsInAssembly defaultConfig argv
|
||||
runTestsInAssemblyWithCLIArgs [] argv
|
||||
|
@ -1,208 +1,215 @@
|
||||
module PrayerTracker.UI.CommonFunctionsTests
|
||||
|
||||
open System.IO
|
||||
open Expecto
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open Microsoft.AspNetCore.Mvc.Localization
|
||||
open Microsoft.Extensions.Localization
|
||||
open PrayerTracker.Tests.TestLocalization
|
||||
open PrayerTracker.Views
|
||||
open System.IO
|
||||
|
||||
|
||||
[<Tests>]
|
||||
let iconSizedTests =
|
||||
testList "iconSized" [
|
||||
test "succeeds" {
|
||||
let ico = iconSized 18 "tom-&-jerry" |> renderHtmlNode
|
||||
Expect.equal ico "<i class=\"material-icons md-18\">tom-&-jerry</i>" "icon HTML not correct"
|
||||
}
|
||||
testList "iconSized" [
|
||||
test "succeeds" {
|
||||
let ico = iconSized 18 "tom-&-jerry" |> renderHtmlNode
|
||||
Expect.equal ico """<i class="material-icons md-18">tom-&-jerry</i>""" "icon HTML not correct"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let iconTests =
|
||||
testList "icon" [
|
||||
test "succeeds" {
|
||||
let ico = icon "bob-&-tom" |> renderHtmlNode
|
||||
Expect.equal ico "<i class=\"material-icons\">bob-&-tom</i>" "icon HTML not correct"
|
||||
}
|
||||
testList "icon" [
|
||||
test "succeeds" {
|
||||
let ico = icon "bob-&-tom" |> renderHtmlNode
|
||||
Expect.equal ico """<i class="material-icons">bob-&-tom</i>""" "icon HTML not correct"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let locStrTests =
|
||||
testList "locStr" [
|
||||
test "succeeds" {
|
||||
let enc = locStr (LocalizedString ("test", "test&")) |> renderHtmlNode
|
||||
Expect.equal enc "test&" "string not encoded correctly"
|
||||
}
|
||||
testList "locStr" [
|
||||
test "succeeds" {
|
||||
let enc = locStr (LocalizedString ("test", "test&")) |> renderHtmlNode
|
||||
Expect.equal enc "test&" "string not encoded correctly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let namedColorListTests =
|
||||
testList "namedColorList" [
|
||||
test "succeeds with default values" {
|
||||
let expected =
|
||||
[ "<select name=\"the-name\">"
|
||||
"<option value=\"aqua\" style=\"background-color:aqua;color:black;\">aqua</option>"
|
||||
"<option value=\"black\" style=\"background-color:black;color:white;\">black</option>"
|
||||
"<option value=\"blue\" style=\"background-color:blue;color:white;\">blue</option>"
|
||||
"<option value=\"fuchsia\" style=\"background-color:fuchsia;color:black;\">fuchsia</option>"
|
||||
"<option value=\"gray\" style=\"background-color:gray;color:white;\">gray</option>"
|
||||
"<option value=\"green\" style=\"background-color:green;color:white;\">green</option>"
|
||||
"<option value=\"lime\" style=\"background-color:lime;color:black;\">lime</option>"
|
||||
"<option value=\"maroon\" style=\"background-color:maroon;color:white;\">maroon</option>"
|
||||
"<option value=\"navy\" style=\"background-color:navy;color:white;\">navy</option>"
|
||||
"<option value=\"olive\" style=\"background-color:olive;color:white;\">olive</option>"
|
||||
"<option value=\"purple\" style=\"background-color:purple;color:white;\">purple</option>"
|
||||
"<option value=\"red\" style=\"background-color:red;color:black;\">red</option>"
|
||||
"<option value=\"silver\" style=\"background-color:silver;color:black;\">silver</option>"
|
||||
"<option value=\"teal\" style=\"background-color:teal;color:white;\">teal</option>"
|
||||
"<option value=\"white\" style=\"background-color:white;color:black;\">white</option>"
|
||||
"<option value=\"yellow\" style=\"background-color:yellow;color:black;\">yellow</option>"
|
||||
"</select>"
|
||||
]
|
||||
|> String.concat ""
|
||||
let selectList = namedColorList "the-name" "" [] _s |> renderHtmlNode
|
||||
Expect.equal expected selectList "The default select list was not generated correctly"
|
||||
}
|
||||
test "succeeds with a selected value" {
|
||||
let selectList = namedColorList "the-name" "white" [] _s |> renderHtmlNode
|
||||
Expect.stringContains selectList " selected>white</option>" "Selected option not generated correctly"
|
||||
}
|
||||
test "succeeds with extra attributes" {
|
||||
let selectList = namedColorList "the-name" "" [ _id "myId" ] _s |> renderHtmlNode
|
||||
Expect.stringStarts selectList "<select name=\"the-name\" id=\"myId\">" "Attributes not included correctly"
|
||||
}
|
||||
testList "namedColorList" [
|
||||
test "succeeds with default values" {
|
||||
let expected =
|
||||
[ """<select name="the-name">"""
|
||||
"""<option value="aqua" style="background-color:aqua;color:black;">aqua</option>"""
|
||||
"""<option value="black" style="background-color:black;color:white;">black</option>"""
|
||||
"""<option value="blue" style="background-color:blue;color:white;">blue</option>"""
|
||||
"""<option value="fuchsia" style="background-color:fuchsia;color:black;">fuchsia</option>"""
|
||||
"""<option value="gray" style="background-color:gray;color:white;">gray</option>"""
|
||||
"""<option value="green" style="background-color:green;color:white;">green</option>"""
|
||||
"""<option value="lime" style="background-color:lime;color:black;">lime</option>"""
|
||||
"""<option value="maroon" style="background-color:maroon;color:white;">maroon</option>"""
|
||||
"""<option value="navy" style="background-color:navy;color:white;">navy</option>"""
|
||||
"""<option value="olive" style="background-color:olive;color:white;">olive</option>"""
|
||||
"""<option value="purple" style="background-color:purple;color:white;">purple</option>"""
|
||||
"""<option value="red" style="background-color:red;color:black;">red</option>"""
|
||||
"""<option value="silver" style="background-color:silver;color:black;">silver</option>"""
|
||||
"""<option value="teal" style="background-color:teal;color:white;">teal</option>"""
|
||||
"""<option value="white" style="background-color:white;color:black;">white</option>"""
|
||||
"""<option value="yellow" style="background-color:yellow;color:black;">yellow</option>"""
|
||||
"</select>"
|
||||
]
|
||||
|> String.concat ""
|
||||
let selectList = namedColorList "the-name" "" [] _s |> renderHtmlNode
|
||||
Expect.equal expected selectList "The default select list was not generated correctly"
|
||||
}
|
||||
test "succeeds with a selected value" {
|
||||
let selectList = namedColorList "the-name" "white" [] _s |> renderHtmlNode
|
||||
Expect.stringContains selectList " selected>white</option>" "Selected option not generated correctly"
|
||||
}
|
||||
test "succeeds with extra attributes" {
|
||||
let selectList = namedColorList "the-name" "" [ _id "myId" ] _s |> renderHtmlNode
|
||||
Expect.stringStarts selectList """<select name="the-name" id="myId">""" "Attributes not included correctly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let radioTests =
|
||||
testList "radio" [
|
||||
test "succeeds when not selected" {
|
||||
let rad = radio "a-name" "anId" "test" "unit" |> renderHtmlNode
|
||||
Expect.equal rad "<input type=\"radio\" name=\"a-name\" id=\"anId\" value=\"test\">"
|
||||
"Unselected radio button not generated correctly"
|
||||
}
|
||||
test "succeeds when selected" {
|
||||
let rad = radio "a-name" "anId" "unit" "unit" |> renderHtmlNode
|
||||
Expect.equal rad "<input type=\"radio\" name=\"a-name\" id=\"anId\" value=\"unit\" checked>"
|
||||
"Selected radio button not generated correctly"
|
||||
}
|
||||
testList "radio" [
|
||||
test "succeeds when not selected" {
|
||||
let rad = radio "a-name" "anId" "test" "unit" |> renderHtmlNode
|
||||
Expect.equal rad """<input type="radio" name="a-name" id="anId" value="test">"""
|
||||
"Unselected radio button not generated correctly"
|
||||
}
|
||||
test "succeeds when selected" {
|
||||
let rad = radio "a-name" "anId" "unit" "unit" |> renderHtmlNode
|
||||
Expect.equal rad """<input type="radio" name="a-name" id="anId" value="unit" checked>"""
|
||||
"Selected radio button not generated correctly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let rawLocTextTests =
|
||||
testList "rawLocText" [
|
||||
test "succeeds" {
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw (LocalizedHtmlString ("test", "test&")) |> renderHtmlNode
|
||||
Expect.equal raw "test&" "string not written correctly"
|
||||
}
|
||||
testList "rawLocText" [
|
||||
test "succeeds" {
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw (LocalizedHtmlString ("test", "test&")) |> renderHtmlNode
|
||||
Expect.equal raw "test&" "string not written correctly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let selectDefaultTests =
|
||||
testList "selectDefault" [
|
||||
test "succeeds" {
|
||||
Expect.equal (selectDefault "a&b") "ā a&b ā" "Default selection not generated correctly"
|
||||
}
|
||||
testList "selectDefault" [
|
||||
test "succeeds" {
|
||||
Expect.equal (selectDefault "a&b") "ā a&b ā" "Default selection not generated correctly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let selectListTests =
|
||||
testList "selectList" [
|
||||
test "succeeds with minimum options" {
|
||||
let theList = selectList "a-list" "" [] [] |> renderHtmlNode
|
||||
Expect.equal theList "<select name=\"a-list\" id=\"a-list\"></select>" "Empty select list not generated correctly"
|
||||
}
|
||||
test "succeeds with all options" {
|
||||
let theList =
|
||||
[ "tom", "Tom&"
|
||||
"bob", "Bob"
|
||||
"jan", "Jan"
|
||||
]
|
||||
|> selectList "the-list" "bob" [ _style "ugly" ]
|
||||
|> renderHtmlNode
|
||||
let expected =
|
||||
[ "<select name=\"the-list\" id=\"the-list\" style=\"ugly\">"
|
||||
"<option value=\"tom\">Tom&</option>"
|
||||
"<option value=\"bob\" selected>Bob</option>"
|
||||
"<option value=\"jan\">Jan</option>"
|
||||
"</select>"
|
||||
]
|
||||
|> String.concat ""
|
||||
Expect.equal theList expected "Filled select list not generated correctly"
|
||||
}
|
||||
testList "selectList" [
|
||||
test "succeeds with minimum options" {
|
||||
let theList = selectList "a-list" "" [] [] |> renderHtmlNode
|
||||
Expect.equal theList """<select name="a-list" id="a-list"></select>"""
|
||||
"Empty select list not generated correctly"
|
||||
}
|
||||
test "succeeds with all options" {
|
||||
let theList =
|
||||
[ "tom", "Tom&"
|
||||
"bob", "Bob"
|
||||
"jan", "Jan"
|
||||
]
|
||||
|> selectList "the-list" "bob" [ _style "ugly" ]
|
||||
|> renderHtmlNode
|
||||
let expected =
|
||||
[ """<select name="the-list" id="the-list" style="ugly">"""
|
||||
"""<option value="tom">Tom&</option>"""
|
||||
"""<option value="bob" selected>Bob</option>"""
|
||||
"""<option value="jan">Jan</option>"""
|
||||
"""</select>"""
|
||||
]
|
||||
|> String.concat ""
|
||||
Expect.equal theList expected "Filled select list not generated correctly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let spaceTests =
|
||||
testList "space" [
|
||||
test "succeeds" {
|
||||
Expect.equal (renderHtmlNode space) " " "space literal not correct"
|
||||
}
|
||||
testList "space" [
|
||||
test "succeeds" {
|
||||
Expect.equal (renderHtmlNode space) " " "space literal not correct"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
[<Tests>]
|
||||
let submitTests =
|
||||
testList "submit" [
|
||||
test "succeeds" {
|
||||
let btn = submit [ _class "slick" ] "file-ico" _s.["a&b"] |> renderHtmlNode
|
||||
Expect.equal
|
||||
btn
|
||||
"<button type=\"submit\" class=\"slick\"><i class=\"material-icons\">file-ico</i> a&b</button>"
|
||||
"Submit button not generated correctly"
|
||||
}
|
||||
testList "submit" [
|
||||
test "succeeds" {
|
||||
let btn = submit [ _class "slick" ] "file-ico" _s["a&b"] |> renderHtmlNode
|
||||
Expect.equal
|
||||
btn
|
||||
"""<button type="submit" class="slick"><i class="material-icons">file-ico</i> a&b</button>"""
|
||||
"Submit button not generated correctly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let tableSummaryTests =
|
||||
testList "tableSummary" [
|
||||
test "succeeds for no entries" {
|
||||
let sum = tableSummary 0 _s |> renderHtmlNode
|
||||
Expect.equal sum "<div class=\"pt-center-text\"><small>No Entries to Display</small></div>"
|
||||
"Summary for no items is incorrect"
|
||||
}
|
||||
test "succeeds for one entry" {
|
||||
let sum = tableSummary 1 _s |> renderHtmlNode
|
||||
Expect.equal sum "<div class=\"pt-center-text\"><small>Displaying 1 Entry</small></div>"
|
||||
"Summary for one item is incorrect"
|
||||
}
|
||||
test "succeeds for many entries" {
|
||||
let sum = tableSummary 5 _s |> renderHtmlNode
|
||||
Expect.equal sum "<div class=\"pt-center-text\"><small>Displaying 5 Entries</small></div>"
|
||||
"Summary for many items is incorrect"
|
||||
}
|
||||
testList "tableSummary" [
|
||||
test "succeeds for no entries" {
|
||||
let sum = tableSummary 0 _s |> renderHtmlNode
|
||||
Expect.equal sum """<div class="pt-center-text"><small>No Entries to Display</small></div>"""
|
||||
"Summary for no items is incorrect"
|
||||
}
|
||||
test "succeeds for one entry" {
|
||||
let sum = tableSummary 1 _s |> renderHtmlNode
|
||||
Expect.equal sum """<div class="pt-center-text"><small>Displaying 1 Entry</small></div>"""
|
||||
"Summary for one item is incorrect"
|
||||
}
|
||||
test "succeeds for many entries" {
|
||||
let sum = tableSummary 5 _s |> renderHtmlNode
|
||||
Expect.equal sum """<div class="pt-center-text"><small>Displaying 5 Entries</small></div>"""
|
||||
"Summary for many items is incorrect"
|
||||
}
|
||||
]
|
||||
|
||||
module TimeZones =
|
||||
|
||||
open PrayerTracker.Views.CommonFunctions.TimeZones
|
||||
open PrayerTracker.Entities
|
||||
open PrayerTracker.Views.CommonFunctions.TimeZones
|
||||
|
||||
[<Tests>]
|
||||
let nameTests =
|
||||
testList "TimeZones.name" [
|
||||
test "succeeds for US Eastern time" {
|
||||
Expect.equal (name "America/New_York" _s |> string) "Eastern" "US Eastern time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for US Central time" {
|
||||
Expect.equal (name "America/Chicago" _s |> string) "Central" "US Central time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for US Mountain time" {
|
||||
Expect.equal (name "America/Denver" _s |> string) "Mountain" "US Mountain time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for US Mountain (AZ) time" {
|
||||
Expect.equal (name "America/Phoenix" _s |> string) "Mountain (Arizona)"
|
||||
"US Mountain (AZ) time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for US Pacific time" {
|
||||
Expect.equal (name "America/Los_Angeles" _s |> string) "Pacific" "US Pacific time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for Central European time" {
|
||||
Expect.equal (name "Europe/Berlin" _s |> string) "Central European"
|
||||
"Central European time zone not returned correctly"
|
||||
}
|
||||
test "fails for unexpected time zone" {
|
||||
Expect.equal (name "Wakanda" _s |> string) "Wakanda" "Unexpected time zone should have returned the original ID"
|
||||
}
|
||||
]
|
||||
[<Tests>]
|
||||
let nameTests =
|
||||
testList "TimeZones.name" [
|
||||
test "succeeds for US Eastern time" {
|
||||
Expect.equal (name (TimeZoneId "America/New_York") _s |> string) "Eastern"
|
||||
"US Eastern time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for US Central time" {
|
||||
Expect.equal (name (TimeZoneId "America/Chicago") _s |> string) "Central"
|
||||
"US Central time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for US Mountain time" {
|
||||
Expect.equal (name (TimeZoneId "America/Denver") _s |> string) "Mountain"
|
||||
"US Mountain time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for US Mountain (AZ) time" {
|
||||
Expect.equal (name (TimeZoneId "America/Phoenix") _s |> string) "Mountain (Arizona)"
|
||||
"US Mountain (AZ) time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for US Pacific time" {
|
||||
Expect.equal (name (TimeZoneId "America/Los_Angeles") _s |> string) "Pacific"
|
||||
"US Pacific time zone not returned correctly"
|
||||
}
|
||||
test "succeeds for Central European time" {
|
||||
Expect.equal (name (TimeZoneId "Europe/Berlin") _s |> string) "Central European"
|
||||
"Central European time zone not returned correctly"
|
||||
}
|
||||
test "fails for unexpected time zone" {
|
||||
Expect.equal (name (TimeZoneId "Wakanda") _s |> string) "Wakanda"
|
||||
"Unexpected time zone should have returned the original ID"
|
||||
}
|
||||
]
|
||||
|
@ -5,189 +5,192 @@ open PrayerTracker
|
||||
|
||||
[<Tests>]
|
||||
let ckEditorToTextTests =
|
||||
testList "ckEditorToText" [
|
||||
test "replaces newline/tab sequence with nothing" {
|
||||
Expect.equal (ckEditorToText "Here is some \n\ttext") "Here is some text"
|
||||
"Newline/tab sequence should have been removed"
|
||||
}
|
||||
test "replaces with a space" {
|
||||
Expect.equal (ckEditorToText "Test text") "Test text" " should have been replaced with a space"
|
||||
}
|
||||
test "replaces double space with one non-breaking space and one regular space" {
|
||||
Expect.equal (ckEditorToText "Test text") "Test  text"
|
||||
"double space should have been replaced with one non-breaking space and one regular space"
|
||||
}
|
||||
test "replaces paragraph break with two line breaks" {
|
||||
Expect.equal (ckEditorToText "some</p><p>text") "some<br><br>text"
|
||||
"paragraph break should have been replaced with two line breaks"
|
||||
}
|
||||
test "removes start and end paragraph tags" {
|
||||
Expect.equal (ckEditorToText "<p>something something</p>") "something something"
|
||||
"start/end paragraph tags should have been removed"
|
||||
}
|
||||
test "trims the result" {
|
||||
Expect.equal (ckEditorToText " abc ") "abc" "Should have trimmed the resulting text"
|
||||
}
|
||||
test "does all the replacements and removals at one time" {
|
||||
Expect.equal (ckEditorToText " <p>Paragraph 1\n\t line two</p><p>Paragraph 2 x</p>")
|
||||
"Paragraph 1 line two<br><br>Paragraph 2  x"
|
||||
"all replacements and removals were not made correctly"
|
||||
}
|
||||
testList "ckEditorToText" [
|
||||
test "replaces newline/tab sequence with nothing" {
|
||||
Expect.equal (ckEditorToText "Here is some \n\ttext") "Here is some text"
|
||||
"Newline/tab sequence should have been removed"
|
||||
}
|
||||
test "replaces with a space" {
|
||||
Expect.equal (ckEditorToText "Test text") "Test text" " should have been replaced with a space"
|
||||
}
|
||||
test "replaces double space with one non-breaking space and one regular space" {
|
||||
Expect.equal (ckEditorToText "Test text") "Test  text"
|
||||
"double space should have been replaced with one non-breaking space and one regular space"
|
||||
}
|
||||
test "replaces paragraph break with two line breaks" {
|
||||
Expect.equal (ckEditorToText "some</p><p>text") "some<br><br>text"
|
||||
"paragraph break should have been replaced with two line breaks"
|
||||
}
|
||||
test "removes start and end paragraph tags" {
|
||||
Expect.equal (ckEditorToText "<p>something something</p>") "something something"
|
||||
"start/end paragraph tags should have been removed"
|
||||
}
|
||||
test "trims the result" {
|
||||
Expect.equal (ckEditorToText " abc ") "abc" "Should have trimmed the resulting text"
|
||||
}
|
||||
test "does all the replacements and removals at one time" {
|
||||
Expect.equal (ckEditorToText " <p>Paragraph 1\n\t line two</p><p>Paragraph 2 x</p>")
|
||||
"Paragraph 1 line two<br><br>Paragraph 2  x"
|
||||
"all replacements and removals were not made correctly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let htmlToPlainTextTests =
|
||||
testList "htmlToPlainText" [
|
||||
test "decodes HTML-encoded entities" {
|
||||
Expect.equal (htmlToPlainText "1 > 0") "1 > 0" "HTML-encoded entities should have been decoded"
|
||||
}
|
||||
test "trims the input HTML" {
|
||||
Expect.equal (htmlToPlainText " howdy ") "howdy" "HTML input string should have been trimmed"
|
||||
}
|
||||
test "replaces line breaks with new lines" {
|
||||
Expect.equal (htmlToPlainText "Lots<br>of<br />new<br>lines") "Lots\nof\nnew\nlines"
|
||||
"Break tags should have been converted to newline characters"
|
||||
}
|
||||
test "replaces non-breaking spaces with spaces" {
|
||||
Expect.equal (htmlToPlainText "Here is some more text") "Here is some more text"
|
||||
"Non-breaking spaces should have been replaced with spaces"
|
||||
}
|
||||
test "does all replacements at one time" {
|
||||
Expect.equal (htmlToPlainText " < <<br>test") "< <\ntest" "All replacements were not made correctly"
|
||||
}
|
||||
test "does not fail when passed null" {
|
||||
Expect.equal (htmlToPlainText null) "" "Should return an empty string for null input"
|
||||
}
|
||||
test "does not fail when passed an empty string" {
|
||||
Expect.equal (htmlToPlainText "") "" "Should return an empty string when given an empty string"
|
||||
}
|
||||
test "preserves blank lines for two consecutive line breaks" {
|
||||
let expected = "Paragraph 1\n\nParagraph 2\n\n...and paragraph 3"
|
||||
Expect.equal (htmlToPlainText "Paragraph 1<br><br>Paragraph 2<br><br>...and <strong>paragraph</strong> <i>3</i>")
|
||||
expected "Blank lines not preserved for consecutive line breaks"
|
||||
}
|
||||
testList "htmlToPlainText" [
|
||||
test "decodes HTML-encoded entities" {
|
||||
Expect.equal (htmlToPlainText "1 > 0") "1 > 0" "HTML-encoded entities should have been decoded"
|
||||
}
|
||||
test "trims the input HTML" {
|
||||
Expect.equal (htmlToPlainText " howdy ") "howdy" "HTML input string should have been trimmed"
|
||||
}
|
||||
test "replaces line breaks with new lines" {
|
||||
Expect.equal (htmlToPlainText "Lots<br>of<br />new<br>lines") "Lots\nof\nnew\nlines"
|
||||
"Break tags should have been converted to newline characters"
|
||||
}
|
||||
test "replaces non-breaking spaces with spaces" {
|
||||
Expect.equal (htmlToPlainText "Here is some more text") "Here is some more text"
|
||||
"Non-breaking spaces should have been replaced with spaces"
|
||||
}
|
||||
test "does all replacements at one time" {
|
||||
Expect.equal (htmlToPlainText " < <<br>test") "< <\ntest"
|
||||
"All replacements were not made correctly"
|
||||
}
|
||||
test "does not fail when passed null" {
|
||||
Expect.equal (htmlToPlainText null) "" "Should return an empty string for null input"
|
||||
}
|
||||
test "does not fail when passed an empty string" {
|
||||
Expect.equal (htmlToPlainText "") "" "Should return an empty string when given an empty string"
|
||||
}
|
||||
test "preserves blank lines for two consecutive line breaks" {
|
||||
let expected = "Paragraph 1\n\nParagraph 2\n\n...and paragraph 3"
|
||||
Expect.equal
|
||||
(htmlToPlainText "Paragraph 1<br><br>Paragraph 2<br><br>...and <strong>paragraph</strong> <i>3</i>")
|
||||
expected "Blank lines not preserved for consecutive line breaks"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let makeUrlTests =
|
||||
testList "makeUrl" [
|
||||
test "returns the URL when there are no parameters" {
|
||||
Expect.equal (makeUrl "/test" []) "/test" "The URL should not have had any query string parameters added"
|
||||
}
|
||||
test "returns the URL with one query string parameter" {
|
||||
Expect.equal (makeUrl "/test" [ "unit", "true" ]) "/test?unit=true" "The URL was not constructed properly"
|
||||
}
|
||||
test "returns the URL with multiple encoded query string parameters" {
|
||||
let url = makeUrl "/test" [ "space", "a space"; "turkey", "=" ]
|
||||
Expect.equal url "/test?space=a+space&turkey=%3D" "The URL was not constructed properly"
|
||||
}
|
||||
testList "makeUrl" [
|
||||
test "returns the URL when there are no parameters" {
|
||||
Expect.equal (makeUrl "/test" []) "/test" "The URL should not have had any query string parameters added"
|
||||
}
|
||||
test "returns the URL with one query string parameter" {
|
||||
Expect.equal (makeUrl "/test" [ "unit", "true" ]) "/test?unit=true" "The URL was not constructed properly"
|
||||
}
|
||||
test "returns the URL with multiple encoded query string parameters" {
|
||||
let url = makeUrl "/test" [ "space", "a space"; "turkey", "=" ]
|
||||
Expect.equal url "/test?space=a+space&turkey=%3D" "The URL was not constructed properly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let sndAsStringTests =
|
||||
testList "sndAsString" [
|
||||
test "converts the second item to a string" {
|
||||
Expect.equal (sndAsString ("a", 5)) "5" "The second part of the tuple should have been converted to a string"
|
||||
}
|
||||
testList "sndAsString" [
|
||||
test "converts the second item to a string" {
|
||||
Expect.equal (sndAsString ("a", 5)) "5"
|
||||
"The second part of the tuple should have been converted to a string"
|
||||
}
|
||||
]
|
||||
|
||||
module StringTests =
|
||||
|
||||
open PrayerTracker.Utils.String
|
||||
open PrayerTracker.Utils.String
|
||||
|
||||
[<Tests>]
|
||||
let replaceFirstTests =
|
||||
testList "String.replaceFirst" [
|
||||
test "replaces the first occurrence when it is found at the beginning of the string" {
|
||||
let testString = "unit unit unit"
|
||||
Expect.equal (replaceFirst "unit" "test" testString) "test unit unit"
|
||||
"First occurrence of a substring was not replaced properly at the beginning of the string"
|
||||
}
|
||||
test "replaces the first occurrence when it is found in the center of the string" {
|
||||
let testString = "test unit test"
|
||||
Expect.equal (replaceFirst "unit" "test" testString) "test test test"
|
||||
"First occurrence of a substring was not replaced properly when it is in the center of the string"
|
||||
}
|
||||
test "returns the original string if the replacement isn't found" {
|
||||
let testString = "unit tests"
|
||||
Expect.equal (replaceFirst "tested" "testing" testString) "unit tests"
|
||||
"String which did not have the target substring was not returned properly"
|
||||
}
|
||||
]
|
||||
[<Tests>]
|
||||
let replaceFirstTests =
|
||||
testList "String.replaceFirst" [
|
||||
test "replaces the first occurrence when it is found at the beginning of the string" {
|
||||
let testString = "unit unit unit"
|
||||
Expect.equal (replaceFirst "unit" "test" testString) "test unit unit"
|
||||
"First occurrence of a substring was not replaced properly at the beginning of the string"
|
||||
}
|
||||
test "replaces the first occurrence when it is found in the center of the string" {
|
||||
let testString = "test unit test"
|
||||
Expect.equal (replaceFirst "unit" "test" testString) "test test test"
|
||||
"First occurrence of a substring was not replaced properly when it is in the center of the string"
|
||||
}
|
||||
test "returns the original string if the replacement isn't found" {
|
||||
let testString = "unit tests"
|
||||
Expect.equal (replaceFirst "tested" "testing" testString) "unit tests"
|
||||
"String which did not have the target substring was not returned properly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let replaceTests =
|
||||
testList "String.replace" [
|
||||
test "succeeds" {
|
||||
Expect.equal (replace "a" "b" "abacab") "bbbcbb" "String did not replace properly"
|
||||
}
|
||||
]
|
||||
[<Tests>]
|
||||
let replaceTests =
|
||||
testList "String.replace" [
|
||||
test "succeeds" {
|
||||
Expect.equal (replace "a" "b" "abacab") "bbbcbb" "String did not replace properly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let trimTests =
|
||||
testList "String.trim" [
|
||||
test "succeeds" {
|
||||
Expect.equal (trim " abc ") "abc" "Space not trimmed from string properly"
|
||||
}
|
||||
]
|
||||
[<Tests>]
|
||||
let trimTests =
|
||||
testList "String.trim" [
|
||||
test "succeeds" {
|
||||
Expect.equal (trim " abc ") "abc" "Space not trimmed from string properly"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let stripTagsTests =
|
||||
let testString = "<p class=\"testing\">Here is some text<br> <br />and some more</p>"
|
||||
testList "stripTags" [
|
||||
test "does nothing if all tags are allowed" {
|
||||
Expect.equal (stripTags [ "p"; "br" ] testString) testString
|
||||
"There should have been no replacements in the target string"
|
||||
}
|
||||
test "strips the start/end tag for non allowed tag" {
|
||||
Expect.equal (stripTags [ "br" ] testString) "Here is some text<br> <br />and some more"
|
||||
"There should have been no \"p\" tag, but all \"br\" tags, in the returned string"
|
||||
}
|
||||
test "strips void/self-closing tags" {
|
||||
Expect.equal (stripTags [] testString) "Here is some text and some more"
|
||||
"There should have been no tags; all void and self-closing tags should have been stripped"
|
||||
}
|
||||
let testString = """<p class="testing">Here is some text<br> <br />and some more</p>"""
|
||||
testList "stripTags" [
|
||||
test "does nothing if all tags are allowed" {
|
||||
Expect.equal (stripTags [ "p"; "br" ] testString) testString
|
||||
"There should have been no replacements in the target string"
|
||||
}
|
||||
test "strips the start/end tag for non allowed tag" {
|
||||
Expect.equal (stripTags [ "br" ] testString) "Here is some text<br> <br />and some more"
|
||||
"There should have been no \"p\" tag, but all \"br\" tags, in the returned string"
|
||||
}
|
||||
test "strips void/self-closing tags" {
|
||||
Expect.equal (stripTags [] testString) "Here is some text and some more"
|
||||
"There should have been no tags; all void and self-closing tags should have been stripped"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let wordWrapTests =
|
||||
testList "wordWrap" [
|
||||
test "breaks where it is supposed to" {
|
||||
let testString = "The quick brown fox jumps over the lazy dog\nIt does!"
|
||||
Expect.equal (wordWrap 20 testString) "The quick brown fox\njumps over the lazy\ndog\nIt does!\n"
|
||||
"Line not broken correctly"
|
||||
}
|
||||
test "wraps long line without a space" {
|
||||
let testString = "Asamatteroffact, the dog does too"
|
||||
Expect.equal (wordWrap 10 testString) "Asamattero\nffact, the\ndog does\ntoo\n"
|
||||
"Longer line not broken correctly"
|
||||
}
|
||||
test "preserves blank lines" {
|
||||
let testString = "Here is\n\na string with blank lines"
|
||||
Expect.equal (wordWrap 80 testString) testString "Blank lines were not preserved"
|
||||
}
|
||||
testList "wordWrap" [
|
||||
test "breaks where it is supposed to" {
|
||||
let testString = "The quick brown fox jumps over the lazy dog\nIt does!"
|
||||
Expect.equal (wordWrap 20 testString) "The quick brown fox\njumps over the lazy\ndog\nIt does!\n"
|
||||
"Line not broken correctly"
|
||||
}
|
||||
test "wraps long line without a space" {
|
||||
let testString = "Asamatteroffact, the dog does too"
|
||||
Expect.equal (wordWrap 10 testString) "Asamattero\nffact, the\ndog does\ntoo\n"
|
||||
"Longer line not broken correctly"
|
||||
}
|
||||
test "preserves blank lines" {
|
||||
let testString = "Here is\n\na string with blank lines"
|
||||
Expect.equal (wordWrap 80 testString) testString "Blank lines were not preserved"
|
||||
}
|
||||
]
|
||||
|
||||
[<Tests>]
|
||||
let wordWrapBTests =
|
||||
testList "wordWrapB" [
|
||||
test "breaks where it is supposed to" {
|
||||
let testString = "The quick brown fox jumps over the lazy dog\nIt does!"
|
||||
Expect.equal (wordWrap 20 testString) "The quick brown fox\njumps over the lazy\ndog\nIt does!\n"
|
||||
"Line not broken correctly"
|
||||
}
|
||||
test "wraps long line without a space and a line with exact length" {
|
||||
let testString = "Asamatteroffact, the dog does too"
|
||||
Expect.equal (wordWrap 10 testString) "Asamattero\nffact, the\ndog does\ntoo\n"
|
||||
"Longer line not broken correctly"
|
||||
}
|
||||
test "wraps long line without a space and a line with non-exact length" {
|
||||
let testString = "Asamatteroffact, that dog does too"
|
||||
Expect.equal (wordWrap 10 testString) "Asamattero\nffact,\nthat dog\ndoes too\n"
|
||||
"Longer line not broken correctly"
|
||||
}
|
||||
test "preserves blank lines" {
|
||||
let testString = "Here is\n\na string with blank lines"
|
||||
Expect.equal (wordWrap 80 testString) testString "Blank lines were not preserved"
|
||||
}
|
||||
testList "wordWrapB" [
|
||||
test "breaks where it is supposed to" {
|
||||
let testString = "The quick brown fox jumps over the lazy dog\nIt does!"
|
||||
Expect.equal (wordWrap 20 testString) "The quick brown fox\njumps over the lazy\ndog\nIt does!\n"
|
||||
"Line not broken correctly"
|
||||
}
|
||||
test "wraps long line without a space and a line with exact length" {
|
||||
let testString = "Asamatteroffact, the dog does too"
|
||||
Expect.equal (wordWrap 10 testString) "Asamattero\nffact, the\ndog does\ntoo\n"
|
||||
"Longer line not broken correctly"
|
||||
}
|
||||
test "wraps long line without a space and a line with non-exact length" {
|
||||
let testString = "Asamatteroffact, that dog does too"
|
||||
Expect.equal (wordWrap 10 testString) "Asamattero\nffact,\nthat dog\ndoes too\n"
|
||||
"Longer line not broken correctly"
|
||||
}
|
||||
test "preserves blank lines" {
|
||||
let testString = "Here is\n\na string with blank lines"
|
||||
Expect.equal (wordWrap 80 testString) testString "Blank lines were not preserved"
|
||||
}
|
||||
]
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,109 +1,122 @@
|
||||
module PrayerTracker.Views.Church
|
||||
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open Giraffe.ViewEngine.Accessibility
|
||||
open Giraffe.ViewEngine.Htmx
|
||||
open PrayerTracker
|
||||
open PrayerTracker.Entities
|
||||
open PrayerTracker.ViewModels
|
||||
|
||||
/// View for the church edit page
|
||||
let edit (m : EditChurch) ctx vi =
|
||||
let pageTitle = match m.isNew () with true -> "Add a New Church" | false -> "Edit Church"
|
||||
let s = I18N.localizer.Force ()
|
||||
[ form [ _action "/web/church/save"; _method "post"; _class "pt-center-columns" ] [
|
||||
style [ _scoped ]
|
||||
[ rawText "#name { width: 20rem; } #city { width: 10rem; } #st { width: 3rem; } #interfaceAddress { width: 30rem; }" ]
|
||||
csrfToken ctx
|
||||
input [ _type "hidden"; _name "churchId"; _value (flatGuid m.churchId) ]
|
||||
div [ _class "pt-field-row" ] [
|
||||
div [ _class "pt-field" ] [
|
||||
label [ _for "name" ] [ locStr s.["Church Name"] ]
|
||||
input [ _type "text"; _name "name"; _id "name"; _required; _autofocus; _value m.name ]
|
||||
]
|
||||
div [ _class "pt-field" ] [
|
||||
label [ _for "City"] [ locStr s.["City"] ]
|
||||
input [ _type "text"; _name "city"; _id "city"; _required; _value m.city ]
|
||||
]
|
||||
div [ _class "pt-field" ] [
|
||||
label [ _for "ST" ] [ locStr s.["State"] ]
|
||||
input [ _type "text"; _name "st"; _id "st"; _required; _minlength "2"; _maxlength "2"; _value m.st ]
|
||||
]
|
||||
let edit (model : EditChurch) ctx viewInfo =
|
||||
let pageTitle = if model.IsNew then "Add a New Church" else "Edit Church"
|
||||
let s = I18N.localizer.Force ()
|
||||
let vi =
|
||||
viewInfo
|
||||
|> AppViewInfo.withScopedStyles [
|
||||
$"#{nameof model.Name} {{ width: 20rem; }}"
|
||||
$"#{nameof model.City} {{ width: 10rem; }}"
|
||||
$"#{nameof model.State} {{ width: 3rem; }}"
|
||||
$"#{nameof model.InterfaceAddress} {{ width: 30rem; }}"
|
||||
]
|
||||
div [ _class "pt-field-row" ] [
|
||||
div [ _class "pt-checkbox-field" ] [
|
||||
input [ _type "checkbox"
|
||||
_name "hasInterface"
|
||||
_id "hasInterface"
|
||||
_value "True"
|
||||
match m.hasInterface with Some x when x -> _checked | _ -> () ]
|
||||
label [ _for "hasInterface" ] [ locStr s.["Has an interface with Virtual Prayer Room"] ]
|
||||
]
|
||||
|> AppViewInfo.withOnLoadScript "PT.church.edit.onPageLoad"
|
||||
form [ _action "/church/save"; _method "post"; _class "pt-center-columns"; Target.content ] [
|
||||
csrfToken ctx
|
||||
input [ _type "hidden"; _name (nameof model.ChurchId); _value model.ChurchId ]
|
||||
div [ _fieldRow ] [
|
||||
div [ _inputField ] [
|
||||
label [ _for (nameof model.Name) ] [ locStr s["Church Name"] ]
|
||||
inputField "text" (nameof model.Name) model.Name [ _required; _autofocus ]
|
||||
]
|
||||
div [ _inputField ] [
|
||||
label [ _for (nameof model.City) ] [ locStr s["City"] ]
|
||||
inputField "text" (nameof model.City) model.City [ _required ]
|
||||
]
|
||||
div [ _inputField ] [
|
||||
label [ _for (nameof model.State) ] [ locStr s["State or Province"] ]
|
||||
inputField "text" (nameof model.State) model.State [ _minlength "2"; _maxlength "2"; _required ]
|
||||
]
|
||||
]
|
||||
div [ _class "pt-field-row pt-fadeable"; _id "divInterfaceAddress" ] [
|
||||
div [ _class "pt-field" ] [
|
||||
label [ _for "interfaceAddress" ] [ locStr s.["VPR Interface URL"] ]
|
||||
input [ _type "url"; _name "interfaceAddress"; _id "interfaceAddress";
|
||||
_value (match m.interfaceAddress with Some ia -> ia | None -> "") ]
|
||||
]
|
||||
div [ _fieldRow ] [
|
||||
div [ _checkboxField ] [
|
||||
inputField "checkbox" (nameof model.HasInterface) "True"
|
||||
[ if defaultArg model.HasInterface false then _checked ]
|
||||
label [ _for (nameof model.HasInterface) ] [
|
||||
locStr s["Has an Interface with ā{0}ā", "Virtual Prayer Space"]
|
||||
]
|
||||
]
|
||||
]
|
||||
div [ _class "pt-field-row" ] [ submit [] "save" s.["Save Church"] ]
|
||||
]
|
||||
script [] [ rawText "PT.onLoad(PT.church.edit.onPageLoad)" ]
|
||||
div [ _fieldRowWith [ "pt-fadeable" ]; _id "divInterfaceAddress" ] [
|
||||
div [ _inputField ] [
|
||||
label [ _for (nameof model.InterfaceAddress) ] [ locStr s["Interface URL"] ]
|
||||
inputField "url" (nameof model.InterfaceAddress) (defaultArg model.InterfaceAddress "") []
|
||||
]
|
||||
]
|
||||
div [ _fieldRow ] [ submit [] "save" s["Save Church"] ]
|
||||
]
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard vi pageTitle
|
||||
|> List.singleton
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard vi pageTitle
|
||||
|
||||
|
||||
/// View for church maintenance page
|
||||
let maintain (churches : Church list) (stats : Map<string, ChurchStats>) ctx vi =
|
||||
let s = I18N.localizer.Force ()
|
||||
let chTbl =
|
||||
match churches with
|
||||
| [] -> space
|
||||
| _ ->
|
||||
table [ _class "pt-table pt-action-table" ] [
|
||||
thead [] [
|
||||
tr [] [
|
||||
th [] [ locStr s.["Actions"] ]
|
||||
th [] [ locStr s.["Name"] ]
|
||||
th [] [ locStr s.["Location"] ]
|
||||
th [] [ locStr s.["Groups"] ]
|
||||
th [] [ locStr s.["Requests"] ]
|
||||
th [] [ locStr s.["Users"] ]
|
||||
th [] [ locStr s.["Interface?"] ]
|
||||
]
|
||||
let maintain (churches : Church list) (stats : Map<string, ChurchStats>) ctx viewInfo =
|
||||
let s = I18N.localizer.Force ()
|
||||
let vi = AppViewInfo.withScopedStyles [ "#churchList { grid-template-columns: repeat(7, auto); }" ] viewInfo
|
||||
let churchTable =
|
||||
match churches with
|
||||
| [] -> space
|
||||
| _ ->
|
||||
section [ _id "churchList"; _class "pt-table"; _ariaLabel "Church list" ] [
|
||||
div [ _class "row head" ] [
|
||||
header [ _class "cell" ] [ locStr s["Actions"] ]
|
||||
header [ _class "cell" ] [ locStr s["Name"] ]
|
||||
header [ _class "cell" ] [ locStr s["Location"] ]
|
||||
header [ _class "cell" ] [ locStr s["Groups"] ]
|
||||
header [ _class "cell" ] [ locStr s["Requests"] ]
|
||||
header [ _class "cell" ] [ locStr s["Users"] ]
|
||||
header [ _class "cell" ] [ locStr s["Interface?"] ]
|
||||
]
|
||||
for church in churches do
|
||||
let churchId = shortGuid church.Id.Value
|
||||
let delAction = $"/church/{churchId}/delete"
|
||||
let delPrompt = s["Are you sure you want to delete this {0}? This action cannot be undone.",
|
||||
$"""{s["Church"].Value.ToLower ()} ({church.Name})"""]
|
||||
div [ _class "row" ] [
|
||||
div [ _class "cell actions" ] [
|
||||
a [ _href $"/church/{churchId}/edit"; _title s["Edit This Church"].Value ] [
|
||||
iconSized 18 "edit"
|
||||
]
|
||||
a [ _href delAction
|
||||
_title s["Delete This Church"].Value
|
||||
_hxPost delAction
|
||||
_hxConfirm delPrompt.Value ] [
|
||||
iconSized 18 "delete_forever"
|
||||
]
|
||||
]
|
||||
div [ _class "cell" ] [ str church.Name ]
|
||||
div [ _class "cell" ] [ str church.City; rawText ", "; str church.State ]
|
||||
div [ _class "cell pt-right-text" ] [ rawText (stats[churchId].SmallGroups.ToString "N0") ]
|
||||
div [ _class "cell pt-right-text" ] [ rawText (stats[churchId].PrayerRequests.ToString "N0") ]
|
||||
div [ _class "cell pt-right-text" ] [ rawText (stats[churchId].Users.ToString "N0") ]
|
||||
div [ _class "cell pt-center-text" ] [
|
||||
locStr s[if church.HasVpsInterface then "Yes" else "No"]
|
||||
]
|
||||
]
|
||||
]
|
||||
churches
|
||||
|> List.map (fun ch ->
|
||||
let chId = flatGuid ch.churchId
|
||||
let delAction = $"/web/church/{chId}/delete"
|
||||
let delPrompt = s.["Are you sure you want to delete this {0}? This action cannot be undone.",
|
||||
$"""{s.["Church"].Value.ToLower ()} ({ch.name})"""]
|
||||
tr [] [
|
||||
td [] [
|
||||
a [ _href $"/web/church/{chId}/edit"; _title s.["Edit This Church"].Value ] [ icon "edit" ]
|
||||
a [ _href delAction
|
||||
_title s.["Delete This Church"].Value
|
||||
_onclick $"return PT.confirmDelete('{delAction}','{delPrompt}')" ]
|
||||
[ icon "delete_forever" ]
|
||||
]
|
||||
td [] [ str ch.name ]
|
||||
td [] [ str ch.city; rawText ", "; str ch.st ]
|
||||
td [ _class "pt-right-text" ] [ rawText (stats.[chId].smallGroups.ToString "N0") ]
|
||||
td [ _class "pt-right-text" ] [ rawText (stats.[chId].prayerRequests.ToString "N0") ]
|
||||
td [ _class "pt-right-text" ] [ rawText (stats.[chId].users.ToString "N0") ]
|
||||
td [ _class "pt-center-text" ] [ locStr s.[match ch.hasInterface with true -> "Yes" | false -> "No"] ]
|
||||
])
|
||||
|> tbody []
|
||||
]
|
||||
[ div [ _class "pt-center-text" ] [
|
||||
br []
|
||||
a [ _href $"/web/church/{emptyGuid}/edit"; _title s.["Add a New Church"].Value ]
|
||||
[ icon "add_circle"; rawText " "; locStr s.["Add a New Church"] ]
|
||||
br []
|
||||
br []
|
||||
]
|
||||
tableSummary churches.Length s
|
||||
chTbl
|
||||
form [ _id "DeleteForm"; _action ""; _method "post" ] [ csrfToken ctx ]
|
||||
[ div [ _class "pt-center-text" ] [
|
||||
br []
|
||||
a [ _href $"/church/{emptyGuid}/edit"; _title s["Add a New Church"].Value ] [
|
||||
icon "add_circle"; rawText " "; locStr s["Add a New Church"]
|
||||
]
|
||||
br []
|
||||
br []
|
||||
]
|
||||
tableSummary churches.Length s
|
||||
form [ _method "post" ] [
|
||||
csrfToken ctx
|
||||
churchTable
|
||||
]
|
||||
]
|
||||
|> Layout.Content.wide
|
||||
|> Layout.standard vi "Maintain Churches"
|
||||
|> Layout.Content.wide
|
||||
|> Layout.standard vi "Maintain Churches"
|
||||
|
@ -1,25 +1,24 @@
|
||||
[<AutoOpen>]
|
||||
module PrayerTracker.Views.CommonFunctions
|
||||
|
||||
open System.IO
|
||||
open System.Text.Encodings.Web
|
||||
open Giraffe
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Giraffe.ViewEngine
|
||||
open Microsoft.AspNetCore.Antiforgery
|
||||
open Microsoft.AspNetCore.Http
|
||||
open Microsoft.AspNetCore.Mvc.Localization
|
||||
open Microsoft.Extensions.Localization
|
||||
open System
|
||||
open System.IO
|
||||
open System.Text.Encodings.Web
|
||||
|
||||
/// Encoded text for a localized string
|
||||
let locStr (text : LocalizedString) = str text.Value
|
||||
|
||||
/// Raw text for a localized HTML string
|
||||
let rawLocText (writer : StringWriter) (text : LocalizedHtmlString) =
|
||||
text.WriteTo (writer, HtmlEncoder.Default)
|
||||
let txt = string writer
|
||||
writer.GetStringBuilder().Clear () |> ignore
|
||||
rawText txt
|
||||
text.WriteTo (writer, HtmlEncoder.Default)
|
||||
let txt = string writer
|
||||
writer.GetStringBuilder().Clear () |> ignore
|
||||
rawText txt
|
||||
|
||||
/// A space (used for back-to-back localization string breaks)
|
||||
let space = rawText " "
|
||||
@ -28,120 +27,191 @@ let space = rawText " "
|
||||
let icon name = i [ _class "material-icons" ] [ rawText name ]
|
||||
|
||||
/// Generate a Material Design icon, specifying the point size (must be defined in CSS)
|
||||
let iconSized size name = i [ _class $"material-icons md-{size}" ] [ rawText name ]
|
||||
let iconSized size name = i [ _class $"material-icons md-%i{size}" ] [ rawText name ]
|
||||
|
||||
/// Generate a CSRF prevention token
|
||||
let csrfToken (ctx : HttpContext) =
|
||||
let antiForgery = ctx.GetService<IAntiforgery> ()
|
||||
let tokenSet = antiForgery.GetAndStoreTokens ctx
|
||||
input [ _type "hidden"; _name tokenSet.FormFieldName; _value tokenSet.RequestToken ]
|
||||
let antiForgery = ctx.GetService<IAntiforgery> ()
|
||||
let tokenSet = antiForgery.GetAndStoreTokens ctx
|
||||
input [ _type "hidden"; _name tokenSet.FormFieldName; _value tokenSet.RequestToken ]
|
||||
|
||||
/// Create a summary for a table of items
|
||||
let tableSummary itemCount (s : IStringLocalizer) =
|
||||
div [ _class "pt-center-text" ] [
|
||||
small [] [
|
||||
match itemCount with
|
||||
| 0 -> s.["No Entries to Display"]
|
||||
| 1 -> s.["Displaying {0} Entry", itemCount]
|
||||
| _ -> s.["Displaying {0} Entries", itemCount]
|
||||
|> locStr
|
||||
]
|
||||
div [ _class "pt-center-text" ] [
|
||||
small [] [
|
||||
match itemCount with
|
||||
| 0 -> s["No Entries to Display"]
|
||||
| 1 -> s["Displaying {0} Entry", itemCount]
|
||||
| _ -> s["Displaying {0} Entries", itemCount]
|
||||
|> locStr
|
||||
]
|
||||
]
|
||||
|
||||
/// Generate a list of named HTML colors
|
||||
let namedColorList name selected attrs (s : IStringLocalizer) =
|
||||
/// The list of HTML named colors (name, display, text color)
|
||||
seq {
|
||||
("aqua", s.["Aqua"], "black")
|
||||
("black", s.["Black"], "white")
|
||||
("blue", s.["Blue"], "white")
|
||||
("fuchsia", s.["Fuchsia"], "black")
|
||||
("gray", s.["Gray"], "white")
|
||||
("green", s.["Green"], "white")
|
||||
("lime", s.["Lime"], "black")
|
||||
("maroon", s.["Maroon"], "white")
|
||||
("navy", s.["Navy"], "white")
|
||||
("olive", s.["Olive"], "white")
|
||||
("purple", s.["Purple"], "white")
|
||||
("red", s.["Red"], "black")
|
||||
("silver", s.["Silver"], "black")
|
||||
("teal", s.["Teal"], "white")
|
||||
("white", s.["White"], "black")
|
||||
("yellow", s.["Yellow"], "black")
|
||||
// The list of HTML named colors (name, display, text color)
|
||||
seq {
|
||||
("aqua", s["Aqua"], "black")
|
||||
("black", s["Black"], "white")
|
||||
("blue", s["Blue"], "white")
|
||||
("fuchsia", s["Fuchsia"], "black")
|
||||
("gray", s["Gray"], "white")
|
||||
("green", s["Green"], "white")
|
||||
("lime", s["Lime"], "black")
|
||||
("maroon", s["Maroon"], "white")
|
||||
("navy", s["Navy"], "white")
|
||||
("olive", s["Olive"], "white")
|
||||
("purple", s["Purple"], "white")
|
||||
("red", s["Red"], "black")
|
||||
("silver", s["Silver"], "black")
|
||||
("teal", s["Teal"], "white")
|
||||
("white", s["White"], "black")
|
||||
("yellow", s["Yellow"], "black")
|
||||
}
|
||||
|> Seq.map (fun color ->
|
||||
let (colorName, dispText, txtColor) = color
|
||||
option [ yield _value colorName
|
||||
yield _style $"background-color:{colorName};color:{txtColor};"
|
||||
match colorName = selected with true -> yield _selected | false -> () ] [
|
||||
encodedText (dispText.Value.ToLower ())
|
||||
])
|
||||
|> List.ofSeq
|
||||
|> select (_name name :: attrs)
|
||||
|> Seq.map (fun color ->
|
||||
let colorName, text, txtColor = color
|
||||
option
|
||||
[ _value colorName
|
||||
_style $"background-color:{colorName};color:{txtColor};"
|
||||
if colorName = selected then _selected
|
||||
] [ encodedText (text.Value.ToLower ()) ])
|
||||
|> List.ofSeq
|
||||
|> select (_name name :: attrs)
|
||||
|
||||
/// Convert a named color to its hex notation
|
||||
let colorToHex (color : string) =
|
||||
match color with
|
||||
| it when it.StartsWith "#" -> color
|
||||
| "aqua" -> "#00ffff"
|
||||
| "black" -> "#000000"
|
||||
| "blue" -> "#0000ff"
|
||||
| "fuchsia" -> "#ff00ff"
|
||||
| "gray" -> "#808080"
|
||||
| "green" -> "#008000"
|
||||
| "lime" -> "#00ff00"
|
||||
| "maroon" -> "#800000"
|
||||
| "navy" -> "#000080"
|
||||
| "olive" -> "#808000"
|
||||
| "purple" -> "#800080"
|
||||
| "red" -> "#ff0000"
|
||||
| "silver" -> "#c0c0c0"
|
||||
| "teal" -> "#008080"
|
||||
| "white" -> "#ffffff"
|
||||
| "yellow" -> "#ffff00"
|
||||
| it -> it
|
||||
|
||||
/// Generate an input[type=radio] that is selected if its value is the current value
|
||||
let radio name domId value current =
|
||||
input [ _type "radio"
|
||||
_name name
|
||||
_id domId
|
||||
_value value
|
||||
match value = current with true -> _checked | false -> () ]
|
||||
input [ _type "radio"
|
||||
_name name
|
||||
if domId <> "" then _id domId
|
||||
_value value
|
||||
if value = current then _checked ]
|
||||
|
||||
/// Generate a select list with the current value selected
|
||||
let selectList name selected attrs items =
|
||||
items
|
||||
|> Seq.map (fun (value, text) ->
|
||||
option [ _value value
|
||||
match value = selected with true -> _selected | false -> () ] [ encodedText text ])
|
||||
|> List.ofSeq
|
||||
|> select (List.concat [ [ _name name; _id name ]; attrs ])
|
||||
items
|
||||
|> Seq.map (fun (value, text) ->
|
||||
option
|
||||
[ _value value
|
||||
if value = selected then _selected
|
||||
] [ encodedText text ])
|
||||
|> List.ofSeq
|
||||
|> select (List.concat [ [ _name name; _id name ]; attrs ])
|
||||
|
||||
/// Generate the text for a default entry at the top of a select list
|
||||
let selectDefault text = $"ā {text} ā"
|
||||
let selectDefault text = $"ā %s{text} ā"
|
||||
|
||||
/// Generate a standard submit button with icon and text
|
||||
let submit attrs ico text = button (_type "submit" :: attrs) [ icon ico; rawText " "; locStr text ]
|
||||
|
||||
/// Format a GUID with no dashes (used for URLs and forms)
|
||||
let flatGuid (x : Guid) = x.ToString "N"
|
||||
|
||||
/// An empty GUID string (used for "add" actions)
|
||||
let emptyGuid = flatGuid Guid.Empty
|
||||
|
||||
|
||||
/// blockquote tag
|
||||
let blockquote = tag "blockquote"
|
||||
|
||||
/// role attribute
|
||||
let _role = attr "role"
|
||||
/// aria-* attribute
|
||||
let _aria typ = attr $"aria-{typ}"
|
||||
/// onclick attribute
|
||||
let _onclick = attr "onclick"
|
||||
/// onsubmit attribute
|
||||
/// Create an HTML onsubmit event handler
|
||||
let _onsubmit = attr "onsubmit"
|
||||
|
||||
/// scoped flag (used for <style> tag)
|
||||
let _scoped = flag "scoped"
|
||||
/// A "rel='noopener'" attribute
|
||||
let _relNoOpener = _rel "noopener"
|
||||
|
||||
/// A class attribute that designates a row of fields, with the additional classes passed
|
||||
let _fieldRowWith classes =
|
||||
let extraClasses = if List.isEmpty classes then "" else $""" {classes |> String.concat " "}"""
|
||||
_class $"pt-field-row{extraClasses}"
|
||||
|
||||
/// The class that designates a row of fields
|
||||
let _fieldRow = _fieldRowWith []
|
||||
|
||||
/// A class attribute that designates an input field, with the additional classes passed
|
||||
let _inputFieldWith classes =
|
||||
let extraClasses = if List.isEmpty classes then "" else $""" {classes |> String.concat " "}"""
|
||||
_class $"pt-field{extraClasses}"
|
||||
|
||||
/// The class that designates an input field / label pair
|
||||
let _inputField = _inputFieldWith []
|
||||
|
||||
/// The class that designates a checkbox / label pair
|
||||
let _checkboxField = _class "pt-checkbox-field"
|
||||
|
||||
/// A group of related fields, inputs, links, etc., displayed in a row
|
||||
let _group = _class "pt-group"
|
||||
|
||||
/// Create an input field of the given type, with matching name and ID and the given value
|
||||
let inputField typ name value attrs =
|
||||
List.concat [ [ _type typ; _name name; _id name; if value <> "" then _value value ]; attrs ] |> input
|
||||
|
||||
/// Generate a table heading with the given localized column names
|
||||
let tableHeadings (s : IStringLocalizer) (headings : string list) =
|
||||
headings
|
||||
|> List.map (fun heading -> th [ _scope "col" ] [ locStr s[heading] ])
|
||||
|> tr []
|
||||
|> List.singleton
|
||||
|> thead []
|
||||
|
||||
/// For a list of strings, prepend a pound sign and string them together with commas (CSS selector by ID)
|
||||
let toHtmlIds it = it |> List.map (fun x -> $"#%s{x}") |> String.concat ", "
|
||||
|
||||
/// The name this function used to have when the view engine was part of Giraffe
|
||||
let renderHtmlNode = RenderView.AsString.htmlNode
|
||||
|
||||
|
||||
open Microsoft.AspNetCore.Html
|
||||
|
||||
/// 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 =
|
||||
|
||||
open System.Collections.Generic
|
||||
open PrayerTracker.Entities
|
||||
|
||||
/// Cross-reference between time zone Ids and their English names
|
||||
let private xref =
|
||||
[ "America/Chicago", "Central"
|
||||
"America/Denver", "Mountain"
|
||||
"America/Los_Angeles", "Pacific"
|
||||
"America/New_York", "Eastern"
|
||||
"America/Phoenix", "Mountain (Arizona)"
|
||||
"Europe/Berlin", "Central European"
|
||||
]
|
||||
|> Map.ofList
|
||||
/// Cross-reference between time zone Ids and their English names
|
||||
let private xref = [
|
||||
TimeZoneId "America/Chicago", "Central"
|
||||
TimeZoneId "America/Denver", "Mountain"
|
||||
TimeZoneId "America/Los_Angeles", "Pacific"
|
||||
TimeZoneId "America/New_York", "Eastern"
|
||||
TimeZoneId "America/Phoenix", "Mountain (Arizona)"
|
||||
TimeZoneId "Europe/Berlin", "Central European"
|
||||
]
|
||||
|
||||
/// Get the name of a time zone, given its Id
|
||||
let name tzId (s : IStringLocalizer) =
|
||||
try s.[xref.[tzId]]
|
||||
with :? KeyNotFoundException -> LocalizedString (tzId, tzId)
|
||||
/// Get the name of a time zone, given its Id
|
||||
let name timeZoneId (s : IStringLocalizer) =
|
||||
match xref |> List.tryFind (fun it -> fst it = timeZoneId) with
|
||||
| Some tz -> s[snd tz]
|
||||
| None ->
|
||||
let tzId = TimeZoneId.toString timeZoneId
|
||||
LocalizedString (tzId, tzId)
|
||||
|
||||
/// All known time zones in their defined order
|
||||
let all = xref |> List.map fst
|
||||
|
||||
|
||||
open Giraffe.ViewEngine.Htmx
|
||||
|
||||
/// Known htmx targets
|
||||
module Target =
|
||||
|
||||
/// htmx links target the body element
|
||||
let body = _hxTarget "body"
|
||||
|
||||
/// htmx links target the #pt-body element
|
||||
let content = _hxTarget "#pt-body"
|
||||
|
300
src/PrayerTracker.UI/Help.fs
Normal file
300
src/PrayerTracker.UI/Help.fs
Normal file
@ -0,0 +1,300 @@
|
||||
/// Help content for PrayerTracker
|
||||
module PrayerTracker.Views.Help
|
||||
|
||||
open System.IO
|
||||
open Giraffe.ViewEngine
|
||||
open PrayerTracker.ViewModels
|
||||
|
||||
/// The help index page
|
||||
let index () =
|
||||
let s = I18N.localizer.Force()
|
||||
let l = I18N.forView "Help/Index"
|
||||
use sw = new StringWriter()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [
|
||||
raw l["Throughout PrayerTracker, you'll see an icon (a question mark in a circle) next to the title on each page."]; space
|
||||
raw l["Clicking this will open a new, small window with directions on using that page."]; space
|
||||
raw l["If you are looking for a quick overview of PrayerTracker, start with the āAdd / Edit a Requestā and āChange Preferencesā entries."] ]
|
||||
hr []
|
||||
p [ _class "pt-center-text" ] [ strong [] [ locStr s["Help Topics"] ] ]
|
||||
p [] [ a [ _href "/help/small-group/preferences" ] [ locStr s["Change Preferences"] ] ]
|
||||
p [] [ a [ _href "/help/small-group/announcement" ] [ locStr s["Send Announcement"] ] ]
|
||||
p [] [ a [ _href "/help/small-group/members" ] [ locStr s["Maintain Group Members"] ] ]
|
||||
p [] [ a [ _href "/help/requests/edit" ] [ locStr s["Add / Edit a Request"] ] ]
|
||||
p [] [ a [ _href "/help/requests/maintain" ] [ locStr s["Maintain Requests"] ] ]
|
||||
p [] [ a [ _href "/help/requests/view" ] [ locStr s["View Request List"] ] ]
|
||||
p [] [ a [ _href "/help/user/log-on" ] [ locStr s["Log On"] ] ]
|
||||
p [] [ a [ _href "/help/user/password" ] [ locStr s["Change Your Password"] ] ] ]
|
||||
|
||||
|
||||
/// Help for prayer requests
|
||||
module Requests =
|
||||
|
||||
/// Add / Edit a Request
|
||||
let edit () =
|
||||
let s = I18N.localizer.Force()
|
||||
let l = I18N.forView "Help/Requests/Edit"
|
||||
use sw = new StringWriter()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [ raw l["This page allows you to enter or update a new prayer request."] ]
|
||||
h2 [ _id "request-type" ] [ locStr s["Request Type"] ]
|
||||
p [] [
|
||||
raw l["There are 5 request types in PrayerTracker."]; space
|
||||
raw l["āCurrent Requestsā are your regular requests that people may have regarding things happening over the next week or so."]; space
|
||||
raw l["āLong-Term Requestsā are requests that may occur repeatedly or continue indefinitely."]; space
|
||||
raw l["āPraise Reportsā are like āCurrent Requestsā, but they are answers to prayer to share with your group."]; space
|
||||
raw l["āExpectingā is for those who are pregnant."]; space
|
||||
raw l["āAnnouncementsā are like āCurrent Requestsā, but instead of a request, they are simply passing information along about something coming up."] ]
|
||||
p [] [
|
||||
raw l["The order above is the order in which the request types appear on the list."]; space
|
||||
raw l["āLong-Term Requestsā and āExpectingā are not subject to the automatic expiration (set on the āChange Preferencesā page) that the other requests are."] ]
|
||||
h2 [ _id "date" ] [ locStr s["Date"] ]
|
||||
p [] [
|
||||
raw l["For new requests, this is a box with a calendar date picker."]; space
|
||||
raw l["Click or tab into the box to display the calendar, which will be preselected to today's date."]; space
|
||||
raw l["For existing requests, there will be a check box labeled āCheck to not update the dateā."]; space
|
||||
raw l["This can be used if you are correcting spelling or punctuation, and do not have an actual update to make to the request."]
|
||||
]
|
||||
h2 [ _id "requestor-subject" ] [ locStr s["Requestor / Subject"] ]
|
||||
p [] [
|
||||
raw l["For requests or praises, this field is for the name of the person who made the request or offered the praise report."]; space
|
||||
raw l["For announcements, this should contain the subject of the announcement."]; space
|
||||
raw l["For all types, it is optional; I used to have an announcement with no subject that ran every week, telling where to send requests and updates."] ]
|
||||
h2 [ _id "expiration" ] [ locStr s["Expiration"] ]
|
||||
p [] [
|
||||
raw l["āExpire Normallyā means that the request is subject to the expiration days in the group preferences."]; space
|
||||
raw l["āRequest Never Expiresā can be used to make a request never expire (note that this is redundant for āLong-Term Requestsā and āExpectingā)."]; space
|
||||
raw l["If you are editing an existing request, a third option appears."]; space
|
||||
raw l["āExpire Immediatelyā will make the request expire when it is saved."]; space
|
||||
raw l["Apart from the icons on the request maintenance page, this is the only way to expire āLong-Term Requestsā and āExpectingā requests, but it can be used for any request type."] ]
|
||||
h2 [ _id "request" ] [ locStr s["Request"] ]
|
||||
p [] [
|
||||
raw l["This is the text of the request."]; space
|
||||
raw l["The editor provides many formatting capabilities, including āSpell Check as you Typeā (enabled by default), āPaste from Wordā, and āPaste Plainā, as well as āSourceā view, if you want to edit the HTML yourself."]; space
|
||||
raw l["It also supports undo and redo, and the editor supports full-screen mode. Hover over each icon to see what each button does."] ] ]
|
||||
|
||||
/// Maintain Requests
|
||||
let maintain () =
|
||||
let s = I18N.localizer.Force()
|
||||
let l = I18N.forView "Help/Requests/Maintain"
|
||||
use sw = new StringWriter()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [
|
||||
raw l["From this page, you can add, edit, and delete your current requests."]; space
|
||||
raw l["You can also restore requests that may have expired, but should be made active once again."] ]
|
||||
h2 [ _id "add-a-new-request" ] [ locStr s["Add a New Request"] ]
|
||||
p [] [
|
||||
raw l["To add a request, click the icon or text in the center of the page, below the title and above the list of requests for your group."] ]
|
||||
h2 [ _id "search-requests" ] [ locStr s["Search Requests"] ]
|
||||
p [] [
|
||||
raw l["If you are looking for a particular requests, enter some text in the search box and click āSearchā."]; space
|
||||
raw l["PrayerTracker will search the Requestor/Subject and Request Text fields (case-insensitively) of both active and inactive requests."]; space
|
||||
raw l["The results will be displayed in the same format as the original Maintain Requests page, so the buttons described below will work the same for those requests as well."]; space
|
||||
raw l["They will also be displayed in pages, if there are a lot of results; the number per page is configurable by small group."] ]
|
||||
h2 [ _id "edit-request" ] [ locStr s["Edit Request"] ]
|
||||
p [] [
|
||||
raw l["To edit a request, click the pencil icon; it's the first icon under the āActionsā column heading."] ]
|
||||
h2 [ _id "expire-a-request" ] [ locStr s["Expire a Request"] ]
|
||||
p [] [
|
||||
raw l["For active requests, the second icon is an eye with a slash through it; clicking this icon will expire the request immediately."]; space
|
||||
raw l["This is equivalent to editing the request, selecting āExpire Immediatelyā, and saving it."] ]
|
||||
h2 [ _id "restore-an-inactive-request" ] [ locStr s["Restore an Inactive Request"] ]
|
||||
p [] [
|
||||
raw l["When the page is first displayed, it does not display inactive requests."]; space
|
||||
raw l["However, clicking the link at the bottom of the page will refresh the page with the inactive requests shown."]; space
|
||||
raw l["The middle icon will look like an eye; clicking it will restore the request as an active request."]; space
|
||||
raw l["The last updated date will be current, and the request is set to expire normally."] ]
|
||||
h2 [ _id "delete-a-request" ] [ locStr s["Delete a Request"] ]
|
||||
p [] [
|
||||
raw l["Deleting a request is contrary to the intent of PrayerTracker, as you can retrieve requests that have expired."]; space
|
||||
raw l["However, if there is a request that needs to be deleted, clicking the trash can icon in the āActionsā column will allow you to do it."]; space
|
||||
raw l["Use this option carefully, as these deletions cannot be undone; once a request is deleted, it is gone for good."] ] ]
|
||||
|
||||
/// View Request List
|
||||
let view () =
|
||||
let s = I18N.localizer.Force()
|
||||
let l = I18N.forView "Help/Requests/View"
|
||||
use sw = new StringWriter()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [
|
||||
raw l["From this page, you can view the request list (for today or for the next Sunday), view a printable version of the list, and e-mail the list to the members of your group."]; space
|
||||
raw l["(NOTE: If you are logged in as a group member, the only option you will see is to view a printable list.)"] ]
|
||||
h2 [ _id "list-for-next-sunday" ] [ locStr s["List for Next Sunday"] ]
|
||||
p [] [
|
||||
raw l["This will modify the date for the list, so it will look like it is currently next Sunday."]; space
|
||||
raw l["This can be used, for example, to see what requests will expire, or allow you to print a list with Sunday's date on Saturday evening."]; space
|
||||
raw l["Note that this link does not appear if it is Sunday."] ]
|
||||
h2 [ _id "view-printable" ] [ locStr s["View Printable"] ]
|
||||
p [] [
|
||||
raw l["Clicking this link will display the list in a format that is suitable for printing; it does not have the normal PrayerTracker header across the top."]; space
|
||||
raw l["Once you have clicked the link, you can print it using your browser's standard āPrintā functionality."] ]
|
||||
h2 [ _id "send-via-e-mail" ] [ locStr s["Send via E-mail"] ]
|
||||
p [] [
|
||||
raw l["Clicking this link will send the list you are currently viewing to your group members."]; space
|
||||
raw l["The page will remind you that you are about to do that, and ask for your confirmation."]; space
|
||||
raw l["If you proceed, you will see a page that shows to whom the list was sent, and what the list looked like."]; space
|
||||
raw l["You may safely use your browser's āBackā button to navigate away from the page."] ] ]
|
||||
|
||||
|
||||
/// Help for small group pages
|
||||
module SmallGroup =
|
||||
|
||||
/// Send an Announcement
|
||||
let announcement () =
|
||||
let s = I18N.localizer.Force()
|
||||
let l = I18N.forView "Help/SmallGroup/Announcement"
|
||||
use sw = new StringWriter()
|
||||
let raw = rawLocText sw
|
||||
[ h2 [ _id "announcement-text" ] [ locStr s["Announcement Text"] ]
|
||||
p [] [
|
||||
raw l["This is the text of the announcement you would like to send."]; space
|
||||
raw l["""It functions the same way as the text box on the <a href="../requests/edit#request">āEdit Requestā page</a>."""] ]
|
||||
h2 [ _id "add-to-request-list" ] [ locStr s["Add to Request List"] ]
|
||||
p [] [
|
||||
raw l["Without this box checked, the text of the announcement will only be e-mailed to your group members."]; space
|
||||
raw l["If you check this box, however, the text of the announcement will be added to your prayer list under the section you have selected."] ] ]
|
||||
|
||||
/// Maintain Group Members
|
||||
let members () =
|
||||
let s = I18N.localizer.Force()
|
||||
let l = I18N.forView "Help/SmallGroup/Members"
|
||||
use sw = new StringWriter()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [ raw l["From this page, you can add, edit, and delete the e-mail addresses for your group."] ]
|
||||
h2 [ _id "add-a-new-group-member" ] [ locStr s["Add a New Group Member"] ]
|
||||
p [] [
|
||||
raw l["To add an e-mail address, click the icon or text in the center of the page, below the title and above the list of addresses for your group."] ]
|
||||
h2 [ _id "edit-group-member" ] [ locStr s["Edit Group Member"] ]
|
||||
p [] [
|
||||
raw l["To edit an e-mail address, click the pencil icon; it's the first icon under the āActionsā column heading."]; space
|
||||
raw l["This will allow you to update the name and/or the e-mail address for that member."] ]
|
||||
h2 [ _id "delete-a-group-member" ] [ locStr s["Delete a Group Member"] ]
|
||||
p [] [
|
||||
raw l["To delete an e-mail address, click the trash can icon in the āActionsā column."]; space
|
||||
raw l["Note that once an e-mail address has been deleted, it is gone."]; space
|
||||
raw l["(Of course, if you delete it in error, you can enter it again using the āAddā instructions above.)"] ] ]
|
||||
|
||||
/// Change Preferences
|
||||
let preferences () =
|
||||
let s = I18N.localizer.Force()
|
||||
let l = I18N.forView "Help/SmallGroup/Preferences"
|
||||
use sw = new StringWriter()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [
|
||||
raw l["This page allows you to change how your prayer request list looks and behaves."]; space
|
||||
raw l["Each section is addressed below."] ]
|
||||
h2 [ _id "requests-expire-after" ] [ locStr s["Requests Expire After"] ]
|
||||
p [] [
|
||||
raw l["When a regular request goes this many days without being updated, it expires and no longer appears on the request list."]; space
|
||||
raw l["Note that the categories āLong-Term Requestsā and āExpectingā never expire automatically."] ]
|
||||
h2 [ _id "requests-new-for" ] [ locStr s["Requests āNewā For"] ]
|
||||
p [] [
|
||||
raw l["Requests that have been updated within this many days are identified by a hollow circle for their bullet, as opposed to a filled circle for other requests."]; space
|
||||
raw l["All categories respect this setting."]; space
|
||||
raw l["If you do a typo correction on a request, if you do not check the box to update the date, this setting will change the bullet."]; space
|
||||
raw l["(NOTE: In the plain-text e-mail, new requests are bulleted with a ā+ā symbol, and old are bulleted with a ā-ā symbol.)"] ]
|
||||
h2 [ _id "long-term-requests-alerted-for-update" ] [ locStr s["Long-Term Requests Alerted for Update"] ]
|
||||
p [] [
|
||||
raw l["Requests that have not been updated in this many weeks are identified by an italic font on the āMaintain Requestsā page, to remind you to seek updates on these requests so that your prayers can stay relevant and current."] ]
|
||||
h2 [ _id "request-sorting" ] [ locStr s["Request Sorting"] ]
|
||||
p [] [
|
||||
raw l["By default, requests are sorted within each group by the last updated date, with the most recent on top."]; space
|
||||
raw l["If you would prefer to have the list sorted by requestor or subject rather than by date, select āSort by Requestor Nameā instead."] ]
|
||||
h2 [ _id "e-mail-from-name-and-address" ] [ locStr s["E-mail āFromā Name and Address"] ]
|
||||
p [] [
|
||||
raw l["PrayerTracker must put an name and e-mail address in the āfromā position of each e-mail it sends."]; space
|
||||
raw l["The default name is āPrayerTrackerā, and the default e-mail address is āprayer@bitbadger.solutionsā."]; space
|
||||
raw l["This will work, but any bounced e-mails and out-of-office replies will be sent to that address (which is not even a real address)."]; space
|
||||
raw l["Changing at least the e-mail address to your address will ensure that you receive these e-mails, and can prune your e-mail list accordingly."] ]
|
||||
h2 [ _id "e-mail-format" ] [ locStr s["E-mail Format"] ]
|
||||
p [] [
|
||||
raw l["This is the default e-mail format for your group."]; space
|
||||
raw l["The PrayerTracker default is HTML, which sends the list just as you see it online."]; space
|
||||
raw l["However, some e-mail clients may not display this properly, so you can choose to default the email to a plain-text format, which does not have colors, italics, or other formatting."]; space
|
||||
raw l["The setting on this page is the group default; you can select a format for each recipient on the āMaintain Group Membersā page."] ]
|
||||
h2 [ _id "colors" ] [ locStr s["Colors"] ]
|
||||
p [] [
|
||||
raw l["You can customize the colors that are used for the headings and lines in your request list."]; space
|
||||
raw l["You can select one of the 16 named colors in the drop down lists, or you can āmix your ownā using red, green, and blue (RGB) values between 0 and 255."]; space
|
||||
raw l["There is a link on the bottom of the page to a color list with more names and their RGB values, if you're really feeling artistic."]; space
|
||||
raw l["The background color cannot be changed."] ]
|
||||
h2 [ _id "fonts-for-list" ] [ locStr s["Fonts for List"] ]
|
||||
p [] [ raw l["There are two options for fonts that will be used in the prayer request list."] ]
|
||||
ul [] [
|
||||
li [] [
|
||||
raw l["āNative Fontsā uses a list of fonts that will render the prayer requests in the best available font for their device, whether that is a desktop or laptop computer, mobile device, or tablet."]; space
|
||||
raw l["(This is the default for new small groups.)"] ]
|
||||
li [] [
|
||||
raw l["āNamed Fontsā uses a comma-separated list of fonts that you specify."]; space
|
||||
raw l["A warning is good here; just because you have an obscure font and like the way that it looks does not mean that others have that same font."]; space
|
||||
raw l["It is generally best to stick with the fonts that come with Windows - fonts like āArialā, āTimes New Romanā, āTahomaā, and āComic Sans MSā."]; space
|
||||
raw l["You should also end the font list with either āserifā or āsans-serifā, which will use the browser's default serif (like āTimes New Romanā) or sans-serif (like āArialā) font."] ] ]
|
||||
h2 [ _id "heading-list-text-size" ] [ locStr s["Heading / List Text Size"] ]
|
||||
p [] [
|
||||
raw l["This is the point size to use for each."]; space
|
||||
raw l["The default for the heading is 16pt, and the default for the text is 12pt."] ]
|
||||
h2 [ _id "making-a-large-print-list" ] [ locStr s["Making a āLarge Printā List"] ]
|
||||
p [] [
|
||||
raw l["If your group is comprised mostly of people who prefer large print, the following settings will make your list look like the typical large-print publication:"] ]
|
||||
blockquote [] [
|
||||
p [] [ strong [] [ locStr s["Fonts"] ]; br []; raw l["""Named Fonts: "Times New Roman",serif"""] ]
|
||||
p [] [ strong [] [ locStr s["Heading Text Size"] ]; br []; rawText "18pt" ]
|
||||
p [] [ strong [] [ locStr s["List Text Size"] ]; br []; rawText "16pt" ] ]
|
||||
h2 [ _id "request-list-visibility" ] [ locStr s["Request List Visibility"] ]
|
||||
p [] [
|
||||
raw l["The group's request list can be either public, private, or password-protected."]; space
|
||||
raw l["Public lists are available without logging in, and private lists are only available online to administrators (though the list can still be sent via e-mail by an administrator)."]; space
|
||||
raw l["Password-protected lists allow group members to log in and view the current request list online, using the āGroup Log Onā link and providing this password."]; space
|
||||
raw l["As this is a shared password, it is stored in plain text, so you can easily see what it is."]; space
|
||||
raw l["If you select āPassword Protectedā but do not enter a password, the list remains private, which is also the default value."]; space
|
||||
raw l["(Changing this password will force all members of the group who logged in with the āRemember Meā box checked to provide the new password.)"] ]
|
||||
h2 [ _id "time-zone" ] [ locStr s["Time Zone"] ]
|
||||
p [] [
|
||||
raw l["This is the time zone that you would like to use for your group."]; space
|
||||
raw l["""If you do not see your time zone listed, just <a href="mailto:daniel@bitbadger.solutions?subject=PrayerTracker+Time+Zone">contact Daniel</a> and tell him what time zone you need."""] ]
|
||||
h2 [ _id "page-size" ] [ locStr s["Page Size"] ]
|
||||
p [] [
|
||||
raw l["As small groups use PrayerTracker, they accumulate many expired requests."]; space
|
||||
raw l["When lists of requests include expired requests, the results will be broken up into pages."]; space
|
||||
raw l["The default value is 100 requests per page, but may be set as low as 10 or as high as 255."] ]
|
||||
h2 [ _id "as-of-date-display" ] [ locStr s["āAs ofā Date Display"] ]
|
||||
p [] [
|
||||
raw l["PrayerTracker can display the last date a request was updated, at the end of the request text."]; space
|
||||
raw l["By default, it does not."]; space
|
||||
raw l["If you select a short date, it will show ā(as of 10/11/2015)ā (for October 11, 2015); if you select a long date, it will show ā(as of Sunday, October 11, 2015)ā."] ] ]
|
||||
|
||||
/// Help for user pages
|
||||
module User =
|
||||
|
||||
/// Log On
|
||||
let logOn () =
|
||||
let s = I18N.localizer.Force()
|
||||
let l = I18N.forView "Help/User/LogOn"
|
||||
use sw = new StringWriter()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [
|
||||
raw l["This page allows you to log on to PrayerTracker."]; space
|
||||
raw l["There are two different levels of access for PrayerTracker - user and group."] ]
|
||||
h2 [ _id "user-log-on" ] [ locStr s["User Log On"] ]
|
||||
p [] [
|
||||
raw l["Enter your e-mail address and password into the appropriate boxes, then select your group."]; space
|
||||
raw l["If you want PrayerTracker to remember you on your computer, click the āRemember Meā box before clicking the āLog Onā button."] ]
|
||||
h2 [ _id "group-log-on" ] [ locStr s["Group Log On"] ]
|
||||
p [] [
|
||||
raw l["If your group has defined a password to use to allow you to view their request list online, select your group from the drop down list, then enter the group password into the appropriate box."]; space
|
||||
raw l["If you want PrayerTracker to remember your group, click the āRemember Meā box before clicking the āLog Onā button."] ] ]
|
||||
|
||||
/// Change Your Password
|
||||
let password () =
|
||||
let s = I18N.localizer.Force()
|
||||
let l = I18N.forView "Help/User/Password"
|
||||
use sw = new StringWriter()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [
|
||||
raw l["This page will let you change your password."]; space
|
||||
raw l["Enter your existing password in the top box, then enter your new password in the bottom two boxes."]; space
|
||||
raw l["Entering your existing password is a security measure; with the āRemember Meā box on the log in page, this will prevent someone else who may be using your computer from being able to simply go to the site and change your password."] ]
|
||||
p [] [
|
||||
raw l["If you cannot remember your existing password, we cannot retrieve it, but we can set it to something known so that you can then change it to your password."]; space
|
||||
a [ _href $"""mailto:daniel@bitbadger.solutions?subject={l["PrayerTracker+Password+Help"].Value}""" ] [
|
||||
raw l["Click here to request help resetting your password."] ] ] ]
|
@ -1,262 +1,259 @@
|
||||
/// Views associated with the home page, or those that don't fit anywhere else
|
||||
module PrayerTracker.Views.Home
|
||||
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open Microsoft.AspNetCore.Html
|
||||
open PrayerTracker.ViewModels
|
||||
open System.IO
|
||||
open Giraffe.ViewEngine
|
||||
open PrayerTracker.ViewModels
|
||||
|
||||
/// The error page
|
||||
let error code vi =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/Error"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
let is404 = "404" = code
|
||||
let pageTitle = match is404 with true -> "Page Not Found" | false -> "Server Error"
|
||||
[ yield!
|
||||
match is404 with
|
||||
| true ->
|
||||
[ p [] [
|
||||
raw l.["The page you requested cannot be found."]
|
||||
raw l.["Please use your “Back” button to return to {0}.", s.["PrayerTracker"]]
|
||||
]
|
||||
p [] [
|
||||
raw l.["If you reached this page from a link within {0}, please copy the link from the browser's address bar, and send it to support, along with the group for which you were currently authenticated (if any).",
|
||||
s.["PrayerTracker"]]
|
||||
]
|
||||
]
|
||||
| false ->
|
||||
[ p [] [
|
||||
raw l.["An error ({0}) has occurred.", code]
|
||||
raw l.["Please use your “Back” button to return to {0}.", s.["PrayerTracker"]]
|
||||
]
|
||||
]
|
||||
br []
|
||||
hr []
|
||||
div [ _style "font-size:70%;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif" ] [
|
||||
img [ _src $"""/img/%A{s.["footer_en"]}.png"""
|
||||
_alt $"""%A{s.["PrayerTracker"]} %A{s.["from Bit Badger Solutions"]}"""
|
||||
_title $"""%A{s.["PrayerTracker"]} %A{s.["from Bit Badger Solutions"]}"""
|
||||
_style "vertical-align:text-bottom;" ]
|
||||
str vi.version
|
||||
]
|
||||
let error code viewInfo =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/Error"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
let is404 = "404" = code
|
||||
let pageTitle = if is404 then "Page Not Found" else "Server Error"
|
||||
[ yield!
|
||||
if is404 then
|
||||
[ p [] [
|
||||
raw l["The page you requested cannot be found."]
|
||||
raw l["Please use your “Back” button to return to {0}.", s["PrayerTracker"]]
|
||||
]
|
||||
p [] [
|
||||
raw l["If you reached this page from a link within {0}, please copy the link from the browser's address bar, and send it to support, along with the group for which you were currently authenticated (if any).",
|
||||
s["PrayerTracker"]]
|
||||
]
|
||||
]
|
||||
else
|
||||
[ p [] [
|
||||
raw l["An error ({0}) has occurred.", code]
|
||||
raw l["Please use your “Back” button to return to {0}.", s["PrayerTracker"]]
|
||||
]
|
||||
]
|
||||
br []
|
||||
hr []
|
||||
div [ _style "font-size:70%;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif" ] [
|
||||
img [ _src $"""/img/%A{s["footer_en"]}.png"""
|
||||
_alt $"""%A{s["PrayerTracker"]} %A{s["from Bit Badger Solutions"]}"""
|
||||
_title $"""%A{s["PrayerTracker"]} %A{s["from Bit Badger Solutions"]}"""
|
||||
_style "vertical-align:text-bottom;" ]
|
||||
str viewInfo.Version
|
||||
]
|
||||
]
|
||||
|> div []
|
||||
|> Layout.bare pageTitle
|
||||
|> div []
|
||||
|> Layout.bare pageTitle
|
||||
|
||||
|
||||
/// The home page
|
||||
let index vi =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/Index"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
|
||||
[ p [] [
|
||||
raw l.["Welcome to <strong>{0}</strong>!", s.["PrayerTracker"]]
|
||||
space
|
||||
raw l.["{0} is an interactive website that provides churches, Sunday School classes, and other organizations an easy way to keep up with their prayer requests.",
|
||||
s.["PrayerTracker"]]
|
||||
space
|
||||
raw l.["It is provided at no charge, as a ministry and a community service."]
|
||||
]
|
||||
h4 [] [ raw l.["What Does It Do?"] ]
|
||||
p [] [
|
||||
raw l.["{0} has what you need to make maintaining a prayer request list a breeze.", s.["PrayerTracker"]]
|
||||
space
|
||||
raw l.["Some of the things it can do..."]
|
||||
]
|
||||
ul [] [
|
||||
li [] [
|
||||
raw l.["It drops old requests off the list automatically."]
|
||||
space
|
||||
raw l.["Requests other than ā{0}ā requests will expire at 14 days, though this can be changed by the organization.",
|
||||
s.["Long-Term Requests"]]
|
||||
space
|
||||
raw l.["This expiration is based on the last update, not the initial request."]
|
||||
space
|
||||
raw l.["(And, once requests do ādrop offā, they are not gone - they may be recovered if needed.)"]
|
||||
let index viewInfo =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/Index"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [
|
||||
raw l["Welcome to <strong>{0}</strong>!", s["PrayerTracker"]]
|
||||
space
|
||||
raw l["{0} is an interactive website that provides churches, Sunday School classes, and other organizations an easy way to keep up with their prayer requests.",
|
||||
s["PrayerTracker"]]
|
||||
space
|
||||
raw l["It is provided at no charge, as a ministry and a community service."]
|
||||
]
|
||||
li [] [
|
||||
raw l.["Requests can be viewed any time."]
|
||||
space
|
||||
raw l.["Lists can be made public, or they can be secured with a password, if desired."]
|
||||
h4 [] [ raw l["What Does It Do?"] ]
|
||||
p [] [
|
||||
raw l["{0} has what you need to make maintaining a prayer request list a breeze.", s["PrayerTracker"]]
|
||||
space
|
||||
raw l["Some of the things it can do..."]
|
||||
]
|
||||
li [] [
|
||||
raw l.["Lists can be e-mailed to a pre-defined list of members."]
|
||||
space
|
||||
raw l.["This can be useful for folks who may not be able to write down all the requests during class, but want a list so that they can pray for them the rest of week."]
|
||||
space
|
||||
raw l.["E-mails are sent individually to each person, which keeps the e-mail list private and keeps the messages from being flagged as spam."]
|
||||
ul [] [
|
||||
li [] [
|
||||
raw l["It drops old requests off the list automatically."]
|
||||
space
|
||||
raw l["Requests other than ā{0}ā requests will expire at 14 days, though this can be changed by the organization.",
|
||||
s["Long-Term Requests"]]
|
||||
space
|
||||
raw l["This expiration is based on the last update, not the initial request."]
|
||||
space
|
||||
raw l["(And, once requests do ādrop offā, they are not gone - they may be recovered if needed.)"]
|
||||
]
|
||||
li [] [
|
||||
raw l["Requests can be viewed any time."]
|
||||
space
|
||||
raw l["Lists can be made public, or they can be secured with a password, if desired."]
|
||||
]
|
||||
li [] [
|
||||
raw l["Lists can be e-mailed to a pre-defined list of members."]
|
||||
space
|
||||
raw l["This can be useful for folks who may not be able to write down all the requests during class, but want a list so that they can pray for them the rest of week."]
|
||||
space
|
||||
raw l["E-mails are sent individually to each person, which keeps the e-mail list private and keeps the messages from being flagged as spam."]
|
||||
]
|
||||
li [] [
|
||||
raw l["The look and feel of the list can be configured for each group."]
|
||||
space
|
||||
raw l["All fonts, colors, and sizes can be customized."]
|
||||
space
|
||||
raw l["This allows for configuration of large-print lists, among other things."]
|
||||
]
|
||||
]
|
||||
li [] [
|
||||
raw l.["The look and feel of the list can be configured for each group."]
|
||||
space
|
||||
raw l.["All fonts, colors, and sizes can be customized."]
|
||||
space
|
||||
raw l.["This allows for configuration of large-print lists, among other things."]
|
||||
h4 [] [ raw l["How Can Your Organization Use {0}?", s["PrayerTracker"]] ]
|
||||
p [] [
|
||||
raw l["Like Godās gift of salvation, {0} is free for the asking for any church, Sunday School class, or other organization who wishes to use it.",
|
||||
s["PrayerTracker"]]
|
||||
space
|
||||
raw l["If your organization would like to get set up, just <a href=\"mailto:daniel@djs-consulting.com?subject=New%20{0}%20Class\">e-mail</a> Daniel and let him know.",
|
||||
s["PrayerTracker"]]
|
||||
]
|
||||
h4 [] [ raw l["Do I Have to Register to See the Requests?"] ]
|
||||
p [] [
|
||||
raw l["This depends on the group."]
|
||||
space
|
||||
raw l["Lists can be configured to be password-protected, but they do not have to be."]
|
||||
space
|
||||
raw l["If you click on the ā{0}ā link above, you will see a list of groups - those that do not indicate that they require logging in are publicly viewable.",
|
||||
s["View Request List"]]
|
||||
]
|
||||
h4 [] [ raw l["How Does It Work?"] ]
|
||||
p [] [
|
||||
raw l["Check out the ā{0}ā link above - it details each of the processes and how they work.", s["Help"]]
|
||||
]
|
||||
]
|
||||
h4 [] [ raw l.["How Can Your Organization Use {0}?", s.["PrayerTracker"]] ]
|
||||
p [] [
|
||||
raw l.["Like Godās gift of salvation, {0} is free for the asking for any church, Sunday School class, or other organization who wishes to use it.",
|
||||
s.["PrayerTracker"]]
|
||||
space
|
||||
raw l.["If your organization would like to get set up, just <a href=\"mailto:daniel@djs-consulting.com?subject=New%20{0}%20Class\">e-mail</a> Daniel and let him know.",
|
||||
s.["PrayerTracker"]]
|
||||
]
|
||||
h4 [] [ raw l.["Do I Have to Register to See the Requests?"] ]
|
||||
p [] [
|
||||
raw l.["This depends on the group."]
|
||||
space
|
||||
raw l.["Lists can be configured to be password-protected, but they do not have to be."]
|
||||
space
|
||||
raw l.["If you click on the ā{0}ā link above, you will see a list of groups - those that do not indicate that they require logging in are publicly viewable.",
|
||||
s.["View Request List"]]
|
||||
]
|
||||
h4 [] [ raw l.["How Does It Work?"] ]
|
||||
p [] [
|
||||
raw l.["Check out the ā{0}ā link above - it details each of the processes and how they work.", s.["Help"]]
|
||||
]
|
||||
]
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard vi "Welcome!"
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard viewInfo "Welcome!"
|
||||
|
||||
|
||||
/// Privacy Policy page
|
||||
let privacyPolicy vi =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/PrivacyPolicy"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
|
||||
[ p [ _class "pt-right-text" ] [ small[] [ em [] [ raw l.["(as of July 31, 2018)"] ] ] ]
|
||||
p [] [
|
||||
raw l.["The nature of the service is one where privacy is a must."]
|
||||
space
|
||||
raw l.["The items below will help you understand the data we collect, access, and store on your behalf as you use this service."]
|
||||
]
|
||||
h3 [] [ raw l.["What We Collect"] ]
|
||||
ul [] [
|
||||
li [] [
|
||||
strong [] [ raw l.["Identifying Data"] ]
|
||||
rawText " – "
|
||||
raw l.["{0} stores the first and last names, e-mail addresses, and hashed passwords of all authorized users.", s.["PrayerTracker"]]
|
||||
space
|
||||
raw l.["Users are also associated with one or more small groups."]
|
||||
let privacyPolicy viewInfo =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/PrivacyPolicy"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
[ p [ _class "pt-right-text" ] [ small [] [ em [] [ raw l["(as of July 31, 2018)"] ] ] ]
|
||||
p [] [
|
||||
raw l["The nature of the service is one where privacy is a must."]
|
||||
space
|
||||
raw l["The items below will help you understand the data we collect, access, and store on your behalf as you use this service."]
|
||||
]
|
||||
li [] [
|
||||
strong [] [ raw l.["User Provided Data"] ]
|
||||
rawText " – "
|
||||
raw l.["{0} stores the text of prayer requests.", s.["PrayerTracker"]]
|
||||
space
|
||||
raw l.["It also stores names and e-mail addreses of small group members, and plain-text passwords for small groups with password-protected lists."]
|
||||
h3 [] [ raw l["What We Collect"] ]
|
||||
ul [] [
|
||||
li [] [
|
||||
strong [] [ raw l["Identifying Data"] ]
|
||||
rawText " – "
|
||||
raw l["{0} stores the first and last names, e-mail addresses, and hashed passwords of all authorized users.",
|
||||
s["PrayerTracker"]]
|
||||
space
|
||||
raw l["Users are also associated with one or more small groups."]
|
||||
]
|
||||
li [] [
|
||||
strong [] [ raw l["User Provided Data"] ]
|
||||
rawText " – "
|
||||
raw l["{0} stores the text of prayer requests.", s["PrayerTracker"]]
|
||||
space
|
||||
raw l["It also stores names and e-mail addresses of small group members, and plain-text passwords for small groups with password-protected lists."]
|
||||
]
|
||||
]
|
||||
]
|
||||
h3 [] [ raw l.["How Your Data Is Accessed / Secured"] ]
|
||||
ul [] [
|
||||
li [] [
|
||||
raw l.["While you are signed in, {0} utilizes a session cookie, and transmits that cookie to the server to establish your identity.",
|
||||
s.["PrayerTracker"]]
|
||||
space
|
||||
raw l.["If you utilize the ā{0}ā box on sign in, a second cookie is stored, and transmitted to establish a session; this cookie is removed by clicking the ā{1}ā link.",
|
||||
s.["Remember Me"], s.["Log Off"]]
|
||||
space
|
||||
raw l.["Both of these cookies are encrypted, both in your browser and in transit."]
|
||||
space
|
||||
raw l.["Finally, a third cookie is used to maintain your currently selected language, so that this selection is maintained across browser sessions."]
|
||||
h3 [] [ raw l["How Your Data Is Accessed / Secured"] ]
|
||||
ul [] [
|
||||
li [] [
|
||||
raw l["While you are signed in, {0} utilizes a session cookie, and transmits that cookie to the server to establish your identity.",
|
||||
s["PrayerTracker"]]
|
||||
space
|
||||
raw l["If you utilize the ā{0}ā box on sign in, a second cookie is stored, and transmitted to establish a session; this cookie is removed by clicking the ā{1}ā link.",
|
||||
s["Remember Me"], s["Log Off"]]
|
||||
space
|
||||
raw l["Both of these cookies are encrypted, both in your browser and in transit."]
|
||||
space
|
||||
raw l["Finally, a third cookie is used to maintain your currently selected language, so that this selection is maintained across browser sessions."]
|
||||
]
|
||||
li [] [
|
||||
raw l["Data for your small group is returned to you, as required, to display and edit."]
|
||||
space
|
||||
raw l["{0} also sends e-mails on behalf of the configured owner of a small group; these e-mails are sent from prayer@djs-consulting.com, with the āReply Toā header set to the configured owner of the small group.",
|
||||
s["PrayerTracker"]]
|
||||
space
|
||||
raw l["Distinct e-mails are sent to each user, as to not disclose the other recipients."]
|
||||
space
|
||||
raw l["On the server, all data is stored in a controlled-access database."]
|
||||
]
|
||||
li [] [
|
||||
raw l["Your data is backed up, along with other Bit Badger Solutions hosted systems, in a rolling manner; backups are preserved for the prior 7 days, and backups from the 1st and 15th are preserved for 3 months."]
|
||||
space
|
||||
raw l["These backups are stored in a private cloud data repository."]
|
||||
]
|
||||
li [] [
|
||||
raw l["Access to servers and backups is strictly controlled and monitored for unauthorized access attempts."]
|
||||
]
|
||||
]
|
||||
li [] [
|
||||
raw l.["Data for your small group is returned to you, as required, to display and edit."]
|
||||
space
|
||||
raw l.["{0} also sends e-mails on behalf of the configured owner of a small group; these e-mails are sent from prayer@djs-consulting.com, with the āReply Toā header set to the configured owner of the small group.",
|
||||
s.["PrayerTracker"]]
|
||||
space
|
||||
raw l.["Distinct e-mails are sent to each user, as to not disclose the other recipients."]
|
||||
space
|
||||
raw l.["On the server, all data is stored in a controlled-access database."]
|
||||
h3 [] [ raw l["Removing Your Data"] ]
|
||||
p [] [
|
||||
raw l["At any time, you may choose to discontinue using {0}; just e-mail Daniel, as you did to register, and request deletion of your small group.",
|
||||
s["PrayerTracker"]]
|
||||
]
|
||||
li [] [
|
||||
raw l.["Your data is backed up, along with other Bit Badger Solutions hosted systems, in a rolling manner; backups are preserved for the prior 7 days, and backups from the 1st and 15th are preserved for 3 months."]
|
||||
space
|
||||
raw l.["These backups are stored in a private cloud data repository."]
|
||||
]
|
||||
li [] [
|
||||
raw l.["Access to servers and backups is strictly controlled and monitored for unauthorized access attempts."]
|
||||
]
|
||||
]
|
||||
h3 [] [ raw l.["Removing Your Data"] ]
|
||||
p [] [
|
||||
raw l.["At any time, you may choose to discontinue using {0}; just e-mail Daniel, as you did to register, and request deletion of your small group.",
|
||||
s.["PrayerTracker"]]
|
||||
]
|
||||
]
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard vi "Privacy Policy"
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard viewInfo "Privacy Policy"
|
||||
|
||||
|
||||
/// Terms of Service page
|
||||
let termsOfService vi =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/TermsOfService"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
let ppLink =
|
||||
a [ _href "/web/legal/privacy-policy" ] [ str (s.["Privacy Policy"].Value.ToLower ()) ]
|
||||
|> (renderHtmlNode >> HtmlString)
|
||||
let termsOfService viewInfo =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/TermsOfService"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
let ppLink =
|
||||
a [ _href "/legal/privacy-policy" ] [ str (s["Privacy Policy"].Value.ToLower ()) ]
|
||||
|> renderHtmlString
|
||||
|
||||
[ p [ _class "pt-right-text" ] [ small [] [ em [] [ raw l.["(as of May 24, 2018)"] ] ] ]
|
||||
h3 [] [ str "1. "; raw l.["Acceptance of Terms"] ]
|
||||
p [] [
|
||||
raw l.["By accessing this web site, you are agreeing to be bound by these Terms and Conditions, and that you are responsible to ensure that your use of this site complies with all applicable laws."]
|
||||
space
|
||||
raw l.["Your continued use of this site implies your acceptance of these terms."]
|
||||
]
|
||||
h3 [] [ str "2. "; raw l.["Description of Service and Registration"] ]
|
||||
p [] [
|
||||
raw l.["{0} is a service that allows individuals to enter and amend prayer requests on behalf of organizations.",
|
||||
s.["PrayerTracker"]]
|
||||
space
|
||||
raw l.["Registration is accomplished via e-mail to Daniel Summers (daniel at bitbadger dot solutions, substituting punctuation)."]
|
||||
space
|
||||
raw l.["See our {0} for details on the personal (user) information we maintain.", ppLink]
|
||||
]
|
||||
h3 [] [ str "3. "; raw l.["Liability"] ]
|
||||
p [] [
|
||||
raw l.["This service is provided āas isā, and no warranty (express or implied) exists."]
|
||||
space
|
||||
raw l.["The service and its developers may not be held liable for any damages that may arise through the use of this service."]
|
||||
]
|
||||
h3 [] [ str "4. "; raw l.["Updates to Terms"] ]
|
||||
p [] [
|
||||
raw l.["These terms and conditions may be updated at any time."]
|
||||
space
|
||||
raw l.["When these terms are updated, users will be notified by a system-generated announcement."]
|
||||
space
|
||||
raw l.["Additionally, the date at the top of this page will be updated."]
|
||||
]
|
||||
hr []
|
||||
p [] [ raw l.["You may also wish to review our {0} to learn how we handle your data.", ppLink] ]
|
||||
[ p [ _class "pt-right-text" ] [ small [] [ em [] [ raw l["(as of May 24, 2018)"] ] ] ]
|
||||
h3 [] [ str "1. "; raw l["Acceptance of Terms"] ]
|
||||
p [] [
|
||||
raw l["By accessing this web site, you are agreeing to be bound by these Terms and Conditions, and that you are responsible to ensure that your use of this site complies with all applicable laws."]
|
||||
space
|
||||
raw l["Your continued use of this site implies your acceptance of these terms."]
|
||||
]
|
||||
h3 [] [ str "2. "; raw l["Description of Service and Registration"] ]
|
||||
p [] [
|
||||
raw l["{0} is a service that allows individuals to enter and amend prayer requests on behalf of organizations.",
|
||||
s["PrayerTracker"]]
|
||||
space
|
||||
raw l["Registration is accomplished via e-mail to Daniel Summers (daniel at bitbadger dot solutions, substituting punctuation)."]
|
||||
space
|
||||
raw l["See our {0} for details on the personal (user) information we maintain.", ppLink]
|
||||
]
|
||||
h3 [] [ str "3. "; raw l["Liability"] ]
|
||||
p [] [
|
||||
raw l["This service is provided āas isā, and no warranty (express or implied) exists."]
|
||||
space
|
||||
raw l["The service and its developers may not be held liable for any damages that may arise through the use of this service."]
|
||||
]
|
||||
h3 [] [ str "4. "; raw l["Updates to Terms"] ]
|
||||
p [] [
|
||||
raw l["These terms and conditions may be updated at any time."]
|
||||
space
|
||||
raw l["When these terms are updated, users will be notified by a system-generated announcement."]
|
||||
space
|
||||
raw l["Additionally, the date at the top of this page will be updated."]
|
||||
]
|
||||
hr []
|
||||
p [] [ raw l["You may also wish to review our {0} to learn how we handle your data.", ppLink] ]
|
||||
]
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard vi "Terms of Service"
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard viewInfo "Terms of Service"
|
||||
|
||||
|
||||
/// View for unauthorized page
|
||||
let unauthorized vi =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/Unauthorized"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [
|
||||
raw l.["If you feel you have reached this page in error, please <a href=\"mailto:daniel@djs-consulting.com?Subject={0}%20Unauthorized%20Access\">contact Daniel</a> and provide the details as to what you were doing (i.e., what link did you click, where had you been, etc.).",
|
||||
s.["PrayerTracker"]]
|
||||
]
|
||||
p [] [
|
||||
raw l.["Otherwise, you may select one of the links above to get back into an authorized portion of {0}.",
|
||||
s.["PrayerTracker"]]
|
||||
]
|
||||
let unauthorized viewInfo =
|
||||
let s = I18N.localizer.Force ()
|
||||
let l = I18N.forView "Home/Unauthorized"
|
||||
use sw = new StringWriter ()
|
||||
let raw = rawLocText sw
|
||||
[ p [] [
|
||||
raw l["If you feel you have reached this page in error, please <a href=\"mailto:daniel@djs-consulting.com?Subject={0}%20Unauthorized%20Access\">contact Daniel</a> and provide the details as to what you were doing (i.e., what link did you click, where had you been, etc.).",
|
||||
s["PrayerTracker"]]
|
||||
]
|
||||
p [] [
|
||||
raw l["Otherwise, you may select one of the links above to get back into an authorized portion of {0}.",
|
||||
s["PrayerTracker"]]
|
||||
]
|
||||
]
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard vi "Unauthorized Access"
|
||||
|> Layout.Content.standard
|
||||
|> Layout.standard viewInfo "Unauthorized Access"
|
||||
|
@ -11,12 +11,12 @@ let private resAsmName = typeof<Common>.Assembly.GetName().Name
|
||||
|
||||
/// Set up the string and HTML localizer factories
|
||||
let setUpFactories fac =
|
||||
stringLocFactory <- fac
|
||||
htmlLocFactory <- HtmlLocalizerFactory stringLocFactory
|
||||
stringLocFactory <- fac
|
||||
htmlLocFactory <- HtmlLocalizerFactory stringLocFactory
|
||||
|
||||
/// An instance of the common string localizer
|
||||
let localizer = lazy (stringLocFactory.Create ("Common", resAsmName))
|
||||
|
||||
/// Get a view localizer
|
||||
let forView (view : string) =
|
||||
htmlLocFactory.Create ($"""Views.{view.Replace ('/', '.')}""", resAsmName)
|
||||
htmlLocFactory.Create ($"Views.{view.Replace ('/', '.')}", resAsmName)
|
||||
|
@ -1,290 +1,352 @@
|
||||
/// Layout items for PrayerTracker
|
||||
module PrayerTracker.Views.Layout
|
||||
|
||||
open Giraffe.GiraffeViewEngine
|
||||
open PrayerTracker
|
||||
open Giraffe.ViewEngine
|
||||
open Giraffe.ViewEngine.Accessibility
|
||||
open PrayerTracker.ViewModels
|
||||
open System
|
||||
open System.Globalization
|
||||
|
||||
|
||||
/// Get the two-character language code for the current request
|
||||
let langCode () = match CultureInfo.CurrentCulture.Name.StartsWith "es" with true -> "es" | _ -> "en"
|
||||
let langCode () = if CultureInfo.CurrentCulture.Name.StartsWith "es" then "es" else "en"
|
||||
|
||||
|
||||
/// Navigation items
|
||||
module Navigation =
|
||||
|
||||
/// Top navigation bar
|
||||
let top m =
|
||||
let s = PrayerTracker.Views.I18N.localizer.Force ()
|
||||
let menuSpacer = rawText " "
|
||||
let leftLinks = [
|
||||
match m.user with
|
||||
| Some u ->
|
||||
li [ _class "dropdown" ] [
|
||||
a [ _class "dropbtn"; _role "button"; _aria "label" s.["Requests"].Value; _title s.["Requests"].Value ]
|
||||
[ icon "question_answer"; space; locStr s.["Requests"]; space; icon "keyboard_arrow_down" ]
|
||||
div [ _class "dropdown-content"; _role "menu" ] [
|
||||
a [ _href "/web/prayer-requests" ] [ icon "compare_arrows"; menuSpacer; locStr s.["Maintain"] ]
|
||||
a [ _href "/web/prayer-requests/view" ] [ icon "list"; menuSpacer; locStr s.["View List"] ]
|
||||
]
|
||||
]
|
||||
li [ _class "dropdown" ] [
|
||||
a [ _class "dropbtn"; _role "button"; _aria "label" s.["Group"].Value; _title s.["Group"].Value ]
|
||||
[ icon "group"; space; locStr s.["Group"]; space; icon "keyboard_arrow_down" ]
|
||||
div [ _class "dropdown-content"; _role "menu" ] [
|
||||
a [ _href "/web/small-group/members" ] [ icon "email"; menuSpacer; locStr s.["Maintain Group Members"] ]
|
||||
a [ _href "/web/small-group/announcement" ] [ icon "send"; menuSpacer; locStr s.["Send Announcement"] ]
|
||||
a [ _href "/web/small-group/preferences" ] [ icon "build"; menuSpacer; locStr s.["Change Preferences"] ]
|
||||
]
|
||||
]
|
||||
match u.isAdmin with
|
||||
| true ->
|
||||
li [ _class "dropdown" ] [
|
||||
a [ _class "dropbtn"; _role "button"; _aria "label" s.["Administration"].Value; _title s.["Administration"].Value ]
|
||||
[ icon "settings"; space; locStr s.["Administration"]; space; icon "keyboard_arrow_down" ]
|
||||
div [ _class "dropdown-content"; _role "menu" ] [
|
||||
a [ _href "/web/churches" ] [ icon "home"; menuSpacer; locStr s.["Churches"] ]
|
||||
a [ _href "/web/small-groups" ] [ icon "send"; menuSpacer; locStr s.["Groups"] ]
|
||||
a [ _href "/web/users" ] [ icon "build"; menuSpacer; locStr s.["Users"] ]
|
||||
]
|
||||
]
|
||||
| false -> ()
|
||||
| None ->
|
||||
match m.group with
|
||||
| Some _ ->
|
||||
li [] [
|
||||
a [ _href "/web/prayer-requests/view"
|
||||
_aria "label" s.["View Request List"].Value
|
||||
_title s.["View Request List"].Value ]
|
||||
[ icon "list"; space; locStr s.["View Request List"] ]
|
||||
]
|
||||
| None ->
|
||||
li [ _class "dropdown" ] [
|
||||
a [ _class "dropbtn"; _role "button"; _aria "label" s.["Log On"].Value; _title s.["Log On"].Value ]
|
||||
[ icon "security"; space; locStr s.["Log On"]; space; icon "keyboard_arrow_down" ]
|
||||
div [ _class "dropdown-content"; _role "menu" ] [
|
||||
a [ _href "/web/user/log-on" ] [ icon "person"; menuSpacer; locStr s.["User"] ]
|
||||
a [ _href "/web/small-group/log-on" ] [ icon "group"; menuSpacer; locStr s.["Group"] ]
|
||||
]
|
||||
]
|
||||
li [] [
|
||||
a [ _href "/web/prayer-requests/lists"
|
||||
_aria "label" s.["View Request List"].Value
|
||||
_title s.["View Request List"].Value ]
|
||||
[ icon "list"; space; locStr s.["View Request List"] ]
|
||||
]
|
||||
li [] [
|
||||
a [ _href $"https://docs.prayer.bitbadger.solutions/{langCode ()}"
|
||||
_aria "label" s.["Help"].Value;
|
||||
_title s.["View Help"].Value
|
||||
_target "_blank"
|
||||
]
|
||||
[ icon "help"; space; locStr s.["Help"] ]
|
||||
]
|
||||
]
|
||||
let rightLinks =
|
||||
match m.group with
|
||||
| Some _ ->
|
||||
[ match m.user with
|
||||
| Some _ ->
|
||||
li [] [
|
||||
a [ _href "/web/user/password"
|
||||
_aria "label" s.["Change Your Password"].Value
|
||||
_title s.["Change Your Password"].Value ]
|
||||
[ icon "lock"; space; locStr s.["Change Your Password"] ]
|
||||
]
|
||||
| None -> ()
|
||||
li [] [
|
||||
a [ _href "/web/log-off"; _aria "label" s.["Log Off"].Value; _title s.["Log Off"].Value ]
|
||||
[ icon "power_settings_new"; space; locStr s.["Log Off"] ]
|
||||
]
|
||||
]
|
||||
| None -> List.empty
|
||||
header [ _class "pt-title-bar" ] [
|
||||
section [ _class "pt-title-bar-left" ] [
|
||||
span [ _class "pt-title-bar-home" ] [
|
||||
a [ _href "/web/"; _title s.["Home"].Value ] [ locStr s.["PrayerTracker"] ]
|
||||
]
|
||||
ul [] leftLinks
|
||||
]
|
||||
section [ _class "pt-title-bar-center" ] []
|
||||
section [ _class "pt-title-bar-right"; _role "toolbar" ] [
|
||||
ul [] rightLinks
|
||||
]
|
||||
]
|
||||
|
||||
/// Identity bar (below top nav)
|
||||
let identity m =
|
||||
let s = I18N.localizer.Force ()
|
||||
header [ _id "pt-language" ] [
|
||||
div [] [
|
||||
span [ _class "u" ] [ locStr s.["Language"]; rawText ": " ]
|
||||
match langCode () with
|
||||
| "es" ->
|
||||
locStr s.["Spanish"]
|
||||
rawText " • "
|
||||
a [ _href "/web/language/en" ] [ locStr s.["Change to English"] ]
|
||||
| _ ->
|
||||
locStr s.["English"]
|
||||
rawText " • "
|
||||
a [ _href "/web/language/es" ] [ locStr s.["Cambie a EspaƱol"] ]
|
||||
]
|
||||
match m.group with
|
||||
| Some g ->
|
||||
[ match m.user with
|
||||
/// Top navigation bar
|
||||
let top m =
|
||||
let s = I18N.localizer.Force()
|
||||
let menuSpacer = rawText " "
|
||||
let _dropdown = _class "dropdown-btn"
|
||||
let leftLinks = [
|
||||
match m.User with
|
||||
| Some u ->
|
||||
span [ _class "u" ] [ locStr s.["Currently Logged On"] ]
|
||||
rawText " "
|
||||
icon "person"
|
||||
strong [] [ str u.fullName ]
|
||||
rawText " "
|
||||
li [ _class "dropdown" ] [
|
||||
a [ _dropdown; _ariaLabel s["Requests"].Value; _title s["Requests"].Value; _roleButton ] [
|
||||
icon "question_answer"; space; locStr s["Requests"]; space; icon "keyboard_arrow_down" ]
|
||||
div [ _class "dropdown-content"; _roleMenuBar ] [
|
||||
a [ _href "/prayer-requests"; _roleMenuItem ] [
|
||||
icon "compare_arrows"; menuSpacer; locStr s["Maintain"] ]
|
||||
a [ _href "/prayer-requests/view"; _roleMenuItem ] [
|
||||
icon "list"; menuSpacer; locStr s["View List"] ] ] ]
|
||||
li [ _class "dropdown" ] [
|
||||
a [ _dropdown; _ariaLabel s["Group"].Value; _title s["Group"].Value; _roleButton ] [
|
||||
icon "group"; space; locStr s["Group"]; space; icon "keyboard_arrow_down" ]
|
||||
div [ _class "dropdown-content"; _roleMenuBar ] [
|
||||
a [ _href "/small-group/members"; _roleMenuItem ] [
|
||||
icon "email"; menuSpacer; locStr s["Maintain Group Members"] ]
|
||||
a [ _href "/small-group/announcement"; _roleMenuItem ] [
|
||||
icon "send"; menuSpacer; locStr s["Send Announcement"] ]
|
||||
a [ _href "/small-group/preferences"; _roleMenuItem ] [
|
||||
icon "build"; menuSpacer; locStr s["Change Preferences"] ] ] ]
|
||||
if u.IsAdmin then
|
||||
li [ _class "dropdown" ] [
|
||||
a [ _dropdown
|
||||
_ariaLabel s["Administration"].Value
|
||||
_title s["Administration"].Value
|
||||
_roleButton ] [
|
||||
icon "settings"; space; locStr s["Administration"]; space; icon "keyboard_arrow_down" ]
|
||||
div [ _class "dropdown-content"; _roleMenuBar ] [
|
||||
a [ _href "/churches"; _roleMenuItem ] [ icon "home"; menuSpacer; locStr s["Churches"] ]
|
||||
a [ _href "/small-groups"; _roleMenuItem ] [
|
||||
icon "send"; menuSpacer; locStr s["Groups"] ]
|
||||