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>
<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="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" />
<PackageReference Include="TaskBuilder.fs" Version="2.1.0" />

View File

@ -15,7 +15,7 @@
</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="NodaTime.Testing" Version="2.4.4" />
</ItemGroup>

View File

@ -9,15 +9,6 @@ open PrayerTracker.Views
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>]
let iconSizedTests =
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>]
let namedColorListTests =
testList "namedColorList" [

View File

@ -15,15 +15,15 @@ let edit (m : EditChurch) ctx vi =
input [ _type "hidden"; _name "churchId"; _value (flatGuid m.churchId) ]
div [ _class "pt-field-row" ] [
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 ]
]
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 ]
]
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 ]
]
]
@ -34,12 +34,12 @@ let edit (m : EditChurch) ctx vi =
yield _id "hasInterface"
yield _value "True"
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" ] [
label [ _for "interfaceAddress" ] [ encLocText s.["VPR Interface URL"] ]
label [ _for "interfaceAddress" ] [ locStr s.["VPR Interface URL"] ]
input [ _type "url"; _name "interfaceAddress"; _id "interfaceAddress";
_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" ] [
thead [] [
tr [] [
th [] [ encLocText s.["Actions"] ]
th [] [ encLocText s.["Name"] ]
th [] [ encLocText s.["Location"] ]
th [] [ encLocText s.["Groups"] ]
th [] [ encLocText s.["Requests"] ]
th [] [ encLocText s.["Users"] ]
th [] [ encLocText s.["Interface?"] ]
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?"] ]
]
]
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) ]
[ icon "delete_forever" ]
]
td [] [ encodedText ch.name ]
td [] [ encodedText ch.city; rawText ", "; encodedText ch.st ]
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" ] [ 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 []
]
[ div [ _class "pt-center-text" ] [
br []
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 []
]

View File

@ -12,7 +12,7 @@ open System.IO
open System.Text.Encodings.Web
/// 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
let rawLocText (writer : StringWriter) (text : LocalizedHtmlString) =
@ -44,7 +44,7 @@ let tableSummary itemCount (s : IStringLocalizer) =
| 0 -> s.["No Entries to Display"]
| 1 -> s.["Displaying {0} Entry", itemCount]
| _ -> s.["Displaying {0} Entries", itemCount]
|> encLocText
|> locStr
]
]
@ -100,7 +100,7 @@ let selectList name selected attrs items =
let selectDefault text = sprintf "— %s —" 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)
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"])
_title (sprintf "%A %A" s.["PrayerTracker"] s.["from Bit Badger Solutions"])
_style "vertical-align:text-bottom;" ]
encodedText vi.version
str vi.version
]
]
|> div []
@ -203,17 +203,17 @@ let termsOfService vi =
use sw = new StringWriter ()
let raw = rawLocText sw
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)
[ 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 [] [
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 [] [ encodedText "2. "; raw l.["Description of Service and Registration"] ]
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"]]
@ -222,13 +222,13 @@ let termsOfService vi =
space
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 [] [
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 [] [ encodedText "4. "; raw l.["Updates to Terms"] ]
h3 [] [ str "4. "; raw l.["Updates to Terms"] ]
p [] [
raw l.["These terms and conditions may be updated at any time."]
space

View File

@ -24,30 +24,30 @@ module Navigation =
| Some u ->
yield li [ _class "dropdown" ] [
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" ] [
a [ _href "/prayer-requests" ] [ icon "compare_arrows"; menuSpacer; encLocText s.["Maintain"] ]
a [ _href "/prayer-requests/view" ] [ icon "list"; menuSpacer; encLocText s.["View List"] ]
a [ _href "/prayer-requests" ] [ icon "compare_arrows"; menuSpacer; locStr s.["Maintain"] ]
a [ _href "/prayer-requests/view" ] [ icon "list"; menuSpacer; locStr s.["View List"] ]
]
]
yield li [ _class "dropdown" ] [
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" ] [
a [ _href "/small-group/members" ] [ icon "email"; menuSpacer; encLocText s.["Maintain Group Members"] ]
a [ _href "/small-group/announcement" ] [ icon "send"; menuSpacer; encLocText s.["Send Announcement"] ]
a [ _href "/small-group/preferences" ] [ icon "build"; menuSpacer; encLocText s.["Change Preferences"] ]
a [ _href "/small-group/members" ] [ icon "email"; menuSpacer; locStr s.["Maintain Group Members"] ]
a [ _href "/small-group/announcement" ] [ icon "send"; menuSpacer; locStr s.["Send Announcement"] ]
a [ _href "/small-group/preferences" ] [ icon "build"; menuSpacer; locStr s.["Change Preferences"] ]
]
]
match u.isAdmin with
| true ->
yield li [ _class "dropdown" ] [
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" ] [
a [ _href "/churches" ] [ icon "home"; menuSpacer; encLocText s.["Churches"] ]
a [ _href "/small-groups" ] [ icon "send"; menuSpacer; encLocText s.["Groups"] ]
a [ _href "/users" ] [ icon "build"; menuSpacer; encLocText s.["Users"] ]
a [ _href "/churches" ] [ icon "home"; menuSpacer; locStr s.["Churches"] ]
a [ _href "/small-groups" ] [ icon "send"; menuSpacer; locStr s.["Groups"] ]
a [ _href "/users" ] [ icon "build"; menuSpacer; locStr s.["Users"] ]
]
]
| false -> ()
@ -58,22 +58,22 @@ module Navigation =
a [ _href "/prayer-requests/view"
_aria "label" 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 ->
yield li [ _class "dropdown" ] [
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" ] [
a [ _href "/user/log-on" ] [ icon "person"; menuSpacer; encLocText s.["User"] ]
a [ _href "/small-group/log-on" ] [ icon "group"; menuSpacer; encLocText s.["Group"] ]
a [ _href "/user/log-on" ] [ icon "person"; menuSpacer; locStr s.["User"] ]
a [ _href "/small-group/log-on" ] [ icon "group"; menuSpacer; locStr s.["Group"] ]
]
]
yield li [] [
a [ _href "/prayer-requests/lists"
_aria "label" 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 [] [
a [ _href (sprintf "https://docs.prayer.bitbadger.solutions/%s" <| langCode ())
@ -81,7 +81,7 @@ module Navigation =
_title s.["View Help"].Value
_target "_blank"
]
[ icon "help"; space; encLocText s.["Help"] ]
[ icon "help"; space; locStr s.["Help"] ]
]
]
let rightLinks =
@ -93,19 +93,19 @@ module Navigation =
a [ _href "/user/password"
_aria "label" 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 -> ()
yield li [] [
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
header [ _class "pt-title-bar" ] [
section [ _class "pt-title-bar-left" ] [
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
]
@ -120,34 +120,34 @@ module Navigation =
let s = I18N.localizer.Force ()
header [ _id "pt-language" ] [
div [] [
yield span [ _class "u" ] [ encLocText s.["Language"]; rawText ": " ]
yield span [ _class "u" ] [ locStr s.["Language"]; rawText ": " ]
match langCode () with
| "es" ->
yield encLocText s.["Spanish"]
yield locStr s.["Spanish"]
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 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
| Some g ->
[ match m.user with
| 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 icon "person"
yield strong [] [ encodedText u.fullName ]
yield strong [] [ str u.fullName ]
yield rawText "&nbsp; &nbsp; "
| None ->
yield encLocText s.["Logged On as a Member of"]
yield locStr s.["Logged On as a Member of"]
yield rawText "&nbsp; "
yield icon "group"
yield space
match m.user with
| Some _ -> yield a [ _href "/small-group" ] [ strong [] [ encodedText g.name ] ]
| None -> yield strong [] [ encodedText g.name ]
| Some _ -> yield a [ _href "/small-group" ] [ strong [] [ str g.name ] ]
| None -> yield strong [] [ str g.name ]
yield rawText " &nbsp;"
]
| None -> []
@ -180,7 +180,7 @@ let private htmlHead m pageTitle =
let s = I18N.localizer.Force ()
head [] [
yield meta [ _charset "UTF-8" ]
yield title [] [ encLocText pageTitle; titleSep; encLocText s.["PrayerTracker"] ]
yield title [] [ locStr pageTitle; titleSep; locStr s.["PrayerTracker"] ]
yield! commonHead
for cssFile in m.style do
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
| Some link -> yield Help.fullLink (langCode ()) link |> helpLink
| None -> ()
yield encLocText pageTitle
yield locStr pageTitle
]
/// Render the messages that may need to be displayed to the user
@ -219,7 +219,7 @@ let private messages m =
match msg.level with
| "Info" -> ()
| lvl ->
yield strong [] [ encLocText s.[lvl] ]
yield strong [] [ locStr s.[lvl] ]
yield rawText " &#xbb; "
yield rawText msg.text.Value
match msg.description with
@ -238,25 +238,25 @@ let private htmlFooter m =
let resultTime = TimeSpan(DateTime.Now.Ticks - m.requestStart).TotalSeconds
footer [] [
div [ _id "pt-legal" ] [
a [ _href "/legal/privacy-policy" ] [ encLocText s.["Privacy Policy"] ]
a [ _href "/legal/privacy-policy" ] [ locStr s.["Privacy Policy"] ]
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; "
a [ _href "https://github.com/bit-badger/PrayerTracker"
_title s.["View source code and get technical support"].Value
_target "_blank"
_rel "noopener" ] [
encLocText s.["Source & Support"]
locStr s.["Source & Support"]
]
]
div [ _id "pt-footer" ] [
a [ _href "/"; _style "line-height:28px;" ] [
img [ _src (sprintf "/img/%O.png" s.["footer_en"]); _alt imgText; _title imgText ]
]
encodedText m.version
str m.version
space
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 "" ] [
head [] [
meta [ _charset "UTF-8" ]
title [] [ encLocText ttl; titleSep; encLocText s.["PrayerTracker"] ]
title [] [ locStr ttl; titleSep; locStr s.["PrayerTracker"] ]
]
body [] [
content

View File

@ -20,14 +20,14 @@ let edit (m : EditRequest) today ctx vi =
input [ _type "hidden"; _name "requestId"; _value (flatGuid m.requestId) ]
div [ _class "pt-field-row" ] [
yield div [ _class "pt-field" ] [
label [ _for "requestType" ] [ encLocText s.["Request Type"] ]
label [ _for "requestType" ] [ locStr s.["Request Type"] ]
ReferenceList.requestTypeList s
|> Seq.ofList
|> Seq.map (fun item -> fst item, (snd item).Value)
|> selectList "requestType" m.requestType [ _required; _autofocus ]
]
yield div [ _class "pt-field" ] [
label [ _for "requestor" ] [ encLocText s.["Requestor / Subject"] ]
label [ _for "requestor" ] [ locStr s.["Requestor / Subject"] ]
input [ _type "text"
_name "requestor"
_id "requestor"
@ -36,7 +36,7 @@ let edit (m : EditRequest) today ctx vi =
match m.isNew () with
| true ->
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 ]
]
| false ->
@ -44,21 +44,21 @@ let edit (m : EditRequest) today ctx vi =
div [ _class "pt-checkbox-field" ] [
br []
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 []
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" ] [
label [] [ encLocText s.["Expiration"] ]
label [] [ locStr s.["Expiration"] ]
ReferenceList.expirationList s ((m.isNew >> not) ())
|> List.map (fun exp ->
let radioId = sprintf "expiration_%s" (fst exp)
span [ _class "text-nowrap" ] [
radio "expiration" radioId (fst exp) m.expiration
label [ _for radioId ] [ encLocText (snd exp) ]
label [ _for radioId ] [ locStr (snd exp) ]
rawText " &nbsp; &nbsp; "
])
|> 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 pt-editor" ] [
label [ _for "text" ] [ encLocText s.["Request"] ]
textarea [ _name "text"; _id "text" ] [ encodedText m.text ]
label [ _for "text" ] [ locStr s.["Request"] ]
textarea [ _name "text"; _id "text" ] [ str m.text ]
]
]
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))
(StringBuilder ())
[ 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 ":"
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) ]
br []
br []
span [ _class "pt-email-heading" ] [ encLocText s.["Plain-Text Format"]; rawText ":" ]
div[ _class "pt-email-canvas" ] [ pre [] [ encodedText (m.asText s) ] ]
span [ _class "pt-email-heading" ] [ locStr s.["Plain-Text Format"]; rawText ":" ]
div[ _class "pt-email-canvas" ] [ pre [] [ str (m.asText s) ] ]
]
|> Layout.Content.standard
|> Layout.standard vi pageTitle
@ -132,9 +132,9 @@ let lists (grps : SmallGroup list) vi =
yield table [ _class "pt-table pt-action-table" ] [
thead [] [
tr [] [
th [] [ encLocText s.["Actions"] ]
th [] [ encLocText s.["Church"] ]
th [] [ encLocText s.["Group"] ]
th [] [ locStr s.["Actions"] ]
th [] [ locStr s.["Church"] ]
th [] [ locStr s.["Group"] ]
]
]
grps
@ -149,8 +149,8 @@ let lists (grps : SmallGroup list) vi =
[ icon "verified_user" ]
|> List.singleton
|> td []
td [] [ encodedText grp.church.name ]
td [] [ encodedText grp.name ]
td [] [ str grp.church.name ]
td [] [ str grp.name ]
])
|> tbody []
]
@ -197,11 +197,10 @@ let maintain (reqs : PrayerRequest seq) (grp : SmallGroup) onlyActive (ctx : Htt
[ icon "delete_forever" ]
]
td [ updReq req ] [
encodedText (req.updatedDate.ToString(s.["MMMM d, yyyy"].Value,
System.Globalization.CultureInfo.CurrentUICulture))
str (req.updatedDate.ToString(s.["MMMM d, yyyy"].Value, System.Globalization.CultureInfo.CurrentUICulture))
]
td [] [ encLocText typs.[req.requestType] ]
td [ reqExp req ] [ encodedText (match req.requestor with Some r -> r | None -> " ") ]
td [] [ locStr typs.[req.requestType] ]
td [ reqExp req ] [ str (match req.requestor with Some r -> r | None -> " ") ]
td [] [
yield
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" ] [
br []
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; "
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 []
]
@ -227,11 +226,11 @@ let maintain (reqs : PrayerRequest seq) (grp : SmallGroup) onlyActive (ctx : Htt
yield table [ _class "pt-table pt-action-table" ] [
thead [] [
tr [] [
th [] [ encLocText s.["Actions"] ]
th [] [ encLocText s.["Updated Date"] ]
th [] [ encLocText s.["Type"] ]
th [] [ encLocText s.["Requestor"] ]
th [] [ encLocText s.["Request"] ]
th [] [ locStr s.["Actions"] ]
th [] [ locStr s.["Updated Date"] ]
th [] [ locStr s.["Type"] ]
th [] [ locStr s.["Requestor"] ]
th [] [ locStr s.["Request"] ]
]
]
tbody [] requests
@ -240,13 +239,13 @@ let maintain (reqs : PrayerRequest seq) (grp : SmallGroup) onlyActive (ctx : Htt
yield br []
match onlyActive with
| true ->
yield encLocText s.["Inactive requests are currently not shown"]
yield locStr s.["Inactive requests are currently not shown"]
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 ->
yield encLocText s.["Inactive requests are currently shown"]
yield locStr s.["Inactive requests are currently shown"]
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 ]
]
@ -269,7 +268,7 @@ let print m version =
_alt imgAlt
_title imgAlt ]
space
encodedText version
str version
]
]
|> Layout.bare pageTitle
@ -286,7 +285,7 @@ let view m vi =
yield a [ _class "pt-icon-link"
_href (sprintf "/prayer-requests/print/%s" dtString)
_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
| true ->
@ -302,7 +301,7 @@ let view m vi =
yield a [ _class "pt-icon-link"
_href (sprintf "/prayer-requests/view/%s" (sunday.ToString "yyyy-MM-dd"))
_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
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)
_title s.["Send via E-mail"].Value
_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 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 -> ()
]

View File

@ -21,7 +21,7 @@
<ItemGroup>
<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.Http" Version="2.2.2" />
<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 div [ _class "pt-field-row" ] [
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 ] []
]
]
@ -23,12 +23,12 @@ let announcement isAdmin ctx vi =
| true ->
yield div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [
label [] [ encLocText s.["Send Announcement to"]; rawText ":" ]
label [] [ locStr s.["Send Announcement to"]; rawText ":" ]
div [ _class "pt-center-text" ] [
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"
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" ] [
div [ _class "pt-checkbox-field" ] [
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" ] [
div [ _class "pt-field" ] [
label [ _for "requestType" ] [ encLocText s.["Request Type"] ]
label [ _for "requestType" ] [ locStr s.["Request Type"] ]
reqTypes
|> Seq.ofList
|> 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
let announcementSent (m : Announcement) vi =
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 ]
br []
br []
span [ _class "pt-email-heading" ] [ encLocText s.["Plain-Text Format"]; rawText ":" ]
div [ _class "pt-email-canvas" ] [ pre [] [ encodedText (m.plainText ()) ] ]
span [ _class "pt-email-heading" ] [ locStr s.["Plain-Text Format"]; rawText ":" ]
div [ _class "pt-email-canvas" ] [ pre [] [ str (m.plainText ()) ] ]
]
|> Layout.Content.standard
|> 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) ]
div [ _class "pt-field-row" ] [
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 ]
]
]
div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [
label [ _for "churchId" ] [ encLocText s.["Church"] ]
label [ _for "churchId" ] [ locStr s.["Church"] ]
seq {
yield "", selectDefault s.["Select Church"].Value
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) ]
div [ _class "pt-field-row" ] [
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 ]
]
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 ]
]
]
div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [
label [ _for "emailType" ] [ encLocText s.["E-mail Format"] ]
label [ _for "emailType" ] [ locStr s.["E-mail Format"] ]
typs
|> Seq.map (fun typ -> fst typ, (snd typ).Value)
|> selectList "emailType" m.emailType []
@ -141,7 +141,7 @@ let logOn (grps : SmallGroup list) grpId ctx vi =
csrfToken ctx
div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [
label [ _for "smallGroupId" ] [ encLocText s.["Group"] ]
label [ _for "smallGroupId" ] [ locStr s.["Group"] ]
seq {
match grps.Length with
| 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 ]
]
div [ _class "pt-field" ] [
label [ _for "password" ] [ encLocText s.["Password"] ]
label [ _for "password" ] [ locStr s.["Password"] ]
input [ _type "password"; _name "password"; _id "password"; _required;
_placeholder (s.["Case-Sensitive"].Value.ToLower ()) ]
]
]
div [ _class "pt-checkbox-field" ] [
input [ _type "checkbox"; _name "rememberMe"; _id "rememberMe"; _value "True" ]
label [ _for "rememberMe" ] [ encLocText s.["Remember Me"] ]
label [ _for "rememberMe" ] [ locStr s.["Remember Me"] ]
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"] ]
]
@ -182,10 +182,10 @@ let maintain (grps : SmallGroup list) ctx vi =
table [ _class "pt-table pt-action-table" ] [
thead [] [
tr [] [
th [] [ encLocText s.["Actions"] ]
th [] [ encLocText s.["Name"] ]
th [] [ encLocText s.["Church"] ]
th [] [ encLocText s.["Time Zone"] ]
th [] [ locStr s.["Actions"] ]
th [] [ locStr s.["Name"] ]
th [] [ locStr s.["Church"] ]
th [] [ locStr s.["Time Zone"] ]
]
]
grps
@ -202,9 +202,9 @@ let maintain (grps : SmallGroup list) ctx vi =
_onclick (sprintf "return PT.confirmDelete('%s','%s')" delAction delPrompt) ]
[ icon "delete_forever" ]
]
td [] [ encodedText g.name ]
td [] [ encodedText g.church.name ]
td [] [ encLocText (TimeZones.name g.preferences.timeZoneId s) ]
td [] [ str g.name ]
td [] [ str g.church.name ]
td [] [ locStr (TimeZones.name g.preferences.timeZoneId s) ]
])
|> 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 ] [
icon "add_circle"
rawText " &nbsp;"
encLocText s.["Add a New Group"]
locStr s.["Add a New Group"]
]
br []
br []
@ -236,10 +236,10 @@ let members (mbrs : Member list) (emailTyps : Map<string, LocalizedString>) ctx
table [ _class "pt-table pt-action-table" ] [
thead [] [
tr [] [
th [] [ encLocText s.["Actions"] ]
th [] [ encLocText s.["Name"] ]
th [] [ encLocText s.["E-mail Address"] ]
th [] [ encLocText s.["Format"] ]
th [] [ locStr s.["Actions"] ]
th [] [ locStr s.["Name"] ]
th [] [ locStr s.["E-mail Address"] ]
th [] [ locStr s.["Format"] ]
]
]
mbrs
@ -257,16 +257,16 @@ let members (mbrs : Member list) (emailTyps : Map<string, LocalizedString>) ctx
_onclick (sprintf "return PT.confirmDelete('%s','%s')" delAction delPrompt) ]
[ icon "delete_forever" ]
]
td [] [ encodedText mbr.memberName ]
td [] [ encodedText mbr.email ]
td [] [ encLocText emailTyps.[defaultArg mbr.format ""] ]
td [] [ str mbr.memberName ]
td [] [ str mbr.email ]
td [] [ locStr emailTyps.[defaultArg mbr.format ""] ]
])
|> tbody []
]
[ div [ _class"pt-center-text" ] [
br []
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 []
]
@ -287,52 +287,52 @@ let overview m vi =
section [] [
header [ _role "heading" ] [
iconSized 72 "bookmark_border"
encLocText s.["Quick Actions"]
locStr s.["Quick Actions"]
]
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 []
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 []
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 [] [
header [ _role "heading" ] [
iconSized 72 "question_answer"
encLocText s.["Prayer Requests"]
locStr s.["Prayer Requests"]
]
div [] [
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 []
for cat in m.activeReqsByCat do
yield encodedText (cat.Value.ToString "N0")
yield str (cat.Value.ToString "N0")
yield space
yield encLocText typs.[cat.Key]
yield locStr typs.[cat.Key]
yield br []
yield br []
yield encodedText (m.allReqs.ToString "N0")
yield str (m.allReqs.ToString "N0")
yield space
yield encLocText s.["Total Requests"]
yield locStr s.["Total Requests"]
yield hr []
yield a [ _href "/prayer-requests/maintain" ] [
icon "compare_arrows"
linkSpacer
encLocText s.["Maintain Prayer Requests"]
locStr s.["Maintain Prayer Requests"]
]
]
]
section [] [
header [ _role "heading" ] [
iconSized 72 "people_outline"
encLocText s.["Group Members"]
locStr s.["Group Members"]
]
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 []
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%; } }" ]
csrfToken ctx
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" ] [
label [ _for "expireDays" ] [ encLocText s.["Requests Expire After"] ]
label [ _for "expireDays" ] [ locStr s.["Requests Expire After"] ]
span [] [
input [ _type "number"; _name "expireDays"; _id "expireDays"; _min "1"; _max "30"; _required; _autofocus
_value (string m.expireDays) ]
space; encodedText (s.["Days"].Value.ToLower ())
space; str (s.["Days"].Value.ToLower ())
]
]
div [ _class "pt-field" ] [
label [ _for "daysToKeepNew" ] [ encLocText s.["Requests “New” For"] ]
label [ _for "daysToKeepNew" ] [ locStr s.["Requests “New” For"] ]
span [] [
input [ _type "number"; _name "daysToKeepNew"; _id "daysToKeepNew"; _min "1"; _max "30"; _required
_value (string m.daysToKeepNew) ]
space; encodedText (s.["Days"].Value.ToLower ())
space; str (s.["Days"].Value.ToLower ())
]
]
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 [] [
input [ _type "number"; _name "longTermUpdateWeeks"; _id "longTermUpdateWeeks"; _min "1"; _max "30"
_required; _value (string m.longTermUpdateWeeks) ]
space; encodedText (s.["Weeks"].Value.ToLower ())
space; str (s.["Weeks"].Value.ToLower ())
]
]
]
]
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
label [ _for "requestSort_D" ] [ encLocText s.["Sort by Last Updated Date"] ]
label [ _for "requestSort_D" ] [ locStr s.["Sort by Last Updated Date"] ]
rawText " &nbsp; "
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 [] [
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" ] [
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 ]
]
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
_value m.emailFromAddress ]
]
]
div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [
label [ _for "defaultEmailType" ] [ encLocText s.["E-mail Format"] ]
label [ _for "defaultEmailType" ] [ locStr s.["E-mail Format"] ]
seq {
yield "", selectDefault s.["Select"].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 [] [
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" ] [
label [ _class "pt-center-text" ] [ encLocText s.["Color of Heading Lines"] ]
label [ _class "pt-center-text" ] [ locStr s.["Color of Heading Lines"] ]
span [] [
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
[ yield _id "headingLineColor_Select"
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
label [ _for "headingLineType_RGB" ] [ encLocText s.["Custom Color"] ]
label [ _for "headingLineType_RGB" ] [ locStr s.["Custom Color"] ]
input [ yield _type "color"
yield _name "headingLineColor"
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" ] [
label [ _class "pt-center-text" ] [ encLocText s.["Color of Heading Text"] ]
label [ _class "pt-center-text" ] [ locStr s.["Color of Heading Text"] ]
span [] [
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
[ yield _id "headingTextColor_Select"
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
label [ _for "headingTextType_RGB" ] [ encLocText s.["Custom Color"] ]
label [ _for "headingTextType_RGB" ] [ locStr s.["Custom Color"] ]
input [ yield _type "color"
yield _name "headingTextColor"
yield _id "headingTextColor_Color"
@ -455,29 +455,29 @@ let preferences (m : EditPreferences) (tzs : TimeZone list) ctx vi =
]
]
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" ] [
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 ]
]
div [ _class "pt-field-row" ] [
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
_value (string m.headingFontSize) ]
]
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
_value (string m.listFontSize) ]
]
]
]
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" ] [
label [ _for "TimeZone" ] [ encLocText s.["Time Zone"] ]
label [ _for "TimeZone" ] [ locStr s.["Time Zone"] ]
seq {
yield "", selectDefault s.["Select"].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" ] [
label [] [ encLocText s.["Request List Visibility"] ]
label [] [ locStr s.["Request List Visibility"] ]
span [] [
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;"
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;"
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"
@ -504,7 +504,7 @@ let preferences (m : EditPreferences) (tzs : TimeZone list) ctx vi =
| false -> yield _class "pt-field-row pt-fadeable"
] [
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";
_value (match m.groupPassword with Some x -> x | None -> "") ]
]

