Updated deps; shortened text func names

Giraffe has aliased "str" for "encodedText"; this project uses that now, and also uses "locStr" instead of "encLocText"
This commit is contained in:
Daniel J. Summers 2019-03-14 23:30:28 -05:00
parent 05985189e7
commit ab262fdab3
13 changed files with 225 additions and 226 deletions

View File

@ -16,7 +16,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="FSharp.EFCore.OptionConverter" Version="1.0.0" /> <PackageReference Include="FSharp.EFCore.OptionConverter" Version="1.0.0" />
<PackageReference Include="Microsoft.FSharpLu" Version="0.10.29" /> <PackageReference Include="Microsoft.FSharpLu" Version="0.10.30" />
<PackageReference Include="NodaTime" Version="2.4.4" /> <PackageReference Include="NodaTime" Version="2.4.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" />
<PackageReference Include="TaskBuilder.fs" Version="2.1.0" /> <PackageReference Include="TaskBuilder.fs" Version="2.1.0" />

View File

@ -15,7 +15,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Expecto" Version="8.8.0" /> <PackageReference Include="Expecto" Version="8.9.1" />
<PackageReference Include="Expecto.VisualStudio.TestAdapter" Version="10.0.2" /> <PackageReference Include="Expecto.VisualStudio.TestAdapter" Version="10.0.2" />
<PackageReference Include="NodaTime.Testing" Version="2.4.4" /> <PackageReference Include="NodaTime.Testing" Version="2.4.4" />
</ItemGroup> </ItemGroup>

View File

@ -9,15 +9,6 @@ open PrayerTracker.Views
open System.IO open System.IO
[<Tests>]
let encLocTextTests =
testList "encLocText" [
test "succeeds" {
let enc = encLocText (LocalizedString ("test", "test&")) |> renderHtmlNode
Expect.equal enc "test&amp;" "string not encoded correctly"
}
]
[<Tests>] [<Tests>]
let iconSizedTests = let iconSizedTests =
testList "iconSized" [ testList "iconSized" [
@ -36,6 +27,15 @@ let iconTests =
} }
] ]
[<Tests>]
let locStrTests =
testList "locStr" [
test "succeeds" {
let enc = locStr (LocalizedString ("test", "test&")) |> renderHtmlNode
Expect.equal enc "test&amp;" "string not encoded correctly"
}
]
[<Tests>] [<Tests>]
let namedColorListTests = let namedColorListTests =
testList "namedColorList" [ testList "namedColorList" [

View File

@ -15,15 +15,15 @@ let edit (m : EditChurch) ctx vi =
input [ _type "hidden"; _name "churchId"; _value (flatGuid m.churchId) ] input [ _type "hidden"; _name "churchId"; _value (flatGuid m.churchId) ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "name" ] [ encLocText s.["Church Name"] ] label [ _for "name" ] [ locStr s.["Church Name"] ]
input [ _type "text"; _name "name"; _id "name"; _required; _autofocus; _value m.name ] input [ _type "text"; _name "name"; _id "name"; _required; _autofocus; _value m.name ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "City"] [ encLocText s.["City"] ] label [ _for "City"] [ locStr s.["City"] ]
input [ _type "text"; _name "city"; _id "city"; _required; _value m.city ] input [ _type "text"; _name "city"; _id "city"; _required; _value m.city ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "ST" ] [ encLocText s.["State"] ] label [ _for "ST" ] [ locStr s.["State"] ]
input [ _type "text"; _name "st"; _id "st"; _required; _minlength "2"; _maxlength "2"; _value m.st ] input [ _type "text"; _name "st"; _id "st"; _required; _minlength "2"; _maxlength "2"; _value m.st ]
] ]
] ]
@ -34,12 +34,12 @@ let edit (m : EditChurch) ctx vi =
yield _id "hasInterface" yield _id "hasInterface"
yield _value "True" yield _value "True"
match m.hasInterface with Some x when x -> yield _checked | _ -> () ] match m.hasInterface with Some x when x -> yield _checked | _ -> () ]
label [ _for "hasInterface" ] [ encLocText s.["Has an interface with Virtual Prayer Room"] ] label [ _for "hasInterface" ] [ locStr s.["Has an interface with Virtual Prayer Room"] ]
] ]
] ]
div [ _class "pt-field-row pt-fadeable"; _id "divInterfaceAddress" ] [ div [ _class "pt-field-row pt-fadeable"; _id "divInterfaceAddress" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "interfaceAddress" ] [ encLocText s.["VPR Interface URL"] ] label [ _for "interfaceAddress" ] [ locStr s.["VPR Interface URL"] ]
input [ _type "url"; _name "interfaceAddress"; _id "interfaceAddress"; input [ _type "url"; _name "interfaceAddress"; _id "interfaceAddress";
_value (match m.interfaceAddress with Some ia -> ia | None -> "") ] _value (match m.interfaceAddress with Some ia -> ia | None -> "") ]
] ]
@ -62,13 +62,13 @@ let maintain (churches : Church list) (stats : Map<string, ChurchStats>) ctx vi
table [ _class "pt-table pt-action-table" ] [ table [ _class "pt-table pt-action-table" ] [
thead [] [ thead [] [
tr [] [ tr [] [
th [] [ encLocText s.["Actions"] ] th [] [ locStr s.["Actions"] ]
th [] [ encLocText s.["Name"] ] th [] [ locStr s.["Name"] ]
th [] [ encLocText s.["Location"] ] th [] [ locStr s.["Location"] ]
th [] [ encLocText s.["Groups"] ] th [] [ locStr s.["Groups"] ]
th [] [ encLocText s.["Requests"] ] th [] [ locStr s.["Requests"] ]
th [] [ encLocText s.["Users"] ] th [] [ locStr s.["Users"] ]
th [] [ encLocText s.["Interface?"] ] th [] [ locStr s.["Interface?"] ]
] ]
] ]
churches churches
@ -85,19 +85,19 @@ let maintain (churches : Church list) (stats : Map<string, ChurchStats>) ctx vi
_onclick (sprintf "return PT.confirmDelete('%s','%A')" delAction delPrompt) ] _onclick (sprintf "return PT.confirmDelete('%s','%A')" delAction delPrompt) ]
[ icon "delete_forever" ] [ icon "delete_forever" ]
] ]
td [] [ encodedText ch.name ] td [] [ str ch.name ]
td [] [ encodedText ch.city; rawText ", "; encodedText ch.st ] 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].smallGroups.ToString "N0") ]
td [ _class "pt-right-text" ] [ rawText (stats.[chId].prayerRequests.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-right-text" ] [ rawText (stats.[chId].users.ToString "N0") ]
td [ _class "pt-center-text" ] [ encLocText s.[match ch.hasInterface with true -> "Yes" | false -> "No"] ] td [ _class "pt-center-text" ] [ locStr s.[match ch.hasInterface with true -> "Yes" | false -> "No"] ]
]) ])
|> tbody [] |> tbody []
] ]
[ div [ _class "pt-center-text" ] [ [ div [ _class "pt-center-text" ] [
br [] br []
a [ _href (sprintf "/church/%s/edit" emptyGuid); _title s.["Add a New Church"].Value ] a [ _href (sprintf "/church/%s/edit" emptyGuid); _title s.["Add a New Church"].Value ]
[ icon "add_circle"; rawText " &nbsp;"; encLocText s.["Add a New Church"] ] [ icon "add_circle"; rawText " &nbsp;"; locStr s.["Add a New Church"] ]
br [] br []
br [] br []
] ]

View File

@ -12,7 +12,7 @@ open System.IO
open System.Text.Encodings.Web open System.Text.Encodings.Web
/// Encoded text for a localized string /// Encoded text for a localized string
let encLocText (text : LocalizedString) = encodedText text.Value let locStr (text : LocalizedString) = str text.Value
/// Raw text for a localized HTML string /// Raw text for a localized HTML string
let rawLocText (writer : StringWriter) (text : LocalizedHtmlString) = let rawLocText (writer : StringWriter) (text : LocalizedHtmlString) =
@ -44,7 +44,7 @@ let tableSummary itemCount (s : IStringLocalizer) =
| 0 -> s.["No Entries to Display"] | 0 -> s.["No Entries to Display"]
| 1 -> s.["Displaying {0} Entry", itemCount] | 1 -> s.["Displaying {0} Entry", itemCount]
| _ -> s.["Displaying {0} Entries", itemCount] | _ -> s.["Displaying {0} Entries", itemCount]
|> encLocText |> locStr
] ]
] ]
@ -100,7 +100,7 @@ let selectList name selected attrs items =
let selectDefault text = sprintf "— %s —" text let selectDefault text = sprintf "— %s —" text
/// Generate a standard submit button with icon and text /// Generate a standard submit button with icon and text
let submit attrs ico text = button (_type "submit" :: attrs) [ icon ico; rawText " &nbsp;"; encLocText text ] let submit attrs ico text = button (_type "submit" :: attrs) [ icon ico; rawText " &nbsp;"; locStr text ]
/// Format a GUID with no dashes (used for URLs and forms) /// Format a GUID with no dashes (used for URLs and forms)
let flatGuid (x : Guid) = x.ToString "N" let flatGuid (x : Guid) = x.ToString "N"

View File

