Big refactoring of PARCOURSMOB - Initial commit
This commit is contained in:
commit
7225d027c9
|
@ -0,0 +1,3 @@
|
||||||
|
config.yaml
|
||||||
|
.vscode
|
||||||
|
__debug_bin
|
|
@ -0,0 +1,3 @@
|
||||||
|
# PARCOURSMOB
|
||||||
|
|
||||||
|
The PARCOURSMOB inclusive mobility platform.
|
|
@ -0,0 +1,41 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ReadConfig() (*viper.Viper, error) {
|
||||||
|
defaults := map[string]any{
|
||||||
|
"service_name": "PARCOURSMOB",
|
||||||
|
"templates": map[string]any{
|
||||||
|
"dir": "templates/default",
|
||||||
|
"public_dir": "template/default/public",
|
||||||
|
},
|
||||||
|
"server": map[string]any{
|
||||||
|
"listen": "0.0.0.0:9000",
|
||||||
|
},
|
||||||
|
"identification": map[string]any{
|
||||||
|
"sessions": map[string]any{
|
||||||
|
"store": "cookie",
|
||||||
|
"session_key": "SESSION_KEY",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"geo": map[string]any{
|
||||||
|
"pelias": map[string]any{
|
||||||
|
"url": "https://geocode.ridygo.fr",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
v := viper.New()
|
||||||
|
for key, value := range defaults {
|
||||||
|
v.SetDefault(key, value)
|
||||||
|
}
|
||||||
|
v.SetConfigName("config")
|
||||||
|
v.AddConfigPath(".")
|
||||||
|
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||||
|
v.AutomaticEnv()
|
||||||
|
err := v.ReadInConfig()
|
||||||
|
return v, err
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
module git.coopgo.io/coopgo-apps/parcoursmob
|
||||||
|
|
||||||
|
go 1.18
|
||||||
|
|
||||||
|
replace git.coopgo.io/coopgo-platform/mobility-accounts => ../../coopgo-platform/mobility-accounts/
|
||||||
|
|
||||||
|
replace git.coopgo.io/coopgo-platform/groups-management => ../../coopgo-platform/groups-management/
|
||||||
|
|
||||||
|
require (
|
||||||
|
git.coopgo.io/coopgo-platform/groups-management v0.0.0-00010101000000-000000000000
|
||||||
|
git.coopgo.io/coopgo-platform/mobility-accounts v0.0.0-00010101000000-000000000000
|
||||||
|
github.com/coreos/go-oidc v2.2.1+incompatible
|
||||||
|
github.com/fogleman/gg v1.3.0
|
||||||
|
github.com/go-playground/validator/v10 v10.11.0
|
||||||
|
github.com/google/uuid v1.3.0
|
||||||
|
github.com/gorilla/mux v1.8.0
|
||||||
|
github.com/gorilla/sessions v1.2.1
|
||||||
|
github.com/spf13/viper v1.12.0
|
||||||
|
go.etcd.io/etcd/client/v3 v3.5.4
|
||||||
|
golang.org/x/image v0.0.0-20220722155232-062f8c9fd539
|
||||||
|
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
|
||||||
|
google.golang.org/grpc v1.48.0
|
||||||
|
google.golang.org/protobuf v1.28.1
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/coreos/go-semver v0.3.0 // indirect
|
||||||
|
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
||||||
|
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
||||||
|
github.com/go-playground/locales v0.14.0 // indirect
|
||||||
|
github.com/go-playground/universal-translator v0.18.0 // indirect
|
||||||
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||||
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
|
github.com/golang/snappy v0.0.1 // indirect
|
||||||
|
github.com/gorilla/securecookie v1.1.1 // indirect
|
||||||
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
|
github.com/klauspost/compress v1.13.6 // indirect
|
||||||
|
github.com/leodido/go-urn v1.2.1 // indirect
|
||||||
|
github.com/magiconair/properties v1.8.6 // indirect
|
||||||
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
|
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
|
||||||
|
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/pquerna/cachecontrol v0.1.0 // indirect
|
||||||
|
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
|
||||||
|
github.com/spf13/afero v1.8.2 // indirect
|
||||||
|
github.com/spf13/cast v1.5.0 // indirect
|
||||||
|
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||||
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
|
github.com/subosito/gotenv v1.3.0 // indirect
|
||||||
|
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||||
|
github.com/xdg-go/scram v1.1.1 // indirect
|
||||||
|
github.com/xdg-go/stringprep v1.0.3 // indirect
|
||||||
|
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||||
|
go.etcd.io/etcd/api/v3 v3.5.4 // indirect
|
||||||
|
go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect
|
||||||
|
go.mongodb.org/mongo-driver v1.10.1 // indirect
|
||||||
|
go.uber.org/atomic v1.7.0 // indirect
|
||||||
|
go.uber.org/multierr v1.6.0 // indirect
|
||||||
|
go.uber.org/zap v1.17.0 // indirect
|
||||||
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
|
||||||
|
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect
|
||||||
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
|
||||||
|
golang.org/x/text v0.3.7 // indirect
|
||||||
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
|
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect
|
||||||
|
gopkg.in/ini.v1 v1.66.4 // indirect
|
||||||
|
gopkg.in/square/go-jose.v2 v2.5.2-0.20210529014059-a5c7eec3c614 // indirect
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
|
)
|
|
@ -0,0 +1,695 @@
|
||||||
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||||
|
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||||
|
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||||
|
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||||
|
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||||
|
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||||
|
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||||
|
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
|
||||||
|
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||||
|
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
|
||||||
|
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
|
||||||
|
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
|
||||||
|
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
|
||||||
|
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||||
|
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
||||||
|
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
||||||
|
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
|
||||||
|
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||||
|
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||||
|
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||||
|
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||||
|
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||||
|
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||||
|
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||||
|
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||||
|
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||||
|
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||||
|
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||||
|
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
|
||||||
|
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||||
|
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
||||||
|
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||||
|
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||||
|
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||||
|
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||||
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
|
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
|
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
|
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
|
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
|
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||||
|
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||||
|
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||||
|
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||||
|
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||||
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
|
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
|
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||||
|
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||||
|
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||||
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
|
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||||
|
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||||
|
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||||
|
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
|
||||||
|
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||||
|
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||||
|
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||||
|
github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk=
|
||||||
|
github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
|
||||||
|
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
|
||||||
|
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||||
|
github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
|
||||||
|
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||||
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||||
|
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/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
|
||||||
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
|
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
|
||||||
|
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
|
||||||
|
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
|
||||||
|
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
|
||||||
|
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
|
||||||
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
|
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||||
|
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||||
|
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||||
|
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||||
|
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||||
|
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||||
|
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
|
||||||
|
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||||
|
github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
|
||||||
|
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
|
||||||
|
github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
|
||||||
|
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
|
||||||
|
github.com/go-playground/validator/v10 v10.11.0 h1:0W+xRM511GY47Yy3bZUbJVitCNg2BOGlCyvTqsp/xIw=
|
||||||
|
github.com/go-playground/validator/v10 v10.11.0/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=
|
||||||
|
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||||
|
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
|
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
|
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||||
|
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||||
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
|
||||||
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
||||||
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
|
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||||
|
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
|
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
|
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
|
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||||
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||||
|
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||||
|
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||||
|
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||||
|
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||||
|
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||||
|
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||||
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
|
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||||
|
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
|
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
|
||||||
|
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
|
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
|
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
|
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||||
|
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
|
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
|
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.2/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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
|
||||||
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
|
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
|
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
|
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||||
|
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||||
|
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
|
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
|
||||||
|
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
|
||||||
|
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||||
|
github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
|
||||||
|
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
||||||
|
github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
|
||||||
|
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
|
||||||
|
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||||
|
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||||
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
|
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
|
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
|
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||||
|
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||||
|
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
|
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
|
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||||
|
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||||
|
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||||
|
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||||
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
|
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
|
||||||
|
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||||
|
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||||
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
|
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||||
|
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||||
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
|
||||||
|
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
|
||||||
|
github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
|
||||||
|
github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||||
|
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||||
|
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||||
|
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0=
|
||||||
|
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||||
|
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
|
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
|
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
|
||||||
|
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU=
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
|
||||||
|
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||||
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8cTqKc=
|
||||||
|
github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI=
|
||||||
|
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||||
|
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||||
|
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
|
||||||
|
github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
|
||||||
|
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||||
|
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
|
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
|
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
|
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||||
|
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||||
|
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
|
||||||
|
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||||
|
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||||
|
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||||
|
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||||
|
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||||
|
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||||
|
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||||
|
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
|
||||||
|
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
|
||||||
|
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE=
|
||||||
|
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0=
|
||||||
|
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||||
|
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||||
|
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||||
|
github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
|
||||||
|
github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
|
||||||
|
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
|
||||||
|
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
|
||||||
|
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||||
|
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||||
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ=
|
||||||
|
github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI=
|
||||||
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
|
||||||
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI=
|
||||||
|
github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs=
|
||||||
|
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
|
||||||
|
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||||
|
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||||
|
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||||
|
github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E=
|
||||||
|
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
|
||||||
|
github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs=
|
||||||
|
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
|
||||||
|
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
|
||||||
|
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
|
||||||
|
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
|
go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc=
|
||||||
|
go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
|
||||||
|
go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg=
|
||||||
|
go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
|
||||||
|
go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4=
|
||||||
|
go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY=
|
||||||
|
go.mongodb.org/mongo-driver v1.10.1 h1:NujsPveKwHaWuKUer/ceo9DzEe7HIj1SlJ6uvXZG0S4=
|
||||||
|
go.mongodb.org/mongo-driver v1.10.1/go.mod h1:z4XpeoU6w+9Vht+jAFyLgVrD+jGSQQe0+CBWFHNiHt8=
|
||||||
|
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||||
|
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||||
|
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
|
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
|
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
|
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||||
|
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||||
|
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
||||||
|
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||||
|
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
|
||||||
|
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||||
|
go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U=
|
||||||
|
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
||||||
|
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
|
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
|
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
|
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
|
||||||
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
|
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||||
|
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||||
|
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
|
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
|
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
|
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||||
|
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||||
|
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||||
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
|
golang.org/x/image v0.0.0-20220722155232-062f8c9fd539 h1:/eM0PCrQI2xd471rI+snWuu251/+/jpBpZqir2mPdnU=
|
||||||
|
golang.org/x/image v0.0.0-20220722155232-062f8c9fd539/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY=
|
||||||
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
|
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||||
|
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||||
|
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||||
|
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||||
|
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||||
|
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
|
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||||
|
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
|
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
|
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||||
|
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
|
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
|
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y=
|
||||||
|
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
|
||||||
|
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=
|
||||||
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||||
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
|
||||||
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
|
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||||
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||||
|
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||||
|
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||||
|
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||||
|
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
|
||||||
|
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||||
|
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
|
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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||||
|
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||||
|
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
|
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
|
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
|
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
|
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
|
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||||
|
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||||
|
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
||||||
|
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
||||||
|
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
||||||
|
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
|
||||||
|
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
|
||||||
|
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=
|
||||||
|
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||||
|
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||||
|
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||||
|
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
|
||||||
|
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||||
|
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||||
|
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||||
|
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||||
|
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I=
|
||||||
|
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
|
||||||
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
|
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||||
|
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||||
|
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||||
|
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||||
|
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
|
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
|
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
|
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
|
||||||
|
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||||
|
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
|
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
|
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
|
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||||
|
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||||
|
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||||
|
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
|
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
|
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||||
|
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
||||||
|
google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w=
|
||||||
|
google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
||||||
|
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||||
|
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||||
|
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||||
|
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||||
|
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||||
|
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||||
|
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||||
|
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||||
|
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||||
|
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||||
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
|
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
|
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||||
|
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
|
||||||
|
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||||
|
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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 h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
|
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||||
|
gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4=
|
||||||
|
gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
|
gopkg.in/square/go-jose.v2 v2.5.2-0.20210529014059-a5c7eec3c614 h1:lwJmuuJQGclcankpPJwh8rorzB0bNbVALv8phDGh8TQ=
|
||||||
|
gopkg.in/square/go-jose.v2 v2.5.2-0.20210529014059-a5c7eec3c614/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||||
|
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
|
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
|
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||||
|
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||||
|
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
|
@ -0,0 +1,30 @@
|
||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/services"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/cache"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
type APIHandler struct {
|
||||||
|
idp *identification.IdentificationProvider
|
||||||
|
config *viper.Viper
|
||||||
|
services *services.ServicesHandler
|
||||||
|
cache *cache.CacheHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIHandler(cfg *viper.Viper, idp *identification.IdentificationProvider, svc *services.ServicesHandler, cache *cache.CacheHandler) (*APIHandler, error) {
|
||||||
|
return &APIHandler{
|
||||||
|
idp: idp,
|
||||||
|
config: cfg,
|
||||||
|
services: svc,
|
||||||
|
cache: cache,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *APIHandler) NotFound(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (h APIHandler) GetCache(w http.ResponseWriter, r *http.Request) {
|
||||||
|
vars := mux.Vars(r)
|
||||||
|
cacheid := vars["cacheid"]
|
||||||
|
|
||||||
|
d, err := h.cache.Get(cacheid)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result := d
|
||||||
|
|
||||||
|
if data, ok := d.([]any); ok {
|
||||||
|
if limitsmin, ok := r.URL.Query()["limits.min"]; ok {
|
||||||
|
min, _ := strconv.Atoi(limitsmin[0])
|
||||||
|
if limitsmax, ok := r.URL.Query()["limits.max"]; ok {
|
||||||
|
max, _ := strconv.Atoi(limitsmax[0])
|
||||||
|
if max > len(data) {
|
||||||
|
result = data[min:]
|
||||||
|
} else {
|
||||||
|
result = data[min:max]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result = data[min:]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
j, err := json.Marshal(result)
|
||||||
|
if err != nil {
|
||||||
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.Write(j)
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (h *APIHandler) GeoAutocomplete(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
pelias := h.config.GetString("geo.pelias.url")
|
||||||
|
|
||||||
|
t, ok := r.URL.Query()["text"]
|
||||||
|
|
||||||
|
if !ok || len(t[0]) < 1 {
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
text := t[0]
|
||||||
|
|
||||||
|
resp, err := http.Get(fmt.Sprintf("%s/autocomplete?text=%s", pelias, text))
|
||||||
|
if err != nil {
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var response map[string]any
|
||||||
|
jsonErr := json.Unmarshal(body, &response)
|
||||||
|
if jsonErr != nil {
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
j, err := json.Marshal(response["features"])
|
||||||
|
if err != nil {
|
||||||
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.Write(j)
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (h APIHandler) OAuth2Callback(w http.ResponseWriter, r *http.Request) {
|
||||||
|
oauth2Token, err := h.idp.OAuth2Config.Exchange(context.Background(), r.URL.Query().Get("code"))
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Exchange error")
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract the ID Token from OAuth2 token.
|
||||||
|
rawIDToken, ok := oauth2Token.Extra("id_token").(string)
|
||||||
|
if !ok {
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = h.idp.TokenVerifier.Verify(context.Background(), rawIDToken)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("not able to verify token")
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusUnauthorized)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
session, _ := h.idp.SessionsStore.Get(r, "parcoursmob_session")
|
||||||
|
session.Values["idtoken"] = rawIDToken
|
||||||
|
|
||||||
|
redirect := "/app/"
|
||||||
|
|
||||||
|
if session.Values["redirect"] != nil && session.Values["redirect"] != "" {
|
||||||
|
redirect = session.Values["redirect"].(string)
|
||||||
|
delete(session.Values, "redirect")
|
||||||
|
}
|
||||||
|
|
||||||
|
session.Save(r, w)
|
||||||
|
|
||||||
|
http.Redirect(w, r, redirect, http.StatusFound)
|
||||||
|
}
|
|
@ -0,0 +1,123 @@
|
||||||
|
package application
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||||
|
"github.com/google/uuid"
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
"google.golang.org/protobuf/types/known/structpb"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) Administration(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
request := &groupsmanagement.GetGroupsRequest{
|
||||||
|
Namespaces: []string{"parcoursmob_organizations"},
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var groups = []any{}
|
||||||
|
|
||||||
|
for _, group := range resp.Groups {
|
||||||
|
g := group.ToStorageType()
|
||||||
|
groups = append(groups, g)
|
||||||
|
}
|
||||||
|
|
||||||
|
h.Renderer.Administration(w, r, groups)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) AdministrationCreateGroup(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if r.Method == "POST" {
|
||||||
|
r.ParseForm()
|
||||||
|
|
||||||
|
if r.FormValue("name") == "" {
|
||||||
|
|
||||||
|
fmt.Println("invalid name")
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
modules := map[string]any{
|
||||||
|
"beneficiaries": r.FormValue("modules.beneficiaries") == "on",
|
||||||
|
"journeys": r.FormValue("modules.journeys") == "on",
|
||||||
|
"vehicles": r.FormValue("modules.vehicles") == "on",
|
||||||
|
"vehicles_management": r.FormValue("modules.vehicles_management") == "on",
|
||||||
|
"events": r.FormValue("modules.events") == "on",
|
||||||
|
"administration": r.FormValue("modules.administration") == "on",
|
||||||
|
}
|
||||||
|
|
||||||
|
groupid := uuid.NewString()
|
||||||
|
|
||||||
|
dataMap := map[string]any{
|
||||||
|
"name": r.FormValue("name"),
|
||||||
|
"modules": modules,
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := structpb.NewValue(dataMap)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
request_organization := &groupsmanagement.AddGroupRequest{
|
||||||
|
Group: &groupsmanagement.Group{
|
||||||
|
Id: groupid,
|
||||||
|
Namespace: "parcoursmob_organizations",
|
||||||
|
Data: data.GetStructValue(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
request_role := &groupsmanagement.AddGroupRequest{
|
||||||
|
Group: &groupsmanagement.Group{
|
||||||
|
Id: groupid + ":admin",
|
||||||
|
Namespace: "parcoursmob_roles",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_organization)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the admin role for the organization
|
||||||
|
_, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_role)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
http.Redirect(w, r, fmt.Sprintf("/app/administration/groups/%s", groupid), http.StatusFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
h.Renderer.AdministrationCreateGroup(w, r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) AdministrationGroupDisplay(w http.ResponseWriter, r *http.Request) {
|
||||||
|
vars := mux.Vars(r)
|
||||||
|
groupid := vars["groupid"]
|
||||||
|
|
||||||
|
request := &groupsmanagement.GetGroupRequest{
|
||||||
|
Id: groupid,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
h.Renderer.AdministrationGroupDisplay(w, r, resp.Group.ToStorageType())
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package application
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/renderer"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/services"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/cache"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ApplicationHandler struct {
|
||||||
|
config *viper.Viper
|
||||||
|
Renderer *renderer.Renderer
|
||||||
|
services *services.ServicesHandler
|
||||||
|
cache *cache.CacheHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewApplicationHandler(cfg *viper.Viper, svc *services.ServicesHandler, cache *cache.CacheHandler) (*ApplicationHandler, error) {
|
||||||
|
templates_root := cfg.GetString("templates.root")
|
||||||
|
renderer := renderer.NewRenderer(cfg, templates_root)
|
||||||
|
return &ApplicationHandler{
|
||||||
|
config: cfg,
|
||||||
|
Renderer: renderer,
|
||||||
|
services: svc,
|
||||||
|
cache: cache,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) NotFound(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) templateFile(file string) string {
|
||||||
|
return h.config.GetString("templates.root") + file
|
||||||
|
}
|
|
@ -0,0 +1,305 @@
|
||||||
|
package application
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"image/png"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
formvalidators "git.coopgo.io/coopgo-apps/parcoursmob/utils/form-validators"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||||
|
profilepictures "git.coopgo.io/coopgo-apps/parcoursmob/utils/profile-pictures"
|
||||||
|
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||||
|
"git.coopgo.io/coopgo-platform/groups-management/storage"
|
||||||
|
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||||
|
"github.com/google/uuid"
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
"google.golang.org/protobuf/types/known/structpb"
|
||||||
|
)
|
||||||
|
|
||||||
|
type BeneficiariesForm struct {
|
||||||
|
FirstName string `json:"first_name" validate:"required"`
|
||||||
|
LastName string `json:"last_name" validate:"required"`
|
||||||
|
Email string `json:"email" validate:"required,email"`
|
||||||
|
Birthdate *time.Time `json:"birthdate"`
|
||||||
|
PhoneNumber string `json:"phone_number" validate:"required,phoneNumber"`
|
||||||
|
Address any `json:"address,omitempty"`
|
||||||
|
Gender string `json:"gender"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) BeneficiariesList(w http.ResponseWriter, r *http.Request) {
|
||||||
|
g := r.Context().Value(identification.GroupKey)
|
||||||
|
if g == nil {
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
group := g.(storage.Group)
|
||||||
|
|
||||||
|
request := &mobilityaccounts.GetAccountsBatchRequest{
|
||||||
|
Accountids: group.Members,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.MobilityAccounts.GetAccountsBatch(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var accounts = []any{}
|
||||||
|
|
||||||
|
for _, account := range resp.Accounts {
|
||||||
|
if filterAccount(r, account) {
|
||||||
|
a := account.ToStorageType()
|
||||||
|
accounts = append(accounts, a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cacheid := uuid.NewString()
|
||||||
|
h.cache.PutWithTTL(cacheid, accounts, 1*time.Hour)
|
||||||
|
|
||||||
|
h.Renderer.BeneficiariesList(w, r, accounts, cacheid)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) BeneficiaryCreate(w http.ResponseWriter, r *http.Request) {
|
||||||
|
g := r.Context().Value(identification.GroupKey)
|
||||||
|
if g == nil {
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
group := g.(storage.Group)
|
||||||
|
fmt.Println(group)
|
||||||
|
|
||||||
|
if r.Method == "POST" {
|
||||||
|
|
||||||
|
dataMap, err := parseForm(r)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := structpb.NewValue(dataMap)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
request := &mobilityaccounts.RegisterRequest{
|
||||||
|
Account: &mobilityaccounts.Account{
|
||||||
|
Namespace: "parcoursmob_beneficiaries",
|
||||||
|
Data: data.GetStructValue(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.MobilityAccounts.Register(context.TODO(), request)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
subscribe := &groupsmanagement.SubscribeRequest{
|
||||||
|
Groupid: group.ID,
|
||||||
|
Memberid: resp.Account.Id,
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = h.services.GRPC.GroupsManagement.Subscribe(context.TODO(), subscribe)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
http.Redirect(w, r, fmt.Sprintf("/app/beneficiaries/%s", resp.Account.Id), http.StatusFound)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
h.Renderer.BeneficiaryCreate(w, r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) BeneficiaryDisplay(w http.ResponseWriter, r *http.Request) {
|
||||||
|
vars := mux.Vars(r)
|
||||||
|
beneficiaryID := vars["beneficiaryid"]
|
||||||
|
|
||||||
|
request := &mobilityaccounts.GetAccountRequest{
|
||||||
|
Id: beneficiaryID,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO filter namespaces
|
||||||
|
//TODO filter groups
|
||||||
|
|
||||||
|
h.Renderer.BeneficiaryDisplay(w, r, resp.Account.ToStorageType())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) BeneficiaryUpdate(w http.ResponseWriter, r *http.Request) {
|
||||||
|
vars := mux.Vars(r)
|
||||||
|
beneficiaryID := vars["beneficiaryid"]
|
||||||
|
|
||||||
|
if r.Method == "POST" {
|
||||||
|
|
||||||
|
dataMap, err := parseForm(r)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := structpb.NewValue(dataMap)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
request := &mobilityaccounts.UpdateDataRequest{
|
||||||
|
Account: &mobilityaccounts.Account{
|
||||||
|
Id: beneficiaryID,
|
||||||
|
Namespace: "parcoursmob_beneficiaries",
|
||||||
|
Data: data.GetStructValue(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.MobilityAccounts.UpdateData(context.TODO(), request)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
http.Redirect(w, r, fmt.Sprintf("/app/beneficiaries/%s", resp.Account.Id), http.StatusFound)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
request := &mobilityaccounts.GetAccountRequest{
|
||||||
|
Id: beneficiaryID,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO filter namespaces
|
||||||
|
//TODO filter groups
|
||||||
|
|
||||||
|
h.Renderer.BeneficiaryUpdate(w, r, resp.Account.ToStorageType())
|
||||||
|
}
|
||||||
|
|
||||||
|
func parseForm(r *http.Request) (map[string]any, error) {
|
||||||
|
if err := r.ParseForm(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var date *time.Time
|
||||||
|
|
||||||
|
if r.PostFormValue("birthdate") != "" {
|
||||||
|
d, err := time.Parse("2006-01-02", r.PostFormValue("birthdate"))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
date = &d
|
||||||
|
}
|
||||||
|
|
||||||
|
formData := BeneficiariesForm{
|
||||||
|
FirstName: r.PostFormValue("first_name"),
|
||||||
|
LastName: r.PostFormValue("last_name"),
|
||||||
|
Email: r.PostFormValue("email"),
|
||||||
|
Birthdate: date,
|
||||||
|
PhoneNumber: r.PostFormValue("phone_number"),
|
||||||
|
Gender: r.PostFormValue("gender"),
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.PostFormValue("address") != "" {
|
||||||
|
var a any
|
||||||
|
json.Unmarshal([]byte(r.PostFormValue("address")), &a)
|
||||||
|
|
||||||
|
formData.Address = a
|
||||||
|
}
|
||||||
|
|
||||||
|
validate := formvalidators.New()
|
||||||
|
if err := validate.Struct(formData); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
d, err := json.Marshal(formData)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var dataMap map[string]any
|
||||||
|
err = json.Unmarshal(d, &dataMap)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return dataMap, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) BeneficiaryPicture(w http.ResponseWriter, r *http.Request) {
|
||||||
|
vars := mux.Vars(r)
|
||||||
|
beneficiaryID := vars["beneficiaryid"]
|
||||||
|
|
||||||
|
request := &mobilityaccounts.GetAccountRequest{
|
||||||
|
Id: beneficiaryID,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
account := resp.Account.ToStorageType()
|
||||||
|
|
||||||
|
firstName := account.Data["first_name"].(string)
|
||||||
|
lastName := account.Data["last_name"].(string)
|
||||||
|
picture := profilepictures.DefaultProfilePicture(strings.ToUpper(firstName[0:1] + lastName[0:1]))
|
||||||
|
|
||||||
|
buffer := new(bytes.Buffer)
|
||||||
|
if err := png.Encode(buffer, picture); err != nil {
|
||||||
|
log.Println("unable to encode image.")
|
||||||
|
}
|
||||||
|
|
||||||
|
w.Header().Set("Content-Type", "image/png")
|
||||||
|
w.Header().Set("Content-Length", strconv.Itoa(len(buffer.Bytes())))
|
||||||
|
if _, err := w.Write(buffer.Bytes()); err != nil {
|
||||||
|
log.Println("unable to write image.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func filterAccount(r *http.Request, a *mobilityaccounts.Account) bool {
|
||||||
|
searchFilter, ok := r.URL.Query()["search"]
|
||||||
|
|
||||||
|
if ok && len(searchFilter[0]) > 0 {
|
||||||
|
name := a.Data.AsMap()["first_name"].(string) + " " + a.Data.AsMap()["last_name"].(string)
|
||||||
|
if !strings.Contains(strings.ToLower(name), strings.ToLower(searchFilter[0])) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package application
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||||
|
"git.coopgo.io/coopgo-platform/groups-management/storage"
|
||||||
|
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) Dashboard(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
g := r.Context().Value(identification.GroupKey)
|
||||||
|
if g == nil {
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
group := g.(storage.Group)
|
||||||
|
|
||||||
|
request := &mobilityaccounts.GetAccountsBatchRequest{
|
||||||
|
Accountids: group.Members,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.MobilityAccounts.GetAccountsBatch(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var accounts = []any{}
|
||||||
|
|
||||||
|
// We only display the 10 last here
|
||||||
|
count := len(resp.Accounts)
|
||||||
|
min := count - 10
|
||||||
|
if min < 0 {
|
||||||
|
min = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, account := range resp.Accounts[min:] {
|
||||||
|
if filterAccount(r, account) {
|
||||||
|
a := account.ToStorageType()
|
||||||
|
accounts = append([]any{a}, accounts...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h.Renderer.Dashboard(w, r, accounts, count)
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package application
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) VehiclesManagementOverview(w http.ResponseWriter, r *http.Request) {
|
||||||
|
h.Renderer.VehiclesManagementOverview(w, r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *ApplicationHandler) VehiclesFleetAdd(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if r.Method == "POST" {
|
||||||
|
if err := r.ParseForm(); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(r.Form)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
h.Renderer.VehiclesFleetAdd(w, r)
|
||||||
|
}
|
|
@ -0,0 +1,116 @@
|
||||||
|
package auth
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/renderer"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/services"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/cache"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||||
|
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
type AuthHandler struct {
|
||||||
|
idp *identification.IdentificationProvider
|
||||||
|
config *viper.Viper
|
||||||
|
services *services.ServicesHandler
|
||||||
|
Renderer *renderer.Renderer
|
||||||
|
cache *cache.CacheHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAuthHandler(cfg *viper.Viper, idp *identification.IdentificationProvider, svc *services.ServicesHandler, cache *cache.CacheHandler) (*AuthHandler, error) {
|
||||||
|
templates_root := cfg.GetString("templates.root")
|
||||||
|
renderer := renderer.NewRenderer(cfg, templates_root)
|
||||||
|
return &AuthHandler{
|
||||||
|
idp: idp,
|
||||||
|
config: cfg,
|
||||||
|
services: svc,
|
||||||
|
Renderer: renderer,
|
||||||
|
cache: cache,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *AuthHandler) Groups(w http.ResponseWriter, r *http.Request) {
|
||||||
|
session, _ := h.idp.SessionsStore.Get(r, "parcoursmob_session")
|
||||||
|
|
||||||
|
if r.Method == "POST" {
|
||||||
|
r.ParseForm()
|
||||||
|
|
||||||
|
groupid := r.FormValue("group")
|
||||||
|
|
||||||
|
session.Values["organization"] = groupid
|
||||||
|
session.Save(r, w)
|
||||||
|
|
||||||
|
http.Redirect(w, r, "/app/", http.StatusFound)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
tokenstring, ok := session.Values["idtoken"]
|
||||||
|
|
||||||
|
if !ok {
|
||||||
|
http.Redirect(w, r, "/app/", http.StatusFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
idtoken, err := h.idp.TokenVerifier.Verify(context.Background(), tokenstring.(string))
|
||||||
|
if err != nil {
|
||||||
|
delete(session.Values, "idtoken")
|
||||||
|
http.Redirect(w, r, "/app/", http.StatusFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var claims map[string]any
|
||||||
|
|
||||||
|
err = idtoken.Claims(&claims)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
g := claims["groups"]
|
||||||
|
|
||||||
|
groups_interface, ok := g.([]any)
|
||||||
|
if !ok {
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
groups := []string{}
|
||||||
|
|
||||||
|
for _, v := range groups_interface {
|
||||||
|
groups = append(groups, v.(string))
|
||||||
|
}
|
||||||
|
|
||||||
|
request := &groupsmanagement.GetGroupsBatchRequest{
|
||||||
|
Groupids: groups,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.GroupsManagement.GetGroupsBatch(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var groupsresponse = []any{}
|
||||||
|
|
||||||
|
for _, group := range resp.Groups {
|
||||||
|
if group.Namespace != "parcoursmob_organizations" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
g := group.ToStorageType()
|
||||||
|
groupsresponse = append(groupsresponse, g)
|
||||||
|
}
|
||||||
|
|
||||||
|
h.Renderer.AuthGroups(w, r, groupsresponse)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *AuthHandler) GroupSwitch(w http.ResponseWriter, r *http.Request) {
|
||||||
|
session, _ := h.idp.SessionsStore.Get(r, "parcoursmob_session")
|
||||||
|
delete(session.Values, "organization")
|
||||||
|
session.Save(r, w)
|
||||||
|
http.Redirect(w, r, "/app/", http.StatusFound)
|
||||||
|
}
|
|
@ -0,0 +1,94 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/handlers/api"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/handlers/application"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/handlers/auth"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/services"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/cache"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
cfg, err := ReadConfig()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
address = cfg.GetString("server.listen")
|
||||||
|
service_name = cfg.GetString("service_name")
|
||||||
|
templates_public_dir = cfg.GetString("templates.public_dir")
|
||||||
|
)
|
||||||
|
|
||||||
|
svc, err := services.NewServicesHandler(cfg)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
idp, err := identification.NewIdentificationProvider(cfg, svc)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cache, err := cache.NewCacheHandler(cfg)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
apiHandler, _ := api.NewAPIHandler(cfg, idp, svc, cache)
|
||||||
|
applicationHandler, _ := application.NewApplicationHandler(cfg, svc, cache)
|
||||||
|
authHandler, _ := auth.NewAuthHandler(cfg, idp, svc, cache)
|
||||||
|
|
||||||
|
fmt.Println("Running", service_name, ":")
|
||||||
|
|
||||||
|
r := mux.NewRouter()
|
||||||
|
|
||||||
|
r.PathPrefix("/public/").Handler(http.StripPrefix("/public/", http.FileServer(http.Dir(templates_public_dir))))
|
||||||
|
|
||||||
|
r.HandleFunc("/auth/groups/", authHandler.Groups)
|
||||||
|
r.HandleFunc("/auth/groups/switch", authHandler.GroupSwitch)
|
||||||
|
|
||||||
|
api_router := r.PathPrefix("/api").Subrouter()
|
||||||
|
api_router.HandleFunc("/", apiHandler.NotFound)
|
||||||
|
api_router.HandleFunc("/geo/autocomplete", apiHandler.GeoAutocomplete)
|
||||||
|
api_router.HandleFunc("/cache/{cacheid}", apiHandler.GetCache)
|
||||||
|
api_router.HandleFunc("/oauth2/callback", apiHandler.OAuth2Callback)
|
||||||
|
|
||||||
|
application := r.PathPrefix("/app").Subrouter()
|
||||||
|
application.HandleFunc("/", applicationHandler.Dashboard)
|
||||||
|
application.HandleFunc("/beneficiaries/", applicationHandler.BeneficiariesList)
|
||||||
|
application.HandleFunc("/beneficiaries/create", applicationHandler.BeneficiaryCreate)
|
||||||
|
application.HandleFunc("/beneficiaries/{beneficiaryid}", applicationHandler.BeneficiaryDisplay)
|
||||||
|
application.HandleFunc("/beneficiaries/{beneficiaryid}/update", applicationHandler.BeneficiaryUpdate)
|
||||||
|
application.HandleFunc("/beneficiaries/{beneficiaryid}/picture", applicationHandler.BeneficiaryPicture)
|
||||||
|
application.HandleFunc("/vehicles-management/", applicationHandler.VehiclesManagementOverview)
|
||||||
|
application.HandleFunc("/vehicles-management/fleet/add", applicationHandler.VehiclesFleetAdd)
|
||||||
|
//TODO Subrouters with middlewares checking security for each module ?
|
||||||
|
application.Use(idp.Middleware)
|
||||||
|
application.Use(idp.GroupsMiddleware)
|
||||||
|
|
||||||
|
appAdmin := application.PathPrefix("/administration").Subrouter()
|
||||||
|
appAdmin.HandleFunc("/", applicationHandler.Administration)
|
||||||
|
appAdmin.HandleFunc("/groups/", applicationHandler.AdministrationCreateGroup)
|
||||||
|
appAdmin.HandleFunc("/groups/{groupid}", applicationHandler.AdministrationGroupDisplay)
|
||||||
|
//TODO Secure with Middleware checking for modules
|
||||||
|
|
||||||
|
fmt.Println("-> HTTP server listening on", address)
|
||||||
|
|
||||||
|
srv := &http.Server{
|
||||||
|
Handler: r,
|
||||||
|
Addr: address,
|
||||||
|
WriteTimeout: 15 * time.Second,
|
||||||
|
ReadTimeout: 15 * time.Second,
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Fatal(srv.ListenAndServe())
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package renderer
|
||||||
|
|
||||||
|
import "net/http"
|
||||||
|
|
||||||
|
const administrationMenu = "administration"
|
||||||
|
|
||||||
|
func (renderer *Renderer) Administration(w http.ResponseWriter, r *http.Request, groups any) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.administration.home.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, administrationMenu)
|
||||||
|
state.ViewState = map[string]any{
|
||||||
|
"groups": groups,
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.Render("administration", w, r, files, state)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (renderer *Renderer) AdministrationCreateGroup(w http.ResponseWriter, r *http.Request) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.administration.create_group.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, administrationMenu)
|
||||||
|
|
||||||
|
renderer.Render("administration", w, r, files, state)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (renderer *Renderer) AdministrationGroupDisplay(w http.ResponseWriter, r *http.Request, group any) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.administration.display_group.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, administrationMenu)
|
||||||
|
state.ViewState = map[string]any{
|
||||||
|
"group": group,
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.Render("administration", w, r, files, state)
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package renderer
|
||||||
|
|
||||||
|
import "net/http"
|
||||||
|
|
||||||
|
func (renderer *Renderer) AuthGroups(w http.ResponseWriter, r *http.Request, groups []any) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.auth.groups.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, "")
|
||||||
|
state.ViewState = map[string]any{
|
||||||
|
"groups": groups,
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.RenderNoLayout("groups switch", w, r, files, state)
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package renderer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"html/template"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
const beneficiariesMenu = "beneficiaries"
|
||||||
|
|
||||||
|
type BeneficiariesListState struct {
|
||||||
|
Count int `json:"count"`
|
||||||
|
CacheId string `json:"cache_id"`
|
||||||
|
Beneficiaries []any `json:"beneficiaries"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s BeneficiariesListState) JSON() template.JS {
|
||||||
|
result, _ := json.Marshal(s)
|
||||||
|
return template.JS(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s BeneficiariesListState) JSONWithLimits(a int, b int) template.JS {
|
||||||
|
if b < len(s.Beneficiaries) {
|
||||||
|
s.Beneficiaries = s.Beneficiaries[a:b]
|
||||||
|
}
|
||||||
|
return s.JSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (renderer *Renderer) BeneficiariesList(w http.ResponseWriter, r *http.Request, accounts []any, cacheid string) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.beneficiaries.list.files")
|
||||||
|
|
||||||
|
state := NewState(r, renderer.ThemeConfig, beneficiariesMenu)
|
||||||
|
state.ViewState = BeneficiariesListState{
|
||||||
|
Count: len(accounts),
|
||||||
|
CacheId: cacheid,
|
||||||
|
Beneficiaries: accounts,
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.Render("beneficiaries_list", w, r, files, state)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (renderer *Renderer) BeneficiaryCreate(w http.ResponseWriter, r *http.Request) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.beneficiaries.create.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, beneficiariesMenu)
|
||||||
|
|
||||||
|
renderer.Render("beneficiaries_create", w, r, files, state)
|
||||||
|
}
|
||||||
|
|
||||||
|
type BeneficiariesDisplayState struct {
|
||||||
|
Beneficiary any
|
||||||
|
}
|
||||||
|
|
||||||
|
func (renderer *Renderer) BeneficiaryDisplay(w http.ResponseWriter, r *http.Request, beneficiary any) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.beneficiaries.display.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, beneficiariesMenu)
|
||||||
|
state.ViewState = beneficiary
|
||||||
|
|
||||||
|
renderer.Render("beneficiaries_display", w, r, files, state)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (renderer *Renderer) BeneficiaryUpdate(w http.ResponseWriter, r *http.Request, beneficiary any) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.beneficiaries.update.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, beneficiariesMenu)
|
||||||
|
state.ViewState = beneficiary
|
||||||
|
|
||||||
|
renderer.Render("beneficiaries_update", w, r, files, state)
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package renderer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
const dashboardMenu = "dashboard"
|
||||||
|
|
||||||
|
func (renderer *Renderer) Dashboard(w http.ResponseWriter, r *http.Request, accounts []any, nbaccounts int) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.dashboard.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, dashboardMenu)
|
||||||
|
state.ViewState = map[string]any{
|
||||||
|
"beneficiaries": map[string]any{
|
||||||
|
"count": nbaccounts,
|
||||||
|
"latest": accounts,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.Render("dashboard", w, r, files, state)
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
package renderer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TimeFrom(d any) *time.Time {
|
||||||
|
|
||||||
|
if date, ok := d.(time.Time); ok {
|
||||||
|
return &date
|
||||||
|
} else if date, ok := d.(string); ok {
|
||||||
|
datetime, err := time.Parse("2006-01-02T15:04:05Z", date)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return &datetime
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func GenderISO5218(d any) string {
|
||||||
|
if date, ok := d.(string); ok {
|
||||||
|
switch date {
|
||||||
|
case "0":
|
||||||
|
return "Inconnu"
|
||||||
|
case "1":
|
||||||
|
return "Masculin"
|
||||||
|
case "2":
|
||||||
|
return "Féminin"
|
||||||
|
case "9":
|
||||||
|
return "Sans objet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if date, ok := d.(int64); ok {
|
||||||
|
switch date {
|
||||||
|
case 0:
|
||||||
|
return "Inconnu"
|
||||||
|
case 1:
|
||||||
|
return "Masculin"
|
||||||
|
case 2:
|
||||||
|
return "Féminin"
|
||||||
|
case 9:
|
||||||
|
return "Sans objet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func Dict(v ...interface{}) map[string]interface{} {
|
||||||
|
dict := map[string]interface{}{}
|
||||||
|
lenv := len(v)
|
||||||
|
for i := 0; i < lenv; i += 2 {
|
||||||
|
key := strval(v[i])
|
||||||
|
if i+1 >= lenv {
|
||||||
|
dict[key] = ""
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
dict[key] = v[i+1]
|
||||||
|
}
|
||||||
|
return dict
|
||||||
|
}
|
||||||
|
|
||||||
|
func strval(v interface{}) string {
|
||||||
|
switch v := v.(type) {
|
||||||
|
case string:
|
||||||
|
return v
|
||||||
|
case []byte:
|
||||||
|
return string(v)
|
||||||
|
case error:
|
||||||
|
return v.Error()
|
||||||
|
case fmt.Stringer:
|
||||||
|
return v.String()
|
||||||
|
default:
|
||||||
|
return fmt.Sprintf("%v", v)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package renderer
|
||||||
|
|
||||||
|
type LayoutState struct {
|
||||||
|
AdministrationState AdministrationState
|
||||||
|
MenuItems []MenuItem
|
||||||
|
}
|
||||||
|
|
||||||
|
type MenuItem struct {
|
||||||
|
Title string
|
||||||
|
Link string
|
||||||
|
Active bool
|
||||||
|
Icon string
|
||||||
|
}
|
||||||
|
|
||||||
|
type AdministrationState struct {
|
||||||
|
Display bool
|
||||||
|
Active bool
|
||||||
|
}
|
|
@ -0,0 +1,184 @@
|
||||||
|
package renderer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"html/template"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/icons"
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||||
|
"git.coopgo.io/coopgo-platform/groups-management/storage"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Renderer struct {
|
||||||
|
TemplatesDir string
|
||||||
|
GlobalConfig *viper.Viper
|
||||||
|
ThemeConfig *viper.Viper
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewRenderer(global *viper.Viper, templates_dir string) *Renderer {
|
||||||
|
theme := viper.New()
|
||||||
|
theme.SetConfigName("config")
|
||||||
|
theme.AddConfigPath(templates_dir)
|
||||||
|
err := theme.ReadInConfig()
|
||||||
|
if err != nil {
|
||||||
|
panic(fmt.Errorf("fatal error config file: %w", err))
|
||||||
|
}
|
||||||
|
return &Renderer{
|
||||||
|
TemplatesDir: templates_dir,
|
||||||
|
GlobalConfig: global,
|
||||||
|
ThemeConfig: theme,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (renderer *Renderer) Render(name string, w http.ResponseWriter, r *http.Request, files []string, state RenderState) {
|
||||||
|
genericFiles := renderer.ThemeConfig.GetStringSlice("views.generic.files")
|
||||||
|
|
||||||
|
prefixed_files := []string{}
|
||||||
|
for _, f := range genericFiles {
|
||||||
|
prefixed_files = append(prefixed_files, renderer.templateFile(f))
|
||||||
|
}
|
||||||
|
for _, f := range files {
|
||||||
|
prefixed_files = append(prefixed_files, renderer.templateFile(f))
|
||||||
|
}
|
||||||
|
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
t := template.New(name).Funcs(
|
||||||
|
template.FuncMap{
|
||||||
|
"timeFrom": TimeFrom,
|
||||||
|
"genderISO5218": GenderISO5218,
|
||||||
|
"dict": Dict,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
t = template.Must(t.ParseFiles(prefixed_files...))
|
||||||
|
err := t.ExecuteTemplate(w, "main", state)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (renderer *Renderer) RenderNoLayout(name string, w http.ResponseWriter, r *http.Request, files []string, state RenderState) {
|
||||||
|
prefixed_files := []string{}
|
||||||
|
for _, f := range files {
|
||||||
|
prefixed_files = append(prefixed_files, renderer.templateFile(f))
|
||||||
|
}
|
||||||
|
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
t := template.New(name).Funcs(
|
||||||
|
template.FuncMap{
|
||||||
|
"timeFrom": TimeFrom,
|
||||||
|
"genderISO5218": GenderISO5218,
|
||||||
|
"dict": Dict,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
t = template.Must(t.ParseFiles(prefixed_files...))
|
||||||
|
err := t.ExecuteTemplate(w, "main", state)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Renderer) templateFile(file string) string {
|
||||||
|
return r.TemplatesDir + file
|
||||||
|
}
|
||||||
|
|
||||||
|
type RenderState struct {
|
||||||
|
icons.IconSet
|
||||||
|
LayoutState
|
||||||
|
Group any
|
||||||
|
Roles any
|
||||||
|
ViewState any // This is a state specific to a given view
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewState(r *http.Request, themeConfig *viper.Viper, menuState string) RenderState {
|
||||||
|
iconset := themeConfig.GetStringMapString("icons.svg")
|
||||||
|
// Get State elements from Request
|
||||||
|
|
||||||
|
g := r.Context().Value(identification.GroupKey)
|
||||||
|
if g == nil {
|
||||||
|
return RenderState{
|
||||||
|
IconSet: icons.NewIconSet(iconset),
|
||||||
|
LayoutState: LayoutState{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var roles map[string]any
|
||||||
|
|
||||||
|
ro, ok := r.Context().Value(identification.RolesKey).(map[string]any)
|
||||||
|
if ok {
|
||||||
|
roles = ro
|
||||||
|
}
|
||||||
|
|
||||||
|
group := g.(storage.Group)
|
||||||
|
|
||||||
|
modules := group.Data["modules"].(map[string]any)
|
||||||
|
|
||||||
|
ls := LayoutState{
|
||||||
|
AdministrationState: AdministrationState{
|
||||||
|
Display: modules["administration"].(bool),
|
||||||
|
Active: menuState == administrationMenu,
|
||||||
|
},
|
||||||
|
MenuItems: []MenuItem{
|
||||||
|
{
|
||||||
|
Title: "Tableau de bord",
|
||||||
|
Link: "/app/",
|
||||||
|
Active: menuState == "dashboard",
|
||||||
|
Icon: "hero:outline/home",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if modules["beneficiaries"].(bool) {
|
||||||
|
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||||
|
Title: "Bénéficiaires",
|
||||||
|
Link: "/app/beneficiaries/",
|
||||||
|
Active: menuState == "beneficiaries",
|
||||||
|
Icon: "hero:outline/user-group",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if modules["journeys"].(bool) {
|
||||||
|
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||||
|
Title: "Déplacements",
|
||||||
|
Link: "/app/journeys/",
|
||||||
|
Active: menuState == "journeys",
|
||||||
|
Icon: "hero:outline/user-group",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if modules["vehicles"].(bool) {
|
||||||
|
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||||
|
Title: "Véhicules",
|
||||||
|
Link: "/app/vehicles/",
|
||||||
|
Active: menuState == "vehicles",
|
||||||
|
Icon: "hero:outline/user-group",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if modules["vehicles_management"].(bool) {
|
||||||
|
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||||
|
Title: "Gestion des véhicules",
|
||||||
|
Link: "/app/vehicles-management/",
|
||||||
|
Active: menuState == "vehicles_management",
|
||||||
|
Icon: "hero:outline/user-group",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if modules["events"].(bool) {
|
||||||
|
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||||
|
Title: "Dispositifs",
|
||||||
|
Link: "/app/events/",
|
||||||
|
Active: menuState == "events",
|
||||||
|
Icon: "hero:outline/user-group",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return RenderState{
|
||||||
|
IconSet: icons.NewIconSet(iconset),
|
||||||
|
Group: group,
|
||||||
|
Roles: roles,
|
||||||
|
LayoutState: ls,
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package renderer
|
||||||
|
|
||||||
|
import "net/http"
|
||||||
|
|
||||||
|
const vehiclesmanagementMenu = "vehicles_management"
|
||||||
|
|
||||||
|
func (renderer *Renderer) VehiclesManagementOverview(w http.ResponseWriter, r *http.Request) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.overview.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
||||||
|
|
||||||
|
renderer.Render("fleet", w, r, files, state)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (renderer *Renderer) VehiclesFleetAdd(w http.ResponseWriter, r *http.Request) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.fleet_add.files")
|
||||||
|
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
||||||
|
|
||||||
|
renderer.Render("fleet", w, r, files, state)
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package services
|
||||||
|
|
||||||
|
import (
|
||||||
|
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GroupsManagementService struct {
|
||||||
|
groupsmanagement.GroupsManagementClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGroupsManagementService(groupsManagementDial string) (*GroupsManagementService, error) {
|
||||||
|
groupsManagementConn, err := grpc.Dial(groupsManagementDial, grpc.WithInsecure())
|
||||||
|
|
||||||
|
client := groupsmanagement.NewGroupsManagementClient(groupsManagementConn)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &GroupsManagementService{
|
||||||
|
GroupsManagementClient: client,
|
||||||
|
}, nil
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package services
|
||||||
|
|
||||||
|
import (
|
||||||
|
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
)
|
||||||
|
|
||||||
|
type MobilityAccountService struct {
|
||||||
|
mobilityaccounts.MobilityAccountsClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMobilityAccountService(mobilityAccountsDial string) (*MobilityAccountService, error) {
|
||||||
|
mobilityAccountsConn, err := grpc.Dial(mobilityAccountsDial, grpc.WithInsecure())
|
||||||
|
|
||||||
|
client := mobilityaccounts.NewMobilityAccountsClient(mobilityAccountsConn)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &MobilityAccountService{
|
||||||
|
MobilityAccountsClient: client,
|
||||||
|
}, nil
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package services
|
||||||
|
|
||||||
|
import (
|
||||||
|
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||||
|
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ServicesHandler struct {
|
||||||
|
GRPC GRPCServices
|
||||||
|
}
|
||||||
|
|
||||||
|
type GRPCServices struct {
|
||||||
|
MobilityAccounts mobilityaccounts.MobilityAccountsClient
|
||||||
|
GroupsManagement groupsmanagement.GroupsManagementClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewServicesHandler(cfg *viper.Viper) (*ServicesHandler, error) {
|
||||||
|
var (
|
||||||
|
mobilityAccountsDial = cfg.GetString("services.grpc.mobilityaccounts.dial")
|
||||||
|
groupsManagementDial = cfg.GetString("services.grpc.groupsmanagement.dial")
|
||||||
|
)
|
||||||
|
mobilityAccounts, err := NewMobilityAccountService(mobilityAccountsDial)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
groupsManagement, err := NewGroupsManagementService(groupsManagementDial)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &ServicesHandler{
|
||||||
|
GRPC: GRPCServices{
|
||||||
|
MobilityAccounts: mobilityAccounts,
|
||||||
|
GroupsManagement: groupsManagement,
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
# PARCOURSMOB default template
|
||||||
|
|
||||||
|
This theme uses :
|
||||||
|
|
||||||
|
- [TailwindCSS](https://tailwindcss.com/) as CSS framework and [Tailwind UI components](https://tailwindui.com/)
|
||||||
|
- [AlpineJS](https://alpinejs.dev/) lightweight Javascript framework
|
||||||
|
|
||||||
|
## TailwindCSS
|
||||||
|
|
||||||
|
Look at the [Tailwind CSS docs](https://tailwindcss.com/docs/installation) to know how to install and use Tailwind.
|
||||||
|
|
||||||
|
If you installed the Tailwind CLI, run this command from this repository while developing.
|
||||||
|
|
||||||
|
```
|
||||||
|
npx tailwind -i ./assets/css/main.css -o public/css/main.css --watch
|
||||||
|
```
|
||||||
|
|
||||||
|
## Esbuild
|
||||||
|
|
||||||
|
To bundle Javascript with esbuild :
|
||||||
|
|
||||||
|
```
|
||||||
|
npx esbuild assets/js/main.js --bundle --outfile=public/js/main.js
|
||||||
|
```
|
|
@ -0,0 +1,19 @@
|
||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Manometer";
|
||||||
|
src: url("https://coopgo.fr/fonts/manometer.woff2") format("woff2"), url("/fonts/manometer.woff") format("woff"); }
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Bitter";
|
||||||
|
font-style: normal;
|
||||||
|
src: url("https://coopgo.fr/fonts/Bitter-Regular.woff") format("woff"); }
|
||||||
|
|
||||||
|
|
||||||
|
@layer base {
|
||||||
|
html {
|
||||||
|
font-family: Bitter, serif;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
import '@kingshott/iodine';
|
||||||
|
import Alpine from 'alpinejs'
|
||||||
|
|
||||||
|
window.Alpine = Alpine
|
||||||
|
|
||||||
|
Alpine.start()
|
Binary file not shown.
|
@ -0,0 +1,47 @@
|
||||||
|
{{ define "address_autocomplete" }}
|
||||||
|
|
||||||
|
<div class="col-span-6 relative" x-data="{
|
||||||
|
input: {{if .Address}}'{{.Address.properties.label}}'{{else}}null{{end}},
|
||||||
|
address: null,
|
||||||
|
addressObject: {{if .Address}}{properties: {label: '{{.Address.properties.label}}'}}{{else}}null{{end}},
|
||||||
|
responselength: 0,
|
||||||
|
async autocomplete() {
|
||||||
|
if(this.input == null || this.input == '') {
|
||||||
|
this.responselength = 0
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
if(this.addressObject != null && this.input == this.addressObject.properties.label) {
|
||||||
|
this.responselength = 0
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
result = await fetch('https://geocode.ridygo.fr/v1/autocomplete/\?text=' + this.input)
|
||||||
|
json = await result.json()
|
||||||
|
|
||||||
|
this.responselength = json['features'].length
|
||||||
|
return json['features']
|
||||||
|
},
|
||||||
|
select(a) {
|
||||||
|
this.address = JSON.stringify(a)
|
||||||
|
this.addressObject = a
|
||||||
|
this.input = a.properties.label
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<input type="hidden" name="{{ .FieldName }}" x-model="address">
|
||||||
|
<label for="address" class="block text-sm font-medium text-gray-700">Adresse</label>
|
||||||
|
<input type="text"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl"
|
||||||
|
x-model="input">
|
||||||
|
|
||||||
|
<ul x-show="responselength > 0"
|
||||||
|
class="absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-xl py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" tabindex="-1" role="listbox" aria-labelledby="listbox-label" aria-activedescendant="listbox-option-3">
|
||||||
|
<template x-for="item in autocomplete">
|
||||||
|
<a href="#">
|
||||||
|
<li class="text-gray-900 hover:bg-gray-200 cursor-default select-none relative py-2 pl-3 pr-9"
|
||||||
|
@click="select(item)">
|
||||||
|
<span class="font-normal block truncate" x-text="item.properties.label" ></span>
|
||||||
|
</li>
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
|
@ -0,0 +1,19 @@
|
||||||
|
{{define "mainmenu"}}
|
||||||
|
|
||||||
|
{{range .LayoutState.MenuItems}}
|
||||||
|
<nav class="px-2 space-y-1">
|
||||||
|
<a href="{{.Link}}"
|
||||||
|
{{ if .Active }}
|
||||||
|
class="bg-white text-co-blue group flex items-center px-2 py-2 text-base font-medium rounded-2xl">
|
||||||
|
{{ else}}
|
||||||
|
class="text-white hover:bg-white hover:bg-opacity-5 group flex items-center px-2 py-2 text-base font-medium rounded-2xl">
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{$.IconSet.Icon .Icon "mr-4 flex-shrink-0 h-6 w-6"}}
|
||||||
|
|
||||||
|
{{.Title}}
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{end}}
|
|
@ -0,0 +1,37 @@
|
||||||
|
{{define "groups_admins"}}
|
||||||
|
<div class="border-t border-gray-200 px-4 py-5 sm:px-6">
|
||||||
|
|
||||||
|
<h2 class="text-md font-medium text-gray-900">Administrateurs</h2>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||||
|
|
||||||
|
<div class="relative rounded-lg bg-white px-6 py-5 flex items-center space-x-3 focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-co-blue">
|
||||||
|
<div class="flex-shrink-0">
|
||||||
|
<img class="h-10 w-10 rounded-co" src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
|
||||||
|
</div>
|
||||||
|
<div class="flex-1 min-w-0">
|
||||||
|
<a href="#" class="focus:outline-none">
|
||||||
|
<span class="absolute inset-0" aria-hidden="true"></span>
|
||||||
|
<p class="text-sm font-medium text-gray-900">Leslie Alexander</p>
|
||||||
|
<p class="text-sm text-gray-500 truncate">aaa@bbb.fr</p>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- More people... -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="px-6 py-4">
|
||||||
|
<h2 class="text-md font-medium text-gray-900">Ajouter</h2>
|
||||||
|
<div class="flex">
|
||||||
|
<div class="pr-2 flex-1">
|
||||||
|
<input type="text" name="name" id="name"
|
||||||
|
class="mt-1 border-gray-300 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
placeholder="Email">
|
||||||
|
</div>
|
||||||
|
<button class="px-1 py-1 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Ajouter</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,142 @@
|
||||||
|
{{define "content"}}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h1 class="text-2xl font-semibold text-gray-900">Administration > Créer une organisation</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8" x-data="{
|
||||||
|
fields: {
|
||||||
|
name: null,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: ['required'],
|
||||||
|
},
|
||||||
|
formValidation: {
|
||||||
|
valid: false,
|
||||||
|
fields: {
|
||||||
|
name: {valid: null},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isFormValid: true,
|
||||||
|
validate() {
|
||||||
|
this.formValidation = Iodine.assert(this.fields, this.rules)
|
||||||
|
},
|
||||||
|
validateField(field) {
|
||||||
|
this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field])
|
||||||
|
},
|
||||||
|
submit(event) {
|
||||||
|
this.validate()
|
||||||
|
if(!this.formValidation.valid) {
|
||||||
|
this.isFormValid = false
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
return this.formValidation.valid
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<form class="space-y-6" method="POST" @submit="submit">
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Nouvelle organisation</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Informations de base sur la nouvelle organisation à créer</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 md:mt-0 md:col-span-2">
|
||||||
|
<div class="grid grid-cols-6 gap-6">
|
||||||
|
<div class="col-span-6">
|
||||||
|
<label for="name" class="block text-sm font-medium text-gray-700">Nom de
|
||||||
|
l'organisation</label>
|
||||||
|
<input type="text" name="name" id="name"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.name" @blur="validateField('name')"
|
||||||
|
:class="formValidation.fields.name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Paramètres</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Paramètres de configuration de l'organisation (modules
|
||||||
|
accessibles, ...)</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 md:mt-0 md:col-span-2">
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend class="sr-only">Droits d'accès aux modules</legend>
|
||||||
|
<div class="text-base font-medium text-gray-900" aria-hidden="true">Droits d'accès aux modules</div>
|
||||||
|
<div class="mt-4 space-y-4">
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="h-5 flex items-center">
|
||||||
|
<input id="beneficiaries" name="modules.beneficiaries" type="checkbox" checked
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.beneficiaries" class="font-medium text-gray-700">Bénéficiaires</label>
|
||||||
|
<p class="text-gray-500">Gestion des bénéficiaires assignés à sa propre organisation.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input id="journeys" name="modules.journeys" type="checkbox"
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.journeys" class="font-medium text-gray-700">Déplacements</label>
|
||||||
|
<p class="text-gray-500">Trouver des solutions et organiser les déplacements de ses bénéficiaires.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input id="vehicles" name="modules.vehicles" type="checkbox"
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.vehicles" class="font-medium text-gray-700">Véhicules</label>
|
||||||
|
<p class="text-gray-500">Trouver et réserver des véhicules pour ses bénéficiaires.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input id="vehicles_management" name="modules.vehicles_management" type="checkbox"
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.vehicles_management" class="font-medium text-gray-700">Gestion des véhicules</label>
|
||||||
|
<p class="text-gray-500">Gérer les véhicules et réservations (pour les gestionnaires de flottes)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input id="events" name="modules.events" type="checkbox"
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.events" class="font-medium text-gray-700">Dispositifs</label>
|
||||||
|
<p class="text-gray-500">Gestion des dispositifs pour les bénéficiaires (auto-écoles sociales, événements, ...)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
|
||||||
|
<a href="/app/administration/">
|
||||||
|
<button type="button"
|
||||||
|
class="bg-white py-2 px-4 border border-gray-300 rounded-2xl shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
|
||||||
|
</a>
|
||||||
|
<button type="submit"
|
||||||
|
class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-2xl text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Créer l'organisation</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,114 @@
|
||||||
|
{{define "content"}}
|
||||||
|
<main class="py-10">
|
||||||
|
<div class="max-w-3xl mx-auto px-4 sm:px-6 md:flex md:items-center md:justify-between md:space-x-5 lg:max-w-7xl lg:px-8">
|
||||||
|
<div class="flex items-center space-x-5">
|
||||||
|
<!-- <div class="flex-shrink-0">
|
||||||
|
<div class="relative">
|
||||||
|
<img class="h-16 w-16 rounded-co" src="/app/beneficiaries/{{.ViewState.ID}}/picture" alt="">
|
||||||
|
<span class="absolute inset-0 shadow-inner rounded-full" aria-hidden="true"></span>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold text-gray-900">{{.ViewState.group.Data.name}}</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-6 flex flex-col-reverse justify-stretch space-y-4 space-y-reverse sm:flex-row-reverse sm:justify-end sm:space-x-reverse sm:space-y-0 sm:space-x-3 md:mt-0 md:flex-row md:space-x-3">
|
||||||
|
<button type="button"
|
||||||
|
class="inline-flex items-center justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-2xl text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Supprimer</button>
|
||||||
|
<a href="/app/administration/groups/{{.ViewState.group.ID}}/update" class="inline-flex"><button type="button"
|
||||||
|
class="w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Modifier</button></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mt-8 max-w-3xl mx-auto grid grid-cols-1 gap-6 sm:px-6 lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-3">
|
||||||
|
<div class="space-y-6 lg:col-start-1 lg:col-span-2">
|
||||||
|
<section aria-labelledby="beneficiary-information-title">
|
||||||
|
<div class="bg-white shadow sm:rounded-lg">
|
||||||
|
<div class="px-4 py-5 sm:px-6">
|
||||||
|
<h2 id="beneficiary-information-title" class="text-lg leading-6 font-medium text-gray-900">
|
||||||
|
Paramètres de l'organisation</h2>
|
||||||
|
<p class="mt-1 max-w-2xl text-sm text-gray-500">Paramètres généraux de l'organisation</p>
|
||||||
|
</div>
|
||||||
|
{{template "groups_admins" .}}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
<section aria-labelledby="modules-title" class="lg:col-start-3 lg:col-span-1">
|
||||||
|
<div class="bg-white px-4 py-5 shadow sm:rounded-lg sm:px-6">
|
||||||
|
<h2 id="modules-title" class="text-lg font-medium text-gray-900">Modules activés</h2>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<div class="mt-4 space-y-4">
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="h-5 flex items-center">
|
||||||
|
<input id="beneficiaries" name="modules.beneficiaries" type="checkbox" disabled {{if .ViewState.group.Data.modules.beneficiaries}} checked{{end}}
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.beneficiaries" class="font-medium text-gray-700">Bénéficiaires</label>
|
||||||
|
<p class="text-gray-500">Gestion des bénéficiaires assignés à sa propre organisation.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input id="journeys" name="modules.journeys" type="checkbox" disabled {{if .ViewState.group.Data.modules.journeys}} checked{{end}}
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.journeys" class="font-medium text-gray-700">Déplacements</label>
|
||||||
|
<p class="text-gray-500">Trouver des solutions et organiser les déplacements de ses bénéficiaires.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input id="vehicles" name="modules.vehicles" type="checkbox" disabled {{if .ViewState.group.Data.modules.vehicles}} checked{{end}}
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.vehicles" class="font-medium text-gray-700">Véhicules</label>
|
||||||
|
<p class="text-gray-500">Trouver et réserver des véhicules pour ses bénéficiaires.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input id="vehicles_management" name="modules.vehicles_management" type="checkbox" disabled {{if .ViewState.group.Data.modules.vehicles_management}} checked{{end}}
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.vehicles_management" class="font-medium text-gray-700">Gestion des véhicules</label>
|
||||||
|
<p class="text-gray-500">Gérer les véhicules et réservations (pour les gestionnaires de flottes)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input id="events" name="modules.events" type="checkbox" disabled {{if .ViewState.group.Data.modules.events}} checked{{end}}
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.events" class="font-medium text-gray-700">Dispositifs</label>
|
||||||
|
<p class="text-gray-500">Gestion des dispositifs pour les bénéficiaires (auto-écoles sociales, événements, ...)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input id="events" name="modules.events" type="checkbox" disabled {{if .ViewState.group.Data.modules.administration}} checked{{end}}
|
||||||
|
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="modules.events" class="font-medium text-gray-700">Administration</label>
|
||||||
|
<p class="text-gray-500">Administration générale de la plateforme PARCOURSMOB. Créer, ajouter des organisations et administrateurs.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,136 @@
|
||||||
|
{{define "content"}}
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h1 class="text-2xl font-semibold text-gray-900">Administration</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8">
|
||||||
|
<h2 class="text-gray-500 text-xs font-medium uppercase tracking-wide">Statistiques</h2>
|
||||||
|
<ul role="list" class="mt-3 grid grid-cols-1 gap-5 sm:gap-6 sm:grid-cols-2 lg:grid-cols-4">
|
||||||
|
<li class="col-span-1 flex shadow-sm rounded-3xl">
|
||||||
|
<div
|
||||||
|
class="flex-shrink-0 flex items-center justify-center w-16 bg-co-blue text-white text-sm font-medium rounded-l-3xl">
|
||||||
|
{{.IconSet.Icon "hero:outline/user-group" "h-6 w-6"}}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="flex-1 flex items-center justify-between border-t border-r border-b border-gray-200 bg-white rounded-r-3xl truncate">
|
||||||
|
<div class="flex-1 px-4 py-2 text-sm truncate">
|
||||||
|
<a href="#" class="text-gray-900 font-medium hover:text-gray-600">Bénéficiaires</a>
|
||||||
|
<p class="text-gray-500">160 bénéficiaires</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="col-span-1 flex shadow-sm rounded-3xl">
|
||||||
|
<div
|
||||||
|
class="flex-shrink-0 flex items-center justify-center w-16 bg-co-green text-white text-sm font-medium rounded-l-3xl">
|
||||||
|
{{.IconSet.Icon "hero:outline/office-building" "h-6 w-6"}}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="flex-1 flex items-center justify-between border-t border-r border-b border-gray-200 bg-white rounded-r-3xl truncate">
|
||||||
|
<div class="flex-1 px-4 py-2 text-sm truncate">
|
||||||
|
<a href="#" class="text-gray-900 font-medium hover:text-gray-600">Organisations</a>
|
||||||
|
<p class="text-gray-500">12 organisations</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="col-span-1 flex shadow-sm rounded-3xl">
|
||||||
|
<div
|
||||||
|
class="flex-shrink-0 flex items-center justify-center w-16 bg-co-red text-white text-sm font-medium rounded-l-3xl">
|
||||||
|
{{.IconSet.Icon "hero:outline/briefcase" "h-6 w-6"}}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="flex-1 flex items-center justify-between border-t border-r border-b border-gray-200 bg-white rounded-r-3xl truncate">
|
||||||
|
<div class="flex-1 px-4 py-2 text-sm truncate">
|
||||||
|
<a href="#" class="text-gray-900 font-medium hover:text-gray-600">Référents</a>
|
||||||
|
<p class="text-gray-500">53 membres</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="col-span-1 flex shadow-sm rounded-3xl">
|
||||||
|
<div
|
||||||
|
class="flex-shrink-0 flex items-center justify-center w-16 bg-co-yellow text-white text-sm font-medium rounded-l-3xl">
|
||||||
|
{{.IconSet.Icon "hero:outline/shield-check" "h-6 w-6"}}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="flex-1 flex items-center justify-between border-t border-r border-b border-gray-200 bg-white rounded-r-3xl truncate">
|
||||||
|
<div class="flex-1 px-4 py-2 text-sm truncate">
|
||||||
|
<a href="#" class="text-gray-900 font-medium hover:text-gray-600">Accompagnement</a>
|
||||||
|
<p class="text-gray-500">363 actions réalisées</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="max-w-7xl mt-10 mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h2 class="text-xl font-semibold text-gray-500">Gestion des organisations</h2>
|
||||||
|
|
||||||
|
<div class="sm:flex sm:items-center">
|
||||||
|
<div class="sm:flex-auto">
|
||||||
|
<p class="mt-2 text-sm text-gray-700"></p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
|
||||||
|
<a href="/app/administration/groups/">
|
||||||
|
<button type="button"
|
||||||
|
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
|
||||||
|
{{$.IconSet.Icon "hero:outline/plus-circle" "h-5 w-5 mr-3"}}
|
||||||
|
Ajouter une organisation
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bg-white shadow overflow-hidden sm:rounded-3xl mt-4">
|
||||||
|
<ul role="list" class="divide-y divide-gray-200">
|
||||||
|
{{range .ViewState.groups}}
|
||||||
|
<li>
|
||||||
|
<a href="/app/administration/groups/{{.ID}}" class="block hover:bg-gray-50">
|
||||||
|
<div class="px-4 py-4 flex items-center sm:px-6">
|
||||||
|
<div class="min-w-0 flex-1 sm:flex sm:items-center sm:justify-between">
|
||||||
|
<div class="truncate">
|
||||||
|
<div class="flex text-sm">
|
||||||
|
<p class="font-medium text-lg text-co-blue truncate">{{.Data.name}}</p>
|
||||||
|
<p class="ml-1 flex-shrink-0 font-normal text-gray-500"></p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-2 flex">
|
||||||
|
<div class="flex items-center text-sm text-gray-500">
|
||||||
|
{{$.IconSet.Icon "hero:outline/user-group" "flex-shrink-0 mr-1.5 h-5 w-5"}}
|
||||||
|
<p>
|
||||||
|
{{ len .Members }} bénéficiaires
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mt-4 flex-shrink-0 sm:mt-0 sm:ml-5">
|
||||||
|
<div class="flex overflow-hidden -space-x-1">
|
||||||
|
<img class="inline-block h-6 w-6 rounded-full ring-2 ring-white"
|
||||||
|
src="https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt="Dries Vincent">
|
||||||
|
|
||||||
|
<img class="inline-block h-6 w-6 rounded-full ring-2 ring-white"
|
||||||
|
src="https://images.unsplash.com/photo-1517841905240-472988babdf9?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt="Lindsay Walton">
|
||||||
|
|
||||||
|
<img class="inline-block h-6 w-6 rounded-full ring-2 ring-white"
|
||||||
|
src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt="Courtney Henry">
|
||||||
|
|
||||||
|
<img class="inline-block h-6 w-6 rounded-full ring-2 ring-white"
|
||||||
|
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt="Tom Cook">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ml-5 flex-shrink-0">
|
||||||
|
{{$.IconSet.Icon "hero:solid/chevron-right" "h-5 w-5 text-gray-400"}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,40 @@
|
||||||
|
{{define "main"}}
|
||||||
|
<html class="h-full bg-gray-50">
|
||||||
|
<head>
|
||||||
|
<title>PARCOURSMOB</title>
|
||||||
|
<link rel="stylesheet" href="/public/css/main.css" />
|
||||||
|
<!-- <script defer type="text/javascript" src="/public/js/main.js" defer></script> -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/@kingshott/iodine@8.1.0/dist/iodine.min.umd.js" defer></script>
|
||||||
|
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
|
||||||
|
</head>
|
||||||
|
<body class="h-full">
|
||||||
|
<div class="min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8 h-">
|
||||||
|
<div class="sm:mx-auto sm:w-full sm:max-w-md">
|
||||||
|
{{.IconSet.Icon "coopgo:parcoursmob/monogram" "mx-auto h-16 w-auto"}}
|
||||||
|
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">Connectez vous à votre organisation</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
|
||||||
|
<div class="bg-white shadow sm:rounded-3xl">
|
||||||
|
<form id="groupform" class="space-y-6" action="" method="POST" x-data="{group: null}" x-init="$watch('group', value => document.getElementById('groupform').submit())">
|
||||||
|
<fieldset>
|
||||||
|
<legend class="sr-only">Organisations</legend>
|
||||||
|
{{range .ViewState.groups}}
|
||||||
|
<div class="relative bg-white rounded-md -space-y-px sm:rounded-3xl">
|
||||||
|
<label class="sm:rounded-3xl relative text-co-blue hover:text-white hover:bg-co-blue p-4 flex flex-row cursor-pointer md:pl-4 md:pr-6 focus:outline-none">
|
||||||
|
<span class="flex-1 items-center text-xl">
|
||||||
|
<input x-model="group" type="radio" name="group" value="{{.ID}}" class="h-4 w-4 sr-only" aria-labelledby="group-{{.ID}}-label" aria-describedby="group-{{.ID}}-description-0">
|
||||||
|
<span id="group-{{.ID}}-label" class="ml-3 font-medium">{{.Data.name}}</span>
|
||||||
|
</span>
|
||||||
|
<span id="group-{{.ID}}-description-0" class="ml-6 pl-1 text-sm md:ml-0 md:pl-0 md:text-right">{{$.IconSet.Icon "hero:solid/chevron-right" "w-6 h-6"}}</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{{define "beneficiary_events"}}
|
||||||
|
<div class="px-4 py-6 sm:px-6">
|
||||||
|
TODO Dispositifs
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{{define "beneficiary_files"}}
|
||||||
|
<div class="px-4 py-6 sm:px-6">
|
||||||
|
TODO Fichiers
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{{define "beneficiary_journeys"}}
|
||||||
|
<div class="px-4 py-6 sm:px-6">
|
||||||
|
TODO Déplacements
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,108 @@
|
||||||
|
{{define "beneficiary_notes"}}
|
||||||
|
<div class="px-4 py-6 sm:px-6">
|
||||||
|
<ul role="list" class="space-y-8">
|
||||||
|
<li>
|
||||||
|
<div class="flex space-x-3">
|
||||||
|
<div class="flex-shrink-0">
|
||||||
|
<img class="h-10 w-10 rounded-full"
|
||||||
|
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt="">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="text-sm">
|
||||||
|
<a href="#" class="font-medium text-gray-900">Leslie Alexander</a>
|
||||||
|
</div>
|
||||||
|
<div class="mt-1 text-sm text-gray-700">
|
||||||
|
<p>Ducimus quas delectus ad maxime totam doloribus reiciendis ex.
|
||||||
|
Tempore dolorem maiores. Similique voluptatibus tempore non ut.</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-2 text-sm space-x-2">
|
||||||
|
<span class="text-gray-500 font-medium">4d ago</span>
|
||||||
|
<span class="text-gray-500 font-medium">·</span>
|
||||||
|
<button type="button" class="text-gray-900 font-medium">Reply</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div class="flex space-x-3">
|
||||||
|
<div class="flex-shrink-0">
|
||||||
|
<img class="h-10 w-10 rounded-full"
|
||||||
|
src="https://images.unsplash.com/photo-1519244703995-f4e0f30006d5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt="">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="text-sm">
|
||||||
|
<a href="#" class="font-medium text-gray-900">Michael Foster</a>
|
||||||
|
</div>
|
||||||
|
<div class="mt-1 text-sm text-gray-700">
|
||||||
|
<p>Et ut autem. Voluptatem eum dolores sint necessitatibus quos. Quis
|
||||||
|
eum qui dolorem accusantium voluptas voluptatem ipsum. Quo facere
|
||||||
|
iusto quia accusamus veniam id explicabo et aut.</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-2 text-sm space-x-2">
|
||||||
|
<span class="text-gray-500 font-medium">4d ago</span>
|
||||||
|
<span class="text-gray-500 font-medium">·</span>
|
||||||
|
<button type="button" class="text-gray-900 font-medium">Reply</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div class="flex space-x-3">
|
||||||
|
<div class="flex-shrink-0">
|
||||||
|
<img class="h-10 w-10 rounded-full"
|
||||||
|
src="https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt="">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="text-sm">
|
||||||
|
<a href="#" class="font-medium text-gray-900">Dries Vincent</a>
|
||||||
|
</div>
|
||||||
|
<div class="mt-1 text-sm text-gray-700">
|
||||||
|
<p>Expedita consequatur sit ea voluptas quo ipsam recusandae. Ab sint et
|
||||||
|
voluptatem repudiandae voluptatem et eveniet. Nihil quas consequatur
|
||||||
|
autem. Perferendis rerum et.</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-2 text-sm space-x-2">
|
||||||
|
<span class="text-gray-500 font-medium">4d ago</span>
|
||||||
|
<span class="text-gray-500 font-medium">·</span>
|
||||||
|
<button type="button" class="text-gray-900 font-medium">Reply</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="bg-gray-50 px-4 py-6 sm:px-6">
|
||||||
|
<div class="flex space-x-3">
|
||||||
|
<div class="flex-shrink-0">
|
||||||
|
<img class="h-10 w-10 rounded-co"
|
||||||
|
src="https://images.unsplash.com/photo-1517365830460-955ce3ccd263?ixlib=rb-=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=8&w=256&h=256&q=80"
|
||||||
|
alt="">
|
||||||
|
</div>
|
||||||
|
<div class="min-w-0 flex-1">
|
||||||
|
<form action="#">
|
||||||
|
<div>
|
||||||
|
<label for="comment" class="sr-only">Note</label>
|
||||||
|
<textarea id="comment" name="comment" rows="3"
|
||||||
|
class="shadow-sm block w-full focus:ring-blue-500 focus:border-blue-500 sm:text-sm border border-gray-300 rounded-md"
|
||||||
|
placeholder="Ajouter une note"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="mt-3 flex items-center justify-between">
|
||||||
|
<a href="#"
|
||||||
|
class="group inline-flex items-start text-sm space-x-2 text-gray-500 hover:text-gray-900">
|
||||||
|
<!-- Heroicon name: solid/question-mark-circle -->
|
||||||
|
{{.IconSet.Icon "hero:solid/question-mark-icon" "flex-shrink-0 h-5 w-5 text-gray-400 group-hover:text-gray-500" }}
|
||||||
|
<span> Accepte le "markdown". </span>
|
||||||
|
</a>
|
||||||
|
<button type="submit"
|
||||||
|
class="inline-flex items-center justify-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-co-blue hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Ajouter la note</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,173 @@
|
||||||
|
{{define "content"}}
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h1 class="text-2xl font-semibold text-gray-900">Ajouter un bénéficiaire</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8"
|
||||||
|
x-data="{
|
||||||
|
fields: {
|
||||||
|
first_name: null,
|
||||||
|
last_name: null,
|
||||||
|
email: null,
|
||||||
|
phone_number: null,
|
||||||
|
birthdate: null
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
first_name: ['required'],
|
||||||
|
last_name: ['required'],
|
||||||
|
email: ['required', 'email'],
|
||||||
|
phone_number: ['required', 'regexMatch:^((\\+)33|0)[1-9](\\d{2}){4}$'],
|
||||||
|
birthdate: ['optional'],
|
||||||
|
},
|
||||||
|
formValidation: {
|
||||||
|
valid: false,
|
||||||
|
fields: {
|
||||||
|
first_name: {valid: null},
|
||||||
|
last_name: {valid: null},
|
||||||
|
email: {valid: null},
|
||||||
|
phone_number: {valid: null},
|
||||||
|
birthdate: {valid: null},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isFormValid: true,
|
||||||
|
validate() {
|
||||||
|
this.formValidation = Iodine.assert(this.fields, this.rules)
|
||||||
|
},
|
||||||
|
validateField(field) {
|
||||||
|
this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field])
|
||||||
|
},
|
||||||
|
submit(event) {
|
||||||
|
this.validate()
|
||||||
|
if(!this.formValidation.valid) {
|
||||||
|
this.isFormValid = false
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
return this.formValidation.valid
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<form class="space-y-6" method="POST" @submit="submit">
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Informations obligatoires</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Informations personnelles sur le bénéficiaire obligatoires
|
||||||
|
pour créer son profil dans PARCOURSMOB</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 md:mt-0 md:col-span-2">
|
||||||
|
<div class="grid grid-cols-6 gap-6">
|
||||||
|
<div class="col-span-6 sm:col-span-3">
|
||||||
|
<label for="first_name" class="block text-sm font-medium text-gray-700">Prénom</label>
|
||||||
|
<input type="text" name="first_name" id="first_name" autocomplete="given-name"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.first_name" @blur="validateField('first_name')"
|
||||||
|
:class="formValidation.fields.first_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-3">
|
||||||
|
<label for="last_name" class="block text-sm font-medium text-gray-700">Nom</label>
|
||||||
|
<input type="text" name="last_name" id="last_name" autocomplete="family-name"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.last_name" @blur="validateField('last_name')"
|
||||||
|
:class="formValidation.fields.last_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-4">
|
||||||
|
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
|
||||||
|
<input type="text" name="email" id="email" autocomplete="email"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.email" @blur="validateField('email')"
|
||||||
|
:class="formValidation.fields.email.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-4">
|
||||||
|
<label for="phone_number" class="block text-sm font-medium text-gray-700">Numéro de
|
||||||
|
téléphone</label>
|
||||||
|
<input type="text" name="phone_number" id="phone_number" autocomplete="phone" placeholder="+33612345678"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.phone_number" @blur="validateField('phone_number')"
|
||||||
|
:class="formValidation.fields.phone_number.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Informations optionnelles</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Autres informations de profil optionnelles</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
|
||||||
|
<div class="grid grid-cols-6 gap-6">
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-3">
|
||||||
|
<label for="birthdate" class="block text-sm font-medium text-gray-700">Date de
|
||||||
|
naissance</label>
|
||||||
|
<input type="date" name="birthdate" id="birthdate" autocomplete="birthdate" placeholder="JJ/MM/AAAA"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.birthdate" @blur="validateField('birthdate')"
|
||||||
|
:class="formValidation.fields.birthdate.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-3">
|
||||||
|
<label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
|
||||||
|
<div class="sm:mt-0 sm:col-span-2">
|
||||||
|
<select id="gender" name="gender" autocomplete="gender" x-model="gender"
|
||||||
|
class="max-w-lg mt-1 block focus:ring-co-blue focus:border-co-blue w-full shadow-sm sm:max-w-xs sm:text-sm border-gray-300 rounded-2xl">
|
||||||
|
<option value="0">Inconnu</option>
|
||||||
|
<option value="1">Masculin</option>
|
||||||
|
<option value="2">Féminin</option>
|
||||||
|
<option value="9">Sans objet</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="col-span-3 sm:col-span-3">
|
||||||
|
<label class="block text-sm font-medium text-gray-700"> Photo </label>
|
||||||
|
<div class="mt-1 flex items-center space-x-5">
|
||||||
|
<span class="inline-block h-12 w-12 rounded-co overflow-hidden bg-gray-100">
|
||||||
|
{{.IconSet.Icon "img:profile-picture-placeholder" "h-full w-full"}}
|
||||||
|
</span>
|
||||||
|
<button type="button"
|
||||||
|
class="bg-white py-2 px-3 border border-gray-300 rounded-2xl shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
||||||
|
Charger la photo
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Paramètres</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Paramètres liés au bénéficiaire, utiles pour exploiter les fonctionnalités de PARCOURSMOB</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
|
||||||
|
|
||||||
|
{{ $fieldName := "address" }}
|
||||||
|
{{ template "address_autocomplete" dict "FieldName" $fieldName }}
|
||||||
|
|
||||||
|
<!-- will dolater : tags, groups, ... -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
|
||||||
|
<a href="/app/beneficiaries/">
|
||||||
|
<button type="button"
|
||||||
|
class="bg-white py-2 px-4 border border-gray-300 rounded-2xl shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
|
||||||
|
</a>
|
||||||
|
<button type="submit"
|
||||||
|
class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-2xl text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Créer le bénéficiaire</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,304 @@
|
||||||
|
{{define "content"}}
|
||||||
|
<main class="py-10">
|
||||||
|
<!-- Page header -->
|
||||||
|
<div class="max-w-3xl mx-auto px-4 sm:px-6 md:flex md:items-center md:justify-between md:space-x-5 lg:max-w-7xl lg:px-8">
|
||||||
|
<div class="flex items-center space-x-5">
|
||||||
|
<div class="flex-shrink-0">
|
||||||
|
<div class="relative">
|
||||||
|
<img class="h-16 w-16 rounded-co" src="/app/beneficiaries/{{.ViewState.ID}}/picture" alt="">
|
||||||
|
<span class="absolute inset-0 shadow-inner rounded-full" aria-hidden="true"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold text-gray-900">{{.ViewState.Data.first_name}}
|
||||||
|
{{.ViewState.Data.last_name}}</h1>
|
||||||
|
<p class="text-sm font-medium text-gray-500">{{if .ViewState.Metadata.created}}Ajouté le <time
|
||||||
|
datetime="2022-07-25">{{.ViewState.Metadata.created}}</time> par
|
||||||
|
<a href="#" class="text-gray-900">Conseiller 1</a>{{end}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="mt-6 flex flex-col-reverse justify-stretch space-y-4 space-y-reverse sm:flex-row-reverse sm:justify-end sm:space-x-reverse sm:space-y-0 sm:space-x-3 md:mt-0 md:flex-row md:space-x-3">
|
||||||
|
<button type="button"
|
||||||
|
class="inline-flex items-center justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-2xl text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Supprimer</button>
|
||||||
|
<a href="/app/beneficiaries/{{.ViewState.ID}}/update" class="inline-flex"><button type="button"
|
||||||
|
class="w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Modifier</button></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-8 max-w-3xl mx-auto grid grid-cols-1 gap-6 sm:px-6 lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-3">
|
||||||
|
<div class="space-y-6 lg:col-start-1 lg:col-span-2">
|
||||||
|
<section aria-labelledby="beneficiary-information-title">
|
||||||
|
<div class="bg-white shadow sm:rounded-lg">
|
||||||
|
<div class="px-4 py-5 sm:px-6">
|
||||||
|
<h2 id="beneficiary-information-title" class="text-lg leading-6 font-medium text-gray-900">
|
||||||
|
Informations personnelles</h2>
|
||||||
|
<p class="mt-1 max-w-2xl text-sm text-gray-500">Informations générales sur le bénéficiaire.</p>
|
||||||
|
</div>
|
||||||
|
<div class="border-t border-gray-200 px-4 py-5 sm:px-6">
|
||||||
|
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
|
||||||
|
{{if .ViewState.Data.email}}
|
||||||
|
<div class="sm:col-span-1">
|
||||||
|
<dt class="text-sm font-medium text-gray-500">Email</dt>
|
||||||
|
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.Data.email}}</dd>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{if .ViewState.Data.phone_number}}
|
||||||
|
<div class="sm:col-span-1">
|
||||||
|
<dt class="text-sm font-medium text-gray-500">Téléphone</dt>
|
||||||
|
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.Data.phone_number}}</dd>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{if .ViewState.Data.birthdate}}
|
||||||
|
<div class="sm:col-span-1">
|
||||||
|
<dt class="text-sm font-medium text-gray-500">Date de naissance</dt>
|
||||||
|
<dd class="mt-1 text-sm text-gray-900">{{(timeFrom .ViewState.Data.birthdate).Format
|
||||||
|
"02/01/2006"}}</dd>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{if and .ViewState.Data.gender (ne .ViewState.Data.gender "0")}}
|
||||||
|
<div class="sm:col-span-1">
|
||||||
|
<dt class="text-sm font-medium text-gray-500">Genre</dt>
|
||||||
|
<dd class="mt-1 text-sm text-gray-900">{{genderISO5218 .ViewState.Data.gender}}</dd>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{if .ViewState.Data.address}}
|
||||||
|
<div class="sm:col-span-1">
|
||||||
|
<dt class="text-sm font-medium text-gray-500">Adresse</dt>
|
||||||
|
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.Data.address.properties.label}}</dd>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section aria-labelledby="functionalities-title" x-data="{
|
||||||
|
tab: 'notes',
|
||||||
|
to(event) {
|
||||||
|
this.tab = event.target.value
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<div class="bg-white shadow sm:rounded-lg sm:overflow-hidden">
|
||||||
|
<div class="divide-y divide-gray-200">
|
||||||
|
<div>
|
||||||
|
<div class="sm:hidden">
|
||||||
|
<label for="tabs" class="sr-only">Select a tab</label>
|
||||||
|
<select id="tabs" name="tabs" @change="to"
|
||||||
|
class="block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
|
||||||
|
<option value="notes">Notes</option>
|
||||||
|
|
||||||
|
<option value="journeys">Déplacements</option>
|
||||||
|
|
||||||
|
<option value="events">Dispositifs</option>
|
||||||
|
|
||||||
|
<option value="files">Documents</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="hidden sm:block">
|
||||||
|
<div class="border-b border-gray-200 pl-4">
|
||||||
|
<nav class="-mb-px flex space-x-8" aria-label="Tabs">
|
||||||
|
<!-- Current: "border-indigo-500 text-indigo-600", Default: "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300" -->
|
||||||
|
<a href="#" @click="tab = 'notes'"
|
||||||
|
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||||
|
:class="tab == 'notes' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||||
|
Notes </a>
|
||||||
|
|
||||||
|
<a href="#" @click="tab = 'journeys'"
|
||||||
|
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||||
|
:class="tab == 'journeys' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||||
|
Déplacements </a>
|
||||||
|
|
||||||
|
<a href="#" @click="tab = 'vehicles'"
|
||||||
|
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||||
|
:class="tab == 'vehicles' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||||
|
Véhicules </a>
|
||||||
|
|
||||||
|
<a href="#" @click="tab = 'events'"
|
||||||
|
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||||
|
:class="tab == 'events' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||||
|
Dispositifs </a>
|
||||||
|
|
||||||
|
<a href="#" @click="tab = 'files'"
|
||||||
|
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||||
|
:class="tab == 'files' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||||
|
Documents </a>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div x-show="tab == 'notes'">{{template "beneficiary_notes" .}}</div>
|
||||||
|
<div x-show="tab == 'journeys'">{{template "beneficiary_journeys" .}}</div>
|
||||||
|
<div x-show="tab == 'events'">{{template "beneficiary_events" .}}</div>
|
||||||
|
<div x-show="tab == 'files'">{{template "beneficiary_files" .}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section aria-labelledby="timeline-title" class="lg:col-start-3 lg:col-span-1">
|
||||||
|
<div class="bg-white px-4 py-5 shadow sm:rounded-lg sm:px-6">
|
||||||
|
<h2 id="timeline-title" class="text-lg font-medium text-gray-900">Actions réalisées</h2>
|
||||||
|
|
||||||
|
<!-- Activity Feed -->
|
||||||
|
<div class="mt-6 flow-root">
|
||||||
|
<ul role="list" class="-mb-8">
|
||||||
|
<li>
|
||||||
|
<div class="relative pb-8">
|
||||||
|
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
|
||||||
|
aria-hidden="true"></span>
|
||||||
|
<div class="relative flex space-x-3">
|
||||||
|
<div>
|
||||||
|
<span
|
||||||
|
class="h-8 w-8 rounded-full bg-gray-400 flex items-center justify-center ring-8 ring-white">
|
||||||
|
<!-- Heroicon name: solid/user -->
|
||||||
|
<svg class="w-5 h-5 text-white" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
||||||
|
clip-rule="evenodd" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm text-gray-500">Applied to <a href="#"
|
||||||
|
class="font-medium text-gray-900">Front End Developer</a></p>
|
||||||
|
</div>
|
||||||
|
<div class="text-right text-sm whitespace-nowrap text-gray-500">
|
||||||
|
<time datetime="2020-09-20">Sep 20</time>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div class="relative pb-8">
|
||||||
|
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
|
||||||
|
aria-hidden="true"></span>
|
||||||
|
<div class="relative flex space-x-3">
|
||||||
|
<div>
|
||||||
|
<span
|
||||||
|
class="h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center ring-8 ring-white">
|
||||||
|
<!-- Heroicon name: solid/thumb-up -->
|
||||||
|
<svg class="w-5 h-5 text-white" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
|
<path
|
||||||
|
d="M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm text-gray-500">Advanced to phone screening by <a href="#"
|
||||||
|
class="font-medium text-gray-900">Bethany Blake</a></p>
|
||||||
|
</div>
|
||||||
|
<div class="text-right text-sm whitespace-nowrap text-gray-500">
|
||||||
|
<time datetime="2020-09-22">Sep 22</time>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div class="relative pb-8">
|
||||||
|
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
|
||||||
|
aria-hidden="true"></span>
|
||||||
|
<div class="relative flex space-x-3">
|
||||||
|
<div>
|
||||||
|
<span
|
||||||
|
class="h-8 w-8 rounded-full bg-green-500 flex items-center justify-center ring-8 ring-white">
|
||||||
|
<!-- Heroicon name: solid/check -->
|
||||||
|
<svg class="w-5 h-5 text-white" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
||||||
|
clip-rule="evenodd" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm text-gray-500">Completed phone screening with <a href="#"
|
||||||
|
class="font-medium text-gray-900">Martha Gardner</a></p>
|
||||||
|
</div>
|
||||||
|
<div class="text-right text-sm whitespace-nowrap text-gray-500">
|
||||||
|
<time datetime="2020-09-28">Sep 28</time>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div class="relative pb-8">
|
||||||
|
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
|
||||||
|
aria-hidden="true"></span>
|
||||||
|
<div class="relative flex space-x-3">
|
||||||
|
<div>
|
||||||
|
<span
|
||||||
|
class="h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center ring-8 ring-white">
|
||||||
|
<!-- Heroicon name: solid/thumb-up -->
|
||||||
|
<svg class="w-5 h-5 text-white" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
|
<path
|
||||||
|
d="M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm text-gray-500">Advanced to interview by <a href="#"
|
||||||
|
class="font-medium text-gray-900">Bethany Blake</a></p>
|
||||||
|
</div>
|
||||||
|
<div class="text-right text-sm whitespace-nowrap text-gray-500">
|
||||||
|
<time datetime="2020-09-30">Sep 30</time>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div class="relative pb-8">
|
||||||
|
<div class="relative flex space-x-3">
|
||||||
|
<div>
|
||||||
|
<span
|
||||||
|
class="h-8 w-8 rounded-full bg-green-500 flex items-center justify-center ring-8 ring-white">
|
||||||
|
<!-- Heroicon name: solid/check -->
|
||||||
|
<svg class="w-5 h-5 text-white" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
||||||
|
clip-rule="evenodd" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm text-gray-500">Completed interview with <a href="#"
|
||||||
|
class="font-medium text-gray-900">Katherine Snyder</a></p>
|
||||||
|
</div>
|
||||||
|
<div class="text-right text-sm whitespace-nowrap text-gray-500">
|
||||||
|
<time datetime="2020-10-04">Oct 4</time>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="mt-6 flex flex-col justify-stretch">
|
||||||
|
<button type="button"
|
||||||
|
class="inline-flex items-center justify-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">Advance
|
||||||
|
to offer</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,159 @@
|
||||||
|
{{define "content"}}
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h1 class="text-2xl font-semibold text-gray-900">Bénéficiaires</h1>
|
||||||
|
|
||||||
|
<div class="sm:flex sm:items-center">
|
||||||
|
<div class="sm:flex-auto">
|
||||||
|
<p class="mt-2 text-sm text-gray-700"></p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
|
||||||
|
<a href="/app/beneficiaries/create">
|
||||||
|
<button type="button"
|
||||||
|
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-ci-blue focus:ring-offset-2 sm:w-auto">
|
||||||
|
{{$.IconSet.Icon "hero:outline/plus-circle" "h-5 w-5 mr-3"}}
|
||||||
|
Ajouter
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8" x-data="{
|
||||||
|
state: {{.ViewState.JSONWithLimits 0 10}},
|
||||||
|
current: 0,
|
||||||
|
nb_pages() {
|
||||||
|
let nbEl = this.state.count
|
||||||
|
return Math.ceil(nbEl/10)
|
||||||
|
},
|
||||||
|
async paginate(page) {
|
||||||
|
let start = (page-1)*10
|
||||||
|
if(start < 0|| start > this.state.count) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let resp = await fetch('/api/cache/' + this.state.cache_id + '?limits.min=' + start + '&limits.max=' + (start+10))
|
||||||
|
let data = await resp.json()
|
||||||
|
this.state.beneficiaries = data
|
||||||
|
this.current=page-1
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<div class="mt-8 flex flex-col">
|
||||||
|
<div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
|
||||||
|
<div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
|
||||||
|
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
|
||||||
|
<table class="min-w-full divide-y divide-gray-300">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th scope="col"
|
||||||
|
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
|
Nom
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Téléphone
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Adresse
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Labels
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
||||||
|
<span class="sr-only">Modifier</span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-200 bg-white">
|
||||||
|
<template x-for="beneficiary in state.beneficiaries">
|
||||||
|
<tr>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="h-10 w-10 flex-shrink-0">
|
||||||
|
<img class="h-10 w-10 rounded-co"
|
||||||
|
:src="'/app/beneficiaries/' + beneficiary.id + '/picture'" alt="">
|
||||||
|
</div>
|
||||||
|
<div class="ml-4">
|
||||||
|
<div class="font-medium text-gray-900"><span
|
||||||
|
x-text="beneficiary.data.first_name"></span> <span
|
||||||
|
x-text="beneficiary.data.last_name"></span></div>
|
||||||
|
<div class="text-gray-500" x-text="beneficiary.data.email"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||||
|
<div class="text-gray-900" x-text="beneficiary.data.phone_number"></div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"
|
||||||
|
x-text="beneficiary.data.address ? beneficiary.data.address.properties.label : ''">
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||||
|
<template x-for="tag in beneficiary.data.tags">
|
||||||
|
<span
|
||||||
|
class="inline-flex rounded-full bg-green-100 px-2 text-xs font-semibold leading-5 text-green-800"
|
||||||
|
x-text="tag"></span>
|
||||||
|
</template>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
|
||||||
|
<a :href="'/app/beneficiaries/' + beneficiary.id"
|
||||||
|
class="text-co-blue hover:text-co-blue">Voir<span class="sr-only">, <span
|
||||||
|
x-text="beneficiary.data.first_name"></span> <span
|
||||||
|
x-text="beneficiary.data.last_name"></span></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- More people... -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6">
|
||||||
|
<div class="flex-1 flex justify-between sm:hidden">
|
||||||
|
<a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"
|
||||||
|
@click="paginate(current)"> Previous </a>
|
||||||
|
<a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"
|
||||||
|
@click="paginate(current+2)"> Next </a>
|
||||||
|
</div>
|
||||||
|
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm text-gray-700">
|
||||||
|
Résultats
|
||||||
|
<span class="font-medium" x-text="Math.min((current * 10)+1, state.count)"></span>
|
||||||
|
à
|
||||||
|
<span class="font-medium" x-text="Math.min((current * 10)+10, state.count)"></span>
|
||||||
|
sur
|
||||||
|
<span class="font-medium" x-text="state.count"></span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
|
||||||
|
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"
|
||||||
|
@click="paginate(current)">
|
||||||
|
<span class="sr-only">Previous</span>
|
||||||
|
<!-- Heroicon name: solid/chevron-left -->
|
||||||
|
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
<template x-for="i in nb_pages">
|
||||||
|
<a href="#" @click="paginate(i)"
|
||||||
|
class="relative inline-flex items-center px-4 py-2 border text-sm font-medium"
|
||||||
|
:class="i == current+1 ? 'z-10 bg-indigo-50 border-co-blue text-co-blue' : 'bg-white border-gray-300 text-gray-500 hover:bg-gray-50'"
|
||||||
|
x-text="i"></a>
|
||||||
|
</template>
|
||||||
|
<!-- Current: "z-10 bg-indigo-50 border-indigo-500 text-indigo-600", Default: "bg-white border-gray-300 text-gray-500 hover:bg-gray-50" -->
|
||||||
|
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"
|
||||||
|
@click="paginate(current+2)">
|
||||||
|
<span class="sr-only">Next</span>
|
||||||
|
<!-- Heroicon name: solid/chevron-right -->
|
||||||
|
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,173 @@
|
||||||
|
{{define "content"}}
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h1 class="text-2xl font-semibold text-gray-900">Modifier un bénéficiaire</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8"
|
||||||
|
x-data="{
|
||||||
|
fields: {
|
||||||
|
first_name: '{{ .ViewState.Data.first_name }}',
|
||||||
|
last_name: '{{ .ViewState.Data.last_name }}',
|
||||||
|
email: '{{ .ViewState.Data.email }}',
|
||||||
|
phone_number: '{{ .ViewState.Data.phone_number }}',
|
||||||
|
birthdate: {{if .ViewState.Data.birthdate}}'{{ (timeFrom .ViewState.Data.birthdate).Format "2006-01-02" }}'{{else}}null{{end}},
|
||||||
|
gender: {{.ViewState.Data.gender}}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
first_name: ['required'],
|
||||||
|
last_name: ['required'],
|
||||||
|
email: ['required', 'email'],
|
||||||
|
phone_number: ['required', 'regexMatch:^((\\+)33|0)[1-9](\\d{2}){4}$'],
|
||||||
|
birthdate: ['optional'],
|
||||||
|
},
|
||||||
|
formValidation: {
|
||||||
|
valid: false,
|
||||||
|
fields: {
|
||||||
|
first_name: {valid: null},
|
||||||
|
last_name: {valid: null},
|
||||||
|
email: {valid: null},
|
||||||
|
phone_number: {valid: null},
|
||||||
|
birthdate: {valid: null},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isFormValid: true,
|
||||||
|
validate() {
|
||||||
|
this.formValidation = Iodine.assert(this.fields, this.rules)
|
||||||
|
},
|
||||||
|
validateField(field) {
|
||||||
|
this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field])
|
||||||
|
},
|
||||||
|
submit(event) {
|
||||||
|
this.validate()
|
||||||
|
if(!this.formValidation.valid) {
|
||||||
|
this.isFormValid = false
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
return this.formValidation.valid
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<form class="space-y-6" method="POST" @submit="submit">
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Informations obligatoires</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Informations personnelles sur le bénéficiaire obligatoires
|
||||||
|
pour créer son profil dans PARCOURSMOB</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 md:mt-0 md:col-span-2">
|
||||||
|
<div class="grid grid-cols-6 gap-6">
|
||||||
|
<div class="col-span-6 sm:col-span-3">
|
||||||
|
<label for="first_name" class="block text-sm font-medium text-gray-700">Prénom</label>
|
||||||
|
<input type="text" name="first_name" id="first_name" autocomplete="given-name"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.first_name" @blur="validateField('first_name')"
|
||||||
|
:class="formValidation.fields.first_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-3">
|
||||||
|
<label for="last_name" class="block text-sm font-medium text-gray-700">Nom</label>
|
||||||
|
<input type="text" name="last_name" id="last_name" autocomplete="family-name"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.last_name" @blur="validateField('last_name')"
|
||||||
|
:class="formValidation.fields.last_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-4">
|
||||||
|
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
|
||||||
|
<input type="text" name="email" id="email" autocomplete="email"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.email" @blur="validateField('email')"
|
||||||
|
:class="formValidation.fields.email.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-4">
|
||||||
|
<label for="phone_number" class="block text-sm font-medium text-gray-700">Numéro de
|
||||||
|
téléphone</label>
|
||||||
|
<input type="text" name="phone_number" id="phone_number" autocomplete="phone" placeholder="+33612345678"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.phone_number" @blur="validateField('phone_number')"
|
||||||
|
:class="formValidation.fields.phone_number.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Informations optionnelles</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Autres informations de profil optionnelles</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
|
||||||
|
<div class="grid grid-cols-6 gap-6">
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-3">
|
||||||
|
<label for="birthdate" class="block text-sm font-medium text-gray-700">Date de
|
||||||
|
naissance</label>
|
||||||
|
<input type="date" name="birthdate" id="birthdate" autocomplete="birthdate" placeholder="JJ/MM/AAAA"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.birthdate" @blur="validateField('birthdate')"
|
||||||
|
:class="formValidation.fields.birthdate.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-span-6 sm:col-span-3">
|
||||||
|
<label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
|
||||||
|
<div class="sm:mt-0 sm:col-span-2">
|
||||||
|
<select id="gender" name="gender" autocomplete="gender" x-model="gender"
|
||||||
|
class="max-w-lg mt-1 block focus:ring-co-blue focus:border-co-blue w-full shadow-sm sm:max-w-xs sm:text-sm border-gray-300 rounded-2xl">
|
||||||
|
<option value="0">Inconnu</option>
|
||||||
|
<option value="1" :selected="fields.gender == '1'">Masculin</option>
|
||||||
|
<option value="2" :selected="fields.gender == '2'">Féminin</option>
|
||||||
|
<option value="9" :selected="fields.gender == '9'">Sans objet</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="col-span-3 sm:col-span-3">
|
||||||
|
<label class="block text-sm font-medium text-gray-700"> Photo </label>
|
||||||
|
<div class="mt-1 flex items-center space-x-5">
|
||||||
|
<span class="inline-block h-12 w-12 rounded-co overflow-hidden bg-gray-100">
|
||||||
|
{{.IconSet.Icon "img:profile-picture-placeholder" "h-full w-full"}}
|
||||||
|
</span>
|
||||||
|
<button type="button"
|
||||||
|
class="bg-white py-2 px-3 border border-gray-300 rounded-2xl shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
||||||
|
Charger la photo
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Paramètres</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Paramètres liés au bénéficiaire, utiles pour exploiter les fonctionnalités de PARCOURSMOB</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
|
||||||
|
|
||||||
|
{{ $fieldName := "address" }}
|
||||||
|
{{ template "address_autocomplete" (dict "FieldName" $fieldName "Address" .ViewState.Data.address) }}
|
||||||
|
<!-- will dolater : tags, groups, ... -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
|
||||||
|
<a href="/app/beneficiaries/{{.ViewState.ID}}">
|
||||||
|
<button type="button"
|
||||||
|
class="bg-white py-2 px-4 border border-gray-300 rounded-2xl shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
|
||||||
|
</a>
|
||||||
|
<button type="submit"
|
||||||
|
class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-2xl text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Modifier</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,31 @@
|
||||||
|
{{define "beneficiaries_widget"}}
|
||||||
|
<div class="col-span-1 bg-white rounded-2xl shadow divide-y divide-gray-200">
|
||||||
|
<div class="-ml-4 -mt-2 px-4 py-2 flex items-center justify-between flex-wrap sm:flex-nowrap">
|
||||||
|
<div class="ml-4 mt-2">
|
||||||
|
<h3 class="text-lg leading-6 font-medium text-gray-900">Bénéficiaires</h3>
|
||||||
|
<h2 class="text-sm leading-6 font-medium text-gray-600">Derniers ajoutés</h2>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="ml-4 mt-2 flex-shrink-0">
|
||||||
|
<button type="button" class="relative inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Voir</button>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
<ul role="list" class="divide-y divide-gray-200">
|
||||||
|
{{range .latest}}
|
||||||
|
<li class="py-2 px-4 flex">
|
||||||
|
<a href="/app/beneficiaries/{{.ID}}" class="flex w-full">
|
||||||
|
<img class="h-6 w-6 rounded-co" src="/app/beneficiaries/{{.ID}}/picture" alt="">
|
||||||
|
<div class="ml-3">
|
||||||
|
<p class="text-sm font-medium text-gray-900">{{.Data.first_name}} {{.Data.last_name}}</p>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<a href="/app/beneficiaries/">
|
||||||
|
<button class="w-full p-2 text-center bg-co-blue text-white rounded-b-2xl text-sm">
|
||||||
|
Gérer les bénéficiaires
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,15 @@
|
||||||
|
{{define "content"}}
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h1 class="text-2xl font-semibold text-gray-900">Tableau de bord</h1>
|
||||||
|
</div>
|
||||||
|
<div class="max-w-7xl mx-auto py-8 px-4 sm:px-6 md:px-8">
|
||||||
|
<div class="py-4 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||||
|
|
||||||
|
|
||||||
|
{{template "beneficiaries_widget" .ViewState.beneficiaries}}
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,177 @@
|
||||||
|
{{define "main"}}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="h-full bg-gray-100">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>PARCOURSMOB</title>
|
||||||
|
<link rel="stylesheet" href="/public/css/main.css" />
|
||||||
|
<!-- <script defer type="text/javascript" src="/public/js/main.js" defer></script> -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/@kingshott/iodine@8.1.0/dist/iodine.min.umd.js" defer></script>
|
||||||
|
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="h-full" x-data="{ offCanvasMenu: false }">
|
||||||
|
<div class="relative z-40 md:hidden" role="dialog" aria-modal="true">
|
||||||
|
|
||||||
|
<div class="fixed inset-0 bg-gray-600 bg-opacity-75" x-show="offCanvasMenu"
|
||||||
|
x-transition:enter="transition-opacity ease-linear duration-300" x-transition:enter-start="opacity-0"
|
||||||
|
x-transition:enter-end="opacity-100" x-transition:leave="transition-opacity ease-linear duration-300"
|
||||||
|
x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0"></div>
|
||||||
|
|
||||||
|
<div class="fixed inset-0 flex z-40" x-show="offCanvasMenu"
|
||||||
|
x-transition:enter="transition ease-in-out duration-300 transform" x-transition:enter-start="-translate-x-full"
|
||||||
|
x-transition:enter-end="translate-x-0" x-transition:leave="transition ease-in-out duration-300 transform"
|
||||||
|
x-transition:leave-start="translate-x-0" x-transition:leave-end="-translate-x-full">
|
||||||
|
<div class="relative flex-1 flex flex-col max-w-xs w-full pt-5 pb-4 bg-co-blue">
|
||||||
|
<div class="absolute top-0 right-0 -mr-12 pt-2" @click="offCanvasMenu = false">
|
||||||
|
<button type="button"
|
||||||
|
class="ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white">
|
||||||
|
<span class="sr-only">Close sidebar</span>
|
||||||
|
{{ .IconSet.Icon "hero:outline/x" "h-6 w-6" }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex-shrink-0 flex items-center px-4">
|
||||||
|
<img class="h-8 w-auto" src="/public/images/parcoursmob_logo_whitered.svg" alt="PARCOURSMOB">
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 flex-1 h-0 overflow-y-auto">
|
||||||
|
|
||||||
|
{{ template "mainmenu" . }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex-shrink-0 w-14" aria-hidden="true">
|
||||||
|
<!-- Dummy element to force sidebar to shrink to fit close icon -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Static sidebar for desktop -->
|
||||||
|
<div class="hidden md:flex md:w-64 md:flex-col md:fixed md:inset-y-0">
|
||||||
|
<!-- Sidebar component, swap this element with another sidebar if you like -->
|
||||||
|
<div class="flex flex-col flex-grow pt-5 bg-co-blue overflow-y-auto">
|
||||||
|
<div class="flex items-center flex-shrink-0 px-4">
|
||||||
|
<img class="h-8 w-auto" src="/public/images/parcoursmob_logo_whitered.svg" alt="PARCOURSMOB">
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 flex-1 flex flex-col">
|
||||||
|
{{ template "mainmenu" . }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="md:pl-64 flex flex-col flex-1">
|
||||||
|
<div class="sticky top-0 z-10 flex-shrink-0 flex h-16 bg-white shadow">
|
||||||
|
<button @click="offCanvasMenu = true" type="button"
|
||||||
|
class="px-4 border-r border-gray-200 text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-co-blue md:hidden">
|
||||||
|
<span class="sr-only">Open sidebar</span>
|
||||||
|
<!-- Heroicon name: outline/menu-alt-2 -->
|
||||||
|
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2"
|
||||||
|
stroke="currentColor" aria-hidden="true">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h7" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<div class="flex-1 px-4 flex justify-between">
|
||||||
|
<div class="flex-1 flex">
|
||||||
|
<form class="w-full flex md:ml-0" action="/app/beneficiaries/" method="GET">
|
||||||
|
<label for="search-field" class="sr-only">Search</label>
|
||||||
|
<div class="relative w-full text-gray-400 focus-within:text-gray-600">
|
||||||
|
<div class="absolute inset-y-0 left-0 flex items-center pointer-events-none">
|
||||||
|
<!-- Heroicon name: solid/search -->
|
||||||
|
{{$.IconSet.Icon "hero:solid/search" "h5 w-5"}}
|
||||||
|
</div>
|
||||||
|
<input id="search-field"
|
||||||
|
class="block w-full h-full pl-8 pr-3 py-2 border-transparent text-gray-900 placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-0 focus:border-transparent sm:text-sm"
|
||||||
|
placeholder="Chercher un bénéficiaire" type="search" name="search">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="ml-4 flex items-center md:ml-6">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="/app/administration/">
|
||||||
|
{{if and .AdministrationState.Display .AdministrationState.Active}}
|
||||||
|
<button
|
||||||
|
class="max-w-xs bg-co-blue px-4 py-2 text-white flex items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
||||||
|
{{.IconSet.Icon "hero:outline/cog" "h-6 w-6"}} Administration
|
||||||
|
</button>
|
||||||
|
{{else if and .AdministrationState.Display}}
|
||||||
|
<button
|
||||||
|
class="max-w-xs bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 flex items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
||||||
|
{{.IconSet.Icon "hero:outline/cog" "h-6 w-6"}} Administration
|
||||||
|
</button>
|
||||||
|
{{end}}
|
||||||
|
</a>
|
||||||
|
<div class="ml-3 relative" x-data="{ groupMenuOpen: false }">
|
||||||
|
<div>
|
||||||
|
<button @click="groupMenuOpen = ! groupMenuOpen" type="button"
|
||||||
|
class="max-w-xs bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 flex items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
||||||
|
{{.Group.Data.name}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"
|
||||||
|
role="menu" aria-orientation="vertical" aria-labelledby="group-menu-button" tabindex="-1"
|
||||||
|
x-show="groupMenuOpen" x-transition:enter="transition ease-out duration-100"
|
||||||
|
x-transition:enter-start="transform opacity-0 scale-95"
|
||||||
|
x-transition:enter-end="transform opacity-100 scale-100"
|
||||||
|
x-transition:leave="transition ease-in duration-75"
|
||||||
|
x-transition:leave-start="transform opacity-100 scale-100"
|
||||||
|
x-transition:leave-end="transform opacity-0 scale-95">
|
||||||
|
<!-- Active: "bg-gray-100", Not Active: "" -->
|
||||||
|
<a href="/app/group/settings" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
|
||||||
|
id="user-menu-item-1">Paramètres</a>
|
||||||
|
|
||||||
|
<a href="/auth/groups/switch" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
|
||||||
|
id="user-menu-item-2">Changer d'organisation</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Profile dropdown -->
|
||||||
|
<div class="ml-3 relative" x-data="{ profileMenuOpen: false }">
|
||||||
|
<div>
|
||||||
|
<button @click="profileMenuOpen = ! profileMenuOpen" type="button"
|
||||||
|
class="max-w-xs bg-white flex items-center text-sm rounded-co focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue"
|
||||||
|
id="user-menu-button" aria-expanded="false" aria-haspopup="true">
|
||||||
|
<span class="sr-only">Open user menu</span>
|
||||||
|
<img class="h-8 w-8 rounded-co"
|
||||||
|
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
|
||||||
|
alt="Menu utilisateur">
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"
|
||||||
|
role="menu" aria-orientation="vertical" aria-labelledby="user-menu-button" tabindex="-1"
|
||||||
|
x-show="profileMenuOpen" x-transition:enter="transition ease-out duration-100"
|
||||||
|
x-transition:enter-start="transform opacity-0 scale-95"
|
||||||
|
x-transition:enter-end="transform opacity-100 scale-100"
|
||||||
|
x-transition:leave="transition ease-in duration-75"
|
||||||
|
x-transition:leave-start="transform opacity-100 scale-100"
|
||||||
|
x-transition:leave-end="transform opacity-0 scale-95">
|
||||||
|
<!-- Active: "bg-gray-100", Not Active: "" -->
|
||||||
|
<a href="/app/profile" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
|
||||||
|
id="user-menu-item-0">Votre profil</a>
|
||||||
|
|
||||||
|
<a href="/app/settings/" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
|
||||||
|
id="user-menu-item-1">Paramètres</a>
|
||||||
|
|
||||||
|
<a href="/app/disconnect" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
|
||||||
|
id="user-menu-item-2">Se déconnecter</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<div class="py-6">
|
||||||
|
{{ template "content" . }}
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,72 @@
|
||||||
|
{{define "bookings_list"}}
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<div class="mt-8 flex flex-col">
|
||||||
|
<div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
|
||||||
|
<div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
|
||||||
|
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
|
||||||
|
<table class="min-w-full divide-y divide-gray-300">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th scope="col"
|
||||||
|
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
|
Statut
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Type
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Immatriculation
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Beneficiaire
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Prescripteur
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Gestionnaire
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Dates
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
||||||
|
<span class="sr-only">Actions</span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-200 bg-white">
|
||||||
|
<tr>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<a :href="'/app/beneficiaries/' + beneficiary.id"
|
||||||
|
class="text-co-blue hover:text-co-blue">Voir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,63 @@
|
||||||
|
{{define "vehicle_type_select"}}
|
||||||
|
<div x-data="{
|
||||||
|
selectOpen: false,
|
||||||
|
vehicle_type: 'car',
|
||||||
|
vehicle_label: 'Voiture',
|
||||||
|
selectType(type, label) {
|
||||||
|
this.vehicle_type = type,
|
||||||
|
this.vehicle_label = label
|
||||||
|
this.selectOpen = false
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<input type="hidden" name="vehicle_type" x-model="vehicle_type">
|
||||||
|
<label id="listbox-label" class="block text-sm font-medium text-gray-700"> Type de véhicule </label>
|
||||||
|
<div class="mt-1 relative">
|
||||||
|
<button @click="selectOpen = ! selectOpen" type="button"
|
||||||
|
class="relative w-full bg-white border border-gray-300 rounded-2xl shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-co-blue focus:border-co-blue sm:text-sm"
|
||||||
|
aria-haspopup="listbox" aria-expanded="true" aria-labelledby="listbox-label">
|
||||||
|
<span class="block truncate" x-text="vehicle_label"></span>
|
||||||
|
<span class="absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none">
|
||||||
|
{{$.IconSet.Icon "hero:solid/selector" "h-5 w-5 text-gray-400"}}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<ul class="absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-xl py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm"
|
||||||
|
tabindex="-1" role="listbox" aria-labelledby="listbox-label" aria-activedescendant="listbox-option-3"
|
||||||
|
x-show="selectOpen" x-transition:leave="transition ease-in duration-100"
|
||||||
|
x-transition:leave-start="transform opacity-100" x-transition:leave-end="transform opacity-0">
|
||||||
|
|
||||||
|
<li class="text-gray-900 cursor-default select-none relative py-2 pl-8 pr-4 hover:bg-co-blue hover:text-white" id="listbox-option-0"
|
||||||
|
role="option" @click="selectType('car', 'Voiture')">
|
||||||
|
<!-- Selected: "font-semibold", Not Selected: "font-normal" -->
|
||||||
|
<span class="font-normal block truncate "> Voiture </span>
|
||||||
|
<span x-show="vehicle_type == 'car'"
|
||||||
|
class="text-co-blue absolute inset-y-0 left-0 flex items-center pl-1.5">
|
||||||
|
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
|
||||||
|
aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
||||||
|
clip-rule="evenodd" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li class="text-gray-900 cursor-default select-none relative py-2 pl-8 pr-4 hover:bg-co-blue hover:text-white" id="listbox-option-0"
|
||||||
|
role="option" @click="selectType('electric_bike', 'Vélo électrique')">
|
||||||
|
<!-- Selected: "font-semibold", Not Selected: "font-normal" -->
|
||||||
|
<span class="font-normal block truncate "> Vélo électrique </span>
|
||||||
|
<span x-show="vehicle_type == 'electric_bike'"
|
||||||
|
class="text-co-blue hover:text-inherit absolute inset-y-0 left-0 flex items-center pl-1.5">
|
||||||
|
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
|
||||||
|
aria-hidden="true">
|
||||||
|
<path fill-rule="evenodd"
|
||||||
|
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
||||||
|
clip-rule="evenodd" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<!-- More items... -->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{end}}
|
|
@ -0,0 +1,54 @@
|
||||||
|
{{define "vehicles_list"}}
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<div class="mt-8 flex flex-col">
|
||||||
|
<div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
|
||||||
|
<div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
|
||||||
|
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
|
||||||
|
<table class="min-w-full divide-y divide-gray-300">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th scope="col"
|
||||||
|
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
|
Immatriculation
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Gestionnaire
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Modèle
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||||
|
Gestionnaire
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
||||||
|
<span class="sr-only">Actions</span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-200 bg-white">
|
||||||
|
<tr>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >aa</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<a :href="'/app/beneficiaries/' + beneficiary.id"
|
||||||
|
class="text-co-blue hover:text-co-blue">Voir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,106 @@
|
||||||
|
{{define "content"}}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h1 class="text-2xl font-semibold text-gray-900">Ajouter un véhicule</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8" x-data="{
|
||||||
|
fields: {
|
||||||
|
licence_plate: null,
|
||||||
|
name: null,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
licence_plate: ['required', 'regexMatch:^[A-Z]{1,2}-[0-9]{1,3}-[A-Z]{1,2}$'],
|
||||||
|
name: ['required'],
|
||||||
|
},
|
||||||
|
formValidation: {
|
||||||
|
valid: false,
|
||||||
|
fields: {
|
||||||
|
name: {valid: null},
|
||||||
|
licence_plate: {valid: null},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isFormValid: true,
|
||||||
|
validate() {
|
||||||
|
this.formValidation = Iodine.assert(this.fields, this.rules)
|
||||||
|
},
|
||||||
|
validateField(field) {
|
||||||
|
this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field])
|
||||||
|
},
|
||||||
|
submit(event) {
|
||||||
|
this.validate()
|
||||||
|
if(!this.formValidation.valid) {
|
||||||
|
this.isFormValid = false
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
return this.formValidation.valid
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<form class="space-y-6" method="POST" @submit="submit">
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Identité du véhicule</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Informations de base sur le véhicule</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 md:mt-0 md:col-span-2">
|
||||||
|
<div class="grid grid-cols-3 md:grid-cols-6 gap-6">
|
||||||
|
<div class="col-span-5">
|
||||||
|
<label for="name" class="block text-sm font-medium text-gray-700">Modèle (ou nom donné au
|
||||||
|
véhicule)</label>
|
||||||
|
<input type="text" name="name" id="name"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.name" @blur="validateField('name')"
|
||||||
|
:class="formValidation.fields.name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
<div class="col-span-3">
|
||||||
|
{{template "vehicle_type_select" .}}
|
||||||
|
</div>
|
||||||
|
<div class="col-span-3">
|
||||||
|
<label for="licence_plate"
|
||||||
|
class="block text-sm font-medium text-gray-700">Immatriculation</label>
|
||||||
|
<input type="text" name="licence_plate" id="licence_plate" placeholder="XX-123-YY"
|
||||||
|
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||||
|
x-model="fields.licence_plate"
|
||||||
|
@blur="fields.licence_plate = fields.licence_plate.toUpperCase(); validateField('licence_plate')"
|
||||||
|
:class="formValidation.fields.licence_plate.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||||
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Informations pratiques</h3>
|
||||||
|
<p class="mt-1 text-sm text-gray-500">Informations pratiques pour la réservation</p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 md:mt-0 md:col-span-2">
|
||||||
|
{{ $fieldName := "address" }}
|
||||||
|
{{ template "address_autocomplete" dict "FieldName" $fieldName }}
|
||||||
|
|
||||||
|
<div class="mt-5">
|
||||||
|
<label for="informations" class="block text-sm font-medium text-gray-700">Informations pratiques pour le bénéficiaire</label>
|
||||||
|
<div class="mt-1">
|
||||||
|
<textarea rows="4" name="informations" id="informations"
|
||||||
|
class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-2xl"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
|
||||||
|
<a href="/app/vehicles-management/">
|
||||||
|
<button type="button"
|
||||||
|
class="bg-white py-2 px-4 border border-gray-300 rounded-2xl shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
|
||||||
|
</a>
|
||||||
|
<button type="submit"
|
||||||
|
class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-2xl text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Ajouter
|
||||||
|
le véhicule</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
|
@ -0,0 +1,31 @@
|
||||||
|
{{define "content"}}
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h1 class="text-2xl font-semibold text-gray-900">Gestion des véhicules et réservations</h1>
|
||||||
|
|
||||||
|
<h2 class="text-xl font-semibold text-gray-600 pt-8">Réservations</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{template "bookings_list" .}}
|
||||||
|
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h2 class="text-xl font-semibold text-gray-600 pt-8">Véhicules</h2>
|
||||||
|
|
||||||
|
<div class="sm:flex sm:items-center">
|
||||||
|
<div class="sm:flex-auto">
|
||||||
|
<p class="mt-2 text-sm text-gray-700"></p>
|
||||||
|
</div>
|
||||||
|
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
|
||||||
|
<a href="/app/vehicles-management/fleet/add">
|
||||||
|
<button type="button"
|
||||||
|
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-ci-blue focus:ring-offset-2 sm:w-auto">
|
||||||
|
{{$.IconSet.Icon "hero:outline/plus-circle" "h-5 w-5 mr-3"}}
|
||||||
|
Ajouter un véhicule
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{template "vehicles_list" .}}
|
||||||
|
|
||||||
|
{{end}}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 374.2 33.2"><defs><style>.cls-1{fill:#ff1300;}.cls-2{fill:#fff;}</style></defs><g id="Calque_2" data-name="Calque 2"><g id="Calque_1-2" data-name="Calque 1"><path class="cls-1" d="M300.9.6a4.7,4.7,0,0,1,4.9,4.9V32.6h-8.6a4.7,4.7,0,0,1-4.9-4.9V14.1h-.9c-.6,0-1,.6-1,1.5v17H282a4.7,4.7,0,0,1-4.9-4.9V14.1h-1a1.4,1.4,0,0,0-.9,1.5v17H263a1.2,1.2,0,0,1-1.2-1.2V5.5A4.7,4.7,0,0,1,266.7.6h17.9l-.7,5a.9.9,0,0,0,.7,1.1.9.9,0,0,0,1-.8l.8-4.6a.9.9,0,0,1,.9-.7Z"/><path class="cls-1" d="M341.1,16.4c0,9.1-1.9,16.8-16.5,16.8S307.8,25,307.8,16.4,310.6,0,324.6,0,341.1,7.8,341.1,16.4Z"/><path class="cls-1" d="M344.3,32.6a1.2,1.2,0,0,1-1.2-1.2V1.8A1.2,1.2,0,0,1,344.3.6h18.8c6.9,0,10.4,2.9,10.4,8.1s-1.6,6.9-4.5,7.5h0c2.9.6,5.2,3.2,5.2,7.7s-3.5,8.6-10.4,8.6Z"/><path class="cls-2" d="M16.2,11.6c0-.6-.4-.9-1-.9h-.8V31.4a1.2,1.2,0,0,1-1.2,1.2H1.2A1.2,1.2,0,0,1,0,31.4V1.8A1.2,1.2,0,0,1,1.2.6H16.8C25.7.6,30.9,4.2,31,10.7s-4.1,9.9-9.4,10H16.1Z"/><path class="cls-2" d="M44.9,23.1H43.2L40,31.9a1.1,1.1,0,0,1-1.2.7H26.9a1.3,1.3,0,0,1-1.3-1.9L37,3.4A4.5,4.5,0,0,1,41.3.6h5.8a4.1,4.1,0,0,1,4,2.6L62.6,30.8c.5,1-.2,1.8-1.3,1.8H41.7Z"/><path class="cls-2" d="M66.1,32.6a1.2,1.2,0,0,1-1.2-1.2V1.8A1.2,1.2,0,0,1,66.1.6H83.2C92.7.6,95.5,7,95.6,12.3c0,3.3-.8,6.9-3.4,8.3l3.4,12H84.4c-2.3,0-5.2-.7-5.9-2.7L71.9,10.7a1,1,0,0,0-1.2-.7,1,1,0,0,0-.5,1.3l7.2,21.3Z"/><path class="cls-2" d="M129.6,17.1c.8,0,1.3.5,1.2,1.2-.2,8.3-2.9,14.9-16.4,14.9-15.8.1-16.8-8.2-16.8-16.8S100.5,0,114.4,0c15.7,0,16.5,8,16.5,15.4H115.3V11.3c0-.8-.4-1.2-1-1.2s-.9.4-.9,1.2V21.9c0,.9.4,1.2.9,1.2s1-.3,1-1.2V17.1Z"/><path class="cls-2" d="M166.2,16.4c0,9.1-2,16.8-16.6,16.8S132.8,25,132.8,16.4,135.7,0,149.6,0,166.2,7.8,166.2,16.4Z"/><path class="cls-2" d="M200.5,1.8V12.2c0,12.7-1.4,21-16.3,21s-16-8.4-16-20.9V1.8A1.2,1.2,0,0,1,169.4.6h13a.9.9,0,0,1,.9.9V21.8c0,.9.4,1.2,1,1.2s.9-.3.9-1.2V1.5a.9.9,0,0,1,.9-.9h13.1A1.2,1.2,0,0,1,200.5,1.8Z"/><path class="cls-2" d="M203.9,32.6a1.2,1.2,0,0,1-1.3-1.2V1.8A1.2,1.2,0,0,1,203.8.6h17.1c9.5,0,12.3,6.4,12.4,11.7,0,3.3-.8,6.9-3.4,8.3l3.4,12H222.1c-2.3,0-5.2-.7-5.9-2.7l-6.6-19.2a1,1,0,0,0-1.2-.7,1,1,0,0,0-.5,1.3l7.2,21.3Z"/><path class="cls-2" d="M235.8,29.2v-10a1,1,0,0,1,1.5-1l11.1,5.1a1,1,0,0,0,1.2-.4.9.9,0,0,0-.6-1.2l-9.3-4.4c-4.5-2.2-4.4-5.5-4.4-8.2,0-7.6,7.4-9.1,14.6-9.1,5.4,0,12.1,1.8,14.3,4.4v9.2a1,1,0,0,1-1.5,1L252.3,9.8a1,1,0,0,0-1.3.4q-.3.8.6,1.2l8.5,4.1c5.3,2.6,4.7,4.9,4.7,9.2s-6.3,8.5-14.9,8.5C244.7,33.2,238,31.6,235.8,29.2Z"/></g></g></svg>
|
After Width: | Height: | Size: 2.4 KiB |
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,23 @@
|
||||||
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
module.exports = {
|
||||||
|
content: ["./**/*.{html,js}"],
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
'co-blue': '#243887',
|
||||||
|
'co-lightblue': '#907eff',
|
||||||
|
'co-red': '#ff1300',
|
||||||
|
'co-green': '#6cc11f',
|
||||||
|
'co-yellow': '#ffdd00',
|
||||||
|
'co-orange': 'ff5300',
|
||||||
|
},
|
||||||
|
borderRadius: {
|
||||||
|
'co': '40%',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
require('@tailwindcss/forms'),
|
||||||
|
],
|
||||||
|
}
|
|
@ -0,0 +1,104 @@
|
||||||
|
package cache
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
clientv3 "go.etcd.io/etcd/client/v3"
|
||||||
|
"go.etcd.io/etcd/client/v3/namespace"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CacheHandler struct {
|
||||||
|
*clientv3.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCacheHandler(cfg *viper.Viper) (*CacheHandler, error) {
|
||||||
|
var (
|
||||||
|
endpoints = cfg.GetStringSlice("cache.storage.etcd.endpoints")
|
||||||
|
prefix = cfg.GetString("cache.storage.etcd.prefix")
|
||||||
|
)
|
||||||
|
|
||||||
|
cli, err := clientv3.New(clientv3.Config{
|
||||||
|
Endpoints: endpoints,
|
||||||
|
DialTimeout: 5 * time.Second,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
cli.KV = namespace.NewKV(cli.KV, prefix)
|
||||||
|
cli.Watcher = namespace.NewWatcher(cli.Watcher, prefix)
|
||||||
|
cli.Lease = namespace.NewLease(cli.Lease, prefix)
|
||||||
|
|
||||||
|
return &CacheHandler{
|
||||||
|
Client: cli,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *CacheHandler) Put(k string, v any) error {
|
||||||
|
data, err := json.Marshal(v)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// _, err = s.Client.KV.Put(context.TODO(), k, data.String())
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
|
_, err = s.Client.KV.Put(ctx, k, string(data))
|
||||||
|
cancel()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *CacheHandler) PutWithTTL(k string, v any, duration time.Duration) error {
|
||||||
|
lease, err := s.Client.Lease.Grant(context.TODO(), int64(duration.Seconds()))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := json.Marshal(v)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// _, err = s.Client.KV.Put(context.TODO(), k, data.String(), clientv3.WithLease(lease.ID))
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
|
_, err = s.Client.KV.Put(ctx, k, string(data), clientv3.WithLease(lease.ID))
|
||||||
|
cancel()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *CacheHandler) Get(k string) (any, error) {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
|
resp, err := s.Client.KV.Get(ctx, k)
|
||||||
|
cancel()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
for _, v := range resp.Kvs {
|
||||||
|
var data any
|
||||||
|
err := json.Unmarshal([]byte(v.Value), &data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// We return directly as we want to last revision of value
|
||||||
|
return data, nil
|
||||||
|
}
|
||||||
|
return nil, errors.New(fmt.Sprintf("no value %v", k))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *CacheHandler) Delete(k string) error {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
|
_, err := s.Client.KV.Delete(ctx, k)
|
||||||
|
cancel()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package formvalidators
|
||||||
|
|
||||||
|
import "github.com/go-playground/validator/v10"
|
||||||
|
|
||||||
|
type FormValidator struct {
|
||||||
|
*validator.Validate
|
||||||
|
}
|
||||||
|
|
||||||
|
func New() (f FormValidator) {
|
||||||
|
validate := validator.New()
|
||||||
|
validate.RegisterValidation("phoneNumber", PhoneNumber)
|
||||||
|
f.Validate = validate
|
||||||
|
return
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package formvalidators
|
||||||
|
|
||||||
|
import (
|
||||||
|
"regexp"
|
||||||
|
|
||||||
|
"github.com/go-playground/validator/v10"
|
||||||
|
)
|
||||||
|
|
||||||
|
const phoneNumberRegexStreing = "^((\\+)33|0)[1-9](\\d{2}){4}$"
|
||||||
|
|
||||||
|
var phoneNumberRegex = regexp.MustCompile(phoneNumberRegexStreing)
|
||||||
|
|
||||||
|
func PhoneNumber(fl validator.FieldLevel) bool {
|
||||||
|
return phoneNumberRegex.MatchString(fl.Field().String())
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package icons
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"html/template"
|
||||||
|
)
|
||||||
|
|
||||||
|
type IconSet struct {
|
||||||
|
Icons map[string]string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewIconSet(set map[string]string) IconSet {
|
||||||
|
return IconSet{
|
||||||
|
Icons: set,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i IconSet) Icon(name string, classes string) template.HTML {
|
||||||
|
icon, ok := i.Icons[name]
|
||||||
|
|
||||||
|
if !ok {
|
||||||
|
return template.HTML("")
|
||||||
|
}
|
||||||
|
|
||||||
|
return template.HTML(fmt.Sprintf(icon, classes))
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package identification
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||||
|
)
|
||||||
|
|
||||||
|
const GroupKey ContextKey = "group"
|
||||||
|
const RolesKey ContextKey = "roles"
|
||||||
|
|
||||||
|
func (p *IdentificationProvider) GroupsMiddleware(next http.Handler) http.Handler {
|
||||||
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
claims := r.Context().Value(ClaimsKey).(map[string]any)
|
||||||
|
|
||||||
|
session, _ := p.SessionsStore.Get(r, "parcoursmob_session")
|
||||||
|
|
||||||
|
o, ok := session.Values["organization"]
|
||||||
|
if !ok || o == nil {
|
||||||
|
http.Redirect(w, r, "/auth/groups/", http.StatusFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
org := o.(string)
|
||||||
|
|
||||||
|
claimgroups, ok := claims["groups"].([]any)
|
||||||
|
|
||||||
|
if !ok {
|
||||||
|
fmt.Println("cast issue")
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, group := range claimgroups {
|
||||||
|
if group == org {
|
||||||
|
|
||||||
|
request := &groupsmanagement.GetGroupRequest{
|
||||||
|
Id: group.(string),
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := p.Services.GRPC.GroupsManagement.GetGroup(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
delete(session.Values, "organization")
|
||||||
|
session.Save(r, w)
|
||||||
|
http.Redirect(w, r, "/auth/groups/", http.StatusFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx := context.WithValue(r.Context(), GroupKey, resp.Group.ToStorageType())
|
||||||
|
|
||||||
|
roles := map[string]bool{}
|
||||||
|
|
||||||
|
for _, role := range claimgroups {
|
||||||
|
//TODO handle flexible roles / roles discovery
|
||||||
|
if role == fmt.Sprintf("%s:admin", org) {
|
||||||
|
roles[role.(string)] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx = context.WithValue(ctx, RolesKey, roles)
|
||||||
|
|
||||||
|
next.ServeHTTP(w, r.WithContext(ctx))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Session organization is not in the available groups
|
||||||
|
delete(session.Values, "organization")
|
||||||
|
session.Save(r, w)
|
||||||
|
http.Redirect(w, r, "/auth/groups/", http.StatusFound)
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,117 @@
|
||||||
|
package identification
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"crypto/rand"
|
||||||
|
"encoding/base64"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"git.coopgo.io/coopgo-apps/parcoursmob/services"
|
||||||
|
"github.com/coreos/go-oidc"
|
||||||
|
"github.com/gorilla/sessions"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"golang.org/x/oauth2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ContextKey string
|
||||||
|
|
||||||
|
const IdtokenKey ContextKey = "idtoken"
|
||||||
|
const ClaimsKey ContextKey = "claims"
|
||||||
|
|
||||||
|
type IdentificationProvider struct {
|
||||||
|
SessionsStore sessions.Store
|
||||||
|
Provider *oidc.Provider
|
||||||
|
OAuth2Config oauth2.Config
|
||||||
|
TokenVerifier *oidc.IDTokenVerifier
|
||||||
|
Services *services.ServicesHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewIdentificationProvider(cfg *viper.Viper, services *services.ServicesHandler) (*IdentificationProvider, error) {
|
||||||
|
var (
|
||||||
|
providerURL = cfg.GetString("identification.oidc.provider")
|
||||||
|
clientID = cfg.GetString("identification.oidc.client_id")
|
||||||
|
clientSecret = cfg.GetString("identification.oidc.client_secret")
|
||||||
|
redirectURL = cfg.GetString("identification.oidc.redirect_url")
|
||||||
|
sessionsSecret = cfg.GetString("identification.sessions.secret")
|
||||||
|
)
|
||||||
|
|
||||||
|
provider, err := oidc.NewProvider(context.Background(), providerURL)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
oauth2Config := oauth2.Config{
|
||||||
|
ClientID: clientID,
|
||||||
|
ClientSecret: clientSecret,
|
||||||
|
RedirectURL: redirectURL,
|
||||||
|
|
||||||
|
// Discovery returns the OAuth2 endpoints.
|
||||||
|
Endpoint: provider.Endpoint(),
|
||||||
|
|
||||||
|
// "openid" is a required scope for OpenID Connect flows.
|
||||||
|
Scopes: []string{oidc.ScopeOpenID, "groups", "profile"},
|
||||||
|
}
|
||||||
|
|
||||||
|
var store = sessions.NewCookieStore([]byte(sessionsSecret))
|
||||||
|
verifier := provider.Verifier(&oidc.Config{ClientID: oauth2Config.ClientID})
|
||||||
|
|
||||||
|
return &IdentificationProvider{
|
||||||
|
SessionsStore: store,
|
||||||
|
Provider: provider,
|
||||||
|
OAuth2Config: oauth2Config,
|
||||||
|
TokenVerifier: verifier,
|
||||||
|
Services: services,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *IdentificationProvider) Middleware(next http.Handler) http.Handler {
|
||||||
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
session, _ := p.SessionsStore.Get(r, "parcoursmob_session")
|
||||||
|
|
||||||
|
if session.Values["idtoken"] == nil || session.Values["idtoken"] == "" {
|
||||||
|
|
||||||
|
state, err := newState()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
session.Values["state"] = state
|
||||||
|
session.Save(r, w)
|
||||||
|
http.Redirect(w, r, p.OAuth2Config.AuthCodeURL(state), http.StatusFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
idtoken, err := p.TokenVerifier.Verify(context.Background(), session.Values["idtoken"].(string))
|
||||||
|
if err != nil {
|
||||||
|
state, err := newState()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
session.Values["state"] = state
|
||||||
|
delete(session.Values, "idtoken")
|
||||||
|
http.Redirect(w, r, p.OAuth2Config.AuthCodeURL(state), http.StatusFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var claims map[string]any
|
||||||
|
|
||||||
|
err = idtoken.Claims(&claims)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx := context.WithValue(r.Context(), IdtokenKey, idtoken)
|
||||||
|
ctx = context.WithValue(ctx, ClaimsKey, claims)
|
||||||
|
|
||||||
|
next.ServeHTTP(w, r.WithContext(ctx))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func newState() (string, error) {
|
||||||
|
b := make([]byte, 16)
|
||||||
|
if _, err := io.ReadFull(rand.Reader, b); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return base64.RawURLEncoding.EncodeToString(b), nil
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package profilepictures
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"image"
|
||||||
|
"image/color"
|
||||||
|
"image/draw"
|
||||||
|
|
||||||
|
"github.com/fogleman/gg"
|
||||||
|
"golang.org/x/image/font"
|
||||||
|
"golang.org/x/image/math/fixed"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DefaultProfilePicture(initials string) *image.RGBA {
|
||||||
|
img := image.NewRGBA(image.Rect(0, 0, 300, 300))
|
||||||
|
col := color.RGBA{36, 56, 135, 255}
|
||||||
|
white := color.RGBA{255, 255, 255, 255}
|
||||||
|
point := fixed.Point26_6{fixed.I(40), fixed.I(200)}
|
||||||
|
|
||||||
|
draw.Draw(img, img.Bounds(), &image.Uniform{col}, image.Point{X: 0, Y: 0}, draw.Src)
|
||||||
|
|
||||||
|
ff, err := gg.LoadFontFace("themes/default/fonts/bitter.ttf", 150.0)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return img
|
||||||
|
}
|
||||||
|
|
||||||
|
d := &font.Drawer{
|
||||||
|
Dst: img,
|
||||||
|
Src: image.NewUniform(white),
|
||||||
|
Face: ff,
|
||||||
|
Dot: point,
|
||||||
|
}
|
||||||
|
d.DrawString(initials)
|
||||||
|
|
||||||
|
return img
|
||||||
|
}
|
Loading…
Reference in New Issue