View File

@ -16,7 +16,7 @@ let assignGroups m groups curGroups ctx vi =
thead [] [
tr [] [
th [] [ rawText "&nbsp;" ]
th [] [ encLocText s.["Group"] ]
th [] [ locStr s.["Group"] ]
]
]
groups
@ -30,7 +30,7 @@ let assignGroups m groups curGroups ctx vi =
yield _value grpId
match curGroups |> List.contains grpId with true -> yield _checked | false -> () ]
]
td [] [ label [ _for inputId ] [ encodedText grpName ] ]
td [] [ label [ _for inputId ] [ str grpName ] ]
])
|> tbody []
]
@ -45,7 +45,7 @@ let assignGroups m groups curGroups ctx vi =
let changePassword ctx vi =
let s = I18N.localizer.Force ()
[ 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"
_method "post"
@ -54,13 +54,13 @@ let changePassword ctx vi =
csrfToken ctx
div [ _class "pt-field-row" ] [
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 ]
]
]
div [ _class "pt-field-row" ] [
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 ]
]
div [ _class "pt-field" ] [
@ -91,25 +91,25 @@ let edit (m : EditUser) ctx vi =
input [ _type "hidden"; _name "userId"; _value (flatGuid m.userId) ]
div [ _class "pt-field-row" ] [
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 ]
]
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 ]
]
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 ]
]
]
div [ _class "pt-field-row" ] [
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 ]
]
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 ]
]
]
@ -119,7 +119,7 @@ let edit (m : EditUser) ctx vi =
yield _id "isAdmin"
yield _value "True"
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"] ]
]
@ -138,18 +138,18 @@ let logOn (m : UserLogOn) groups ctx vi =
input [ _type "hidden"; _name "redirectUrl"; _value (defaultArg m.redirectUrl "") ]
div [ _class "pt-field-row" ] [
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 ]
]
div [ _class "pt-field" ] [
label [ _for "password" ] [ encLocText s.["Password"] ]
label [ _for "password" ] [ locStr s.["Password"] ]
input [ _type "password"; _name "password"; _id "password"; _required;
_placeholder (sprintf "(%s)" (s.["Case-Sensitive"].Value.ToLower ())) ]
]
]
div [ _class "pt-field-row" ] [
div [ _class "pt-field" ] [
label [ _for "smallGroupId" ] [ encLocText s.["Group"] ]
label [ _for "smallGroupId" ] [ locStr s.["Group"] ]
seq {
yield "", selectDefault s.["Select Group"].Value
yield! groups
@ -160,9 +160,9 @@ let logOn (m : UserLogOn) groups ctx vi =
]
div [ _class "pt-checkbox-field" ] [
input [ _type "checkbox"; _name "rememberMe"; _id "rememberMe"; _value "True" ]
label [ _for "rememberMe" ] [ encLocText s.["Remember Me"] ]
label [ _for "rememberMe" ] [ locStr s.["Remember Me"] ]
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"] ]
]
@ -181,9 +181,9 @@ let maintain (users : User list) ctx vi =
table [ _class "pt-table pt-action-table" ] [
thead [] [
tr [] [
th [] [ encLocText s.["Actions"] ]
th [] [ encLocText s.["Name"] ]
th [] [ encLocText s.["Admin?"] ]
th [] [ locStr s.["Actions"] ]
th [] [ locStr s.["Name"] ]
th [] [ locStr s.["Admin?"] ]
]
]
users
@ -202,11 +202,11 @@ let maintain (users : User list) ctx vi =
_onclick (sprintf "return PT.confirmDelete('%s','%s')" delAction delPrompt) ]
[ icon "delete_forever" ]
]
td [] [ encodedText user.fullName ]
td [] [ str user.fullName ]
td [ _class "pt-center-text" ] [
match user.isAdmin with
| true -> yield strong [] [ encLocText s.["Yes"] ]
| false -> yield encLocText s.["No"]
| true -> yield strong [] [ locStr s.["Yes"] ]
| false -> yield locStr s.["No"]
]
])
|> tbody []
@ -214,7 +214,7 @@ let maintain (users : User list) ctx vi =
[ div [ _class "pt-center-text" ] [
br []
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 []
]

View File

@ -548,13 +548,13 @@ with
| true ->
yield div [ _style (sprintf "text-align:center;font-family:%s" prefs.listFonts) ] [
span [ _style (sprintf "font-size:%ipt;" prefs.headingFontSize) ] [
strong [] [ encodedText s.["Prayer Requests"].Value ]
strong [] [ str s.["Prayer Requests"].Value ]
]
br []
span [ _style (sprintf "font-size:%ipt;" prefs.textFontSize) ] [
strong [] [ encodedText this.listGroup.name ]
strong [] [ str this.listGroup.name ]
br []
encodedText (this.date.ToString s.["MMMM d, yyyy"].Value)
str (this.date.ToString s.["MMMM d, yyyy"].Value)
]
]
yield br []
@ -572,7 +572,7 @@ with
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;"
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) ] [
match req.requestor with
| Some rqstr when rqstr <> "" ->
yield strong [] [ encodedText rqstr ]
yield strong [] [ str rqstr ]
yield rawText " &mdash; "
| Some _ -> ()
| None -> ()

View File

@ -30,7 +30,7 @@
<PackageReference Include="Giraffe" Version="3.6.0" />
<PackageReference Include="Giraffe.TokenRouter" Version="1.0.0" />
<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" />
</ItemGroup>