@ -39,7 +39,7 @@ let error code vi =
_alt (sprintf "%A %A" s.["PrayerTracker"] s.["from Bit Badger Solutions"]) _alt (sprintf "%A %A" s.["PrayerTracker"] s.["from Bit Badger Solutions"])
_title (sprintf "%A %A" s.["PrayerTracker"] s.["from Bit Badger Solutions"]) _title (sprintf "%A %A" s.["PrayerTracker"] s.["from Bit Badger Solutions"])
_style "vertical-align:text-bottom;" ] _style "vertical-align:text-bottom;" ]
encodedText vi.version str vi.version
] ]
] ]
|> div [] |> div []
@ -203,17 +203,17 @@ let termsOfService vi =
use sw = new StringWriter () use sw = new StringWriter ()
let raw = rawLocText sw let raw = rawLocText sw
let ppLink = let ppLink =
a [ _href "/legal/privacy-policy" ] [ encodedText (s.["Privacy Policy"].Value.ToLower ()) ] a [ _href "/legal/privacy-policy" ] [ str (s.["Privacy Policy"].Value.ToLower ()) ]
|> (renderHtmlNode >> HtmlString) |> (renderHtmlNode >> HtmlString)
[ p [ _class "pt-right-text" ] [ small [] [ em [] [ raw l.["(as of May 24, 2018)"] ] ] ] [ p [ _class "pt-right-text" ] [ small [] [ em [] [ raw l.["(as of May 24, 2018)"] ] ] ]
h3 [] [ encodedText "1. "; raw l.["Acceptance of Terms"] ] h3 [] [ str "1. "; raw l.["Acceptance of Terms"] ]
p [] [ 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."] 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 space
raw l.["Your continued use of this site implies your acceptance of these terms."] raw l.["Your continued use of this site implies your acceptance of these terms."]
] ]
h3 [] [ encodedText "2. "; raw l.["Description of Service and Registration"] ] h3 [] [ str "2. "; raw l.["Description of Service and Registration"] ]
p [] [ p [] [
raw l.["{0} is a service that allows individuals to enter and amend prayer requests on behalf of organizations.", raw l.["{0} is a service that allows individuals to enter and amend prayer requests on behalf of organizations.",
s.["PrayerTracker"]] s.["PrayerTracker"]]
@ -222,13 +222,13 @@ let termsOfService vi =
space space
raw l.["See our {0} for details on the personal (user) information we maintain.", ppLink] raw l.["See our {0} for details on the personal (user) information we maintain.", ppLink]
] ]
h3 [] [ encodedText "3. "; raw l.["Liability"] ] h3 [] [ str "3. "; raw l.["Liability"] ]
p [] [ p [] [
raw l.["This service is provided “as is”, and no warranty (express or implied) exists."] raw l.["This service is provided “as is”, and no warranty (express or implied) exists."]
space 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."] 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 [] [ encodedText "4. "; raw l.["Updates to Terms"] ] h3 [] [ str "4. "; raw l.["Updates to Terms"] ]
p [] [ p [] [
raw l.["These terms and conditions may be updated at any time."] raw l.["These terms and conditions may be updated at any time."]
space space

View File

@ -24,30 +24,30 @@ module Navigation =
| Some u -> | Some u ->
yield li [ _class "dropdown" ] [ yield li [ _class "dropdown" ] [
a [ _class "dropbtn"; _role "button"; _aria "label" s.["Requests"].Value; _title s.["Requests"].Value ] a [ _class "dropbtn"; _role "button"; _aria "label" s.["Requests"].Value; _title s.["Requests"].Value ]
[ icon "question_answer"; space; encLocText s.["Requests"]; space; icon "keyboard_arrow_down" ] [ icon "question_answer"; space; locStr s.["Requests"]; space; icon "keyboard_arrow_down" ]
div [ _class "dropdown-content"; _role "menu" ] [ div [ _class "dropdown-content"; _role "menu" ] [
a [ _href "/prayer-requests" ] [ icon "compare_arrows"; menuSpacer; encLocText s.["Maintain"] ] a [ _href "/prayer-requests" ] [ icon "compare_arrows"; menuSpacer; locStr s.["Maintain"] ]
a [ _href "/prayer-requests/view" ] [ icon "list"; menuSpacer; encLocText s.["View List"] ] a [ _href "/prayer-requests/view" ] [ icon "list"; menuSpacer; locStr s.["View List"] ]
] ]
] ]
yield li [ _class "dropdown" ] [ yield li [ _class "dropdown" ] [
a [ _class "dropbtn"; _role "button"; _aria "label" s.["Group"].Value; _title s.["Group"].Value ] a [ _class "dropbtn"; _role "button"; _aria "label" s.["Group"].Value; _title s.["Group"].Value ]
[ icon "group"; space; encLocText s.["Group"]; space; icon "keyboard_arrow_down" ] [ icon "group"; space; locStr s.["Group"]; space; icon "keyboard_arrow_down" ]
div [ _class "dropdown-content"; _role "menu" ] [ div [ _class "dropdown-content"; _role "menu" ] [
a [ _href "/small-group/members" ] [ icon "email"; menuSpacer; encLocText s.["Maintain Group Members"] ] a [ _href "/small-group/members" ] [ icon "email"; menuSpacer; locStr s.["Maintain Group Members"] ]
a [ _href "/small-group/announcement" ] [ icon "send"; menuSpacer; encLocText s.["Send Announcement"] ] a [ _href "/small-group/announcement" ] [ icon "send"; menuSpacer; locStr s.["Send Announcement"] ]
a [ _href "/small-group/preferences" ] [ icon "build"; menuSpacer; encLocText s.["Change Preferences"] ] a [ _href "/small-group/preferences" ] [ icon "build"; menuSpacer; locStr s.["Change Preferences"] ]
] ]
] ]
match u.isAdmin with match u.isAdmin with
| true -> | true ->
yield li [ _class "dropdown" ] [ yield li [ _class "dropdown" ] [
a [ _class "dropbtn"; _role "button"; _aria "label" s.["Administration"].Value; _title s.["Administration"].Value ] a [ _class "dropbtn"; _role "button"; _aria "label" s.["Administration"].Value; _title s.["Administration"].Value ]
[ icon "settings"; space; encLocText s.["Administration"]; space; icon "keyboard_arrow_down" ] [ icon "settings"; space; locStr s.["Administration"]; space; icon "keyboard_arrow_down" ]
div [ _class "dropdown-content"; _role "menu" ] [ div [ _class "dropdown-content"; _role "menu" ] [
a [ _href "/churches" ] [ icon "home"; menuSpacer; encLocText s.["Churches"] ] a [ _href "/churches" ] [ icon "home"; menuSpacer; locStr s.["Churches"] ]
a [ _href "/small-groups" ] [ icon "send"; menuSpacer; encLocText s.["Groups"] ] a [ _href "/small-groups" ] [ icon "send"; menuSpacer; locStr s.["Groups"] ]
a [ _href "/users" ] [ icon "build"; menuSpacer; encLocText s.["Users"] ] a [ _href "/users" ] [ icon "build"; menuSpacer; locStr s.["Users"] ]
] ]
] ]
| false -> () | false -> ()
@ -58,22 +58,22 @@ module Navigation =
a [ _href "/prayer-requests/view" a [ _href "/prayer-requests/view"
_aria "label" s.["View Request List"].Value _aria "label" s.["View Request List"].Value
_title s.["View Request List"].Value ] _title s.["View Request List"].Value ]
[ icon "list"; space; encLocText s.["View Request List"] ] [ icon "list"; space; locStr s.["View Request List"] ]
] ]
| None -> | None ->
yield li [ _class "dropdown" ] [ yield li [ _class "dropdown" ] [
a [ _class "dropbtn"; _role "button"; _aria "label" s.["Log On"].Value; _title s.["Log On"].Value ] a [ _class "dropbtn"; _role "button"; _aria "label" s.["Log On"].Value; _title s.["Log On"].Value ]
[ icon "security"; space; encLocText s.["Log On"]; space; icon "keyboard_arrow_down" ] [ icon "security"; space; locStr s.["Log On"]; space; icon "keyboard_arrow_down" ]
div [ _class "dropdown-content"; _role "menu" ] [ div [ _class "dropdown-content"; _role "menu" ] [
a [ _href "/user/log-on" ] [ icon "person"; menuSpacer; encLocText s.["User"] ] a [ _href "/user/log-on" ] [ icon "person"; menuSpacer; locStr s.["User"] ]
a [ _href "/small-group/log-on" ] [ icon "group"; menuSpacer; encLocText s.["Group"] ] a [ _href "/small-group/log-on" ] [ icon "group"; menuSpacer; locStr s.["Group"] ]
] ]
] ]
yield li [] [ yield li [] [
a [ _href "/prayer-requests/lists" a [ _href "/prayer-requests/lists"
_aria "label" s.["View Request List"].Value _aria "label" s.["View Request List"].Value
_title s.["View Request List"].Value ] _title s.["View Request List"].Value ]
[ icon "list"; space; encLocText s.["View Request List"] ] [ icon "list"; space; locStr s.["View Request List"] ]
] ]
yield li [] [ yield li [] [
a [ _href (sprintf "https://docs.prayer.bitbadger.solutions/%s" <| langCode ()) a [ _href (sprintf "https://docs.prayer.bitbadger.solutions/%s" <| langCode ())
@ -81,7 +81,7 @@ module Navigation =
_title s.["View Help"].Value _title s.["View Help"].Value
_target "_blank" _target "_blank"
] ]
[ icon "help"; space; encLocText s.["Help"] ] [ icon "help"; space; locStr s.["Help"] ]
] ]
] ]
let rightLinks = let rightLinks =
@ -93,19 +93,19 @@ module Navigation =
a [ _href "/user/password" a [ _href "/user/password"
_aria "label" s.["Change Your Password"].Value _aria "label" s.["Change Your Password"].Value
_title s.["Change Your Password"].Value ] _title s.["Change Your Password"].Value ]
[ icon "lock"; space; encLocText s.["Change Your Password"] ] [ icon "lock"; space; locStr s.["Change Your Password"] ]
] ]
| None -> () | None -> ()
yield li [] [ yield li [] [
a [ _href "/log-off"; _aria "label" s.["Log Off"].Value; _title s.["Log Off"].Value ] a [ _href "/log-off"; _aria "label" s.["Log Off"].Value; _title s.["Log Off"].Value ]
[ icon "power_settings_new"; space; encLocText s.["Log Off"] ] [ icon "power_settings_new"; space; locStr s.["Log Off"] ]
] ]
] ]
| None -> List.empty | None -> List.empty
header [ _class "pt-title-bar" ] [ header [ _class "pt-title-bar" ] [
section [ _class "pt-title-bar-left" ] [ section [ _class "pt-title-bar-left" ] [
span [ _class "pt-title-bar-home" ] [ span [ _class "pt-title-bar-home" ] [
a [ _href "/"; _title s.["Home"].Value ] [ encLocText s.["PrayerTracker"] ] a [ _href "/"; _title s.["Home"].Value ] [ locStr s.["PrayerTracker"] ]
] ]
ul [] leftLinks ul [] leftLinks
] ]
@ -120,34 +120,34 @@ module Navigation =
let s = I18N.localizer.Force () let s = I18N.localizer.Force ()
header [ _id "pt-language" ] [ header [ _id "pt-language" ] [
div [] [ div [] [
yield span [ _class "u" ] [ encLocText s.["Language"]; rawText ": " ] yield span [ _class "u" ] [ locStr s.["Language"]; rawText ": " ]
match langCode () with match langCode () with
| "es" -> | "es" ->
yield encLocText s.["Spanish"] yield locStr s.["Spanish"]
yield rawText " &nbsp; &bull; &nbsp; " yield rawText " &nbsp; &bull; &nbsp; "
yield a [ _href "/language/en" ] [ encLocText s.["Change to English"] ] yield a [ _href "/language/en" ] [ locStr s.["Change to English"] ]
| _ -> | _ ->
yield encLocText s.["English"] yield locStr s.["English"]
yield rawText " &nbsp; &bull; &nbsp; " yield rawText " &nbsp; &bull; &nbsp; "
yield a [ _href "/language/es" ] [ encLocText s.["Cambie a Español"] ] yield a [ _href "/language/es" ] [ locStr s.["Cambie a Español"] ]
] ]
match m.group with match m.group with
| Some g -> | Some g ->
[ match m.user with [ match m.user with
| Some u -> | Some u ->
yield span [ _class "u" ] [ encLocText s.["Currently Logged On"] ] yield span [ _class "u" ] [ locStr s.["Currently Logged On"] ]
yield rawText "&nbsp; &nbsp;" yield rawText "&nbsp; &nbsp;"
yield icon "person" yield icon "person"
yield strong [] [ encodedText u.fullName ] yield strong [] [ str u.fullName ]
yield rawText "&nbsp; &nbsp; " yield rawText "&nbsp; &nbsp; "
| None -> | None ->
yield encLocText s.["Logged On as a Member of"] yield locStr s.["Logged On as a Member of"]
yield rawText "&nbsp; " yield rawText "&nbsp; "
yield icon "group" yield icon "group"
yield space yield space
match m.user with match m.user with
| Some _ -> yield a [ _href "/small-group" ] [ strong [] [ encodedText g.name ] ] | Some _ -> yield a [ _href "/small-group" ] [ strong [] [ str g.name ] ]
| None -> yield strong [] [ encodedText g.name ] | None -> yield strong [] [ str g.name ]
yield rawText " &nbsp;" yield rawText " &nbsp;"
] ]
| None -> [] | None -> []
@ -180,7 +180,7 @@ let private htmlHead m pageTitle =
let s = I18N.localizer.Force () let s = I18N.localizer.Force ()
head [] [ head [] [
yield meta [ _charset "UTF-8" ] yield meta [ _charset "UTF-8" ]
yield title [] [ encLocText pageTitle; titleSep; encLocText s.["PrayerTracker"] ] yield title [] [ locStr pageTitle; titleSep; locStr s.["PrayerTracker"] ]
yield! commonHead yield! commonHead
for cssFile in m.style do for cssFile in m.style do
yield link [ _rel "stylesheet"; _href (sprintf "/css/%s.css" cssFile); _type "text/css" ] yield link [ _rel "stylesheet"; _href (sprintf "/css/%s.css" cssFile); _type "text/css" ]
@ -205,7 +205,7 @@ let private renderPageTitle m pageTitle =
match m.helpLink with match m.helpLink with
| Some link -> yield Help.fullLink (langCode ()) link |> helpLink | Some link -> yield Help.fullLink (langCode ()) link |> helpLink
| None -> () | None -> ()
yield encLocText pageTitle yield locStr pageTitle
] ]
/// Render the messages that may need to be displayed to the user /// Render the messages that may need to be displayed to the user
@ -219,7 +219,7 @@ let private messages m =
match msg.level with match msg.level with
| "Info" -> () | "Info" -> ()
| lvl -> | lvl ->
yield strong [] [ encLocText s.[lvl] ] yield strong [] [ locStr s.[lvl] ]
yield rawText " &#xbb; " yield rawText " &#xbb; "
yield rawText msg.text.Value yield rawText msg.text.Value
match msg.description with match msg.description with
@ -238,25 +238,25 @@ let private htmlFooter m =
let resultTime = TimeSpan(DateTime.Now.Ticks - m.requestStart).TotalSeconds let resultTime = TimeSpan(DateTime.Now.Ticks - m.requestStart).TotalSeconds
footer [] [ footer [] [
div [ _id "pt-legal" ] [ div [ _id "pt-legal" ] [
a [ _href "/legal/privacy-policy" ] [ encLocText s.["Privacy Policy"] ] a [ _href "/legal/privacy-policy" ] [ locStr s.["Privacy Policy"] ]
rawText " &bull; " rawText " &bull; "
a [ _href "/legal/terms-of-service" ] [ encLocText s.["Terms of Service"] ] a [ _href "/legal/terms-of-service" ] [ locStr s.["Terms of Service"] ]
rawText " &bull; " rawText " &bull; "
a [ _href "https://github.com/bit-badger/PrayerTracker" a [ _href "https://github.com/bit-badger/PrayerTracker"
_title s.["View source code and get technical support"].Value _title s.["View source code and get technical support"].Value
_target "_blank" _target "_blank"
_rel "noopener" ] [ _rel "noopener" ] [
encLocText s.["Source & Support"] locStr s.["Source & Support"]
] ]
] ]
div [ _id "pt-footer" ] [ div [ _id "pt-footer" ] [
a [ _href "/"; _style "line-height:28px;" ] [ a [ _href "/"; _style "line-height:28px;" ] [
img [ _src (sprintf "/img/%O.png" s.["footer_en"]); _alt imgText; _title imgText ] img [ _src (sprintf "/img/%O.png" s.["footer_en"]); _alt imgText; _title imgText ]
] ]
encodedText m.version str m.version
space space
i [ _title s.["This page loaded in {0:N3} seconds", resultTime].Value; _class "material-icons md-18" ] [ i [ _title s.["This page loaded in {0:N3} seconds", resultTime].Value; _class "material-icons md-18" ] [
encodedText "schedule" str "schedule"
] ]
] ]
] ]
@ -286,7 +286,7 @@ let bare pageTitle content =
html [ _lang "" ] [ html [ _lang "" ] [
head [] [ head [] [
meta [ _charset "UTF-8" ] meta [ _charset "UTF-8" ]
title [] [ encLocText ttl; titleSep; encLocText s.["PrayerTracker"] ] title [] [ locStr ttl; titleSep; locStr s.["PrayerTracker"] ]
] ]
body [] [ body [] [
content content

View File

@ -20,14 +20,14 @@ let edit (m : EditRequest) today ctx vi =
input [ _type "hidden"; _name "requestId"; _value (flatGuid m.requestId) ] input [ _type "hidden"; _name "requestId"; _value (flatGuid m.requestId) ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
yield div [ _class "pt-field" ] [ yield div [ _class "pt-field" ] [
label [ _for "requestType" ] [ encLocText s.["Request Type"] ] label [ _for "requestType" ] [ locStr s.["Request Type"] ]
ReferenceList.requestTypeList s ReferenceList.requestTypeList s
|> Seq.ofList |> Seq.ofList
|> Seq.map (fun item -> fst item, (snd item).Value) |> Seq.map (fun item -> fst item, (snd item).Value)
|> selectList "requestType" m.requestType [ _required; _autofocus ] |> selectList "requestType" m.requestType [ _required; _autofocus ]
] ]
yield div [ _class "pt-field" ] [ yield div [ _class "pt-field" ] [
label [ _for "requestor" ] [ encLocText s.["Requestor / Subject"] ] label [ _for "requestor" ] [ locStr s.["Requestor / Subject"] ]
input [ _type "text" input [ _type "text"
_name "requestor" _name "requestor"
_id "requestor" _id "requestor"
@ -36,7 +36,7 @@ let edit (m : EditRequest) today ctx vi =
match m.isNew () with match m.isNew () with
| true -> | true ->
yield div [ _class "pt-field" ] [ yield div [ _class "pt-field" ] [
label [ _for "enteredDate" ] [ encLocText s.["Date"] ] label [ _for "enteredDate" ] [ locStr s.["Date"] ]
input [ _type "date"; _name "enteredDate"; _id "enteredDate"; _placeholder today ] input [ _type "date"; _name "enteredDate"; _id "enteredDate"; _placeholder today ]
] ]
| false -> | false ->
@ -44,21 +44,21 @@ let edit (m : EditRequest) today ctx vi =
div [ _class "pt-checkbox-field" ] [ div [ _class "pt-checkbox-field" ] [
br [] br []
input [ _type "checkbox"; _name "skipDateUpdate"; _id "skipDateUpdate"; _value "True" ] input [ _type "checkbox"; _name "skipDateUpdate"; _id "skipDateUpdate"; _value "True" ]
label [ _for "skipDateUpdate" ] [ encLocText s.["Check to not update the date"] ] label [ _for "skipDateUpdate" ] [ locStr s.["Check to not update the date"] ]
br [] br []
small [] [ em [] [ encodedText (s.["Typo Corrections"].Value.ToLower ()); rawText ", etc." ] ] small [] [ em [] [ str (s.["Typo Corrections"].Value.ToLower ()); rawText ", etc." ] ]
] ]
] ]
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [] [ encLocText s.["Expiration"] ] label [] [ locStr s.["Expiration"] ]
ReferenceList.expirationList s ((m.isNew >> not) ()) ReferenceList.expirationList s ((m.isNew >> not) ())
|> List.map (fun exp -> |> List.map (fun exp ->
let radioId = sprintf "expiration_%s" (fst exp) let radioId = sprintf "expiration_%s" (fst exp)
span [ _class "text-nowrap" ] [ span [ _class "text-nowrap" ] [
radio "expiration" radioId (fst exp) m.expiration radio "expiration" radioId (fst exp) m.expiration
label [ _for radioId ] [ encLocText (snd exp) ] label [ _for radioId ] [ locStr (snd exp) ]
rawText " &nbsp; &nbsp; " rawText " &nbsp; &nbsp; "
]) ])
|> div [ _class "pt-center-text" ] |> div [ _class "pt-center-text" ]
@ -66,8 +66,8 @@ let edit (m : EditRequest) today ctx vi =
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field pt-editor" ] [ div [ _class "pt-field pt-editor" ] [
label [ _for "text" ] [ encLocText s.["Request"] ] label [ _for "text" ] [ locStr s.["Request"] ]
textarea [ _name "text"; _id "text" ] [ encodedText m.text ] textarea [ _name "text"; _id "text" ] [ str m.text ]
] ]
] ]
div [ _class "pt-field-row" ] [ submit [] "save" s.["Save Request"] ] div [ _class "pt-field-row" ] [ submit [] "save" s.["Save Request"] ]
@ -87,17 +87,17 @@ let email m vi =
|> List.fold (fun (acc : StringBuilder) mbr -> acc.AppendFormat(", {0} <{1}>", mbr.memberName, mbr.email)) |> List.fold (fun (acc : StringBuilder) mbr -> acc.AppendFormat(", {0} <{1}>", mbr.memberName, mbr.email))
(StringBuilder ()) (StringBuilder ())
[ p [ _style (sprintf "font-family:%s;font-size:%ipt;" prefs.listFonts prefs.textFontSize) ] [ [ p [ _style (sprintf "font-family:%s;font-size:%ipt;" prefs.listFonts prefs.textFontSize) ] [
encLocText s.["The request list was sent to the following people, via individual e-mails"] locStr s.["The request list was sent to the following people, via individual e-mails"]
rawText ":" rawText ":"
br [] br []
small [] [ encodedText (addresses.Remove(0, 2).ToString ()) ] small [] [ str (addresses.Remove(0, 2).ToString ()) ]
] ]
span [ _class "pt-email-heading" ] [ encLocText s.["HTML Format"]; rawText ":" ] span [ _class "pt-email-heading" ] [ locStr s.["HTML Format"]; rawText ":" ]
div [ _class "pt-email-canvas" ] [ rawText (m.asHtml s) ] div [ _class "pt-email-canvas" ] [ rawText (m.asHtml s) ]
br [] br []
br [] br []
span [ _class "pt-email-heading" ] [ encLocText s.["Plain-Text Format"]; rawText ":" ] span [ _class "pt-email-heading" ] [ locStr s.["Plain-Text Format"]; rawText ":" ]
div[ _class "pt-email-canvas" ] [ pre [] [ encodedText (m.asText s) ] ] div[ _class "pt-email-canvas" ] [ pre [] [ str (m.asText s) ] ]
] ]
|> Layout.Content.standard |> Layout.Content.standard
|> Layout.standard vi pageTitle |> Layout.standard vi pageTitle
@ -132,9 +132,9 @@ let lists (grps : SmallGroup list) vi =
yield table [ _class "pt-table pt-action-table" ] [ yield table [ _class "pt-table pt-action-table" ] [
thead [] [ thead [] [
tr [] [ tr [] [
th [] [ encLocText s.["Actions"] ] th [] [ locStr s.["Actions"] ]
th [] [ encLocText s.["Church"] ] th [] [ locStr s.["Church"] ]
th [] [ encLocText s.["Group"] ] th [] [ locStr s.["Group"] ]
] ]
] ]
grps grps
@ -149,8 +149,8 @@ let lists (grps : SmallGroup list) vi =
[ icon "verified_user" ] [ icon "verified_user" ]
|> List.singleton |> List.singleton
|> td [] |> td []
td [] [ encodedText grp.church.name ] td [] [ str grp.church.name ]
td [] [ encodedText grp.name ] td [] [ str grp.name ]
]) ])
|> tbody [] |> tbody []
] ]
@ -197,11 +197,10 @@ let maintain (reqs : PrayerRequest seq) (grp : SmallGroup) onlyActive (ctx : Htt
[ icon "delete_forever" ] [ icon "delete_forever" ]
] ]
td [ updReq req ] [ td [ updReq req ] [
encodedText (req.updatedDate.ToString(s.["MMMM d, yyyy"].Value, str (req.updatedDate.ToString(s.["MMMM d, yyyy"].Value, System.Globalization.CultureInfo.CurrentUICulture))
System.Globalization.CultureInfo.CurrentUICulture))
] ]
td [] [ encLocText typs.[req.requestType] ] td [] [ locStr typs.[req.requestType] ]
td [ reqExp req ] [ encodedText (match req.requestor with Some r -> r | None -> " ") ] td [ reqExp req ] [ str (match req.requestor with Some r -> r | None -> " ") ]
td [] [ td [] [
yield yield
match 60 > reqText.Length with match 60 > reqText.Length with
@ -213,10 +212,10 @@ let maintain (reqs : PrayerRequest seq) (grp : SmallGroup) onlyActive (ctx : Htt
[ yield div [ _class "pt-center-text" ] [ [ yield div [ _class "pt-center-text" ] [
br [] br []
a [ _href (sprintf "/prayer-request/%s/edit" emptyGuid); _title s.["Add a New Request"].Value ] a [ _href (sprintf "/prayer-request/%s/edit" emptyGuid); _title s.["Add a New Request"].Value ]
[ icon "add_circle"; rawText " &nbsp;"; encLocText s.["Add a New Request"] ] [ icon "add_circle"; rawText " &nbsp;"; locStr s.["Add a New Request"] ]
rawText " &nbsp; &nbsp; &nbsp; " rawText " &nbsp; &nbsp; &nbsp; "
a [ _href "/prayer-requests/view"; _title s.["View Prayer Request List"].Value ] a [ _href "/prayer-requests/view"; _title s.["View Prayer Request List"].Value ]
[ icon "list"; rawText " &nbsp;"; encLocText s.["View Prayer Request List"] ] [ icon "list"; rawText " &nbsp;"; locStr s.["View Prayer Request List"] ]
br [] br []
br [] br []
] ]
@ -227,11 +226,11 @@ let maintain (reqs : PrayerRequest seq) (grp : SmallGroup) onlyActive (ctx : Htt
yield table [ _class "pt-table pt-action-table" ] [ yield table [ _class "pt-table pt-action-table" ] [
thead [] [ thead [] [
tr [] [ tr [] [
th [] [ encLocText s.["Actions"] ] th [] [ locStr s.["Actions"] ]
th [] [ encLocText s.["Updated Date"] ] th [] [ locStr s.["Updated Date"] ]
th [] [ encLocText s.["Type"] ] th [] [ locStr s.["Type"] ]
th [] [ encLocText s.["Requestor"] ] th [] [ locStr s.["Requestor"] ]
th [] [ encLocText s.["Request"] ] th [] [ locStr s.["Request"] ]
] ]
] ]
tbody [] requests tbody [] requests
@ -240,13 +239,13 @@ let maintain (reqs : PrayerRequest seq) (grp : SmallGroup) onlyActive (ctx : Htt
yield br [] yield br []
match onlyActive with match onlyActive with
| true -> | true ->
yield encLocText s.["Inactive requests are currently not shown"] yield locStr s.["Inactive requests are currently not shown"]
yield br [] yield br []
yield a [ _href "/prayer-requests/inactive" ] [ encLocText s.["Show Inactive Requests"] ] yield a [ _href "/prayer-requests/inactive" ] [ locStr s.["Show Inactive Requests"] ]
| false -> | false ->
yield encLocText s.["Inactive requests are currently shown"] yield locStr s.["Inactive requests are currently shown"]
yield br [] yield br []
yield a [ _href "/prayer-requests" ] [ encLocText s.["Do Not Show Inactive Requests"] ] yield a [ _href "/prayer-requests" ] [ locStr s.["Do Not Show Inactive Requests"] ]
] ]
yield form [ _id "DeleteForm"; _action ""; _method "post" ] [ csrfToken ctx ] yield form [ _id "DeleteForm"; _action ""; _method "post" ] [ csrfToken ctx ]
] ]
@ -269,7 +268,7 @@ let print m version =
_alt imgAlt _alt imgAlt
_title imgAlt ] _title imgAlt ]
space space
encodedText version str version
] ]
] ]
|> Layout.bare pageTitle |> Layout.bare pageTitle
@ -286,7 +285,7 @@ let view m vi =
yield a [ _class "pt-icon-link" yield a [ _class "pt-icon-link"
_href (sprintf "/prayer-requests/print/%s" dtString) _href (sprintf "/prayer-requests/print/%s" dtString)
_title s.["View Printable"].Value ] [ _title s.["View Printable"].Value ] [
icon "print"; rawText " &nbsp;"; encLocText s.["View Printable"] icon "print"; rawText " &nbsp;"; locStr s.["View Printable"]
] ]
match m.canEmail with match m.canEmail with
| true -> | true ->
@ -302,7 +301,7 @@ let view m vi =
yield a [ _class "pt-icon-link" yield a [ _class "pt-icon-link"
_href (sprintf "/prayer-requests/view/%s" (sunday.ToString "yyyy-MM-dd")) _href (sprintf "/prayer-requests/view/%s" (sunday.ToString "yyyy-MM-dd"))
_title s.["List for Next Sunday"].Value ] [ _title s.["List for Next Sunday"].Value ] [
icon "update"; rawText " &nbsp;"; encLocText s.["List for Next Sunday"] icon "update"; rawText " &nbsp;"; locStr s.["List for Next Sunday"]
] ]
yield spacer yield spacer
let emailPrompt = s.["This will e-mail the current list to every member of your group, without further prompting. Are you sure this is what you are ready to do?"].Value let emailPrompt = s.["This will e-mail the current list to every member of your group, without further prompting. Are you sure this is what you are ready to do?"].Value
@ -310,11 +309,11 @@ let view m vi =
_href (sprintf "/prayer-requests/email/%s" dtString) _href (sprintf "/prayer-requests/email/%s" dtString)
_title s.["Send via E-mail"].Value _title s.["Send via E-mail"].Value
_onclick (sprintf "return PT.requests.view.promptBeforeEmail('%s')" emailPrompt) ] [ _onclick (sprintf "return PT.requests.view.promptBeforeEmail('%s')" emailPrompt) ] [
icon "mail_outline"; rawText " &nbsp;"; encLocText s.["Send via E-mail"] icon "mail_outline"; rawText " &nbsp;"; locStr s.["Send via E-mail"]
] ]
yield spacer yield spacer
yield a [ _class "pt-icon-link"; _href "/prayer-requests"; _title s.["Maintain Prayer Requests"].Value ] [ yield a [ _class "pt-icon-link"; _href "/prayer-requests"; _title s.["Maintain Prayer Requests"].Value ] [
icon "compare_arrows"; rawText " &nbsp;"; encLocText s.["Maintain Prayer Requests"] icon "compare_arrows"; rawText " &nbsp;"; locStr s.["Maintain Prayer Requests"]
] ]
| false -> () | false -> ()
] ]

