diff --git a/arn/User.go b/arn/User.go index d33aa8c6..a16c95e6 100644 --- a/arn/User.go +++ b/arn/User.go @@ -56,7 +56,7 @@ type User struct { UserAgent string `json:"agent" private:"true"` Balance int `json:"balance" private:"true"` Image Image `json:"image"` - Avatar UserAvatar `json:"avatar"` + Avatar UserAvatar `json:"avatar" editable:"true"` Cover UserCover `json:"cover"` Accounts UserAccounts `json:"accounts" private:"true"` Browser UserBrowser `json:"browser" private:"true"` diff --git a/arn/UserAPI.go b/arn/UserAPI.go index f32b01cf..6491e02b 100644 --- a/arn/UserAPI.go +++ b/arn/UserAPI.go @@ -96,10 +96,10 @@ func (user *User) Edit(ctx aero.Context, key string, value reflect.Value, newVal user.BirthDay = newBirthDay return true, nil - case "ProExpires": - user := GetUserFromContext(ctx) + case "ProExpires", "Avatar.Extension", "Avatar.LastModified": + editor := GetUserFromContext(ctx) - if user == nil || user.Role != "admin" { + if editor == nil || editor.Role != "admin" { return true, errors.New("Not authorized to edit") } diff --git a/arn/UserAvatar.go b/arn/UserAvatar.go index 42102c86..9f8c8631 100644 --- a/arn/UserAvatar.go +++ b/arn/UserAvatar.go @@ -60,9 +60,8 @@ var avatarOutputs = []imageserver.Output{ // UserAvatar ... type UserAvatar struct { - Extension string `json:"extension"` - Source string `json:"source"` - LastModified int64 `json:"lastModified"` + Extension string `json:"extension" editable:"true"` + LastModified int64 `json:"lastModified" editable:"true"` } // SetImageBytes accepts a byte buffer that represents an image file and updates the avatar. diff --git a/go.mod b/go.mod index f7b614c9..ca8bd94b 100644 --- a/go.mod +++ b/go.mod @@ -3,34 +3,35 @@ module github.com/animenotifier/notify.moe go 1.12 require ( - cloud.google.com/go v0.44.3 // indirect + cloud.google.com/go v0.45.1 // indirect github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect - github.com/aerogo/aero v1.3.22 - github.com/aerogo/api v0.2.1 + github.com/aerogo/aero v1.3.24 + github.com/aerogo/api v0.2.2 github.com/aerogo/crawler v0.2.5 github.com/aerogo/flow v0.1.5 - github.com/aerogo/graphql v0.4.1 - github.com/aerogo/http v1.0.9 + github.com/aerogo/graphql v0.4.2 + github.com/aerogo/http v1.0.10 github.com/aerogo/log v0.2.6 github.com/aerogo/manifest v0.1.5 github.com/aerogo/markdown v0.1.9 github.com/aerogo/mirror v0.2.4 - github.com/aerogo/nano v0.3.4 + github.com/aerogo/nano v0.3.5 github.com/aerogo/pack v0.6.1 + github.com/aerogo/packet v0.2.2 // indirect github.com/aerogo/run v1.0.2 github.com/aerogo/session-store-nano v0.1.7 github.com/aerogo/sitemap v0.1.4 - github.com/akyoto/assert v0.2.0 + github.com/akyoto/assert v0.2.1 github.com/akyoto/cache v1.0.3 github.com/akyoto/color v1.8.7 github.com/akyoto/go-matroska v0.1.1 github.com/akyoto/hash v0.4.5 - github.com/akyoto/imageserver v0.3.6 - github.com/akyoto/stringutils v0.2.3 + github.com/akyoto/imageserver v0.3.7 + github.com/akyoto/stringutils v0.2.4 github.com/akyoto/webpush-go v0.1.2 github.com/animenotifier/anilist v0.2.5 github.com/animenotifier/ffxiv v0.2.2 - github.com/animenotifier/japanese v0.2.4 + github.com/animenotifier/japanese v0.2.5 github.com/animenotifier/kitsu v0.2.4 github.com/animenotifier/mal v0.2.5 github.com/animenotifier/osu v0.1.2 @@ -39,6 +40,7 @@ require ( github.com/animenotifier/twist v0.2.6 github.com/bwmarrin/discordgo v0.19.0 github.com/dustin/go-humanize v1.0.0 + github.com/frankban/quicktest v1.4.0 // indirect github.com/go-chi/chi v4.0.2+incompatible // indirect github.com/go-ole/go-ole v1.2.4 // indirect github.com/gomodule/oauth1 v0.0.0-20181215000758-9a59ed3b0a84 @@ -55,6 +57,7 @@ require ( github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect github.com/smartystreets/assertions v1.0.0 // indirect github.com/smartystreets/goconvey v0.0.0-20190710185942-9d28bd7c0945 // indirect + github.com/stretchr/objx v0.2.0 // indirect github.com/tdewolff/parse v2.3.4+incompatible // indirect github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf // indirect github.com/ungerik/go-gravatar v0.0.0-20120802094239-6ab22628222a @@ -63,7 +66,9 @@ require ( golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 // indirect golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 - golang.org/x/sys v0.0.0-20190903213830-1f305c863dab // indirect + golang.org/x/sys v0.0.0-20190904154756-749cb33beabd // indirect google.golang.org/appengine v1.6.2 // indirect gopkg.in/ini.v1 v1.46.0 // indirect ) + +exclude github.com/logpacker/PayPal-Go-SDK v2.0.5+incompatible diff --git a/go.sum b/go.sum index 4612c990..2e8d8e00 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,12 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.41.0 h1:NFvqUTDnSNYPX5oReekmB+D+90jrJIcVImxQ3qrBVgM= cloud.google.com/go v0.41.0/go.mod h1:OauMR7DV8fzvZIl2qg6rkaIhD/vmgk4iwEw/h6ercmg= 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 h1:0sMegbmn/8uTwpNkB0q9cLEpZ2W5a6kl+wtBQgPWBJQ= cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1 h1:lRi0CHyU+ytlvylOlFKKq0af6JncuyoRh1J+QJBqQx0= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -22,10 +26,14 @@ github.com/aerogo/aero v1.3.21 h1:tipV8etMEj11VF9ekkI3pEAaGJkuWKzhbwdSHQreONU= github.com/aerogo/aero v1.3.21/go.mod h1:Or3OxJsAPB6fuYK5Y7CJGgc+wFzZMDI4E2Svv65kkKA= github.com/aerogo/aero v1.3.22 h1:T0ROjG0wshxXFhi5dLBBXD5NVh+nLcesp6VRerZUQR8= github.com/aerogo/aero v1.3.22/go.mod h1:kU22MF1nXesZRo4K2k3wvsD8QCux1Qk9+tgISWeChc0= +github.com/aerogo/aero v1.3.24 h1:H+7NgdYphrFV8rJuIxuv1hWXY5sDM5oi5LjP+06EpGA= +github.com/aerogo/aero v1.3.24/go.mod h1:NoCNMwMfMi0t1W4Wld0kcbkXgEIjm87GopBeLgrTB5U= github.com/aerogo/api v0.2.0 h1:mIc/y381e+Qc85eSc2cKPdpDDOmT0hlnEeCw2Dcf7no= github.com/aerogo/api v0.2.0/go.mod h1:6objJn5XiKpYpywQUPrFjxZIXD4NVI2LwcBNYCEcS3Y= github.com/aerogo/api v0.2.1 h1:fEcnOCEyaMwuuWgPDgeWKMRw2dPgcWTPV3NGmJiarn4= github.com/aerogo/api v0.2.1/go.mod h1:FjpGimrlG1nemBNPmVzpQ3ZEP0TGSLK71j4ssnd9Bsg= +github.com/aerogo/api v0.2.2 h1:6+hrwD7ZypvVnVKa/3J96QRaZu6gUnmFsMS49yc8rLg= +github.com/aerogo/api v0.2.2/go.mod h1:FjpGimrlG1nemBNPmVzpQ3ZEP0TGSLK71j4ssnd9Bsg= github.com/aerogo/cluster v0.1.8 h1:N/jU2t7kQfKjXzQIArBQvtNkJCiaP9+jgdEid3P2Omc= github.com/aerogo/cluster v0.1.8/go.mod h1:ldxff0R9VPbm1yoZdkCrVYWroflgmwh+g6EM8+jFXyE= github.com/aerogo/codetree v1.2.9 h1:Z01dFVK1Y5R8xF+9vnImtOQ05moEGs7XFNXlQIX28RY= @@ -36,16 +44,22 @@ github.com/aerogo/csp v0.1.6 h1:C2OpzPZHY1S5H+Dz0Or+YgVSfXT36avJw9e1smrIWUY= github.com/aerogo/csp v0.1.6/go.mod h1:KNqnTFffuDwIPJxBEFTl3baBx+x3Vw+9kcMfu5APFJA= github.com/aerogo/csp v0.1.8 h1:gNm3PN41sVkseg0QrD5xuZxFMLJoUvykbagUb7uKaLw= github.com/aerogo/csp v0.1.8/go.mod h1:xB+51XmDvkdRYsOCwVoG/D+aJGEJfi6KxqM3/zf2jZw= +github.com/aerogo/csp v0.1.9 h1:7K8FujZkE62Wes0lXt9sTG0kf/pn3G3XkDwhmrTlnpY= +github.com/aerogo/csp v0.1.9/go.mod h1:xB+51XmDvkdRYsOCwVoG/D+aJGEJfi6KxqM3/zf2jZw= github.com/aerogo/flow v0.1.5 h1:wmSzIpHKV63CUsQ/YaLBti/5csUj1toK8jGvM+0z/fg= github.com/aerogo/flow v0.1.5/go.mod h1:kG63T/cHB2uR0nu0SGvy8d49J6YuI6LP1IehkP7VtwM= github.com/aerogo/graphql v0.4.1 h1:i+W8km/V51bwu3UyvzoKmzxpRv08z6BUJOGGDW8J/lQ= github.com/aerogo/graphql v0.4.1/go.mod h1:4SvpVsDtDo3q8sI6cAoqlPJd7TuqZjw71TbhCsKMQjo= +github.com/aerogo/graphql v0.4.2 h1:IF8+Ufh3oksYr6xSEfrd/C9pLB6tawqXBkAAD4uduxk= +github.com/aerogo/graphql v0.4.2/go.mod h1:4SvpVsDtDo3q8sI6cAoqlPJd7TuqZjw71TbhCsKMQjo= github.com/aerogo/http v1.0.3 h1:vf6A+Igme5OHQPaP3a00uPDS0oxsx3puMA23d1NsWDM= github.com/aerogo/http v1.0.3/go.mod h1:B1igUmMLpE6KabMpc9reHCJJNUOJ2U/PR9s1fF3TpPQ= github.com/aerogo/http v1.0.6 h1:+aswlcWlUxjVcokF8hUjNJmGIEZuhbFbHi8uSadEvtc= github.com/aerogo/http v1.0.6/go.mod h1:LwJ7b+LjrHj60FhYQ586K3/O7aNGxkE2dy/exEkQ6rA= github.com/aerogo/http v1.0.9 h1:ddgS613r1/XNNayvlQK1/hnSoR2GCOzIeO6wL0x84gQ= github.com/aerogo/http v1.0.9/go.mod h1:qVlq+QszT9mFVL92hmMs71fqzA1DILTjNSucEWUdFmk= +github.com/aerogo/http v1.0.10 h1:CIFhdka8DjJ/vF2oxQVi+1lNi7LZp5xSmkEjbEwhrdI= +github.com/aerogo/http v1.0.10/go.mod h1:rG/KkSLgpcjuB9I8k+OWbQI9YbahHIridyva0AQdH70= github.com/aerogo/linter-performance v1.0.3 h1:pYsmUd8jp6CVrFx+YNo9Gfdf222CKG2gCVjp8cljZNY= github.com/aerogo/linter-performance v1.0.3/go.mod h1:po6XSSbSgR30lazzqSRGV++a2omxYr2qjqFvcvUCH40= github.com/aerogo/linter-performance v1.0.5 h1:2tNBov+S/zuJ7Z0t2Yif2AYTfviNavJEGtfm1Sjyap4= @@ -66,10 +80,14 @@ github.com/aerogo/mirror v0.2.4 h1:FOCoRC4ncZaMvGal6Cfg8hW7zvFSg/kSUlg4l2r9BEs= github.com/aerogo/mirror v0.2.4/go.mod h1:pdFnS9P1APNFcULbuT6QaMCuTCa0to4W4rHm6ymkELY= github.com/aerogo/nano v0.3.4 h1:Wk0eRHvsnjni6ROScIo9bRpyuME8ZtgnQwpTi0xbc2M= github.com/aerogo/nano v0.3.4/go.mod h1:OVx7/5zHvieZH4CO5YksGUVOrA+aVGh1TjnqzA73jTQ= +github.com/aerogo/nano v0.3.5 h1:5rnkoUK2t/NM69VuujY/ktx1+n5xQfQWiZST4ks/X68= +github.com/aerogo/nano v0.3.5/go.mod h1:OVx7/5zHvieZH4CO5YksGUVOrA+aVGh1TjnqzA73jTQ= github.com/aerogo/pack v0.6.1 h1:WHkuQGuOaRHMrL+ie/yasVt4Bpd5FXqSCYYCj0eW3Ys= github.com/aerogo/pack v0.6.1/go.mod h1:B3FfccPZzZhZ3Jf2rTEVE8JbCtJwcABTPcwZR6xHQ2k= github.com/aerogo/packet v0.2.0 h1:YipWaCqHLn73WP+fU85a6yl6GULlUHWyy+ATmcm7pog= github.com/aerogo/packet v0.2.0/go.mod h1:8+cOKIJ35ZJAi8Afd94ed6q8D0eq3KeJFxXUEgTxPY0= +github.com/aerogo/packet v0.2.2 h1:Fxoeljvod5cO2xgiHzDFRR8nhoNcA8u3FBaUkwBVsPk= +github.com/aerogo/packet v0.2.2/go.mod h1:8+cOKIJ35ZJAi8Afd94ed6q8D0eq3KeJFxXUEgTxPY0= github.com/aerogo/pixy v1.2.8 h1:sEtWdjaWyiVLsj/nh8WmMPjwl6SkwSNI0lH23zljKUk= github.com/aerogo/pixy v1.2.8/go.mod h1:BddpLok0HvXZqDl5EYHZ85mf392HtA9gPk7IQRuoFnM= github.com/aerogo/run v1.0.2 h1:fcddUcM5ZNjyoAf09mMYlkQzYEfvDvVvbIfR/WGA68k= @@ -93,6 +111,7 @@ github.com/aerogo/sitemap v0.1.4/go.mod h1:/1NT13qIsTm/ydlZHEMd8m014E2yyQkI5coim github.com/akyoto/assert v0.1.3/go.mod h1:g5e6ag+ksCEQENq/LnmU9z04wCAIFDr8KacBusVL0H8= github.com/akyoto/assert v0.2.0 h1:lR7OHrbbBNNZFmRVS8I5MzS0ShLH36ZQVZVyg1bvs6A= github.com/akyoto/assert v0.2.0/go.mod h1:g5e6ag+ksCEQENq/LnmU9z04wCAIFDr8KacBusVL0H8= +github.com/akyoto/assert v0.2.1/go.mod h1:g5e6ag+ksCEQENq/LnmU9z04wCAIFDr8KacBusVL0H8= github.com/akyoto/autoimport v0.6.4 h1:9VCUjAZUvJIrIZBVkkwcnWUB4gLDBkF5VYNSwcDDino= github.com/akyoto/autoimport v0.6.4/go.mod h1:4K2kwIeP2rNaR5oUoRUlxgHyukM0j+IfC5P3/ILWeyE= github.com/akyoto/cache v1.0.2 h1:YNaLbfbfBRr21dReBErQxfnVPBsVR/aeFpIKxsF88n8= @@ -116,12 +135,16 @@ github.com/akyoto/ignore v1.0.4 h1:ONxBnW2TIH3x3kYN94O9x0kYRdHrnNMBAMB2m9XAV9k= github.com/akyoto/ignore v1.0.4/go.mod h1:7EcPvLQHEzZ53k4nXGKqfEFLwMnUqpaZkt+vbLzW9tE= github.com/akyoto/imageserver v0.3.6 h1:Sxcbgo45Lh7afcSmcU8OS49VYbqh4kE3DK0Lxuuxf74= github.com/akyoto/imageserver v0.3.6/go.mod h1:9AuMUxIt5CPlTmJre4ETwWxRnThOkkE1EhavC8HX4U8= +github.com/akyoto/imageserver v0.3.7 h1:UHU+93WtFfwKlFc4iCN4/h1jGH3l2xkFc/iIbqJL9ek= +github.com/akyoto/imageserver v0.3.7/go.mod h1:YFX5fAtDqSep2AI8MJE8r5mwFvUDndbNnKqX88cUxfw= github.com/akyoto/stringutils v0.2.0 h1:86gMW/31LO7zc8mGGWB4gLqyFzrNHMZYyj6ebSQbpH4= github.com/akyoto/stringutils v0.2.0/go.mod h1:EigXf5ZaULP6f5CNjqIIo0fjDHbRe8P4BQwlqCsvi9k= github.com/akyoto/stringutils v0.2.1 h1:4St8vcRnNFuCNSMEJ34TeLb7/FfsvZaSU8/Scr6Zymg= github.com/akyoto/stringutils v0.2.1/go.mod h1:BUYzDYA2CZ7bqDZKpAQMUJOG9mCCOw4qd4JM3770bI8= github.com/akyoto/stringutils v0.2.3 h1:ggwgzXEXEj5SPtZr/7uYC+creqvz33UfWz37561/no4= github.com/akyoto/stringutils v0.2.3/go.mod h1:nyO78pc92gciYObsOGWasnQN/s18JEQusXtN/7iC2AM= +github.com/akyoto/stringutils v0.2.4 h1:VYW2FH2qjmQyJWZDSNFSP8btbSwJDoY0x14uiD/0OLU= +github.com/akyoto/stringutils v0.2.4/go.mod h1:nyO78pc92gciYObsOGWasnQN/s18JEQusXtN/7iC2AM= github.com/akyoto/uuid v1.1.3 h1:FEz14tNTfaUeY0Jrkz2F17rjKiks6hOALGcPmAmtn1s= github.com/akyoto/uuid v1.1.3/go.mod h1:8dgzDQyrpuApBGIQHOX7JkvCZHusXZ0tGlQcxxv4bYg= github.com/akyoto/webpush-go v0.1.2 h1:Ufg8Al6xyyaTmdlLkfOGDEapVClymzJl/Whu8pOydjM= @@ -134,6 +157,8 @@ github.com/animenotifier/ffxiv v0.2.2 h1:pW0TRqgjqNbZ8K8UskGWiTP43GdLD6hlzdfmxGd github.com/animenotifier/ffxiv v0.2.2/go.mod h1:JdnHHGD9W6QLdZWf38fw1jIqDRemr5dthlr5RKdmipE= github.com/animenotifier/japanese v0.2.4 h1:tLv2Ra9DboX8vy4MQyteVUb9k81CYKvQ7yG1pyEcM6s= github.com/animenotifier/japanese v0.2.4/go.mod h1:8jNusDGV2pHjQiyQAPXzpqkJK2Aa1LTLcKt0AOeR/Ro= +github.com/animenotifier/japanese v0.2.5 h1:3crv70AzmrTiJCI6SG9rUeFS2T3FXdxKwvRjjUa/74g= +github.com/animenotifier/japanese v0.2.5/go.mod h1:Xmhi5U+JbRuqmHzFB1zTMfA3SM35hKmzC0Z2J2q8SH0= github.com/animenotifier/kitsu v0.2.3 h1:Ps05auh4irG11O3yqYl5LCMWjhgonGc9QK02k5p1LN4= github.com/animenotifier/kitsu v0.2.3/go.mod h1:VP3vxTAZsaA3oW2EfJ/rP5wNOhnKen74iHNcHvW5nOg= github.com/animenotifier/kitsu v0.2.4 h1:YFVUR0EPSbSljjgEWtf4Hz72cCFgGyxOpjPc+64EsWA= @@ -215,6 +240,7 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA 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/ikawaha/kagome v1.10.0/go.mod h1:eEV1yEy8Hm2eJRMz6nU1OlbrafRqXTECbsmm9aUMX2s= +github.com/ikawaha/kagome v1.11.0/go.mod h1:eEV1yEy8Hm2eJRMz6nU1OlbrafRqXTECbsmm9aUMX2s= github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= @@ -420,6 +446,9 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 h1:ng0gs1AKnRRuEMZoTLLlbOd+C golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190903213830-1f305c863dab h1:2WmrFWBmUPXp+o/5X0nS66SLRS6DKwZlgFD76BKThvc= golang.org/x/sys v0.0.0-20190903213830-1f305c863dab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904005037-43c01164e931/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= @@ -447,6 +476,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -462,6 +492,7 @@ google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= 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/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= diff --git a/pages/statistics/statistics.go b/pages/statistics/statistics.go index a3bee925..903c1abb 100644 --- a/pages/statistics/statistics.go +++ b/pages/statistics/statistics.go @@ -26,7 +26,6 @@ func getUserStats() []*arn.PieChart { os := stats{} notifications := stats{} titleLanguage := stats{} - avatar := stats{} ip := stats{} pro := stats{} connectionType := stats{} @@ -91,12 +90,6 @@ func getUserStats() []*arn.PieChart { notifications["Disabled"]++ } - if user.Avatar.Source == "" { - avatar["none"]++ - } else { - avatar[user.Avatar.Source]++ - } - if arn.IsIPv6(user.IP) { ip["IPv6"]++ } else { @@ -120,7 +113,6 @@ func getUserStats() []*arn.PieChart { arn.NewPieChart("Browser", browser), arn.NewPieChart("Country", country), arn.NewPieChart("Title language", titleLanguage), - arn.NewPieChart("Avatar", avatar), arn.NewPieChart("Notifications", notifications), arn.NewPieChart("Gender", gender), arn.NewPieChart("Pixel ratio", pixelRatio), diff --git a/utils/editform/editform.go b/utils/editform/editform.go index f26eaf26..589325c4 100644 --- a/utils/editform/editform.go +++ b/utils/editform/editform.go @@ -141,7 +141,7 @@ func RenderField(b *strings.Builder, v *reflect.Value, field reflect.StructField } // Int - if fieldType == "int" { + if fieldType == "int" || fieldType == "int64" { b.WriteString(components.InputNumber(idPrefix+field.Name, float64(fieldValue.Int()), field.Name, field.Tag.Get("tooltip"), "", "", "1")) return }