finish new repo options page

This commit is contained in:
Unknwon committed 2015-08-31 13:36:31 +08:00
1 parent c6b039c6f9
commit cb381078ff
7 files changed
+53 -58

No files matched your search

+1 -2
View File
@@ -496,8 +496,7 @@ settings.basic_settings = Basic Settings
settings.danger_zone = Danger Zone
settings.site = Official Site
settings.update_settings = Update Settings
settings.change_reponame = Repository Name Changed
settings.change_reponame_desc = Repository name was changed. This will affect how links relate to the repository. Do you want to continue?
settings.change_reponame_prompt = This change will affect how links relate to the repository.
settings.transfer = Transfer Ownership
settings.transfer_desc = Transfer this repository to another user or to an organization in which you have admin rights.
settings.new_owner_has_same_repo = The new owner already has a repository with same name. Please choose another name.
+1 -1
View File
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
const APP_VER = "0.6.7.0830 Beta"
const APP_VER = "0.6.7.0831 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
+2 -2
View File
@@ -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\x7d\xfd\x72\xdc\x48\x8e\xe7\xff\x7c\x0a\xb6\x37\x7c\xee\x8e\x90\xcb\xd1\xdd\x71\x1f\xd1\x61\xbb\x4f\x96\xda\x1f\xb3\x96\xa5\xb5\xe4\x99\x9b\x73\x38\xd8\xac\x22\x55\xc5\x71\x15\x59\x4d\xb2\x5c\xae\xd9\xd8\x88\x7b\x8d\x7b\xbd\x7b\x92\x03\x7e\x00\xf2\x83\x64\xc9\xf6\xec\xc6\xdd\x3f\x12\x2b\x13\xf9\x85\x44\x22\x01\x24\x12\x99\x6f\xb7\x59\x51\x76\x8b\xf4\x49\x7a\x9a\x6e\xf3\xaa\x5e\x97\x5d\x97\x76\xe5\xfa\xf6\xe1\xaa\xe9\xfa\xb2\x48\x5f\x54\x3d\xfd\x6e\x3f\x55\x8b\x32\x49\x56\xcd\xa6\x24\xd0\x97\xf4\x2f\x29\xf2\x6e\x35\x6f\xf2\xb6\xa0\x84\x73\xfb\x4e\xca\xcf\xdb\x75\xd3\x32\xd0\x6f\xf2\x95\xac\xca\xf5\x96\xcb\xd0\xbf\xa4\xab\x96\x75\x56\xd5\xf4\xf3\x9a\xbe\xd2\x57\x75\xd2\x35\x8b\x2a\x5f\x67\x41\x06\x12\x2c\xff\x97\xf4\xa7\xba\x48\xaf\xfb\x72\x9b\x3e\xee\x36\xf9\x7a\xfd\x34\xef\x50\xa4\x2f\xd3\x7c\xb1\x68\x76\x75\xff\xf8\x91\x64\x48\xe5\xcd\xae\xb7\xda\x2f\x77\xbd\xa4\xed\xb6\x96\xf4\x6e\x9b\xb4\xe5\xb2\xa2\x81\xb5\x94\xf4\x56\x3f\x93\x7d\x39\xef\xaa\x9e\x3b\xfd\x17\xf9\x4a\x3e\x95\x6d\x57\x35\xdc\x9f\x3f\xcb\x57\xb2\xcd\x97\x0c\x70\x45\xff\x92\xbe\xdc\x6c\xd7\x39\x0a\xdc\xe8\x67\xb2\xce\xeb\xe5\x4e\x60\x5e\xeb\x67\xb2\x68\x4b\xca\xca\xea\x72\x4f\xa9\x67\xf8\x91\xd2\x8f\xd9\x6c\x96\xec\x08\xa7\xd9\xb6\x6d\x6e\xab\x75\x99\xe5\x75\x91\x6d\x04\x6b\xef\x28\x3d\xd5\xf4\x94\xd2\x53\x4e\xc7\x30\xca\x82\x10\x94\xe5\x9d\x8e\x85\xa6\x86\xf0\x95\x77\x09\xaa\xaa\xf3\x8d\x95\xe6\xcf\xa4\xdc\xe4\xd5\x9a\x27\xe1\x21\x7f\x50\xe7\xbb\x6e\xdf\x60\xaa\xae\xf4\x93\x10\x91\xf5\x87\x6d\x09\x3c\x3c\xbc\xa1\xaf\x64\x91\x6f\xfb\xc5\x2a\xe7\xbe\xca\x57\x42\x40\xdb\x86\x10\xd2\xb4\x07\xc0\xd9\x8f\xa4\x69\x97\x79\x5d\xfd\x3d\xef\x05\x49\x97\xc1\xcf\x64\x53\xb5\x6d\xc3\xf8\xbd\xc0\x47\x42\x23\xce\xb8\x1e\x4a\x79\x43\x98\x08\x6a\xe1\x9c\x4d\xb5\x6c\x05\x95\x9c\x79\x81\x5f\x5c\x0b\xe7\xdd\x36\xed\x47\xcd\x78\xce\x9f\x83\xa2\xd4\x09\xcd\x8d\xdb\xcf\x6b\x42\xbe\xe6\x5e\xe0\x47\x04\xd0\x25\x79\xb1\x21\x54\x6e\xf3\xba\x64\x1c\x9d\xf2\x2f\xc2\x0b\xfd\x4a\x94\xa6\xb2\xae\xec\xfb\xaa\x5e\x32\xb2\x4f\x25\x29\xbd\xd6\xa4\x24\xc8\x73\x69\x87\x66\xe7\xa6\x93\xd2\xff\x4a\x3f\xd3\x2b\xf9\x29\x79\x41\x21\x64\xba\x92\x3c\x92\x2e\xbb\x2d\xcb\x42\xc6\xd2\xa5\xcf\xe9\x3b\xd9\xee\xd6\x6b\xc2\xda\x1f\xbb\xb2\xeb\xb9\xd0\x15\xfd\xa6\xf1\xcb\xef\xa4\xea\x3a\xfa\xa0\xe4\x57\xf8\x48\x68\xea\xea\x05\x06\x73\x86\x8f\x24\x79\xdf\x95\x79\xbb\x58\x7d\x48\xe4\x3f\xfa\xca\x1f\x4c\x7b\xc7\x26\x95\x09\x49\x89\x48\x5a\xb0\x06\x92\x45\x53\xf0\x8f\x33\xfa\x47\x55\x57\x75\xd7\xd3\x8a\xfb\x90\xe8\x07\x83\xc9\x97\x4c\x40\x5f\xf5\xc0\x82\x26\x62\xf9\x76\x3c\x83\xe9\xf3\xaa\xed\xfa\x87\x7d\x45\xc4\xfa\x76\x57\x27\x3c\x3e\x5a\x6d\x59\x31\x37\x26\xf4\xa2\x21\x14\x21\xb9\xa5\xf1\x5d\x1c\xae\xff\xe5\xf5\x49\x7a\x45\x9c\x68\xd9\x96\xf4\x9d\x52\x1d\xf4\x8f\xca\xfc\x3c\x4b\xa8\x94\xb5\x74\x9e\xf7\xf9\x3c\xef\x4a\x8f\x56\xce\x14\xea\x76\x79\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\x8d\x77\x6a\x85\x50\x1d\xba\xae\x5c\x1d\x6f\x78\x71\x51\x3a\x33\x35\x14\xbe\x5a\x97\x9c\x4e\x55\xa5\xaf\xde\xbc\xb9\x3c\x7f\x96\x96\xf5\xb2\xaa\xcb\x74\x5f\xf5\xab\x74\xd7\xdf\xfe\xb7\x6c\x59\xd6\x65\x4b\x3c\x6e\x51\xa5\xb4\xa6\x5a\xa2\x84\x94\x08\x5b\x06\x37\x4b\xba\x6e\x4d\x6b\x1f\xe8\xbd\xbe\x7e\x9d\x5e\x30\x8a\xb7\x79\xbf\x42\x47\xfa\x55\xd2\xfd\xb1\x66\x14\xb9\x06\x6f\x56\x65\x0a\x2a\x03\x50\x73\x6b\xf8\x48\x0b\xed\xe3\x2c\x29\xdb\x36\x23\xb6\xd4\x1f\x32\x2d\xac\xf5\x0d\x21\xa5\x0a\x22\x9d\xba\xe9\xd3\x79\x99\xa2\xcc\x2c\x49\xac\xc3\x86\xdd\xd3\xed\x76\x5d\x2d\x64\xad\xbf\x90\x3c\x8f\x68\xde\x41\x14\x4b\x21\x1c\x10\x65\x79\x01\xba\x88\x3d\xf3\x7a\x48\x23\x06\x82\xf2\xab\x92\x18\xe0\x6a\xb7\x14\xb6\xb7\x6e\x76\xc5\x77\xa0\x54\xeb\xbd\x27\xd4\xf4\x6d\x43\x1d\x06\x76\x1c\x80\x6f\xe2\x94\x28\x8e\x37\xad\xb6\xdc\x34\xc4\x57\x1c\xb1\x57\x44\x50\xfb\x8a\x32\x69\xa4\x5d\xfe\x89\xd6\x5b\xdf\xa4\xfd\xaa\xea\xd2\x82\x88\x6d\xc1\x15\xd3\xd2\xd8\xd1\x76\x21\x64\x41\x04\x2a\xa4\x61\x69\xf1\x1c\x00\x6a\xb3\x23\x6a\x5a\x51\x65\xbc\x19\xf1\xce\x49\x55\x4e\xf5\x13\x43\xa2\x7a\x40\xdf\x44\xb9\x0d\x71\x65\xe6\x9b\xe7\xf8\xd0\xdf\x61\xfd\xd4\xab\xfc\xf6\x96\x7a\xd5\x11\x55\xbc\x4c\x17\xeb\x86\x48\xea\xdd\xdb\xd7\x1d\x13\xcc\x2a\xdb\x36\x2d\xb6\x39\xca\xba\xa2\x4f\x97\x16\x20\x9a\x21\xea\xdd\x66\x4e\xbf\xf6\xab\x8a\x38\x00\xd0\xce\x25\x78\x37\xa7\x54\x6a\x62\xd7\xd1\x14\x9e\xa4\x44\xc2\x34\x02\x42\x19\x08\x80\xc7\x50\x54\x5d\x3e\xa7\xb9\x67\xf0\x5b\xda\xb6\x76\x2d\x91\xd5\xaa\xef\xb7\xd6\xf2\xcb\x9b\x9b\x2b\x69\xda\xa5\xde\xd5\x76\x1e\x50\x06\xe6\x60\xcd\x1b\x6f\x9d\x36\xf5\x0c\x44\xb2\x6b\xd7\x03\xfa\xa1\xb1\x5a\xce\x11\xbc\x70\x17\x1e\xf1\x9f\x6b\x8f\x1e\xe0\xb9\x23\xe9\x64\x0f\x6a\x22\x1c\x97\xd8\x00\x89\xa8\x9b\x2d\xd7\x1b\x50\xf5\xa5\x26\x78\x52\xc6\xa6\xe9\xf2\x65\xeb\xa4\x5c\xc8\x3e\x01\xfb\xdf\xd0\x80\x95\x8d\x5c\x5f\x10\x1a\xc0\x4b\x90\x7a\xdb\x36\x1b\x4a\x7d\x4e\xff\x7c\x82\xef\xfe\x05\xd7\x07\x98\xbc\x28\x88\xbf\x75\x27\xe9\xdb\xe7\x67\xe9\x7f\xfe\xf9\xa7\x9f\x66\xe9\xab\x9e\x57\x22\x13\xe7\xdf\x98\xa8\xe8\x53\xf6\x70\x07\x4a\x2c\xa3\x27\xba\xbLine truncated
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x72\xdc\x48\x8e\xe7\xff\x7c\x0a\xb6\x37\x7c\xee\x8e\x90\xcb\xd1\xdd\x71\x1f\xd1\x61\xbb\x4f\x96\xda\x1f\xb3\x96\xa5\xb5\xe4\x99\x9b\x73\x38\xd8\xac\x22\x55\xc5\x71\x15\x59\x4d\xb2\x5c\xae\xd9\xd8\x88\x7b\x8d\x7b\xbd\x7b\x92\x03\x7e\x00\xf2\x83\x64\xc9\xf6\xec\xc6\xdd\x3f\x12\x2b\x13\xf9\x85\x44\x22\x01\x24\x12\x99\x6f\xb7\x59\x51\x76\x8b\xf4\x49\x7a\x9a\x6e\xf3\xaa\x5e\x97\x5d\x97\x76\xe5\xfa\xf6\xe1\xaa\xe9\xfa\xb2\x48\x5f\x54\x3d\xfd\x6e\x3f\x55\x8b\x32\x49\x56\xcd\xa6\x24\xd0\x97\xf4\x2f\x29\xf2\x6e\x35\x6f\xf2\xb6\xa0\x84\x73\xfb\x4e\xca\xcf\xdb\x75\xd3\x32\xd0\x6f\xf2\x95\xac\xca\xf5\x96\xcb\xd0\xbf\xa4\xab\x96\x75\x56\xd5\xf4\xf3\x9a\xbe\xd2\x57\x75\xd2\x35\x8b\x2a\x5f\x67\x41\x06\x12\x2c\xff\x97\xf4\xa7\xba\x48\xaf\xfb\x72\x9b\x3e\xee\x36\xf9\x7a\xfd\x34\xef\x50\xa4\x2f\xd3\x7c\xb1\x68\x76\x75\xff\xf8\x91\x64\x48\xe5\xcd\xae\xb7\xda\x2f\x77\xbd\xa4\xed\xb6\x96\xf4\x6e\x9b\xb4\xe5\xb2\xa2\x81\xb5\x94\xf4\x56\x3f\x93\x7d\x39\xef\xaa\x9e\x3b\xfd\x17\xf9\x4a\x3e\x95\x6d\x57\x35\xdc\x9f\x3f\xcb\x57\xb2\xcd\x97\x0c\x70\x45\xff\x92\xbe\xdc\x6c\xd7\x39\x0a\xdc\xe8\x67\xb2\xce\xeb\xe5\x4e\x60\x5e\xeb\x67\xb2\x68\x4b\xca\xca\xea\x72\x4f\xa9\x67\xf8\x91\xd2\x8f\xd9\x6c\x96\xec\x08\xa7\xd9\xb6\x6d\x6e\xab\x75\x99\xe5\x75\x91\x6d\x04\x6b\xef\x28\x3d\xd5\xf4\x94\xd2\x53\x4e\xc7\x30\xca\x82\x10\x94\xe5\x9d\x8e\x85\xa6\x86\xf0\x95\x77\x09\xaa\xaa\xf3\x8d\x95\xe6\xcf\xa4\xdc\xe4\xd5\x9a\x27\xe1\x21\x7f\x50\xe7\xbb\x6e\xdf\x60\xaa\xae\xf4\x93\x10\x91\xf5\x87\x6d\x09\x3c\x3c\xbc\xa1\xaf\x64\x91\x6f\xfb\xc5\x2a\xe7\xbe\xca\x57\x42\x40\xdb\x86\x10\xd2\xb4\x07\xc0\xd9\x8f\xa4\x69\x97\x79\x5d\xfd\x3d\xef\x05\x49\x97\xc1\xcf\x64\x53\xb5\x6d\xc3\xf8\xbd\xc0\x47\x42\x23\xce\xb8\x1e\x4a\x79\x43\x98\x08\x6a\xe1\x9c\x4d\xb5\x6c\x05\x95\x9c\x79\x81\x5f\x5c\x0b\xe7\xdd\x36\xed\x47\xcd\x78\xce\x9f\x83\xa2\xd4\x09\xcd\x8d\xdb\xcf\x6b\x42\xbe\xe6\x5e\xe0\x47\x04\xd0\x25\x79\xb1\x21\x54\x6e\xf3\xba\x64\x1c\x9d\xf2\x2f\xc2\x0b\xfd\x4a\x94\xa6\xb2\xae\xec\xfb\xaa\x5e\x32\xb2\x4f\x25\x29\xbd\xd6\xa4\x24\xc8\x73\x69\x87\x66\xe7\xa6\x93\xd2\xff\x4a\x3f\xd3\x2b\xf9\x29\x79\x41\x21\x64\xba\x92\x3c\x92\x2e\xbb\x2d\xcb\x42\xc6\xd2\xa5\xcf\xe9\x3b\xd9\xee\xd6\x6b\xc2\xda\x1f\xbb\xb2\xeb\xb9\xd0\x15\xfd\xa6\xf1\xcb\xef\xa4\xea\x3a\xfa\xa0\xe4\x57\xf8\x48\x68\xea\xea\x05\x06\x73\x86\x8f\x24\x79\xdf\x95\x79\xbb\x58\x7d\x48\xe4\x3f\xfa\xca\x1f\x4c\x7b\xc7\x26\x95\x09\x49\x89\x48\x5a\xb0\x06\x92\x45\x53\xf0\x8f\x33\xfa\x47\x55\x57\x75\xd7\xd3\x8a\xfb\x90\xe8\x07\x83\xc9\x97\x4c\x40\x5f\xf5\xc0\x82\x26\x62\xf9\x76\x3c\x83\xe9\xf3\xaa\xed\xfa\x87\x7d\x45\xc4\xfa\x76\x57\x27\x3c\x3e\x5a\x6d\x59\x31\x37\x26\xf4\xa2\x21\x14\x21\xb9\xa5\xf1\x5d\x1c\xae\xff\xe5\xf5\x49\x7a\x45\x9c\x68\xd9\x96\xf4\x9d\x52\x1d\xf4\x8f\xca\xfc\x3c\x4b\xa8\x94\xb5\x74\x9e\xf7\xf9\x3c\xef\x4a\x8f\x56\xce\x14\xea\x76\x79\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\x8d\x77\x6a\x85\x50\x1d\xba\xae\x5c\x1d\x6f\x78\x71\x51\x3a\x33\x35\x14\xbe\x5a\x97\x9c\x4e\x55\xa5\xaf\xde\xbc\xb9\x3c\x7f\x96\x96\xf5\xb2\xaa\xcb\x74\x5f\xf5\xab\x74\xd7\xdf\xfe\xb7\x6c\x59\xd6\x65\x4b\x3c\x6e\x51\xa5\xb4\xa6\x5a\xa2\x84\x94\x08\x5b\x06\x37\x4b\xba\x6e\x4d\x6b\x1f\xe8\xbd\xbe\x7e\x9d\x5e\x30\x8a\xb7\x79\xbf\x42\x47\xfa\x55\xd2\xfd\xb1\x66\x14\xb9\x06\x6f\x56\x65\x0a\x2a\x03\x50\x73\x6b\xf8\x48\x0b\xed\xe3\x2c\x29\xdb\x36\x23\xb6\xd4\x1f\x32\x2d\xac\xf5\x0d\x21\xa5\x0a\x22\x9d\xba\xe9\xd3\x79\x99\xa2\xcc\x2c\x49\xac\xc3\x86\xdd\xd3\xed\x76\x5d\x2d\x64\xad\xbf\x90\x3c\x8f\x68\xde\x41\x14\x4b\x21\x1c\x10\x65\x79\x01\xba\x88\x3d\xf3\x7a\x48\x23\x06\x82\xf2\xab\x92\x18\xe0\x6a\xb7\x14\xb6\xb7\x6e\x76\xc5\x77\xa0\x54\xeb\xbd\x27\xd4\xf4\x6d\x43\x1d\x06\x76\x1c\x80\x6f\xe2\x94\x28\x8e\x37\xad\xb6\xdc\x34\xc4\x57\x1c\xb1\x57\x44\x50\xfb\x8a\x32\x69\xa4\x5d\xfe\x89\xd6\x5b\xdf\xa4\xfd\xaa\xea\xd2\x82\x88\x6d\xc1\x15\xd3\xd2\xd8\xd1\x76\x21\x64\x41\x04\x2a\xa4\x61\x69\xf1\x1c\x00\x6a\xb3\x23\x6a\x5a\x51\x65\xbc\x19\xf1\xce\x49\x55\x4e\xf5\x13\x43\xa2\x7a\x40\xdf\x44\xb9\x0d\x71\x65\xe6\x9b\xe7\xf8\xd0\xdf\x61\xfd\xd4\xab\xfc\xf6\x96\x7a\xd5\x11\x55\xbc\x4c\x17\xeb\x86\x48\xea\xdd\xdb\xd7\x1d\x13\xcc\x2a\xdb\x36\x2d\xb6\x39\xca\xba\xa2\x4f\x97\x16\x20\x9a\x21\xea\xdd\x66\x4e\xbf\xf6\xab\x8a\x38\x00\xd0\xce\x25\x78\x37\xa7\x54\x6a\x62\xd7\xd1\x14\x9e\xa4\x44\xc2\x34\x02\x42\x19\x08\x80\xc7\x50\x54\x5d\x3e\xa7\xb9\x67\xf0\x5b\xda\xb6\x76\x2d\x91\xd5\xaa\xef\xb7\xd6\xf2\xcb\x9b\x9b\x2b\x69\xda\xa5\xde\xd5\x76\x1e\x50\x06\xe6\x60\xcd\x1b\x6f\x9d\x36\xf5\x0c\x44\xb2\x6b\xd7\x03\xfa\xa1\xb1\x5a\xce\x11\xbc\x70\x17\x1e\xf1\x9f\x6b\x8f\x1e\xe0\xb9\x23\xe9\x64\x0f\x6a\x22\x1c\x97\xd8\x00\x89\xa8\x9b\x2d\xd7\x1b\x50\xf5\xa5\x26\x78\x52\xc6\xa6\xe9\xf2\x65\xeb\xa4\x5c\xc8\x3e\x01\xfb\xdf\xd0\x80\x95\x8d\x5c\x5f\x10\x1a\xc0\x4b\x90\x7a\xdb\x36\x1b\x4a\x7d\x4e\xff\x7c\x82\xef\xfe\x05\xd7\x07\x98\xbc\x28\x88\xbf\x75\x27\xe9\xdb\xe7\x67\xe9\x7f\xfe\xf9\xa7\x9f\x66\xe9\xab\x9e\x57\x22\x13\xe7\xdf\x98\xa8\xe8\x53\xf6\x70\x07\x4a\x2c\xa3\x27\xba\xbLine 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: 40391, mode: os.FileMode(420), modTime: time.Unix(1440876042, 0)}
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 40295, mode: os.FileMode(420), modTime: time.Unix(1440998367, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
+12
View File
@@ -182,6 +182,18 @@ function initRepository() {
return;
}
// Options
if ($('.repository.settings.options').length > 0) {
$('#repo_name').keyup(function () {
var $prompt_span = $('#repo-name-change-prompt');
if ($(this).val().toLowerCase() != $(this).data('repo-name').toLowerCase()) {
$prompt_span.show();
}else{
$prompt_span.hide();
}
});
}
// Labels
if ($('.repository.labels').length > 0) {
// Create label
+34 -50
View File
@@ -44,6 +44,8 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["PageIsSettingsOptions"] = true
repo := ctx.Repo.Repository
switch ctx.Query("action") {
case "update":
if ctx.HasError() {
@@ -53,44 +55,41 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
newRepoName := form.RepoName
// Check if repository name has been changed.
if ctx.Repo.Repository.Name != newRepoName {
if err := models.ChangeRepositoryName(ctx.Repo.Owner, ctx.Repo.Repository.Name, newRepoName); err != nil {
if repo.LowerName != strings.ToLower(newRepoName) {
if err := models.ChangeRepositoryName(ctx.Repo.Owner, repo.Name, newRepoName); err != nil {
ctx.Data["Err_RepoName"] = true
switch {
case models.IsErrRepoAlreadyExist(err):
ctx.Data["Err_RepoName"] = true
ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), SETTINGS_OPTIONS, &form)
case models.IsErrNameReserved(err):
ctx.Data["Err_RepoName"] = true
ctx.RenderWithErr(ctx.Tr("repo.form.name_reserved", err.(models.ErrNameReserved).Name), SETTINGS_OPTIONS, &form)
case models.IsErrNamePatternNotAllowed(err):
ctx.Data["Err_RepoName"] = true
ctx.RenderWithErr(ctx.Tr("repo.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), SETTINGS_OPTIONS, &form)
default:
ctx.Handle(500, "ChangeRepositoryName", err)
}
return
}
log.Trace("Repository name changed: %s/%s -> %s", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newRepoName)
ctx.Repo.Repository.Name = newRepoName
ctx.Repo.Repository.LowerName = strings.ToLower(newRepoName)
log.Trace("Repository name changed: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newRepoName)
}
// In case it's just a case change.
repo.Name = newRepoName
repo.LowerName = strings.ToLower(newRepoName)
br := form.Branch
if ctx.Repo.GitRepo.IsBranchExist(br) {
ctx.Repo.Repository.DefaultBranch = br
if ctx.Repo.GitRepo.IsBranchExist(form.Branch) {
repo.DefaultBranch = form.Branch
}
ctx.Repo.Repository.Description = form.Description
ctx.Repo.Repository.Website = form.Website
visibilityChanged := ctx.Repo.Repository.IsPrivate != form.Private
ctx.Repo.Repository.IsPrivate = form.Private
if err := models.UpdateRepository(ctx.Repo.Repository, visibilityChanged); err != nil {
repo.Description = form.Description
repo.Website = form.Website
visibilityChanged := repo.IsPrivate != form.Private
repo.IsPrivate = form.Private
if err := models.UpdateRepository(repo, visibilityChanged); err != nil {
ctx.Handle(404, "UpdateRepository", err)
return
}
log.Trace("Repository updated: %s/%s", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name)
log.Trace("Repository updated: %s/%s", ctx.Repo.Owner.Name, repo.Name)
if ctx.Repo.Repository.IsMirror {
if repo.IsMirror {
if form.Interval > 0 {
ctx.Repo.Mirror.Interval = form.Interval
ctx.Repo.Mirror.NextUpdate = time.Now().Add(time.Duration(form.Interval) * time.Hour)
@@ -101,13 +100,20 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
}
ctx.Flash.Success(ctx.Tr("repo.settings.update_settings_success"))
ctx.Redirect(fmt.Sprintf("%s/%s/%s/settings", setting.AppSubUrl, ctx.Repo.Owner.Name, ctx.Repo.Repository.Name))
ctx.Redirect(fmt.Sprintf("%s/%s/%s/settings", setting.AppSubUrl, ctx.Repo.Owner.Name, repo.Name))
case "transfer":
if ctx.Repo.Repository.Name != form.RepoName {
if repo.Name != form.RepoName {
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), SETTINGS_OPTIONS, nil)
return
}
if ctx.Repo.Owner.IsOrganization() {
if !ctx.Repo.Owner.IsOwnedBy(ctx.User.Id) {
ctx.Error(404)
return
}
}
newOwner := ctx.Query("new_owner_name")
isExist, err := models.IsUserExist(0, newOwner)
if err != nil {
@@ -118,16 +124,7 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
return
}
if _, err = models.UserSignIn(ctx.User.Name, ctx.Query("password")); err != nil {
if models.IsErrUserNotExist(err) {
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_password"), SETTINGS_OPTIONS, nil)
} else {
ctx.Handle(500, "UserSignIn", err)
}
return
}
if err = models.TransferOwnership(ctx.User, newOwner, ctx.Repo.Repository); err != nil {
if err = models.TransferOwnership(ctx.User, newOwner, repo); err != nil {
if models.IsErrRepoAlreadyExist(err) {
ctx.RenderWithErr(ctx.Tr("repo.settings.new_owner_has_same_repo"), SETTINGS_OPTIONS, nil)
} else {
@@ -135,11 +132,11 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
}
return
}
log.Trace("Repository transfered: %s/%s -> %s", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newOwner)
log.Trace("Repository transfered: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newOwner)
ctx.Flash.Success(ctx.Tr("repo.settings.transfer_succeed"))
ctx.Redirect(setting.AppSubUrl + "/")
ctx.Redirect(setting.AppSubUrl + "/" + newOwner + "/" + repo.Name)
case "delete":
if ctx.Repo.Repository.Name != form.RepoName {
if repo.Name != form.RepoName {
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), SETTINGS_OPTIONS, nil)
return
}
@@ -151,25 +148,12 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
}
}
if _, err := models.UserSignIn(ctx.User.Name, ctx.Query("password")); err != nil {
if models.IsErrUserNotExist(err) {
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_password"), SETTINGS_OPTIONS, nil)
} else {
ctx.Handle(500, "UserSignIn", err)
}
return
}
if err := models.DeleteRepository(ctx.Repo.Owner.Id, ctx.Repo.Repository.ID, ctx.Repo.Owner.Name); err != nil {
if err := models.DeleteRepository(ctx.Repo.Owner.Id, repo.ID, ctx.Repo.Owner.Name); err != nil {
ctx.Handle(500, "DeleteRepository", err)
return
}
log.Trace("Repository deleted: %s/%s", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name)
if ctx.Repo.Owner.IsOrganization() {
ctx.Redirect(setting.AppSubUrl + "/org/" + ctx.Repo.Owner.Name + "/dashboard")
} else {
ctx.Redirect(setting.AppSubUrl + "/")
}
log.Trace("Repository deleted: %s/%s", ctx.Repo.Owner.Name, repo.Name)
ctx.Redirect(ctx.Repo.Owner.DashboardLink())
}
}
+1 -1
View File
@@ -1 +1 @@
0.6.7.0830 Beta
0.6.7.0831 Beta
+2 -2
View File
@@ -14,7 +14,7 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update">
<div class="required field {{if .Err_RepoName}}error{{end}}">
<label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
<label for="repo_name">{{.i18n.Tr "repo.repo_name"}}<span class="text red hide" id="repo-name-change-prompt"> {{.i18n.Tr "repo.settings.change_reponame_prompt"}}</span></label>
<input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
</div>
<div class="field {{if .Err_Description}}error{{end}}">
@@ -46,7 +46,7 @@
<div class="inline field">
<label>{{.i18n.Tr "repo.visibility"}}</label>
<div class="ui checkbox">
<input name="private" type="checkbox" {{if .private}}checked{{end}}>
<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
<label>{{.i18n.Tr "repo.visiblity_helper" | Safe}}</label>
</div>
</div>