View File

@ -21,7 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Giraffe" Version="3.6.0" /> <PackageReference Include="Giraffe" Version="3.6.0" />
<PackageReference Include="MailKit" Version="2.1.2" /> <PackageReference Include="MailKit" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" /> <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" />

View File

@ -15,7 +15,7 @@ let announcement isAdmin ctx vi =
yield csrfToken ctx yield csrfToken ctx
yield div [ _class "pt-field-row" ] [ yield div [ _class "pt-field-row" ] [
div [ _class "pt-field pt-editor" ] [ div [ _class "pt-field pt-editor" ] [
label [ _for "text" ] [ encLocText s.["Announcement Text"] ] label [ _for "text" ] [ locStr s.["Announcement Text"] ]
textarea [ _name "text"; _id "text"; _autofocus ] [] textarea [ _name "text"; _id "text"; _autofocus ] []
] ]
] ]
@ -23,12 +23,12 @@ let announcement isAdmin ctx vi =
| true -> | true ->
yield div [ _class "pt-field-row" ] [ yield div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [] [ encLocText s.["Send Announcement to"]; rawText ":" ] label [] [ locStr s.["Send Announcement to"]; rawText ":" ]
div [ _class "pt-center-text" ] [ div [ _class "pt-center-text" ] [
radio "sendToClass" "sendY" "Y" "Y" radio "sendToClass" "sendY" "Y" "Y"
label [ _for "sendY" ] [ encLocText s.["This Group"]; rawText " &nbsp; &nbsp; " ] label [ _for "sendY" ] [ locStr s.["This Group"]; rawText " &nbsp; &nbsp; " ]
radio "sendToClass" "sendN" "N" "Y" radio "sendToClass" "sendN" "N" "Y"
label [ _for "sendN" ] [ encLocText s.["All {0} Users", s.["PrayerTracker"]] ] label [ _for "sendN" ] [ locStr s.["All {0} Users", s.["PrayerTracker"]] ]
] ]
] ]
] ]
@ -37,12 +37,12 @@ let announcement isAdmin ctx vi =
yield div [ _class "pt-field-row pt-fadeable pt-shown"; _id "divAddToList" ] [ yield div [ _class "pt-field-row pt-fadeable pt-shown"; _id "divAddToList" ] [
div [ _class "pt-checkbox-field" ] [ div [ _class "pt-checkbox-field" ] [
input [ _type "checkbox"; _name "addToRequestList"; _id "addToRequestList"; _value "True" ] input [ _type "checkbox"; _name "addToRequestList"; _id "addToRequestList"; _value "True" ]
label [ _for "addToRequestList" ] [ encLocText s.["Add to Request List"] ] label [ _for "addToRequestList" ] [ locStr s.["Add to Request List"] ]
] ]
] ]
yield div [ _class "pt-field-row pt-fadeable"; _id "divCategory" ] [ yield div [ _class "pt-field-row pt-fadeable"; _id "divCategory" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "requestType" ] [ encLocText s.["Request Type"] ] label [ _for "requestType" ] [ locStr s.["Request Type"] ]
reqTypes reqTypes
|> Seq.ofList |> Seq.ofList
|> Seq.map (fun item -> fst item, (snd item).Value) |> Seq.map (fun item -> fst item, (snd item).Value)
@ -60,12 +60,12 @@ let announcement isAdmin ctx vi =
/// View for once an announcement has been sent /// View for once an announcement has been sent
let announcementSent (m : Announcement) vi = let announcementSent (m : Announcement) vi =
let s = I18N.localizer.Force () let s = I18N.localizer.Force ()
[ span [ _class "pt-email-heading" ] [ encLocText s.["HTML Format"]; rawText ":" ] [ span [ _class "pt-email-heading" ] [ locStr s.["HTML Format"]; rawText ":" ]
div [ _class "pt-email-canvas" ] [ rawText m.text ] div [ _class "pt-email-canvas" ] [ rawText m.text ]
br [] br []
br [] br []
span [ _class "pt-email-heading" ] [ encLocText s.["Plain-Text Format"]; rawText ":" ] span [ _class "pt-email-heading" ] [ locStr s.["Plain-Text Format"]; rawText ":" ]
div [ _class "pt-email-canvas" ] [ pre [] [ encodedText (m.plainText ()) ] ] div [ _class "pt-email-canvas" ] [ pre [] [ str (m.plainText ()) ] ]
] ]
|> Layout.Content.standard |> Layout.Content.standard
|> Layout.standard vi "Announcement Sent" |> Layout.standard vi "Announcement Sent"
@ -80,13 +80,13 @@ let edit (m : EditSmallGroup) (churches : Church list) ctx vi =
input [ _type "hidden"; _name "smallGroupId"; _value (flatGuid m.smallGroupId) ] input [ _type "hidden"; _name "smallGroupId"; _value (flatGuid m.smallGroupId) ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "name" ] [ encLocText s.["Group Name"] ] label [ _for "name" ] [ locStr s.["Group Name"] ]
input [ _type "text"; _name "name"; _id "name"; _value m.name; _required; _autofocus ] input [ _type "text"; _name "name"; _id "name"; _value m.name; _required; _autofocus ]
] ]
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "churchId" ] [ encLocText s.["Church"] ] label [ _for "churchId" ] [ locStr s.["Church"] ]
seq { seq {
yield "", selectDefault s.["Select Church"].Value yield "", selectDefault s.["Select Church"].Value
yield! churches |> List.map (fun c -> flatGuid c.churchId, c.name) yield! churches |> List.map (fun c -> flatGuid c.churchId, c.name)
@ -111,17 +111,17 @@ let editMember (m : EditMember) (typs : (string * LocalizedString) seq) ctx vi =
input [ _type "hidden"; _name "memberId"; _value (flatGuid m.memberId) ] input [ _type "hidden"; _name "memberId"; _value (flatGuid m.memberId) ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "memberName" ] [ encLocText s.["Member Name"] ] label [ _for "memberName" ] [ locStr s.["Member Name"] ]
input [ _type "text"; _name "memberName"; _id "memberName"; _required; _autofocus; _value m.memberName ] input [ _type "text"; _name "memberName"; _id "memberName"; _required; _autofocus; _value m.memberName ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "emailAddress" ] [ encLocText s.["E-mail Address"] ] label [ _for "emailAddress" ] [ locStr s.["E-mail Address"] ]
input [ _type "email"; _name "emailAddress"; _id "emailAddress"; _required; _value m.emailAddress ] input [ _type "email"; _name "emailAddress"; _id "emailAddress"; _required; _value m.emailAddress ]
] ]
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "emailType" ] [ encLocText s.["E-mail Format"] ] label [ _for "emailType" ] [ locStr s.["E-mail Format"] ]
typs typs
|> Seq.map (fun typ -> fst typ, (snd typ).Value) |> Seq.map (fun typ -> fst typ, (snd typ).Value)
|> selectList "emailType" m.emailType [] |> selectList "emailType" m.emailType []
@ -141,7 +141,7 @@ let logOn (grps : SmallGroup list) grpId ctx vi =
csrfToken ctx csrfToken ctx
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "smallGroupId" ] [ encLocText s.["Group"] ] label [ _for "smallGroupId" ] [ locStr s.["Group"] ]
seq { seq {
match grps.Length with match grps.Length with
| 0 -> yield "", s.["There are no classes with passwords defined"].Value | 0 -> yield "", s.["There are no classes with passwords defined"].Value
@ -153,16 +153,16 @@ let logOn (grps : SmallGroup list) grpId ctx vi =
|> selectList "smallGroupId" grpId [ _required ] |> selectList "smallGroupId" grpId [ _required ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "password" ] [ encLocText s.["Password"] ] label [ _for "password" ] [ locStr s.["Password"] ]
input [ _type "password"; _name "password"; _id "password"; _required; input [ _type "password"; _name "password"; _id "password"; _required;
_placeholder (s.["Case-Sensitive"].Value.ToLower ()) ] _placeholder (s.["Case-Sensitive"].Value.ToLower ()) ]
] ]
] ]
div [ _class "pt-checkbox-field" ] [ div [ _class "pt-checkbox-field" ] [
input [ _type "checkbox"; _name "rememberMe"; _id "rememberMe"; _value "True" ] input [ _type "checkbox"; _name "rememberMe"; _id "rememberMe"; _value "True" ]
label [ _for "rememberMe" ] [ encLocText s.["Remember Me"] ] label [ _for "rememberMe" ] [ locStr s.["Remember Me"] ]
br [] br []
small [] [ em [] [ encodedText (s.["Requires Cookies"].Value.ToLower ()) ] ] small [] [ em [] [ str (s.["Requires Cookies"].Value.ToLower ()) ] ]
] ]
div [ _class "pt-field-row" ] [ submit [] "account_circle" s.["Log On"] ] div [ _class "pt-field-row" ] [ submit [] "account_circle" s.["Log On"] ]
] ]
@ -182,10 +182,10 @@ let maintain (grps : SmallGroup list) ctx vi =
table [ _class "pt-table pt-action-table" ] [ table [ _class "pt-table pt-action-table" ] [
thead [] [ thead [] [
tr [] [ tr [] [
th [] [ encLocText s.["Actions"] ] th [] [ locStr s.["Actions"] ]
th [] [ encLocText s.["Name"] ] th [] [ locStr s.["Name"] ]
th [] [ encLocText s.["Church"] ] th [] [ locStr s.["Church"] ]
th [] [ encLocText s.["Time Zone"] ] th [] [ locStr s.["Time Zone"] ]
] ]
] ]
grps grps
@ -202,9 +202,9 @@ let maintain (grps : SmallGroup list) ctx vi =
_onclick (sprintf "return PT.confirmDelete('%s','%s')" delAction delPrompt) ] _onclick (sprintf "return PT.confirmDelete('%s','%s')" delAction delPrompt) ]
[ icon "delete_forever" ] [ icon "delete_forever" ]
] ]
td [] [ encodedText g.name ] td [] [ str g.name ]
td [] [ encodedText g.church.name ] td [] [ str g.church.name ]
td [] [ encLocText (TimeZones.name g.preferences.timeZoneId s) ] td [] [ locStr (TimeZones.name g.preferences.timeZoneId s) ]
]) ])
|> tbody [] |> tbody []
] ]
@ -213,7 +213,7 @@ let maintain (grps : SmallGroup list) ctx vi =
a [ _href (sprintf "/small-group/%s/edit" emptyGuid); _title s.["Add a New Group"].Value ] [ a [ _href (sprintf "/small-group/%s/edit" emptyGuid); _title s.["Add a New Group"].Value ] [
icon "add_circle" icon "add_circle"
rawText " &nbsp;" rawText " &nbsp;"
encLocText s.["Add a New Group"] locStr s.["Add a New Group"]
] ]
br [] br []
br [] br []
@ -236,10 +236,10 @@ let members (mbrs : Member list) (emailTyps : Map<string, LocalizedString>) ctx
table [ _class "pt-table pt-action-table" ] [ table [ _class "pt-table pt-action-table" ] [
thead [] [ thead [] [
tr [] [ tr [] [
th [] [ encLocText s.["Actions"] ] th [] [ locStr s.["Actions"] ]
th [] [ encLocText s.["Name"] ] th [] [ locStr s.["Name"] ]
th [] [ encLocText s.["E-mail Address"] ] th [] [ locStr s.["E-mail Address"] ]
th [] [ encLocText s.["Format"] ] th [] [ locStr s.["Format"] ]
] ]
] ]
mbrs mbrs
@ -257,16 +257,16 @@ let members (mbrs : Member list) (emailTyps : Map<string, LocalizedString>) ctx
_onclick (sprintf "return PT.confirmDelete('%s','%s')" delAction delPrompt) ] _onclick (sprintf "return PT.confirmDelete('%s','%s')" delAction delPrompt) ]
[ icon "delete_forever" ] [ icon "delete_forever" ]
] ]
td [] [ encodedText mbr.memberName ] td [] [ str mbr.memberName ]
td [] [ encodedText mbr.email ] td [] [ str mbr.email ]
td [] [ encLocText emailTyps.[defaultArg mbr.format ""] ] td [] [ locStr emailTyps.[defaultArg mbr.format ""] ]
]) ])
|> tbody [] |> tbody []
] ]
[ div [ _class"pt-center-text" ] [ [ div [ _class"pt-center-text" ] [
br [] br []
a [ _href (sprintf "/small-group/member/%s/edit" emptyGuid); _title s.["Add a New Group Member"].Value ] a [ _href (sprintf "/small-group/member/%s/edit" emptyGuid); _title s.["Add a New Group Member"].Value ]
[ icon "add_circle"; rawText " &nbsp;"; encLocText s.["Add a New Group Member"] ] [ icon "add_circle"; rawText " &nbsp;"; locStr s.["Add a New Group Member"] ]
br [] br []
br [] br []
] ]
@ -287,52 +287,52 @@ let overview m vi =
section [] [ section [] [
header [ _role "heading" ] [ header [ _role "heading" ] [
iconSized 72 "bookmark_border" iconSized 72 "bookmark_border"
encLocText s.["Quick Actions"] locStr s.["Quick Actions"]
] ]
div [] [ div [] [
a [ _href "/prayer-requests/view" ] [ icon "list"; linkSpacer; encLocText s.["View Prayer Request List"] ] a [ _href "/prayer-requests/view" ] [ icon "list"; linkSpacer; locStr s.["View Prayer Request List"] ]
hr [] hr []
a [ _href "/small-group/announcement" ] [ icon "send"; linkSpacer; encLocText s.["Send Announcement"] ] a [ _href "/small-group/announcement" ] [ icon "send"; linkSpacer; locStr s.["Send Announcement"] ]
hr [] hr []
a [ _href "/small-group/preferences" ] [ icon "build"; linkSpacer; encLocText s.["Change Preferences"] ] a [ _href "/small-group/preferences" ] [ icon "build"; linkSpacer; locStr s.["Change Preferences"] ]
] ]
] ]
section [] [ section [] [
header [ _role "heading" ] [ header [ _role "heading" ] [
iconSized 72 "question_answer" iconSized 72 "question_answer"
encLocText s.["Prayer Requests"] locStr s.["Prayer Requests"]
] ]
div [] [ div [] [
yield p [ _class "pt-center-text" ] [ yield p [ _class "pt-center-text" ] [
strong [] [ encodedText (m.totalActiveReqs.ToString "N0"); space; encLocText s.["Active Requests"] ] strong [] [ str (m.totalActiveReqs.ToString "N0"); space; locStr s.["Active Requests"] ]
] ]
yield hr [] yield hr []
for cat in m.activeReqsByCat do for cat in m.activeReqsByCat do
yield encodedText (cat.Value.ToString "N0") yield str (cat.Value.ToString "N0")
yield space yield space
yield encLocText typs.[cat.Key] yield locStr typs.[cat.Key]
yield br [] yield br []
yield br [] yield br []
yield encodedText (m.allReqs.ToString "N0") yield str (m.allReqs.ToString "N0")
yield space yield space
yield encLocText s.["Total Requests"] yield locStr s.["Total Requests"]
yield hr [] yield hr []
yield a [ _href "/prayer-requests/maintain" ] [ yield a [ _href "/prayer-requests/maintain" ] [
icon "compare_arrows" icon "compare_arrows"
linkSpacer linkSpacer
encLocText s.["Maintain Prayer Requests"] locStr s.["Maintain Prayer Requests"]
] ]
] ]
] ]
section [] [ section [] [
header [ _role "heading" ] [ header [ _role "heading" ] [
iconSized 72 "people_outline" iconSized 72 "people_outline"
encLocText s.["Group Members"] locStr s.["Group Members"]
] ]
div [ _class "pt-center-text" ] [ div [ _class "pt-center-text" ] [
strong [] [ encodedText (m.totalMbrs.ToString "N0"); space; encLocText s.["Members"] ] strong [] [ str (m.totalMbrs.ToString "N0"); space; locStr s.["Members"] ]
hr [] hr []
a [ _href "/small-group/members" ] [ icon "email"; linkSpacer; encLocText s.["Maintain Group Members"] ] a [ _href "/small-group/members" ] [ icon "email"; linkSpacer; locStr s.["Maintain Group Members"] ]
] ]
] ]
] ]
@ -351,58 +351,58 @@ let preferences (m : EditPreferences) (tzs : TimeZone list) ctx vi =
style [ _scoped ] [ rawText "#expireDays, #daysToKeepNew, #longTermUpdateWeeks, #headingFontSize, #listFontSize { width: 3rem; } #emailFromAddress { width: 20rem; } #listFonts { width: 40rem; } @media screen and (max-width: 40rem) { #listFonts { width: 100%; } }" ] style [ _scoped ] [ rawText "#expireDays, #daysToKeepNew, #longTermUpdateWeeks, #headingFontSize, #listFontSize { width: 3rem; } #emailFromAddress { width: 20rem; } #listFonts { width: 40rem; } @media screen and (max-width: 40rem) { #listFonts { width: 100%; } }" ]
csrfToken ctx csrfToken ctx
fieldset [] [ fieldset [] [
legend [] [ strong [] [ icon "date_range"; rawText " &nbsp;"; encLocText s.["Dates"] ] ] legend [] [ strong [] [ icon "date_range"; rawText " &nbsp;"; locStr s.["Dates"] ] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "expireDays" ] [ encLocText s.["Requests Expire After"] ] label [ _for "expireDays" ] [ locStr s.["Requests Expire After"] ]
span [] [ span [] [
input [ _type "number"; _name "expireDays"; _id "expireDays"; _min "1"; _max "30"; _required; _autofocus input [ _type "number"; _name "expireDays"; _id "expireDays"; _min "1"; _max "30"; _required; _autofocus
_value (string m.expireDays) ] _value (string m.expireDays) ]
space; encodedText (s.["Days"].Value.ToLower ()) space; str (s.["Days"].Value.ToLower ())
] ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "daysToKeepNew" ] [ encLocText s.["Requests “New” For"] ] label [ _for "daysToKeepNew" ] [ locStr s.["Requests “New” For"] ]
span [] [ span [] [
input [ _type "number"; _name "daysToKeepNew"; _id "daysToKeepNew"; _min "1"; _max "30"; _required input [ _type "number"; _name "daysToKeepNew"; _id "daysToKeepNew"; _min "1"; _max "30"; _required
_value (string m.daysToKeepNew) ] _value (string m.daysToKeepNew) ]
space; encodedText (s.["Days"].Value.ToLower ()) space; str (s.["Days"].Value.ToLower ())
] ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "longTermUpdateWeeks" ] [ encLocText s.["Long-Term Requests Alerted for Update"] ] label [ _for "longTermUpdateWeeks" ] [ locStr s.["Long-Term Requests Alerted for Update"] ]
span [] [ span [] [
input [ _type "number"; _name "longTermUpdateWeeks"; _id "longTermUpdateWeeks"; _min "1"; _max "30" input [ _type "number"; _name "longTermUpdateWeeks"; _id "longTermUpdateWeeks"; _min "1"; _max "30"
_required; _value (string m.longTermUpdateWeeks) ] _required; _value (string m.longTermUpdateWeeks) ]
space; encodedText (s.["Weeks"].Value.ToLower ()) space; str (s.["Weeks"].Value.ToLower ())
] ]
] ]
] ]
] ]
fieldset [] [ fieldset [] [
legend [] [ strong [] [ icon "sort"; rawText " &nbsp;"; encLocText s.["Request Sorting"] ] ] legend [] [ strong [] [ icon "sort"; rawText " &nbsp;"; locStr s.["Request Sorting"] ] ]
radio "requestSort" "requestSort_D" "D" m.requestSort radio "requestSort" "requestSort_D" "D" m.requestSort
label [ _for "requestSort_D" ] [ encLocText s.["Sort by Last Updated Date"] ] label [ _for "requestSort_D" ] [ locStr s.["Sort by Last Updated Date"] ]
rawText " &nbsp; " rawText " &nbsp; "
radio "requestSort" "requestSort_R" "R" m.requestSort radio "requestSort" "requestSort_R" "R" m.requestSort
label [ _for "requestSort_R" ] [ encLocText s.["Sort by Requestor Name"] ] label [ _for "requestSort_R" ] [ locStr s.["Sort by Requestor Name"] ]
] ]
fieldset [] [ fieldset [] [
legend [] [ strong [] [ icon "mail_outline"; rawText " &nbsp;"; encLocText s.["E-mail"] ] ] legend [] [ strong [] [ icon "mail_outline"; rawText " &nbsp;"; locStr s.["E-mail"] ] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "emailFromName" ] [ encLocText s.["From Name"] ] label [ _for "emailFromName" ] [ locStr s.["From Name"] ]
input [ _type "text"; _name "emailFromName"; _id "emailFromName"; _required; _value m.emailFromName ] input [ _type "text"; _name "emailFromName"; _id "emailFromName"; _required; _value m.emailFromName ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "emailFromAddress" ] [ encLocText s.["From Address"] ] label [ _for "emailFromAddress" ] [ locStr s.["From Address"] ]
input [ _type "email"; _name "emailFromAddress"; _id "emailFromAddress"; _required input [ _type "email"; _name "emailFromAddress"; _id "emailFromAddress"; _required
_value m.emailFromAddress ] _value m.emailFromAddress ]
] ]
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "defaultEmailType" ] [ encLocText s.["E-mail Format"] ] label [ _for "defaultEmailType" ] [ locStr s.["E-mail Format"] ]
seq { seq {
yield "", selectDefault s.["Select"].Value yield "", selectDefault s.["Select"].Value
yield! ReferenceList.emailTypeList "" s |> Seq.skip 1 |> Seq.map (fun typ -> fst typ, (snd typ).Value) yield! ReferenceList.emailTypeList "" s |> Seq.skip 1 |> Seq.map (fun typ -> fst typ, (snd typ).Value)
@ -412,19 +412,19 @@ let preferences (m : EditPreferences) (tzs : TimeZone list) ctx vi =
] ]
] ]
fieldset [] [ fieldset [] [
legend [] [ strong [] [ icon "color_lens"; rawText " &nbsp;"; encLocText s.["Colors"] ]; rawText " ***" ] legend [] [ strong [] [ icon "color_lens"; rawText " &nbsp;"; locStr s.["Colors"] ]; rawText " ***" ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _class "pt-center-text" ] [ encLocText s.["Color of Heading Lines"] ] label [ _class "pt-center-text" ] [ locStr s.["Color of Heading Lines"] ]
span [] [ span [] [
radio "headingLineType" "headingLineType_Name" "Name" m.headingLineType radio "headingLineType" "headingLineType_Name" "Name" m.headingLineType
label [ _for "headingLineType_Name" ] [ encLocText s.["Named Color"] ] label [ _for "headingLineType_Name" ] [ locStr s.["Named Color"] ]
namedColorList "headingLineColor" m.headingLineColor namedColorList "headingLineColor" m.headingLineColor
[ yield _id "headingLineColor_Select" [ yield _id "headingLineColor_Select"
match m.headingLineColor.StartsWith "#" with true -> yield _disabled | false -> () ] s match m.headingLineColor.StartsWith "#" with true -> yield _disabled | false -> () ] s
rawText "&nbsp; &nbsp; "; encodedText (s.["or"].Value.ToUpper ()) rawText "&nbsp; &nbsp; "; str (s.["or"].Value.ToUpper ())
radio "headingLineType" "headingLineType_RGB" "RGB" m.headingLineType radio "headingLineType" "headingLineType_RGB" "RGB" m.headingLineType
label [ _for "headingLineType_RGB" ] [ encLocText s.["Custom Color"] ] label [ _for "headingLineType_RGB" ] [ locStr s.["Custom Color"] ]
input [ yield _type "color" input [ yield _type "color"
yield _name "headingLineColor" yield _name "headingLineColor"
yield _id "headingLineColor_Color" yield _id "headingLineColor_Color"
@ -435,16 +435,16 @@ let preferences (m : EditPreferences) (tzs : TimeZone list) ctx vi =
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _class "pt-center-text" ] [ encLocText s.["Color of Heading Text"] ] label [ _class "pt-center-text" ] [ locStr s.["Color of Heading Text"] ]
span [] [ span [] [
radio "headingTextType" "headingTextType_Name" "Name" m.headingTextType radio "headingTextType" "headingTextType_Name" "Name" m.headingTextType
label [ _for "headingTextType_Name" ] [ encLocText s.["Named Color"] ] label [ _for "headingTextType_Name" ] [ locStr s.["Named Color"] ]
namedColorList "headingTextColor" m.headingTextColor namedColorList "headingTextColor" m.headingTextColor
[ yield _id "headingTextColor_Select" [ yield _id "headingTextColor_Select"
match m.headingTextColor.StartsWith "#" with true -> yield _disabled | false -> () ] s match m.headingTextColor.StartsWith "#" with true -> yield _disabled | false -> () ] s
rawText "&nbsp; &nbsp; "; encodedText (s.["or"].Value.ToUpper ()) rawText "&nbsp; &nbsp; "; str (s.["or"].Value.ToUpper ())
radio "headingTextType" "headingTextType_RGB" "RGB" m.headingTextType radio "headingTextType" "headingTextType_RGB" "RGB" m.headingTextType
label [ _for "headingTextType_RGB" ] [ encLocText s.["Custom Color"] ] label [ _for "headingTextType_RGB" ] [ locStr s.["Custom Color"] ]
input [ yield _type "color" input [ yield _type "color"
yield _name "headingTextColor" yield _name "headingTextColor"
yield _id "headingTextColor_Color" yield _id "headingTextColor_Color"
@ -455,29 +455,29 @@ let preferences (m : EditPreferences) (tzs : TimeZone list) ctx vi =
] ]
] ]
fieldset [] [ fieldset [] [
legend [] [ strong [] [ icon "font_download"; rawText " &nbsp;"; encLocText s.["Fonts"] ] ] legend [] [ strong [] [ icon "font_download"; rawText " &nbsp;"; locStr s.["Fonts"] ] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "listFonts" ] [ encLocText s.["Fonts** for List"] ] label [ _for "listFonts" ] [ locStr s.["Fonts** for List"] ]
input [ _type "text"; _name "listFonts"; _id "listFonts"; _required; _value m.listFonts ] input [ _type "text"; _name "listFonts"; _id "listFonts"; _required; _value m.listFonts ]
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "headingFontSize" ] [ encLocText s.["Heading Text Size"] ] label [ _for "headingFontSize" ] [ locStr s.["Heading Text Size"] ]
input [ _type "number"; _name "headingFontSize"; _id "headingFontSize"; _min "8"; _max "24"; _required input [ _type "number"; _name "headingFontSize"; _id "headingFontSize"; _min "8"; _max "24"; _required
_value (string m.headingFontSize) ] _value (string m.headingFontSize) ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "listFontSize" ] [ encLocText s.["List Text Size"] ] label [ _for "listFontSize" ] [ locStr s.["List Text Size"] ]
input [ _type "number"; _name "listFontSize"; _id "listFontSize"; _min "8"; _max "24"; _required input [ _type "number"; _name "listFontSize"; _id "listFontSize"; _min "8"; _max "24"; _required
_value (string m.listFontSize) ] _value (string m.listFontSize) ]
] ]
] ]
] ]
fieldset [] [ fieldset [] [
legend [] [ strong [] [ icon "settings"; rawText " &nbsp;"; encLocText s.["Other Settings"] ] ] legend [] [ strong [] [ icon "settings"; rawText " &nbsp;"; locStr s.["Other Settings"] ] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "TimeZone" ] [ encLocText s.["Time Zone"] ] label [ _for "TimeZone" ] [ locStr s.["Time Zone"] ]
seq { seq {
yield "", selectDefault s.["Select"].Value yield "", selectDefault s.["Select"].Value
yield! tzs |> List.map (fun tz -> tz.timeZoneId, (TimeZones.name tz.timeZoneId s).Value) yield! tzs |> List.map (fun tz -> tz.timeZoneId, (TimeZones.name tz.timeZoneId s).Value)
@ -486,16 +486,16 @@ let preferences (m : EditPreferences) (tzs : TimeZone list) ctx vi =
] ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [] [ encLocText s.["Request List Visibility"] ] label [] [ locStr s.["Request List Visibility"] ]
span [] [ span [] [
radio "listVisibility" "viz_Public" (string RequestVisibility.``public``) (string m.listVisibility) radio "listVisibility" "viz_Public" (string RequestVisibility.``public``) (string m.listVisibility)
label [ _for "viz_Public" ] [ encLocText s.["Public"] ] label [ _for "viz_Public" ] [ locStr s.["Public"] ]
rawText " &nbsp;" rawText " &nbsp;"
radio "listVisibility" "viz_Private" (string RequestVisibility.``private``) (string m.listVisibility) radio "listVisibility" "viz_Private" (string RequestVisibility.``private``) (string m.listVisibility)
label [ _for "viz_Private" ] [ encLocText s.["Private"] ] label [ _for "viz_Private" ] [ locStr s.["Private"] ]
rawText " &nbsp;" rawText " &nbsp;"
radio "listVisibility" "viz_Password" (string RequestVisibility.passwordProtected) (string m.listVisibility) radio "listVisibility" "viz_Password" (string RequestVisibility.passwordProtected) (string m.listVisibility)
label [ _for "viz_Password" ] [ encLocText s.["Password Protected"] ] label [ _for "viz_Password" ] [ locStr s.["Password Protected"] ]
] ]
] ]
div [ yield _id "divClassPassword" div [ yield _id "divClassPassword"
@ -504,7 +504,7 @@ let preferences (m : EditPreferences) (tzs : TimeZone list) ctx vi =
| false -> yield _class "pt-field-row pt-fadeable" | false -> yield _class "pt-field-row pt-fadeable"
] [ ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "groupPassword" ] [ encLocText s.["Group Password (Used to Read Online)"] ] label [ _for "groupPassword" ] [ locStr s.["Group Password (Used to Read Online)"] ]
input [ _type "text"; _name "groupPassword"; _id "groupPassword"; input [ _type "text"; _name "groupPassword"; _id "groupPassword";
_value (match m.groupPassword with Some x -> x | None -> "") ] _value (match m.groupPassword with Some x -> x | None -> "") ]
] ]

