diff --git a/.vscode/settings.json b/.vscode/settings.json index 4a664bb..e5b97c9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,11 @@ { - "editor.tabSize": 2, - "editor.detectIndentation": false, - "editor.insertSpaces": false + "editor.tabSize": 2, + "editor.detectIndentation": false, + "editor.insertSpaces": false, + "files.associations": { + "*.html": "twig" + }, + "emmet.includeLanguages": { + "twig": "html" + }, } \ No newline at end of file diff --git a/controllers/home.go b/controllers/home.go index 161c08e..01b46df 100644 --- a/controllers/home.go +++ b/controllers/home.go @@ -6,5 +6,5 @@ func Homepage(c *fiber.Ctx) error { return c.Render("index", fiber.Map{ "PageTitle": "Accueil", "Title": "Hello, World!", - }, "layouts/main") + }) } diff --git a/controllers/login.go b/controllers/login.go index 3e3bcf0..75a058e 100644 --- a/controllers/login.go +++ b/controllers/login.go @@ -14,7 +14,7 @@ import ( func LoginForm(c *fiber.Ctx) error { return c.Render("login", fiber.Map{ "PageTitle": "Connexion", - }, "layouts/main") + }) } func LoginProcess(c *fiber.Ctx) error { @@ -50,7 +50,7 @@ func LoginProcess(c *fiber.Ctx) error { return c.Render("login", fiber.Map{ "PageTitle": "Connexion", "LoginError": "Email ou mot de passe incorrect", - }, "layouts/main") + }) } sess.Set("userid", user.ID) diff --git a/controllers/mfa.go b/controllers/mfa.go index 148bde8..d356460 100644 --- a/controllers/mfa.go +++ b/controllers/mfa.go @@ -75,5 +75,5 @@ func TotpEnrollPage(c *fiber.Ctx) error { "PageTitle": "Enregistrement multifacteur", "QrCode": imgBase64, "Secret": key.Secret(), - }, "layouts/main") + }) } diff --git a/controllers/welcome.go b/controllers/welcome.go index 8495506..0f03455 100644 --- a/controllers/welcome.go +++ b/controllers/welcome.go @@ -2,7 +2,6 @@ package controllers import ( "fmt" - "strings" "git.readonly.ch/bouzoure/popvaud-people/helpers" "git.readonly.ch/bouzoure/popvaud-people/models" @@ -109,6 +108,6 @@ func WelcomePage(c *fiber.Ctx) error { "Email": user.Email, "Name": user.Name, "EmailUpdate": emailUpdate, - "FormErrors": strings.Join(formErrors, "
"), - }, "layouts/main") + "FormErrors": formErrors, + }) } diff --git a/go.mod b/go.mod index 381124a..71deaa6 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.23.4 require ( github.com/glebarez/sqlite v1.11.0 + github.com/go-playground/validator v9.31.0+incompatible github.com/gofiber/fiber/v2 v2.52.5 github.com/gofiber/storage/badger/v2 v2.0.1 github.com/gofiber/template/pug/v2 v2.1.7 @@ -15,9 +16,11 @@ require ( ) require ( + github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect + github.com/CloudyKit/jet/v6 v6.2.0 // indirect github.com/Joker/hpp v1.0.0 // indirect github.com/Joker/jade v1.1.3 // indirect - github.com/andybalholm/brotli v1.0.5 // indirect + github.com/andybalholm/brotli v1.1.0 // indirect github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -25,11 +28,13 @@ require ( github.com/dgraph-io/badger/v3 v3.2103.5 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/flosch/pongo2/v6 v6.0.0 // indirect github.com/glebarez/go-sqlite v1.21.2 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator v9.31.0+incompatible // indirect github.com/gofiber/template v1.8.3 // indirect + github.com/gofiber/template/django/v3 v3.1.12 // indirect + github.com/gofiber/template/jet/v2 v2.1.10 // indirect github.com/gofiber/utils v1.1.0 // indirect github.com/gofiber/utils/v2 v2.0.0-beta.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -39,6 +44,7 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/golobby/cast v1.3.3 // indirect github.com/google/flatbuffers v23.5.26+incompatible // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/klauspost/compress v1.17.2 // indirect @@ -54,10 +60,11 @@ require ( github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.33.0 // indirect + gopkg.in/go-playground/assert.v1 v1.2.1 // indirect modernc.org/libc v1.22.5 // indirect modernc.org/mathutil v1.5.0 // indirect modernc.org/memory v1.5.0 // indirect diff --git a/go.sum b/go.sum index 056499b..df6c1ad 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,17 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= +github.com/CloudyKit/jet/v6 v6.2.0 h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME= +github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4= github.com/Joker/hpp v1.0.0 h1:65+iuJYdRXv/XyN62C1uEmmOx3432rNG/rKlX6V7Kkc= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Joker/jade v1.1.3 h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk= github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= -github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= +github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= @@ -41,6 +45,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/flosch/pongo2/v6 v6.0.0 h1:lsGru8IAzHgIAw6H2m4PCyleO58I40ow6apih0WprMU= +github.com/flosch/pongo2/v6 v6.0.0/go.mod h1:CuDpFm47R0uGGE7z13/tTlt1Y6zdxvr2RLT5LJhsHEU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo= github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k= @@ -58,6 +64,10 @@ github.com/gofiber/storage/badger/v2 v2.0.1 h1:iIB5Dh2dypJjdEruYgBf7H4l5a98R5pVK github.com/gofiber/storage/badger/v2 v2.0.1/go.mod h1:2LA5uR3q4xFVd0oXIZWK+7yzlO2vzLa/D062R7fowFI= github.com/gofiber/template v1.8.3 h1:hzHdvMwMo/T2kouz2pPCA0zGiLCeMnoGsQZBTSYgZxc= github.com/gofiber/template v1.8.3/go.mod h1:bs/2n0pSNPOkRa5VJ8zTIvedcI/lEYxzV3+YPXdBvq8= +github.com/gofiber/template/django/v3 v3.1.12 h1:w2jxm9bJajhvrroXqEmUmakbvDSlzjpHgOI8yyh2iJs= +github.com/gofiber/template/django/v3 v3.1.12/go.mod h1:4YNpM+LJ/el+cjUpdulp8lOH6dxZ2jaQmrF4E2/KGAk= +github.com/gofiber/template/jet/v2 v2.1.10 h1:FRmpHeHAh0+H/eUdIKiEGzg3c93lCs29o73rKuHl/sI= +github.com/gofiber/template/jet/v2 v2.1.10/go.mod h1:QeUnwUkq/VAhbhSJZCNlgH4VxwPE4g3WqztzrP1oQJo= github.com/gofiber/template/pug/v2 v2.1.7 h1:KFvCNq7huc8TLMcfCSxMljloqtiXOGmqzpKl4PaBUfk= github.com/gofiber/template/pug/v2 v2.1.7/go.mod h1:9hAsWmaNUHOTTdG2+ITer100tGtICjzfL3yRCugW8hM= github.com/gofiber/utils v1.1.0 h1:vdEBpn7AzIUJRhe+CiTOJdUcTg4Q9RK+pEa0KPbLdrM= @@ -104,8 +114,9 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -215,8 +226,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -258,7 +269,6 @@ golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -288,6 +298,8 @@ google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHh gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/main.go b/main.go index e9424e0..f7de8ff 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( "git.readonly.ch/bouzoure/popvaud-people/middlewares" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/filesystem" - "github.com/gofiber/template/pug/v2" + "github.com/gofiber/template/django/v3" ) //go:embed static/* @@ -49,9 +49,9 @@ func main() { } // Create a new engine - var engine *pug.Engine + var engine *django.Engine if config.Debug { - engine = pug.New("./views", ".pug") + engine = django.New("./views", ".html") engine.ShouldReload = true } else { embedViews2, err := fs.Sub(embedViews, "views") @@ -59,9 +59,9 @@ func main() { log.Fatal(err) } - engine = pug.NewFileSystem( + engine = django.NewFileSystem( http.FS(embedViews2), - ".pug", + ".html", ) } diff --git a/static/events.js b/static/events.js deleted file mode 100644 index a31bc8b..0000000 --- a/static/events.js +++ /dev/null @@ -1,4 +0,0 @@ -$(document).ready(function() { - var elem = $("#totp-enroll-image img"); - $(elem).attr("src", $(elem).data("image")); -}); \ No newline at end of file diff --git a/views/index.html b/views/index.html new file mode 100644 index 0000000..fe28694 --- /dev/null +++ b/views/index.html @@ -0,0 +1,5 @@ +{% extends "layouts/main.html" %} + +{% block main %} +

Home

+{% endblock %} diff --git a/views/index.pug b/views/index.pug deleted file mode 100644 index 011b105..0000000 --- a/views/index.pug +++ /dev/null @@ -1,5 +0,0 @@ -include partials/header.pug - -h1 #{.Title} - -include partials/footer.pug \ No newline at end of file diff --git a/views/layouts/main.html b/views/layouts/main.html new file mode 100644 index 0000000..1729361 --- /dev/null +++ b/views/layouts/main.html @@ -0,0 +1,38 @@ + + + + + + + {% set PageTitleSuffix = "Camarades | POP Vaud" %} + {% if PageTitle %} + {{ PageTitle }} | {{ PageTitleSuffix }} + {% else %} + {{ PageTitleSuffix }} + {% endif %} + + + + + {% block stylesheet %}{% endblock %} + + + {% block header %} + {% include "partials/header.html" %} + {% endblock %} + + {% block main %} + + {% endblock %} + + + + + + {% block javascript %}{% endblock %} + + diff --git a/views/layouts/main.pug b/views/layouts/main.pug deleted file mode 100644 index 4f00e83..0000000 --- a/views/layouts/main.pug +++ /dev/null @@ -1,20 +0,0 @@ -doctype html -html(lang="fr", data-bs-theme="dark") - head - if .PageTitle - title #{.PageTitle} - People - POP Vaud - else - title People - POP Vaud - - meta(name="viewport" content="width=device-width, initial-scale=1") - link(rel="icon", href="/static/images/favicon.jpg") - link(rel="stylesheet", href="/static/bootstrap/css/bootstrap.min.css") - link(rel="stylesheet", href="/static/main.css") - body - | {{embed}} - - script(src="/static/jquery/jquery.min.js") - script(src="/static/bootstrap/js/bootstrap.bundle.min.js") - script(src="/static/feather/dist/feather.min.js") - script feather.replace(); - script(src="/static/events.js") diff --git a/views/login.html b/views/login.html new file mode 100644 index 0000000..1b0e805 --- /dev/null +++ b/views/login.html @@ -0,0 +1,53 @@ +{% extends "layouts/main.html" %} + +{% block main %} +
+
+
+
+ Authentification +
+
+ {% if LoginError %} +
+ {{ LoginError }} +
+ {% endif %} + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+
+{% endblock %} diff --git a/views/login.pug b/views/login.pug deleted file mode 100644 index feff70d..0000000 --- a/views/login.pug +++ /dev/null @@ -1,22 +0,0 @@ -include partials/header.pug - -.container - #login-card.my-5 - .card - .card-header - | Authentification - .card-body - if .LoginError - .alert.alert-danger - | #{.LoginError} - form#login(method="post") - .mb-3 - label.form-label(for="email") Adresse email - input#email.form-control(type="email", required, name="email") - .mb-3 - label.form-label(for="password") Mot de passe - input#password.form-control(type="password", required, name="password") - .mt-3.text-end - button.btn.btn-primary(type="submit") - i.me-2(data-feather="log-in") - | Connexion diff --git a/views/partials/footer.pug b/views/partials/footer.pug deleted file mode 100644 index 3715699..0000000 --- a/views/partials/footer.pug +++ /dev/null @@ -1 +0,0 @@ -h2 Footer diff --git a/views/partials/header.html b/views/partials/header.html new file mode 100644 index 0000000..ce19c31 --- /dev/null +++ b/views/partials/header.html @@ -0,0 +1,13 @@ + diff --git a/views/partials/header.pug b/views/partials/header.pug deleted file mode 100644 index 41c1e12..0000000 --- a/views/partials/header.pug +++ /dev/null @@ -1,5 +0,0 @@ -nav.navbar.bg-body-tertiary - div.container - a.navbar-brand(href="/") - img#header-logo.me-1(src="/static/images/logo.jpg", alt="Logo") - | Gestion membres diff --git a/views/totp_enroll.html b/views/totp_enroll.html new file mode 100644 index 0000000..7a4e3a8 --- /dev/null +++ b/views/totp_enroll.html @@ -0,0 +1,60 @@ +{% extends "layouts/main.html" %} + +{% block main %} +
+
+
+
+ Vérification multifacteur (TOTP) +
+
+ {% if MfaError %} +
+ {{ MfaError }} +
+ {% endif %} + +
+ Code QR +
+ +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+
+{% endblock %} diff --git a/views/totp_enroll.pug b/views/totp_enroll.pug deleted file mode 100644 index 56e14ff..0000000 --- a/views/totp_enroll.pug +++ /dev/null @@ -1,24 +0,0 @@ -include partials/header.pug - -.container - #login-card.my-5 - .card - .card-header - | Vérification multifacteur (TOTP) - .card-body - if .MfaError - .alert.alert-danger - | #{.MfaError} - #totp-enroll-image.text-center.my-3 - img(data-image=.QrCode) - form#login(method="post") - .mb-3 - label.form-label(for="secret") Secret (si pas possible de scanner le code QR) - input#secret.form-control(type="text", value!=.Secret, disabled) - .mb-3 - label.form-label(for="otp") Code temporaire - input#otp.form-control(type="text", required, name="otp", placeholder="000000" pattern="[0-9]{6}") - .mt-3.text-end - button.btn.btn-primary(type="submit") - i.me-2(data-feather="check-circle") - | Vérifier diff --git a/views/welcome.html b/views/welcome.html new file mode 100644 index 0000000..023fb6b --- /dev/null +++ b/views/welcome.html @@ -0,0 +1,94 @@ +{% extends "layouts/main.html" %} + +{% block main %} +
+
+
+
+ Paramètres du compte +
+
+ {% if FormErrors %} +
+
    + {% for error in FormErrors %} +
  • {{ error }}
  • + {% endfor %} +
+
+ {% endif %} + +
+
+ + {% if EmailUpdate %} + + {% else %} + + {% endif %} +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+
+{% endblock %} diff --git a/views/welcome.pug b/views/welcome.pug deleted file mode 100644 index 7c4a836..0000000 --- a/views/welcome.pug +++ /dev/null @@ -1,31 +0,0 @@ -include partials/header.pug - -.container - #login-card.my-5 - .card - .card-header - | Paramètres du compte - .card-body - if .FormErrors - .alert.alert-danger - | #{.FormErrors} - form#login(method="post") - .mb-3 - label.form-label(for="email") Adresse email - if .EmailUpdate - input#email.form-control(type="email", required, name="email", value=.Email) - else - input#email.form-control(type="text", disabled, name="email", value=.Email) - .mb-3 - label.form-label(for="name") Nom complet - input#name.form-control(type="text", required, name="name", value=.Name) - .mb-3 - label.form-label(for="password") Nouveau mot de passe - input#password.form-control(type="password", required, name="password") - .mb-3 - label.form-label(for="password-verify") Vérifier le mot de passe - input#password-verify.form-control(type="password", required, name="password-verify") - .mt-3.text-end - button.btn.btn-primary(type="submit") - i.me-2(data-feather="save") - | Enregistrer