mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-14 01:35:55 +09:00
1 parent
85f34ba538
commit
c38754d432
6 files changed
+53
-21
No files matched your search
@@ -406,6 +406,7 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Group("/settings", func() {
|
||||
m.Combo("").Get(org.Settings).
|
||||
Post(bindIgnErr(auth.UpdateOrgSettingForm{}), org.SettingsPost)
|
||||
m.Post("/avatar", binding.MultipartForm(auth.UploadAvatarForm{}), org.SettingsAvatar)
|
||||
|
||||
m.Group("/hooks", func() {
|
||||
m.Get("", org.Webhooks)
|
||||
|
||||
@@ -656,6 +656,7 @@ settings.location = Location
|
||||
settings.update_settings = Update Settings
|
||||
settings.update_setting_success = Organization settings has been updated successfully.
|
||||
settings.change_orgname_prompt = This change will affect how links relate to the organization.
|
||||
settings.update_avatar_success = Organization avatar setting has been updated successfully.
|
||||
settings.delete = Delete Organization
|
||||
settings.delete_account = Delete This Organization
|
||||
settings.delete_prompt = The organization will be permanently removed, and this <strong>CANNOT</strong> be undone!
|
||||
|
||||
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x92\xdc\x46\xae\x27\xfe\x9d\x4f\x41\xeb\x84\xfe\xb2\x23\x5a\xa5\xb0\xfd\xdf\x4b\x38\x24\x79\x5b\xdd\xd6\x65\x8e\x5a\xdd\xa3\x6e\xcf\xec\xac\x42\x41\xb3\x8a\xac\x2a\x8e\xaa\xc8\x32\xc9\x52\xa9\xe7\xc4\x89\xd8\xd7\xd8\xd7\xdb\x27\x59\xe0\x07\x20\x2f\x24\xab\x25\x79\x4e\xec\x7e\xe9\x66\x65\x22\x6f\x48\x24\x12\x40\x22\x91\xf9\x6e\x97\x15\x65\xb7\x48\x9f\xa4\xa7\xe9\x2e\xaf\xea\x4d\xd9\x75\x69\x57\x6e\x96\x0f\xd7\x4d\xd7\x97\x45\xfa\xa2\xea\xe9\x77\xfb\xb1\x5a\x94\x49\xb2\x6e\xb6\x25\x81\xbe\xa4\x7f\x49\x91\x77\xeb\x79\x93\xb7\x05\x25\x9c\xdb\x77\x52\x7e\xda\x6d\x9a\x96\x81\x7e\x91\xaf\x64\x5d\x6e\x76\x5c\x86\xfe\x25\x5d\xb5\xaa\xb3\xaa\xa6\x9f\xd7\xf4\x95\xbe\xaa\x93\xae\x59\x54\xf9\x26\x0b\x32\x90\x60\xf9\x3f\xa5\x3f\xd4\x45\x7a\xdd\x97\xbb\xf4\x71\xb7\xcd\x37\x9b\xa7\x79\x87\x22\x7d\x99\xe6\x8b\x45\xb3\xaf\xfb\xc7\x8f\x24\x43\x2a\x6f\xf6\xbd\xd5\x7e\xb9\xef\x25\x6d\xbf\xb3\xa4\x5f\x77\x49\x5b\xae\x2a\x1a\x58\x4b\x49\x6f\xf5\x33\x39\x94\xf3\xae\xea\xb9\xd3\x7f\x95\xaf\xe4\x63\xd9\x76\x55\xc3\xfd\xf9\x8b\x7c\x25\xbb\x7c\xc5\x00\x57\xf4\x2f\xe9\xcb\xed\x6e\x93\xa3\xc0\x8d\x7e\x26\x9b\xbc\x5e\xed\x05\xe6\xb5\x7e\x26\x8b\xb6\xa4\xac\xac\x2e\x0f\x94\x7a\x86\x1f\x29\xfd\x98\xcd\x66\xc9\x9e\x70\x9a\xed\xda\x66\x59\x6d\xca\x2c\xaf\x8b\x6c\x2b\x58\xfb\x95\xd2\x53\x4d\x4f\x29\x3d\xe5\x74\x0c\xa3\x2c\x08\x41\x59\xde\xe9\x58\x68\x6a\x08\x5f\x79\x97\xa0\xaa\x3a\xdf\x5a\x69\xfe\x4c\xca\x6d\x5e\x6d\x78\x12\x1e\xf2\x07\x75\xbe\xeb\x0e\x0d\xa6\xea\x4a\x3f\x09\x11\x59\x7f\xbb\x2b\x81\x87\x87\x37\xf4\x95\x2c\xf2\x5d\xbf\x58\xe7\xdc\x57\xf9\x4a\x08\x68\xd7\x10\x42\x9a\xf6\x16\x70\xf6\x23\x69\xda\x55\x5e\x57\xff\xc8\x7b\x41\xd2\x65\xf0\x33\xd9\x56\x6d\xdb\x30\x7e\x2f\xf0\x91\xd0\x88\x33\xae\x87\x52\xde\x10\x26\x82\x5a\x38\x67\x5b\xad\x5a\x41\x25\x67\x5e\xe0\x17\xd7\xc2\x79\xcb\xa6\xfd\xa0\x19\xcf\xf9\x73\x50\x94\x3a\xa1\xb9\x71\xfb\x79\x4d\xc8\xd7\xdc\x0b\xfc\x88\x00\xba\x24\x2f\xb6\x84\xca\x5d\x5e\x97\x8c\xa3\x53\xfe\x45\x78\xa1\x5f\x89\xd2\x54\xd6\x95\x7d\x5f\xd5\x2b\x46\xf6\xa9\x24\xa5\xd7\x9a\x94\x04\x79\x2e\xed\xb6\xd9\xbb\xe9\xa4\xf4\xbf\xd1\xcf\xf4\x4a\x7e\x4a\x5e\x50\x08\x99\xae\x24\x8f\xa4\xcb\x96\x65\x59\xc8\x58\xba\xf4\x39\x7d\x27\xbb\xfd\x66\x43\x58\xfb\x7d\x5f\x76\x3d\x17\xba\xa2\xdf\x34\x7e\xf9\x9d\x54\x5d\x47\x1f\x94\xfc\x0a\x1f\x09\x4d\x5d\xbd\xc0\x60\xce\xf0\x91\x24\xef\xba\x32\x6f\x17\xeb\xf7\x89\xfc\x47\x5f\xf9\x83\x69\xef\xd8\xa4\x32\x21\x29\x11\x49\x0b\xd6\x40\xb2\x68\x0a\xfe\x71\x46\xff\xa8\xea\xaa\xee\x7a\x5a\x71\xef\x13\xfd\x60\x30\xf9\x92\x09\xe8\xab\x1e\x58\xd0\x44\x2c\xdf\x8e\x67\x30\x7d\x5e\xb5\x5d\xff\xb0\xaf\x88\x58\xdf\xee\xeb\x84\xc7\x47\xab\x2d\x2b\xe6\xc6\x84\x5e\x34\x84\x22\x24\xb7\x34\xbe\x8b\xdb\xeb\x3f\xbf\x3e\x49\xaf\x88\x13\xad\xda\x92\xbe\x53\xaa\x83\xfe\x51\x99\x1f\x67\x09\x95\xb2\x96\xce\xf3\x3e\x9f\xe7\x5d\xe9\xd1\xca\x99\x42\xdd\x2e\x0f\x34\xce\x5c\x0d\x1c\xac\xeb\xa3\xf1\x4e\xad\x10\xaa\x43\xd7\x95\xab\xe3\x0d\x2f\x2e\x4a\x67\xa6\x86\xc2\x57\x9b\x92\xd3\xa9\xaa\xf4\xd5\x9b\x37\x97\xe7\xcf\xd2\xb2\x5e\x55\x75\x99\x1e\xaa\x7e\x9d\xee\xfb\xe5\x7f\xcd\x56\x65\x5d\xb6\xc4\xe3\x16\x55\x4a\x6b\xaa\x25\x4a\x48\x89\xb0\x65\x70\xb3\xa4\xeb\x36\xb4\xf6\x81\xde\xeb\xeb\xd7\xe9\x05\xa3\x78\x97\xf7\x6b\x74\xa4\x5f\x27\xdd\xef\x1b\x46\x91\x6b\xf0\x66\x5d\xa6\xa0\x32\x00\x35\x4b\xc3\x47\x5a\x68\x1f\x67\x49\xd9\xb6\x19\xb1\xa5\xfe\x36\xd3\xc2\x5a\xdf\x10\x52\xaa\x20\xd2\xa9\x9b\x3e\x9d\x97\x29\xca\xcc\x92\xc4\x3a\x6c\xd8\x3d\xdd\xed\x36\xd5\x42\xd6\xfa\x0b\xc9\xf3\x88\xe6\x1d\x44\xb1\x14\xc2\x01\x51\x96\x17\xa0\x8b\xd8\x33\xaf\x87\x34\x62\x20\x28\xbf\x2e\x89\x01\xae\xf7\x2b\x61\x7b\x9b\x66\x5f\x7c\x03\x4a\xb5\xde\x7b\x42\x4d\xdf\x36\xd4\x61\x60\xc7\x01\xf8\x26\x4e\x89\xe2\x78\xd3\x6a\xcb\x6d\x43\x7c\xc5\x11\x7b\x45\x04\x75\xa8\x28\x93\x46\xda\xe5\x1f\x69\xbd\xf5\x4d\xda\xaf\xab\x2e\x2d\x88\xd8\x16\x5c\x31\x2d\x8d\x3d\x6d\x17\x42\x16\x44\xa0\x42\x1a\x96\x16\xcf\x01\xa0\xb6\x7b\xa2\xa6\x35\x55\xc6\x9b\x11\xef\x9c\x54\xe5\x54\x3f\x31\x24\xaa\x07\xf4\x4d\x94\xdb\x10\x57\x66\xbe\x79\x8e\x0f\xfd\x1d\xd6\x4f\xbd\xca\x97\x4b\xea\x55\x47\x54\xf1\x32\x5d\x6c\x1a\x22\xa9\x5f\xdf\xbe\xee\x98\x60\xd6\xd9\xae\x69\xb1\xcd\x51\xd6\x15\x7d\xba\xb4\x00\xd1\x0c\x51\xef\xb7\x73\xfa\x75\x58\x57\xc4\x01\x80\x76\x2e\xc1\xbb\x39\xa5\x52\x13\xfb\x8e\xa6\xf0\x24\x25\x12\xa6\x11\x10\xca\x40\x00\x3c\x86\xa2\xea\xf2\x39\xcd\x3d\x83\x2f\x69\xdb\xda\xb7\x44\x56\xeb\xbe\xdf\x59\xcb\x2f\x6f\x6e\xae\xa4\x69\x97\x7a\x57\xdb\x79\x40\x19\x98\x83\x0d\x6f\xbc\x75\xda\xd4\x33\x10\xc9\xbe\xdd\x0c\xe8\x87\xc6\x6a\x39\x47\xf0\xc2\x5d\x78\xc4\x7f\xae\x3d\x7a\x80\xe7\x8e\xa4\x93\x03\xa8\x89\x70\x5c\x62\x03\x24\xa2\x6e\x76\x5c\x6f\x40\xd5\x97\x9a\xe0\x49\x19\x9b\xa6\xcb\x97\xad\x93\x72\x21\xfb\x04\xec\x7f\x4b\x03\x56\x36\x72\x7d\x41\x68\x00\x2f\x41\xea\xb2\x6d\xb6\x94\xfa\x9c\xfe\xf9\x04\xdf\xfd\x0b\xae\x0f\x30\x79\x51\x10\x7f\xeb\x4e\xd2\xb7\xcf\xcf\xd2\xff\xf4\xe3\x0f\x3f\xcc\xd2\x57\x3d\xaf\x44\x26\xce\xbf\x33\x51\xd1\xa7\xec\xe1\x0e\x94\x58\x46\x4f\x7Line truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x92\xdc\x46\xae\x27\xfe\x9d\x4f\x41\xeb\x84\xfe\xb2\x23\x5a\xa5\xb0\xfd\xdf\x4b\x38\x24\x79\x5b\xdd\xd6\x65\x8e\x5a\xdd\xa3\x6e\xcf\xec\xac\x42\x41\xb3\x8a\xac\x2a\x8e\xaa\xc8\x32\xc9\x52\xa9\xe7\xc4\x89\xd8\xd7\xd8\xd7\xdb\x27\x59\xe0\x07\x20\x2f\x24\xab\x25\x79\x4e\xec\x7e\xe9\x66\x65\x22\x6f\x48\x24\x12\x40\x22\x91\xf9\x6e\x97\x15\x65\xb7\x48\x9f\xa4\xa7\xe9\x2e\xaf\xea\x4d\xd9\x75\x69\x57\x6e\x96\x0f\xd7\x4d\xd7\x97\x45\xfa\xa2\xea\xe9\x77\xfb\xb1\x5a\x94\x49\xb2\x6e\xb6\x25\x81\xbe\xa4\x7f\x49\x91\x77\xeb\x79\x93\xb7\x05\x25\x9c\xdb\x77\x52\x7e\xda\x6d\x9a\x96\x81\x7e\x91\xaf\x64\x5d\x6e\x76\x5c\x86\xfe\x25\x5d\xb5\xaa\xb3\xaa\xa6\x9f\xd7\xf4\x95\xbe\xaa\x93\xae\x59\x54\xf9\x26\x0b\x32\x90\x60\xf9\x3f\xa5\x3f\xd4\x45\x7a\xdd\x97\xbb\xf4\x71\xb7\xcd\x37\x9b\xa7\x79\x87\x22\x7d\x99\xe6\x8b\x45\xb3\xaf\xfb\xc7\x8f\x24\x43\x2a\x6f\xf6\xbd\xd5\x7e\xb9\xef\x25\x6d\xbf\xb3\xa4\x5f\x77\x49\x5b\xae\x2a\x1a\x58\x4b\x49\x6f\xf5\x33\x39\x94\xf3\xae\xea\xb9\xd3\x7f\x95\xaf\xe4\x63\xd9\x76\x55\xc3\xfd\xf9\x8b\x7c\x25\xbb\x7c\xc5\x00\x57\xf4\x2f\xe9\xcb\xed\x6e\x93\xa3\xc0\x8d\x7e\x26\x9b\xbc\x5e\xed\x05\xe6\xb5\x7e\x26\x8b\xb6\xa4\xac\xac\x2e\x0f\x94\x7a\x86\x1f\x29\xfd\x98\xcd\x66\xc9\x9e\x70\x9a\xed\xda\x66\x59\x6d\xca\x2c\xaf\x8b\x6c\x2b\x58\xfb\x95\xd2\x53\x4d\x4f\x29\x3d\xe5\x74\x0c\xa3\x2c\x08\x41\x59\xde\xe9\x58\x68\x6a\x08\x5f\x79\x97\xa0\xaa\x3a\xdf\x5a\x69\xfe\x4c\xca\x6d\x5e\x6d\x78\x12\x1e\xf2\x07\x75\xbe\xeb\x0e\x0d\xa6\xea\x4a\x3f\x09\x11\x59\x7f\xbb\x2b\x81\x87\x87\x37\xf4\x95\x2c\xf2\x5d\xbf\x58\xe7\xdc\x57\xf9\x4a\x08\x68\xd7\x10\x42\x9a\xf6\x16\x70\xf6\x23\x69\xda\x55\x5e\x57\xff\xc8\x7b\x41\xd2\x65\xf0\x33\xd9\x56\x6d\xdb\x30\x7e\x2f\xf0\x91\xd0\x88\x33\xae\x87\x52\xde\x10\x26\x82\x5a\x38\x67\x5b\xad\x5a\x41\x25\x67\x5e\xe0\x17\xd7\xc2\x79\xcb\xa6\xfd\xa0\x19\xcf\xf9\x73\x50\x94\x3a\xa1\xb9\x71\xfb\x79\x4d\xc8\xd7\xdc\x0b\xfc\x88\x00\xba\x24\x2f\xb6\x84\xca\x5d\x5e\x97\x8c\xa3\x53\xfe\x45\x78\xa1\x5f\x89\xd2\x54\xd6\x95\x7d\x5f\xd5\x2b\x46\xf6\xa9\x24\xa5\xd7\x9a\x94\x04\x79\x2e\xed\xb6\xd9\xbb\xe9\xa4\xf4\xbf\xd1\xcf\xf4\x4a\x7e\x4a\x5e\x50\x08\x99\xae\x24\x8f\xa4\xcb\x96\x65\x59\xc8\x58\xba\xf4\x39\x7d\x27\xbb\xfd\x66\x43\x58\xfb\x7d\x5f\x76\x3d\x17\xba\xa2\xdf\x34\x7e\xf9\x9d\x54\x5d\x47\x1f\x94\xfc\x0a\x1f\x09\x4d\x5d\xbd\xc0\x60\xce\xf0\x91\x24\xef\xba\x32\x6f\x17\xeb\xf7\x89\xfc\x47\x5f\xf9\x83\x69\xef\xd8\xa4\x32\x21\x29\x11\x49\x0b\xd6\x40\xb2\x68\x0a\xfe\x71\x46\xff\xa8\xea\xaa\xee\x7a\x5a\x71\xef\x13\xfd\x60\x30\xf9\x92\x09\xe8\xab\x1e\x58\xd0\x44\x2c\xdf\x8e\x67\x30\x7d\x5e\xb5\x5d\xff\xb0\xaf\x88\x58\xdf\xee\xeb\x84\xc7\x47\xab\x2d\x2b\xe6\xc6\x84\x5e\x34\x84\x22\x24\xb7\x34\xbe\x8b\xdb\xeb\x3f\xbf\x3e\x49\xaf\x88\x13\xad\xda\x92\xbe\x53\xaa\x83\xfe\x51\x99\x1f\x67\x09\x95\xb2\x96\xce\xf3\x3e\x9f\xe7\x5d\xe9\xd1\xca\x99\x42\xdd\x2e\x0f\x34\xce\x5c\x0d\x1c\xac\xeb\xa3\xf1\x4e\xad\x10\xaa\x43\xd7\x95\xab\xe3\x0d\x2f\x2e\x4a\x67\xa6\x86\xc2\x57\x9b\x92\xd3\xa9\xaa\xf4\xd5\x9b\x37\x97\xe7\xcf\xd2\xb2\x5e\x55\x75\x99\x1e\xaa\x7e\x9d\xee\xfb\xe5\x7f\xcd\x56\x65\x5d\xb6\xc4\xe3\x16\x55\x4a\x6b\xaa\x25\x4a\x48\x89\xb0\x65\x70\xb3\xa4\xeb\x36\xb4\xf6\x81\xde\xeb\xeb\xd7\xe9\x05\xa3\x78\x97\xf7\x6b\x74\xa4\x5f\x27\xdd\xef\x1b\x46\x91\x6b\xf0\x66\x5d\xa6\xa0\x32\x00\x35\x4b\xc3\x47\x5a\x68\x1f\x67\x49\xd9\xb6\x19\xb1\xa5\xfe\x36\xd3\xc2\x5a\xdf\x10\x52\xaa\x20\xd2\xa9\x9b\x3e\x9d\x97\x29\xca\xcc\x92\xc4\x3a\x6c\xd8\x3d\xdd\xed\x36\xd5\x42\xd6\xfa\x0b\xc9\xf3\x88\xe6\x1d\x44\xb1\x14\xc2\x01\x51\x96\x17\xa0\x8b\xd8\x33\xaf\x87\x34\x62\x20\x28\xbf\x2e\x89\x01\xae\xf7\x2b\x61\x7b\x9b\x66\x5f\x7c\x03\x4a\xb5\xde\x7b\x42\x4d\xdf\x36\xd4\x61\x60\xc7\x01\xf8\x26\x4e\x89\xe2\x78\xd3\x6a\xcb\x6d\x43\x7c\xc5\x11\x7b\x45\x04\x75\xa8\x28\x93\x46\xda\xe5\x1f\x69\xbd\xf5\x4d\xda\xaf\xab\x2e\x2d\x88\xd8\x16\x5c\x31\x2d\x8d\x3d\x6d\x17\x42\x16\x44\xa0\x42\x1a\x96\x16\xcf\x01\xa0\xb6\x7b\xa2\xa6\x35\x55\xc6\x9b\x11\xef\x9c\x54\xe5\x54\x3f\x31\x24\xaa\x07\xf4\x4d\x94\xdb\x10\x57\x66\xbe\x79\x8e\x0f\xfd\x1d\xd6\x4f\xbd\xca\x97\x4b\xea\x55\x47\x54\xf1\x32\x5d\x6c\x1a\x22\xa9\x5f\xdf\xbe\xee\x98\x60\xd6\xd9\xae\x69\xb1\xcd\x51\xd6\x15\x7d\xba\xb4\x00\xd1\x0c\x51\xef\xb7\x73\xfa\x75\x58\x57\xc4\x01\x80\x76\x2e\xc1\xbb\x39\xa5\x52\x13\xfb\x8e\xa6\xf0\x24\x25\x12\xa6\x11\x10\xca\x40\x00\x3c\x86\xa2\xea\xf2\x39\xcd\x3d\x83\x2f\x69\xdb\xda\xb7\x44\x56\xeb\xbe\xdf\x59\xcb\x2f\x6f\x6e\xae\xa4\x69\x97\x7a\x57\xdb\x79\x40\x19\x98\x83\x0d\x6f\xbc\x75\xda\xd4\x33\x10\xc9\xbe\xdd\x0c\xe8\x87\xc6\x6a\x39\x47\xf0\xc2\x5d\x78\xc4\x7f\xae\x3d\x7a\x80\xe7\x8e\xa4\x93\x03\xa8\x89\x70\x5c\x62\x03\x24\xa2\x6e\x76\x5c\x6f\x40\xd5\x97\x9a\xe0\x49\x19\x9b\xa6\xcb\x97\xad\x93\x72\x21\xfb\x04\xec\x7f\x4b\x03\x56\x36\x72\x7d\x41\x68\x00\x2f\x41\xea\xb2\x6d\xb6\x94\xfa\x9c\xfe\xf9\x04\xdf\xfd\x0b\xae\x0f\x30\x79\x51\x10\x7f\xeb\x4e\xd2\xb7\xcf\xcf\xd2\xff\xf4\xe3\x0f\x3f\xcc\xd2\x57\x3d\xaf\x44\x26\xce\xbf\x33\x51\xd1\xa7\xec\xe1\x0e\x94\x58\x46\x4f\x7Line truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 42071, mode: os.FileMode(420), modTime: time.Unix(1441567776, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 42163, mode: os.FileMode(420), modTime: time.Unix(1441573860, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers/user"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -73,6 +74,17 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateOrgSettingForm) {
|
||||
ctx.Redirect(org.HomeLink() + "/settings")
|
||||
}
|
||||
|
||||
func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) {
|
||||
form.Enable = true
|
||||
if err := user.UpdateAvatarSetting(ctx, form, ctx.Org.Organization); err != nil {
|
||||
ctx.Flash.Error(err.Error())
|
||||
} else {
|
||||
ctx.Flash.Success(ctx.Tr("org.settings.update_avatar_success"))
|
||||
}
|
||||
|
||||
ctx.Redirect(ctx.Org.OrgLink + "/settings")
|
||||
}
|
||||
|
||||
func SettingsDelete(ctx *middleware.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("org.settings")
|
||||
ctx.Data["PageIsSettingsDelete"] = true
|
||||
|
||||
+23
-19
@@ -5,6 +5,8 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
@@ -87,45 +89,47 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
|
||||
}
|
||||
|
||||
// FIXME: limit size.
|
||||
func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) {
|
||||
defer ctx.Redirect(setting.AppSubUrl + "/user/settings")
|
||||
|
||||
ctx.User.UseCustomAvatar = form.Enable
|
||||
func UpdateAvatarSetting(ctx *middleware.Context, form auth.UploadAvatarForm, ctxUser *models.User) error {
|
||||
ctxUser.UseCustomAvatar = form.Enable
|
||||
|
||||
if form.Avatar != nil {
|
||||
fr, err := form.Avatar.Open()
|
||||
if err != nil {
|
||||
ctx.Flash.Error(err.Error())
|
||||
return
|
||||
return fmt.Errorf("Avatar.Open: %v", err)
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadAll(fr)
|
||||
if err != nil {
|
||||
ctx.Flash.Error(err.Error())
|
||||
return
|
||||
return fmt.Errorf("ReadAll: %v", err)
|
||||
}
|
||||
if _, ok := base.IsImageFile(data); !ok {
|
||||
ctx.Flash.Error(ctx.Tr("settings.uploaded_avatar_not_a_image"))
|
||||
return
|
||||
return errors.New(ctx.Tr("settings.uploaded_avatar_not_a_image"))
|
||||
}
|
||||
if err = ctx.User.UploadAvatar(data); err != nil {
|
||||
ctx.Flash.Error(err.Error())
|
||||
return
|
||||
if err = ctxUser.UploadAvatar(data); err != nil {
|
||||
return fmt.Errorf("UploadAvatar: %v", err)
|
||||
}
|
||||
} else {
|
||||
// In case no avatar at all.
|
||||
if form.Enable && !com.IsFile(ctx.User.CustomAvatarPath()) {
|
||||
ctx.Flash.Error(ctx.Tr("settings.no_custom_avatar_available"))
|
||||
return
|
||||
return errors.New(ctx.Tr("settings.no_custom_avatar_available"))
|
||||
}
|
||||
}
|
||||
|
||||
if err := models.UpdateUser(ctx.User); err != nil {
|
||||
ctx.Flash.Error(err.Error())
|
||||
return
|
||||
if err := models.UpdateUser(ctxUser); err != nil {
|
||||
return fmt.Errorf("UpdateUser: %v", err)
|
||||
}
|
||||
|
||||
ctx.Flash.Success(ctx.Tr("settings.update_avatar_success"))
|
||||
return nil
|
||||
}
|
||||
|
||||
func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) {
|
||||
if err := UpdateAvatarSetting(ctx, form, ctx.User); err != nil {
|
||||
ctx.Flash.Error(err.Error())
|
||||
} else {
|
||||
ctx.Flash.Success(ctx.Tr("settings.update_avatar_success"))
|
||||
}
|
||||
|
||||
ctx.Redirect(setting.AppSubUrl + "/user/settings")
|
||||
}
|
||||
|
||||
func SettingsEmails(ctx *middleware.Context) {
|
||||
|
||||
@@ -37,6 +37,20 @@
|
||||
<button class="ui green button">{{$.i18n.Tr "org.settings.update_settings"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="inline field">
|
||||
<label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
|
||||
<input name="avatar" type="file" >
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user