View File

@ -16,7 +16,7 @@ let assignGroups m groups curGroups ctx vi =
thead [] [ thead [] [
tr [] [ tr [] [
th [] [ rawText "&nbsp;" ] th [] [ rawText "&nbsp;" ]
th [] [ encLocText s.["Group"] ] th [] [ locStr s.["Group"] ]
] ]
] ]
groups groups
@ -30,7 +30,7 @@ let assignGroups m groups curGroups ctx vi =
yield _value grpId yield _value grpId
match curGroups |> List.contains grpId with true -> yield _checked | false -> () ] match curGroups |> List.contains grpId with true -> yield _checked | false -> () ]
] ]
td [] [ label [ _for inputId ] [ encodedText grpName ] ] td [] [ label [ _for inputId ] [ str grpName ] ]
]) ])
|> tbody [] |> tbody []
] ]
@ -45,7 +45,7 @@ let assignGroups m groups curGroups ctx vi =
let changePassword ctx vi = let changePassword ctx vi =
let s = I18N.localizer.Force () let s = I18N.localizer.Force ()
[ p [ _class "pt-center-text" ] [ [ p [ _class "pt-center-text" ] [
encLocText s.["To change your password, enter your current password in the specified box below, then enter your new password twice."] locStr s.["To change your password, enter your current password in the specified box below, then enter your new password twice."]
] ]
form [ _action "/user/password/change" form [ _action "/user/password/change"
_method "post" _method "post"
@ -54,13 +54,13 @@ let changePassword ctx vi =
csrfToken ctx csrfToken ctx
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "oldPassword" ] [ encLocText s.["Current Password"] ] label [ _for "oldPassword" ] [ locStr s.["Current Password"] ]
input [ _type "password"; _name "oldPassword"; _id "oldPassword"; _required; _autofocus ] input [ _type "password"; _name "oldPassword"; _id "oldPassword"; _required; _autofocus ]
] ]
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "newPassword" ] [ encLocText s.["New Password Twice"] ] label [ _for "newPassword" ] [ locStr s.["New Password Twice"] ]
input [ _type "password"; _name "newPassword"; _id "newPassword"; _required ] input [ _type "password"; _name "newPassword"; _id "newPassword"; _required ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
@ -91,25 +91,25 @@ let edit (m : EditUser) ctx vi =
input [ _type "hidden"; _name "userId"; _value (flatGuid m.userId) ] input [ _type "hidden"; _name "userId"; _value (flatGuid m.userId) ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "firstName" ] [ encLocText s.["First Name"] ] label [ _for "firstName" ] [ locStr s.["First Name"] ]
input [ _type "text"; _name "firstName"; _id "firstName"; _value m.firstName; _required; _autofocus ] input [ _type "text"; _name "firstName"; _id "firstName"; _value m.firstName; _required; _autofocus ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "lastName" ] [ encLocText s.["Last Name"] ] label [ _for "lastName" ] [ locStr s.["Last Name"] ]
input [ _type "text"; _name "lastName"; _id "lastName"; _value m.lastName; _required ] input [ _type "text"; _name "lastName"; _id "lastName"; _value m.lastName; _required ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "emailAddress" ] [ encLocText s.["E-mail Address"] ] label [ _for "emailAddress" ] [ locStr s.["E-mail Address"] ]
input [ _type "email"; _name "emailAddress"; _id "emailAddress"; _value m.emailAddress; _required ] input [ _type "email"; _name "emailAddress"; _id "emailAddress"; _value m.emailAddress; _required ]
] ]
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "password" ] [ encLocText s.["Password"] ] label [ _for "password" ] [ locStr s.["Password"] ]
input [ _type "password"; _name "password"; _id "password"; _placeholder pwPlaceholder ] input [ _type "password"; _name "password"; _id "password"; _placeholder pwPlaceholder ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "passwordConfirm" ] [ encLocText s.["Password Again"] ] label [ _for "passwordConfirm" ] [ locStr s.["Password Again"] ]
input [ _type "password"; _name "passwordConfirm"; _id "passwordConfirm"; _placeholder pwPlaceholder ] input [ _type "password"; _name "passwordConfirm"; _id "passwordConfirm"; _placeholder pwPlaceholder ]
] ]
] ]
@ -119,7 +119,7 @@ let edit (m : EditUser) ctx vi =
yield _id "isAdmin" yield _id "isAdmin"
yield _value "True" yield _value "True"
match m.isAdmin with Some x when x -> yield _checked | _ -> () ] match m.isAdmin with Some x when x -> yield _checked | _ -> () ]
label [ _for "isAdmin" ] [ encLocText s.["This user is a PrayerTracker administrator"] ] label [ _for "isAdmin" ] [ locStr s.["This user is a PrayerTracker administrator"] ]
] ]
div [ _class "pt-field-row" ] [ submit [] "save" s.["Save User"] ] div [ _class "pt-field-row" ] [ submit [] "save" s.["Save User"] ]
] ]
@ -138,18 +138,18 @@ let logOn (m : UserLogOn) groups ctx vi =
input [ _type "hidden"; _name "redirectUrl"; _value (defaultArg m.redirectUrl "") ] input [ _type "hidden"; _name "redirectUrl"; _value (defaultArg m.redirectUrl "") ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "emailAddress"] [ encLocText s.["E-mail Address"] ] label [ _for "emailAddress"] [ locStr s.["E-mail Address"] ]
input [ _type "email"; _name "emailAddress"; _id "emailAddress"; _value m.emailAddress; _required; _autofocus ] input [ _type "email"; _name "emailAddress"; _id "emailAddress"; _value m.emailAddress; _required; _autofocus ]
] ]
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "password" ] [ encLocText s.["Password"] ] label [ _for "password" ] [ locStr s.["Password"] ]
input [ _type "password"; _name "password"; _id "password"; _required; input [ _type "password"; _name "password"; _id "password"; _required;
_placeholder (sprintf "(%s)" (s.["Case-Sensitive"].Value.ToLower ())) ] _placeholder (sprintf "(%s)" (s.["Case-Sensitive"].Value.ToLower ())) ]
] ]
] ]
div [ _class "pt-field-row" ] [ div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [ div [ _class "pt-field" ] [
label [ _for "smallGroupId" ] [ encLocText s.["Group"] ] label [ _for "smallGroupId" ] [ locStr s.["Group"] ]
seq { seq {
yield "", selectDefault s.["Select Group"].Value yield "", selectDefault s.["Select Group"].Value
yield! groups yield! groups
@ -160,9 +160,9 @@ let logOn (m : UserLogOn) groups ctx vi =
] ]
div [ _class "pt-checkbox-field" ] [ div [ _class "pt-checkbox-field" ] [
input [ _type "checkbox"; _name "rememberMe"; _id "rememberMe"; _value "True" ] input [ _type "checkbox"; _name "rememberMe"; _id "rememberMe"; _value "True" ]
label [ _for "rememberMe" ] [ encLocText s.["Remember Me"] ] label [ _for "rememberMe" ] [ locStr s.["Remember Me"] ]
br [] br []
small [] [ em [] [ rawText "("; encodedText (s.["Requires Cookies"].Value.ToLower ()); rawText ")" ] ] small [] [ em [] [ rawText "("; str (s.["Requires Cookies"].Value.ToLower ()); rawText ")" ] ]
] ]
div [ _class "pt-field-row" ] [ submit [] "account_circle" s.["Log On"] ] div [ _class "pt-field-row" ] [ submit [] "account_circle" s.["Log On"] ]
] ]
@ -181,9 +181,9 @@ let maintain (users : User list) ctx vi =
table [ _class "pt-table pt-action-table" ] [ table [ _class "pt-table pt-action-table" ] [
thead [] [ thead [] [
tr [] [ tr [] [
th [] [ encLocText s.["Actions"] ] th [] [ locStr s.["Actions"] ]
th [] [ encLocText s.["Name"] ] th [] [ locStr s.["Name"] ]
th [] [ encLocText s.["Admin?"] ] th [] [ locStr s.["Admin?"] ]
] ]
] ]
users users
@ -202,11 +202,11 @@ let maintain (users : User list) ctx vi =
_onclick (sprintf "return PT.confirmDelete('%s','%s')" delAction delPrompt) ] _onclick (sprintf "return PT.confirmDelete('%s','%s')" delAction delPrompt) ]
[ icon "delete_forever" ] [ icon "delete_forever" ]
] ]
td [] [ encodedText user.fullName ] td [] [ str user.fullName ]
td [ _class "pt-center-text" ] [ td [ _class "pt-center-text" ] [
match user.isAdmin with match user.isAdmin with
| true -> yield strong [] [ encLocText s.["Yes"] ] | true -> yield strong [] [ locStr s.["Yes"] ]
| false -> yield encLocText s.["No"] | false -> yield locStr s.["No"]
] ]
]) ])
|> tbody [] |> tbody []
@ -214,7 +214,7 @@ let maintain (users : User list) ctx vi =
[ div [ _class "pt-center-text" ] [ [ div [ _class "pt-center-text" ] [
br [] br []
a [ _href (sprintf "/user/%s/edit" emptyGuid); _title s.["Add a New User"].Value ] a [ _href (sprintf "/user/%s/edit" emptyGuid); _title s.["Add a New User"].Value ]
[ icon "add_circle"; rawText " &nbsp;"; encLocText s.["Add a New User"] ] [ icon "add_circle"; rawText " &nbsp;"; locStr s.["Add a New User"] ]
br [] br []
br [] br []
] ]

View File

@ -548,13 +548,13 @@ with
| true -> | true ->
yield div [ _style (sprintf "text-align:center;font-family:%s" prefs.listFonts) ] [ yield div [ _style (sprintf "text-align:center;font-family:%s" prefs.listFonts) ] [
span [ _style (sprintf "font-size:%ipt;" prefs.headingFontSize) ] [ span [ _style (sprintf "font-size:%ipt;" prefs.headingFontSize) ] [
strong [] [ encodedText s.["Prayer Requests"].Value ] strong [] [ str s.["Prayer Requests"].Value ]
] ]
br [] br []
span [ _style (sprintf "font-size:%ipt;" prefs.textFontSize) ] [ span [ _style (sprintf "font-size:%ipt;" prefs.textFontSize) ] [
strong [] [ encodedText this.listGroup.name ] strong [] [ str this.listGroup.name ]
br [] br []
encodedText (this.date.ToString s.["MMMM d, yyyy"].Value) str (this.date.ToString s.["MMMM d, yyyy"].Value)
] ]
] ]
yield br [] yield br []
@ -572,7 +572,7 @@ with
tr [] [ tr [] [
td [ _style (sprintf "font-size:%ipt;color:%s;padding:3px 0;border-top:solid 3px %s;border-bottom:solid 3px %s;font-weight:bold;" td [ _style (sprintf "font-size:%ipt;color:%s;padding:3px 0;border-top:solid 3px %s;border-bottom:solid 3px %s;font-weight:bold;"
prefs.headingFontSize prefs.headingColor prefs.lineColor prefs.lineColor) ] [ prefs.headingFontSize prefs.headingColor prefs.lineColor prefs.lineColor) ] [
rawText "&nbsp; &nbsp; "; encodedText catName.Value; rawText "&nbsp; &nbsp; " rawText "&nbsp; &nbsp; "; str catName.Value; rawText "&nbsp; &nbsp; "
] ]
] ]
] ]
@ -585,7 +585,7 @@ with
bullet prefs.listFonts prefs.textFontSize) ] [ bullet prefs.listFonts prefs.textFontSize) ] [
match req.requestor with match req.requestor with
| Some rqstr when rqstr <> "" -> | Some rqstr when rqstr <> "" ->
yield strong [] [ encodedText rqstr ] yield strong [] [ str rqstr ]
yield rawText " &mdash; " yield rawText " &mdash; "
| Some _ -> () | Some _ -> ()
| None -> () | None -> ()

View File

@ -30,7 +30,7 @@
<PackageReference Include="Giraffe" Version="3.6.0" /> <PackageReference Include="Giraffe" Version="3.6.0" />
<PackageReference Include="Giraffe.TokenRouter" Version="1.0.0" /> <PackageReference Include="Giraffe.TokenRouter" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.2" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" />
</ItemGroup> </ItemGroup>