Daniel J. Summers c7bda8eb28 WIP on log on
- Add anti-CSRF tokens to forms
- WIP on toast notifications
2023-01-08 16:19:25 -05:00

16 lines
509 B
Forth

[<AutoOpen>]
module JobsJobsJobs.Views.Common
open Giraffe.ViewEngine
open Microsoft.AspNetCore.Antiforgery
/// Create an audio clip with the specified text node
let audioClip clip text =
span [ _class "jjj-audio-clip"; _onclick "jjj.playFile(this)" ] [
text; audio [ _id clip ] [ source [ _src $"/audio/{clip}.mp3" ] ]
]
/// Create an anti-forgery hidden input
let antiForgery (csrf : AntiforgeryTokenSet) =
input [ _type "hidden"; _name csrf.FormFieldName; _value csrf.RequestToken ]