Merge pull request #2 from gogits/develop

Update Develop
This commit is contained in:
Yixin Hao committed 2015-08-21 15:27:38 +08:00
commit 50cd67cd4b
28 files changed
+668 -333

No files matched your search

+3 -2
View File
@@ -272,8 +272,9 @@ func runWeb(ctx *cli.Context) {
m.Post("/email", bindIgnErr(auth.AddEmailForm{}), user.SettingsEmailPost)
m.Get("/password", user.SettingsPassword)
m.Post("/password", bindIgnErr(auth.ChangePasswordForm{}), user.SettingsPasswordPost)
m.Get("/ssh", user.SettingsSSHKeys)
m.Post("/ssh", bindIgnErr(auth.AddSSHKeyForm{}), user.SettingsSSHKeysPost)
m.Combo("/ssh").Get(user.SettingsSSHKeys).
Post(bindIgnErr(auth.AddSSHKeyForm{}), user.SettingsSSHKeysPost)
m.Post("/ssh/delete", user.DeleteSSHKey)
m.Get("/social", user.SettingsSocial)
m.Combo("/applications").Get(user.SettingsApplications).
Post(bindIgnErr(auth.NewAccessTokenForm{}), user.SettingsApplicationsPost)
+3
View File
@@ -276,6 +276,9 @@ key_name = Key Name
key_content = Content
add_key_success = New SSH key '%s' has been added successfully!
delete_key = Delete
ssh_key_deletion = SSH Key Deletion
ssh_key_deletion_desc = Delete this SSH key will remove all related accesses for your account. Do you want to continue?
ssh_key_deletion_success = SSH key has been deleted successfully!
add_on = Added on
last_used = Last used on
no_activity = No recent activity
+6
View File
@@ -169,6 +169,12 @@ func ParsePatch(pid int64, maxlines int, cmd *exec.Cmd, reader io.Reader) (*Diff
beg := len(DIFF_HEAD)
a := line[beg : (len(line)-beg)/2+beg]
// In case file name is surrounded by double quotes(it happens only in git-shell).
if a[0] == '"' {
a = a[1 : len(a)-1]
a = strings.Replace(a, `\"`, `"`, -1)
}
curFile = &DiffFile{
Name: a[strings.Index(a, "/")+1:],
Index: len(diff.Files) + 1,
+9 -1
View File
@@ -466,7 +466,15 @@ func deletePublicKey(e *xorm.Session, key *PublicKey) error {
}
// DeletePublicKey deletes SSH key information both in database and authorized_keys file.
func DeletePublicKey(key *PublicKey) (err error) {
func DeletePublicKey(id int64) (err error) {
key := &PublicKey{ID: id}
has, err := x.Id(key.ID).Get(key)
if err != nil {
return err
} else if !has {
return nil
}
sess := x.NewSession()
defer sessionRelease(sess)
if err = sess.Begin(); err != nil {
+7
View File
@@ -166,6 +166,13 @@ type Repository struct {
Updated time.Time `xorm:"UPDATED"`
}
func (repo *Repository) AfterSet(colName string, _ xorm.Cell) {
switch colName {
case "updated":
repo.Updated = regulateTimeZone(repo.Updated)
}
}
func (repo *Repository) getOwner(e Engine) (err error) {
if repo.Owner == nil {
repo.Owner, err = getUserByID(e, repo.OwnerID)
+2 -2
View File
@@ -772,7 +772,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\xdb\x48\x92\xe7\xff\x78\x0a\xb4\x37\x7c\x76\x47\xc8\x74\x74\x4f\xdc\x47\x4c\xd8\xee\x93\xa5\xf6\xc7\xac\x65\x69\x2d\x79\xe6\xe6\x1c\x0e\x34\x48\x40\x24\x46\x24\xc0\x06\x40\xd1\x9a\x8d\x8d\xb8\xd7\xb8\xd7\xbb\x27\xb9\xcc\x5f\x66\xd6\x07\x00\xca\xf6\xec\xc6\xdd\x3f\x64\xa1\x2a\xeb\x2b\x2b\x2b\x2b\x33\x2b\xab\x2a\xdf\x6e\xb3\xa2\xec\x16\xe9\xf3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\x93\x55\xd3\xf5\x65\x91\xbe\xae\x7a\xfa\x6e\x6f\xab\x45\x99\x24\xab\x66\x53\x12\xe8\x1b\xfa\x4b\x8a\xbc\x5b\xcd\x9b\xbc\x2d\x28\xe2\xd4\xc2\x49\xf9\x65\xbb\x6e\x5a\x06\xfa\x55\x42\xc9\xaa\x5c\x6f\x39\x0f\xfd\x25\x5d\xb5\xac\xb3\xaa\xa6\xcf\x4b\x0a\xa5\x6f\xeb\xa4\x6b\x16\x55\xbe\xce\x82\x04\x44\x58\xfa\x1f\xd3\x9f\xeb\x22\xbd\xec\xcb\x6d\xfa\xac\xdb\xe4\xeb\xf5\x8b\xbc\x43\x96\xbe\x4c\xf3\xc5\xa2\xd9\xd5\xfd\xb3\xa7\x92\x20\x85\x37\xbb\xde\x4a\x3f\xdf\xf5\x12\xb7\xdb\x5a\xd4\xc7\x6d\xd2\x96\xcb\x8a\x3a\xd6\x52\xd4\x07\x0d\x26\xfb\x72\xde\x55\x3d\x37\xfa\x2f\x12\x4a\x6e\xcb\xb6\xab\x1a\x6e\xcf\x9f\x25\x94\x6c\xf3\x25\x03\x5c\xd0\x5f\xd2\x97\x9b\xed\x3a\x47\x86\x2b\x0d\x26\xeb\xbc\x5e\xee\x04\xe6\x9d\x06\x93\x45\x5b\x52\x52\x56\x97\x7b\x8a\x3d\xc1\x47\x4a\x1f\xb3\xd9\x2c\xd9\x11\x4e\xb3\x6d\xdb\x5c\x57\xeb\x32\xcb\xeb\x22\xdb\x08\xd6\x3e\x52\x7c\xaa\xf1\x29\xc5\xa7\x1c\x8f\x6e\x94\x05\x21\x28\xcb\x3b\xed\x0b\x0d\x0d\xe1\x2b\xef\x12\x14\x55\xe7\x1b\xcb\xcd\xc1\xa4\xdc\xe4\xd5\x9a\x07\xe1\x09\x07\xa8\xf1\x5d\xb7\x6f\x30\x54\x17\x1a\x24\x44\x64\xfd\xdd\xb6\x04\x1e\x9e\x5c\x51\x28\x59\xe4\xdb\x7e\xb1\xca\xb9\xad\x12\x4a\x08\x68\xdb\x10\x42\x9a\xf6\x0e\x70\xf6\x91\x34\xed\x32\xaf\xab\xbf\xe7\xbd\x20\xe9\x3c\xf8\x4c\x36\x55\xdb\x36\x8c\xdf\x33\x04\x12\xea\x71\xc6\xe5\x50\xcc\x7b\xc2\x44\x50\x0a\xa7\x6c\xaa\x65\x2b\xa8\xe4\xc4\x33\x7c\x71\x29\x9c\x76\xdd\xb4\x37\x9a\xf0\x8a\x83\x83\xac\xd4\x08\x4d\x8d\xeb\xcf\x6b\x42\xbe\xa6\x9e\xe1\x23\x02\xe8\x92\xbc\xd8\x10\x2a\xb7\x79\x5d\x32\x8e\x8e\xf9\x8b\xf0\x42\x5f\x89\xd2\x54\xd6\x95\x7d\x5f\xd5\x4b\x46\xf6\xb1\x44\xa5\x97\x1a\x95\x04\x69\x2e\xee\xae\xd9\xb9\xe1\xa4\xf8\xbf\xd2\x67\x7a\x21\x9f\x92\x16\x64\x42\xa2\xcb\xc9\x3d\xe9\xb2\xeb\xb2\x2c\xa4\x2f\x5d\xfa\x8a\xc2\xc9\x76\xb7\x5e\x13\xd6\x7e\xdf\x95\x5d\xcf\x99\x2e\xe8\x9b\xfa\x2f\xdf\x49\xd5\x75\x14\xa0\xe8\xb7\x08\x24\x34\x74\xf5\x02\x9d\x39\x41\x20\x49\x3e\x75\x65\xde\x2e\x56\x9f\x13\xf9\x47\x5b\x39\xc0\xb4\x77\x68\x50\x99\x90\x94\x88\xa4\x06\xab\x20\x59\x34\x05\x7f\x9c\xd0\x1f\x15\x5d\xd5\x5d\x4f\x33\xee\x73\xa2\x01\x06\x93\x90\x0c\x40\x5f\xf5\xc0\x82\x46\x62\xfa\x76\x3c\x82\xe9\xab\xaa\xed\xfa\x27\x7d\x45\xc4\xfa\x61\x57\x27\xdc\x3f\x9a\x6d\x59\x31\x37\x26\xf4\xba\x21\x14\x21\xba\xa5\xfe\x9d\xdd\x5d\xfe\xcb\xbb\xa3\xf4\x82\x38\xd1\xb2\x2d\x29\x9c\x52\x19\xf4\x47\x79\xfe\x30\x4b\x28\x97\xd5\x74\x9a\xf7\xf9\x3c\xef\x4a\x8f\x56\x4e\x14\xea\x76\x69\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\xf5\x77\x6a\x86\x50\x19\x3a\xaf\x5c\x19\xef\x79\x72\x51\x3c\x33\x35\x64\xbe\x58\x97\x1c\x4f\x45\xa5\x6f\xdf\xbf\x3f\x3f\x7d\x99\x96\xf5\xb2\xaa\xcb\x74\x5f\xf5\xab\x74\xd7\x5f\xff\xb7\x6c\x59\xd6\x65\x4b\x3c\x6e\x51\xa5\x34\xa7\x5a\xa2\x84\x94\x08\x5b\x3a\x37\x4b\xba\x6e\x4d\x73\x1f\xe8\xbd\xbc\x7c\x97\x9e\x31\x8a\xb7\x79\xbf\x42\x43\xfa\x55\xd2\xfd\xbe\x66\x14\xb9\x0a\xaf\x56\x65\x0a\x2a\x03\x50\x73\x6d\xf8\x48\x0b\x6d\xe3\x2c\x29\xdb\x36\x23\xb6\xd4\xdf\x65\x9a\x59\xcb\x1b\x42\x4a\x11\x44\x3a\x75\xd3\xa7\xf3\x32\x45\x9e\x59\x92\x58\x83\x0d\xbb\xc7\xdb\xed\xba\x5a\xc8\x5c\x7f\x2d\x69\x1e\xd1\xbc\x82\x28\x96\x42\x38\x20\xca\xd2\x02\x74\x11\x7b\xe6\xf9\x90\x46\x0c\x04\xf9\x57\x25\x31\xc0\xd5\x6e\x29\x6c\x6f\xdd\xec\x8a\x1f\x40\xa9\xd6\x7a\x4f\xa8\xe9\x87\x86\x1a\x0c\xec\x38\x00\x5f\xc5\x31\x51\x1c\x2f\x5a\x6d\xb9\x69\x88\xaf\x38\x62\xaf\x88\xa0\xf6\x15\x25\x52\x4f\xbb\xfc\x96\xe6\x5b\xdf\xa4\xfd\xaa\xea\xd2\x82\x88\x6d\xc1\x05\xd3\xd4\xd8\xd1\x72\x21\x64\x41\x04\x2a\xa4\x61\x71\xf1\x18\x00\x6a\xb3\x23\x6a\x5a\x51\x61\xbc\x18\xf1\xca\x49\x45\x4e\xb5\x13\x5d\xa2\x72\x40\xdf\x44\xb9\x0d\x71\x65\xe6\x9b\xa7\x08\xe8\x77\x58\x3e\xb5\x2a\xbf\xbe\xa6\x56\x75\x44\x15\x6f\xd2\xc5\xba\x21\x92\xfa\xf8\xe1\x5d\xc7\x04\xb3\xca\xb6\x4d\x8b\x65\x8e\x92\x2e\x28\xe8\xe2\x02\x44\x33\x44\xbd\xdb\xcc\xe9\x6b\xbf\xaa\x88\x03\x00\xed\x9c\x83\x57\x73\x8a\xa5\x2a\x76\x1d\x0d\xe1\x51\x4a\x24\x4c\x3d\x20\x94\x81\x00\xb8\x0f\x45\xd5\xe5\x73\x1a\x7b\x06\xbf\xa6\x65\x6b\xd7\x12\x59\xad\xfa\x7e\x6b\x35\xbf\xb9\xba\xba\x90\xaa\x5d\xec\x7d\x75\xe7\x01\x65\x60\x0c\xd6\xbc\xf0\xd6\x69\x53\xcf\x40\x24\xbb\x76\x3d\xa0\x1f\xea\xab\xa5\x1c\xc0\x0b\x37\xe1\x29\xff\x5c\x7a\xf4\x00\xcf\x1d\x49\x27\x7b\x50\x13\xe1\xb8\xc4\x02\x48\x44\xdd\x6c\xb9\xdc\x80\xaa\xcf\x35\xc2\x93\x32\x16\x4d\x97\x2e\x4b\x27\xa5\x42\xf6\x09\xd8\xff\x86\x3a\xac\x6c\xe4\xf2\x8c\xd0\x00\x5e\x82\xd8\xeb\xb6\xd9\x50\xec\x2b\xfa\xf3\x11\xbe\xf9\x67\x5c\x1e\x60\xf2\xa2\x20\xfe\xd6\x1d\xa5\x1f\x5e\x9d\xa4\xff\xf9\x0f\x3f\xff\x3c\x4b\xdf\xf6\x3c\x13\x99\x38\xff\xc6\x44\x45\x41\x59\xc3\x1d\x28\xb1\x8c\x9e\xe8\xee\x01\xcf\xac\x07\xe9\x3Line truncated
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x72\xdb\x48\x92\xe7\xff\x78\x0a\xb4\x37\x7c\x76\x47\xc8\x74\x74\x4f\xdc\x47\x4c\xd8\xee\x93\xa5\xf6\xc7\xac\x65\x69\x2d\x79\xe6\xe6\x1c\x0e\x34\x48\x40\x24\x46\x24\xc0\x06\x40\xd1\x9a\x8d\x8d\xb8\xd7\xb8\xd7\xbb\x27\xb9\xcc\x5f\x66\xd6\x07\x00\xca\xf6\xec\xc6\xdd\x3f\x64\xa1\x2a\xeb\x2b\x2b\x2b\x2b\x2b\x2b\x2b\x2b\xdf\x6e\xb3\xa2\xec\x16\xe9\xf3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\x93\x55\xd3\xf5\x65\x91\xbe\xae\x7a\xfa\x6e\x6f\xab\x45\x99\x24\xab\x66\x53\x12\xe8\x1b\xfa\x4b\x8a\xbc\x5b\xcd\x9b\xbc\x2d\x28\xe2\xd4\xc2\x49\xf9\x65\xbb\x6e\x5a\x06\xfa\x55\x42\xc9\xaa\x5c\x6f\x39\x0f\xfd\x25\x5d\xb5\xac\xb3\xaa\xa6\xcf\x4b\x0a\xa5\x6f\xeb\xa4\x6b\x16\x55\xbe\xce\x82\x04\x44\x58\xfa\x1f\xd3\x9f\xeb\x22\xbd\xec\xcb\x6d\xfa\xac\xdb\xe4\xeb\xf5\x8b\xbc\x43\x96\xbe\x4c\xf3\xc5\xa2\xd9\xd5\xfd\xb3\xa7\x92\x20\x85\x37\xbb\xde\x4a\x3f\xdf\xf5\x12\xb7\xdb\x5a\xd4\xc7\x6d\xd2\x96\xcb\x8a\x3a\xd6\x52\xd4\x07\x0d\x26\xfb\x72\xde\x55\x3d\x37\xfa\x2f\x12\x4a\x6e\xcb\xb6\xab\x1a\x6e\xcf\x9f\x25\x94\x6c\xf3\x25\x03\x5c\xd0\x5f\xd2\x97\x9b\xed\x3a\x47\x86\x2b\x0d\x26\xeb\xbc\x5e\xee\x04\xe6\x9d\x06\x93\x45\x5b\x52\x52\x56\x97\x7b\x8a\x3d\xc1\x47\x4a\x1f\xb3\xd9\x2c\xd9\x11\x4e\xb3\x6d\xdb\x5c\x57\xeb\x32\xcb\xeb\x22\xdb\x08\xd6\x3e\x52\x7c\xaa\xf1\x29\xc5\xa7\x1c\x8f\x6e\x94\x05\x21\x28\xcb\x3b\xed\x0b\x0d\x0d\xe1\x2b\xef\x12\x14\x55\xe7\x1b\xcb\xcd\xc1\xa4\xdc\xe4\xd5\x9a\x07\xe1\x09\x07\xa8\xf1\x5d\xb7\x6f\x30\x54\x17\x1a\x24\x44\x64\xfd\xdd\xb6\x04\x1e\x9e\x5c\x51\x28\x59\xe4\xdb\x7e\xb1\xca\xb9\xad\x12\x4a\x08\x68\xdb\x10\x42\x9a\xf6\x0e\x70\xf6\x91\x34\xed\x32\xaf\xab\xbf\xe7\xbd\x20\xe9\x3c\xf8\x4c\x36\x55\xdb\x36\x8c\xdf\x33\x04\x12\xea\x71\xc6\xe5\x50\xcc\x7b\xc2\x44\x50\x0a\xa7\x6c\xaa\x65\x2b\xa8\xe4\xc4\x33\x7c\x71\x29\x9c\x76\xdd\xb4\x37\x9a\xf0\x8a\x83\x83\xac\xd4\x08\x4d\x8d\xeb\xcf\x6b\x42\xbe\xa6\x9e\xe1\x23\x02\xe8\x92\xbc\xd8\x10\x2a\xb7\x79\x5d\x32\x8e\x8e\xf9\x8b\xf0\x42\x5f\x89\xd2\x54\xd6\x95\x7d\x5f\xd5\x4b\x46\xf6\xb1\x44\xa5\x97\x1a\x95\x04\x69\x2e\xee\xae\xd9\xb9\xe1\xa4\xf8\xbf\xd2\x67\x7a\x21\x9f\x92\x16\x64\x42\xa2\xcb\xc9\x3d\xe9\xb2\xeb\xb2\x2c\xa4\x2f\x5d\xfa\x8a\xc2\xc9\x76\xb7\x5e\x13\xd6\x7e\xdf\x95\x5d\xcf\x99\x2e\xe8\x9b\xfa\x2f\xdf\x49\xd5\x75\x14\xa0\xe8\xb7\x08\x24\x34\x74\xf5\x02\x9d\x39\x41\x20\x49\x3e\x75\x65\xde\x2e\x56\x9f\x13\xf9\x47\x5b\x39\xc0\xb4\x77\x68\x50\x99\x90\x94\x88\xa4\x06\xab\x20\x59\x34\x05\x7f\x9c\xd0\x1f\x15\x5d\xd5\x5d\x4f\x33\xee\x73\xa2\x01\x06\x93\x90\x0c\x40\x5f\xf5\xc0\x82\x46\x62\xfa\x76\x3c\x82\xe9\xab\xaa\xed\xfa\x27\x7d\x45\xc4\xfa\x61\x57\x27\xdc\x3f\x9a\x6d\x59\x31\x37\x26\xf4\xba\x21\x14\x21\xba\xa5\xfe\x9d\xdd\x5d\xfe\xcb\xbb\xa3\xf4\x82\x38\xd1\xb2\x2d\x29\x9c\x52\x19\xf4\x47\x79\xfe\x30\x4b\x28\x97\xd5\x74\x9a\xf7\xf9\x3c\xef\x4a\x8f\x56\x4e\x14\xea\x76\x69\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\xf5\x77\x6a\x86\x50\x19\x3a\xaf\x5c\x19\xef\x79\x72\x51\x3c\x33\x35\x64\xbe\x58\x97\x1c\x4f\x45\xa5\x6f\xdf\xbf\x3f\x3f\x7d\x99\x96\xf5\xb2\xaa\xcb\x74\x5f\xf5\xab\x74\xd7\x5f\xff\xb7\x6c\x59\xd6\x65\x4b\x3c\x6e\x51\xa5\x34\xa7\x5a\xa2\x84\x94\x08\x5b\x3a\x37\x4b\xba\x6e\x4d\x73\x1f\xe8\xbd\xbc\x7c\x97\x9e\x31\x8a\xb7\x79\xbf\x42\x43\xfa\x55\xd2\xfd\xbe\x66\x14\xb9\x0a\xaf\x56\x65\x0a\x2a\x03\x50\x73\x6d\xf8\x48\x0b\x6d\xe3\x2c\x29\xdb\x36\x23\xb6\xd4\xdf\x65\x9a\x59\xcb\x1b\x42\x4a\x11\x44\x3a\x75\xd3\xa7\xf3\x32\x45\x9e\x59\x92\x58\x83\x0d\xbb\xc7\xdb\xed\xba\x5a\xc8\x5c\x7f\x2d\x69\x1e\xd1\xbc\x82\x28\x96\x42\x38\x20\xca\xd2\x02\x74\x11\x7b\xe6\xf9\x90\x46\x0c\x04\xf9\x57\x25\x31\xc0\xd5\x6e\x29\x6c\x6f\xdd\xec\x8a\x1f\x40\xa9\xd6\x7a\x4f\xa8\xe9\x87\x86\x1a\x0c\xec\x38\x00\x5f\xc5\x31\x51\x1c\x2f\x5a\x6d\xb9\x69\x88\xaf\x38\x62\xaf\x88\xa0\xf6\x15\x25\x52\x4f\xbb\xfc\x96\xe6\x5b\xdf\xa4\xfd\xaa\xea\xd2\x82\x88\x6d\xc1\x05\xd3\xd4\xd8\xd1\x72\x21\x64\x41\x04\x2a\xa4\x61\x71\xf1\x18\x00\x6a\xb3\x23\x6a\x5a\x51\x61\xbc\x18\xf1\xca\x49\x45\x4e\xb5\x13\x5d\xa2\x72\x40\xdf\x44\xb9\x0d\x71\x65\xe6\x9b\xa7\x08\xe8\x77\x58\x3e\xb5\x2a\xbf\xbe\xa6\x56\x75\x44\x15\x6f\xd2\xc5\xba\x21\x92\xfa\xf8\xe1\x5d\xc7\x04\xb3\xca\xb6\x4d\x8b\x65\x8e\x92\x2e\x28\xe8\xe2\x02\x44\x33\x44\xbd\xdb\xcc\xe9\x6b\xbf\xaa\x88\x03\x00\xed\x9c\x83\x57\x73\x8a\xa5\x2a\x76\x1d\x0d\xe1\x51\x4a\x24\x4c\x3d\x20\x94\x81\x00\xb8\x0f\x45\xd5\xe5\x73\x1a\x7b\x06\xbf\xa6\x65\x6b\xd7\x12\x59\xad\xfa\x7e\x6b\x35\xbf\xb9\xba\xba\x90\xaa\x5d\xec\x7d\x75\xe7\x01\x65\x60\x0c\xd6\xbc\xf0\xd6\x69\x53\xcf\x40\x24\xbb\x76\x3d\xa0\x1f\xea\xab\xa5\x1c\xc0\x0b\x37\xe1\x29\xff\x5c\x7a\xf4\x00\xcf\x1d\x49\x27\x7b\x50\x13\xe1\xb8\xc4\x02\x48\x44\xdd\x6c\xb9\xdc\x80\xaa\xcf\x35\xc2\x93\x32\x16\x4d\x97\x2e\x4b\x27\xa5\x42\xf6\x09\xd8\xff\x86\x3a\xac\x6c\xe4\xf2\x8c\xd0\x00\x5e\x82\xd8\xeb\xb6\xd9\x50\xec\x2b\xfa\xf3\x11\xbe\xf9\x67\x5c\x1e\x60\xf2\xa2\x20\xfe\xd6\x1d\xa5\x1f\x5e\x9d\xa4\xff\xf9\x0f\x3f\xff\x3c\x4b\xdf\xf6\x3c\x13\x99\x38\xff\xc6\x44\x45\x41\x59\xc3\x1d\x28\xb1\x8c\x9e\xe8\xee\x01\xcf\xac\x07\xe9\x3Line truncated
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
return bindataRead(
@@ -787,7 +787,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 38717, mode: os.FileMode(420), modTime: time.Unix(1439995842, 0)}
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 38939, mode: os.FileMode(420), modTime: time.Unix(1440061419, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
+3 -1
View File
@@ -275,9 +275,11 @@ func (repo *Repository) searchCommits(id sha1, keyword string) (*list.List, erro
return parsePrettyFormatLog(repo, stdout)
}
var CommitsRangeSize = 50
func (repo *Repository) commitsByRange(id sha1, page int) (*list.List, error) {
stdout, stderr, err := com.ExecCmdDirBytes(repo.Path, "git", "log", id.String(),
"--skip="+com.ToStr((page-1)*50), "--max-count=50", prettyLogFormat)
"--skip="+com.ToStr((page-1)*CommitsRangeSize), "--max-count="+com.ToStr(CommitsRangeSize), prettyLogFormat)
if err != nil {
return nil, errors.New(string(stderr))
}
+7
View File
@@ -71,6 +71,13 @@ func parseTreeData(tree *Tree, data []byte) ([]*TreeEntry, error) {
step = bytes.IndexByte(data[pos:], '\n')
entry.name = string(data[pos : pos+step])
// In case entry name is surrounded by double quotes(it happens only in git-shell).
if entry.name[0] == '"' {
entry.name = string(data[pos+1 : pos+step-1])
entry.name = strings.Replace(entry.name, `\"`, `"`, -1)
}
pos += step + 1
entries = append(entries, entry)
}
+30
View File
@@ -17,6 +17,33 @@ import (
"github.com/gogits/gogs/modules/setting"
)
type loginAuth struct {
username, password string
}
// SMTP AUTH LOGIN Auth Handler
func LoginAuth(username, password string) smtp.Auth {
return &loginAuth{username, password}
}
func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) {
return "LOGIN", []byte{}, nil
}
func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) {
if more {
switch string(fromServer) {
case "Username:":
return []byte(a.username), nil
case "Password:":
return []byte(a.password), nil
default:
return nil, fmt.Errorf("unknwon fromServer: %s", string(fromServer))
}
}
return nil, nil
}
type Message struct {
To []string
From string
@@ -135,6 +162,9 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte)
auth = smtp.CRAMMD5Auth(settings.User, settings.Passwd)
} else if strings.Contains(options, "PLAIN") {
auth = smtp.PlainAuth("", settings.User, settings.Passwd, host)
} else if strings.Contains(options, "LOGIN") {
// Patch for AUTH LOGIN
auth = LoginAuth(settings.User, settings.Passwd)
}
if auth != nil {
+1 -1
View File
@@ -1 +1 @@
@font-face{font-family:octicons;src:url(../fonts/octicons.eot?#iefix&v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('embedded-opentype'),url(../fonts/octicons.woff?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('woff'),url(../fonts/octicons.ttf?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('truetype'),url(../fonts/octicons.svg?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d#octicons) format('svg');font-weight:400;font-style:normal}.mega-octicon,.octicon{font:normal normal normal 16px/1 octicons;display:inline-block;text-decoration:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mega-octicon{font-size:32px}.octicon-alert:before{content:'\f02d'}.octicon-arrow-down:before{content:'\f03f'}.octicon-arrow-left:before{content:'\f040'}.octicon-arrow-right:before{content:'\f03e'}.octicon-arrow-small-down:before{content:'\f0a0'}.octicon-arrow-small-left:before{content:'\f0a1'}.octicon-arrow-small-right:before{content:'\f071'}.octicon-arrow-small-up:before{content:'\f09f'}.octicon-arrow-up:before{content:'\f03d'}.octicon-beaker:before,.octicon-microscope:before{content:'\f0dd'}.octicon-bell:before{content:'\f0de'}.octicon-book:before{content:'\f007'}.octicon-bookmark:before{content:'\f07b'}.octicon-briefcase:before{content:'\f0d3'}.octicon-broadcast:before{content:'\f048'}.octicon-browser:before{content:'\f0c5'}.octicon-bug:before{content:'\f091'}.octicon-calendar:before{content:'\f068'}.octicon-check:before{content:'\f03a'}.octicon-checklist:before{content:'\f076'}.octicon-chevron-down:before{content:'\f0a3'}.octicon-chevron-left:before{content:'\f0a4'}.octicon-chevron-right:before{content:'\f078'}.octicon-chevron-up:before{content:'\f0a2'}.octicon-circle-slash:before{content:'\f084'}.octicon-circuit-board:before{content:'\f0d6'}.octicon-clippy:before{content:'\f035'}.octicon-clock:before{content:'\f046'}.octicon-cloud-download:before{content:'\f00b'}.octicon-cloud-upload:before{content:'\f00c'}.octicon-code:before{content:'\f05f'}.octicon-color-mode:before{content:'\f065'}.octicon-comment-add:before,.octicon-comment:before{content:'\f02b'}.octicon-comment-discussion:before{content:'\f04f'}.octicon-credit-card:before{content:'\f045'}.octicon-dash:before{content:'\f0ca'}.octicon-dashboard:before{content:'\f07d'}.octicon-database:before{content:'\f096'}.octicon-clone:before,.octicon-desktop-download:before{content:'\f0dc'}.octicon-device-camera:before{content:'\f056'}.octicon-device-camera-video:before{content:'\f057'}.octicon-device-desktop:before{content:'\f27c'}.octicon-device-mobile:before{content:'\f038'}.octicon-diff:before{content:'\f04d'}.octicon-diff-added:before{content:'\f06b'}.octicon-diff-ignored:before{content:'\f099'}.octicon-diff-modified:before{content:'\f06d'}.octicon-diff-removed:before{content:'\f06c'}.octicon-diff-renamed:before{content:'\f06e'}.octicon-ellipsis:before{content:'\f09a'}.octicon-eye-unwatch:before,.octicon-eye-watch:before,.octicon-eye:before{content:'\f04e'}.octicon-file-binary:before{content:'\f094'}.octicon-file-code:before{content:'\f010'}.octicon-file-directory:before{content:'\f016'}.octicon-file-media:before{content:'\f012'}.octicon-file-pdf:before{content:'\f014'}.octicon-file-submodule:before{content:'\f017'}.octicon-file-symlink-directory:before{content:'\f0b1'}.octicon-file-symlink-file:before{content:'\f0b0'}.octicon-file-text:before{content:'\f011'}.octicon-file-zip:before{content:'\f013'}.octicon-flame:before{content:'\f0d2'}.octicon-fold:before{content:'\f0cc'}.octicon-gear:before{content:'\f02f'}.octicon-gift:before{content:'\f042'}.octicon-gist:before{content:'\f00e'}.octicon-gist-secret:before{content:'\f08c'}.octicon-git-branch-create:before,.octicon-git-branch-delete:before,.octicon-git-branch:before{content:'\f020'}.octicon-git-commit:before{content:'\f01f'}.octicon-git-compare:before{content:'\f0ac'}.octicon-git-merge:before{content:'\f023'}.octicon-git-pull-request-abandoned:before,.octicon-git-pull-request:before{content:'\f009'}.octicon-globe:before{content:'\f0b6'}.octicon-graph:before{content:'\f043'}.octicon-heart:before{content:'\2665'}.octicon-history:before{content:'\f07e'}.octicon-home:before{content:'\f08d'}.octicon-horizontal-rule:before{content:'\f070'}.octicon-hubot:before{content:'\f09d'}.octicon-inbox:before{content:'\f0cf'}.octicon-info:before{content:'\f059'}.octicon-issue-closed:before{content:'\f028'}.octicon-issue-opened:before{content:'\f026'}.octicon-issue-reopened:before{content:'\f027'}.octicon-jersey:before{content:'\f019'}.octicon-key:before{content:'\f049'}.octicon-keyboard:before{content:'\f00d'}.octicon-law:before{content:'\f0d8'}.octicon-light-bulb:before{content:'\f000'}.octicon-link:before{content:'\f05c'}.octicon-link-external:before{content:'\f07f'}.octicon-list-ordered:before{content:'\f062'}.octicon-list-unordered:before{content:'\f061'}.octicon-location:before{content:'\f060'}.octicon-gLine truncated
@font-face{font-family:octicons;src:url(../fonts/octicons.eot?#iefix&v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('embedded-opentype'),url(../fonts/octicons.woff?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('woff'),url(../fonts/octicons.ttf?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('truetype'),url(../fonts/octicons.svg?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d#octicons) format('svg');font-weight:400;font-style:normal}.mega-octicon,.octicon{font:normal normal normal 16px/1 octicons;display:inline-block;text-decoration:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mega-octicon{font-size:32px}.octicon-alert:before{content:'\f02d'}.octicon-arrow-down:before{content:'\f03f'}.octicon-arrow-left:before{content:'\f040'}.octicon-arrow-right:before{content:'\f03e'}.octicon-arrow-small-down:before{content:'\f0a0'}.octicon-arrow-small-left:before{content:'\f0a1'}.octicon-arrow-small-right:before{content:'\f071'}.octicon-arrow-small-up:before{content:'\f09f'}.octicon-arrow-up:before{content:'\f03d'}.octicon-beaker:before,.octicon-microscope:before{content:'\f0dd'}.octicon-bell:before{content:'\f0de'}.octicon-book:before{content:'\f007'}.octicon-bookmark:before{content:'\f07b'}.octicon-briefcase:before{content:'\f0d3'}.octicon-broadcast:before{content:'\f048'}.octicon-browser:before{content:'\f0c5'}.octicon-bug:before{content:'\f091'}.octicon-calendar:before{content:'\f068'}.octicon-check:before{content:'\f03a'}.octicon-checklist:before{content:'\f076'}.octicon-chevron-down:before{content:'\f0a3'}.octicon-chevron-left:before{content:'\f0a4'}.octicon-chevron-right:before{content:'\f078'}.octicon-chevron-up:before{content:'\f0a2'}.octicon-circle-slash:before{content:'\f084'}.octicon-circuit-board:before{content:'\f0d6'}.octicon-clippy:before{content:'\f035'}.octicon-clock:before{content:'\f046'}.octicon-cloud-download:before{content:'\f00b'}.octicon-cloud-upload:before{content:'\f00c'}.octicon-code:before{content:'\f05f'}.octicon-color-mode:before{content:'\f065'}.octicon-comment-add:before,.octicon-comment:before{content:'\f02b'}.octicon-comment-discussion:before{content:'\f04f'}.octicon-credit-card:before{content:'\f045'}.octicon-dash:before{content:'\f0ca'}.octicon-dashboard:before{content:'\f07d'}.octicon-database:before{content:'\f096'}.octicon-clone:before,.octicon-desktop-download:before{content:'\f0dc'}.octicon-device-camera:before{content:'\f056'}.octicon-device-camera-video:before{content:'\f057'}.octicon-device-desktop:before{content:'\f27c'}.octicon-device-mobile:before{content:'\f038'}.octicon-diff:before{content:'\f04d'}.octicon-diff-added:before{content:'\f06b'}.octicon-diff-ignored:before{content:'\f099'}.octicon-diff-modified:before{content:'\f06d'}.octicon-diff-removed:before{content:'\f06c'}.octicon-diff-renamed:before{content:'\f06e'}.octicon-ellipsis:before{content:'\f09a'}.octicon-eye-unwatch:before,.octicon-eye-watch:before,.octicon-eye:before{content:'\f04e'}.octicon-file-binary:before{content:'\f094'}.octicon-file-code:before{content:'\f010'}.octicon-file-directory:before{content:'\f016'}.octicon-file-media:before{content:'\f012'}.octicon-file-pdf:before{content:'\f014'}.octicon-file-submodule:before{content:'\f017'}.octicon-file-symlink-directory:before{content:'\f0b1'}.octicon-file-symlink-file:before{content:'\f0b0'}.octicon-file-text:before{content:'\f011'}.octicon-file-zip:before{content:'\f013'}.octicon-flame:before{content:'\f0d2'}.octicon-fold:before{content:'\f0cc'}.octicon-gear:before{content:'\f02f'}.octicon-gift:before{content:'\f042'}.octicon-gist:before{content:'\f00e'}.octicon-gist-secret:before{content:'\f08c'}.octicon-git-branch-create:before,.octicon-git-branch-delete:before,.octicon-git-branch:before{content:'\f020'}.octicon-git-commit:before{content:'\f01f'}.octicon-git-compare:before{content:'\f0ac'}.octicon-git-merge:before{content:'\f023'}.octicon-git-pull-request-abandoned:before,.octicon-git-pull-request:before{content:'\f009'}.octicon-globe:before{content:'\f0b6'}.octicon-graph:before{content:'\f043'}.octicon-heart:before{content:'\2665'}.octicon-history:before{content:'\f07e'}.octicon-home:before{content:'\f08d'}.octicon-horizontal-rule:before{content:'\f070'}.octicon-hubot:before{content:'\f09d'}.octicon-inbox:before{content:'\f0cf'}.octicon-info:before{content:'\f059'}.octicon-issue-closed:before{content:'\f028'}.octicon-issue-opened:before{content:'\f026'}.octicon-issue-reopened:before{content:'\f027'}.octicon-jersey:before{content:'\f019'}.octicon-key:before{content:'\f049'}.octicon-keyboard:before{content:'\f00d'}.octicon-law:before{content:'\f0d8'}.octicon-light-bulb:before{content:'\f000'}.octicon-link:before{content:'\f05c'}.octicon-link-external:before{content:'\f07f'}.octicon-list-ordered:before{content:'\f062'}.octicon-list-unordered:before{content:'\f061'}.octicon-location:before{content:'\f060'}.octicon-gLine truncated
+19
View File
@@ -339,6 +339,25 @@ function initRepository() {
})
}
// Diff
if ($('.repository.diff').length > 0) {
$('.diff-detail-box .toggle.button').click(function () {
$($(this).data('target')).slideToggle(100);
})
var $counter = $('.diff-counter');
if ($counter.length < 1) {
return;
}
$counter.each(function (i, item) {
var $item = $(item);
var addLine = $item.find('span[data-line].add').data("line");
var delLine = $item.find('span[data-line].del').data("line");
var addPercent = parseFloat(addLine) / (parseFloat(addLine) + parseFloat(delLine)) * 100;
$item.find(".bar .add").css("width", addPercent + "%");
});
}
// Pull request
if ($('.repository.compare.pull').length > 0) {
var $branch_dropdown = $('.choose.branch .dropdown')
+1 -1
View File
@@ -1,6 +1,6 @@
.admin {
padding-top: 15px;
padding-bottom: @footer-margin * 3;
padding-bottom: @footer-margin * 2;
.table.segment {
padding: 0;
+20
View File
@@ -92,6 +92,13 @@ img {
&.small {
font-size: 0.75em;
}
&.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}
}
.message {
@@ -111,6 +118,19 @@ img {
border-color: #F0C36D;
}
}
.info {
&.header {
background-color: #d9edf7!important;
border-color: #85c5e5;
}
&.segment {
border-color: #85c5e5;
}
}
.normal.header {
font-weight: normal;
}
.avatar.image {
border-radius: 3px;
+5 -1
View File
@@ -9,7 +9,11 @@
.ui.attached.header {
background: #f0f0f0;
.right {
margin-top: -6px;
margin-top: -5px;
.button {
padding: 8px 10px;
font-weight: normal;
}
}
}
.repository {
+1 -1
View File
@@ -1,5 +1,5 @@
.home {
padding-bottom: @footer-margin * 3;
padding-bottom: @footer-margin * 2;
.logo {
max-width: 250px;
}
+1 -1
View File
@@ -1,6 +1,6 @@
.install {
padding-top: 45px;
padding-bottom: @footer-margin * 3;
padding-bottom: @footer-margin * 2;
form {
@input-padding: 320px !important;
label {
+182 -1
View File
@@ -2,7 +2,7 @@
@mega-octicon-width: 30px;
padding-top: 15px;
padding-bottom: @footer-margin * 3;
padding-bottom: @footer-margin * 2;
.head {
.column {
@@ -424,6 +424,187 @@
}
}
}
&.commits {
.header {
.ui.right {
.search {
input {
font-weight: normal;
padding: 5px 10px;
}
}
.button {
float: right;
margin-left: 5px;
margin-top: 1px;
}
}
}
}
.commits.table {
font-size: 13px;
th, td {
&:first-child {
padding-left: 15px;
}
}
td {
line-height: 15px;
}
.author {
min-width: 180px;
}
.message span {
max-width: 500px;
}
.date {
width: 120px;
}
}
.sha.label {
font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace;
font-size: 14px;
padding: 6px 10px 4px 10px;
font-weight: normal;
}
.diff-detail-box {
margin: 15px 0;
line-height: 30px;
ol {
clear: both;
padding-left: 0;
margin-top: 5px;
margin-bottom: 28px;
li {
list-style: none;
padding-bottom: 4px;
margin-bottom: 4px;
border-bottom: 1px dashed #DDD;
padding-left: 6px;
}
}
span.status{
display: inline-block;
width: 12px;
height: 12px;
margin-right: 8px;
vertical-align: middle;
&.modify {
background-color: #f0db88;
}
&.add {
background-color: #b4e2b4;
}
&.del {
background-color: #e9aeae;
}
&.rename {
background-color: #dad8ff;
}
}
}
.diff-box {
.count {
margin-right: 12px;
.bar {
background-color: #e75316;
height: 12px;
width: 40px;
display: inline-block;
margin: 2px 4px 0 4px;
vertical-align: text-top;
.add {
background-color: #77c64a;
height: 12px;
}
}
}
.file {
color: #888;
}
}
.diff-file-box {
.header {
border-bottom: 1px solid #d4d4d5!important;
}
.file-body.file-code {
.lines-num {
text-align: right;
color: #999;
background: #fafafa;
width: 1%;
}
.lines-num-old {
border-right: 1px solid #DDD;
}
}
.code-diff {
font-size: 13px;
td {
padding: 0;
border-top: none;
}
pre {
margin: 0;
}
.lines-num {
border-right: 1px solid #d4d4d5;
padding: 0 5px;
}
tbody {
tr {
&.tag-code {
td, pre {
background-color: #E0E0E0 !important;
border-color: #ADADAD!important;
}
// td.selected-line, td.selected-line pre {
// background-color: #ffffdd !important;
// }
}
// &.same-code {
// td.selected-line, td.selected-line pre {
// background-color: #ffffdd !important;
// }
// }
&.del-code {
td, pre {
background-color: #ffe2dd !important;
border-color: #e9aeae !important;
}
// td.selected-line, td.selected-line pre {
// background-color: #ffffdd !important;
// }
}
&.add-code {
td, pre {
background-color: #d1ffd6 !important;
border-color: #b4e2b4 !important;
}
// td.selected-line, td.selected-line pre {
// background-color: #ffffdd !important;
// }
}
&:hover {
td {
background-color: #FFF8D2 !important;
border-color: #F0DB88 !important;
}
pre {
background-color: transparent !important;
}
}
}
}
}
}
.code-view {
overflow: auto;
overflow-x: auto;
overflow-y: hidden;
}
}
.ui.comments {
+1 -1
View File
@@ -1,6 +1,6 @@
.user {
padding-top: 15px;
padding-bottom: @footer-margin * 3;
padding-bottom: @footer-margin * 2;
&.settings {
.key.list {
+8 -18
View File
@@ -9,6 +9,7 @@ import (
"path"
"github.com/Unknwon/com"
"github.com/Unknwon/paginater"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
@@ -44,7 +45,7 @@ func RenderIssueLinks(oldCommits *list.List, repoLink string) *list.List {
}
func Commits(ctx *middleware.Context) {
ctx.Data["IsRepoToolbarCommits"] = true
ctx.Data["PageIsCommits"] = true
userName := ctx.Repo.Owner.Name
repoName := ctx.Repo.Repository.Name
@@ -64,19 +65,11 @@ func Commits(ctx *middleware.Context) {
return
}
// Calculate and validate page number.
page, _ := com.StrTo(ctx.Query("p")).Int()
if page < 1 {
page := ctx.QueryInt("page")
if page <= 1 {
page = 1
}
lastPage := page - 1
if lastPage < 0 {
lastPage = 0
}
nextPage := page + 1
if page*50 > commitsCount {
nextPage = 0
}
ctx.Data["Page"] = paginater.New(commitsCount, git.CommitsRangeSize, page, 5)
// Both `git log branchName` and `git log commitId` work.
commits, err := ctx.Repo.Commit.CommitsByRange(page)
@@ -91,14 +84,11 @@ func Commits(ctx *middleware.Context) {
ctx.Data["Username"] = userName
ctx.Data["Reponame"] = repoName
ctx.Data["CommitCount"] = commitsCount
ctx.Data["LastPageNum"] = lastPage
ctx.Data["NextPageNum"] = nextPage
ctx.HTML(200, COMMITS)
}
func SearchCommits(ctx *middleware.Context) {
ctx.Data["IsSearchPage"] = true
ctx.Data["IsRepoToolbarCommits"] = true
ctx.Data["PageIsCommits"] = true
keyword := ctx.Query("q")
if len(keyword) == 0 {
@@ -199,7 +189,7 @@ func FileHistory(ctx *middleware.Context) {
}
func Diff(ctx *middleware.Context) {
ctx.Data["IsRepoToolbarCommits"] = true
ctx.Data["PageIsDiff"] = true
userName := ctx.Repo.Owner.Name
repoName := ctx.Repo.Repository.Name
@@ -253,7 +243,7 @@ func Diff(ctx *middleware.Context) {
ctx.Data["Parents"] = parents
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", commitId)
if (commit.ParentCount() > 0) {
if commit.ParentCount() > 0 {
ctx.Data["BeforeSourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", parents[0])
}
ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "raw", commitId)
+7
View File
@@ -677,6 +677,13 @@ func SettingsDeployKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["PageIsSettingsKeys"] = true
keys, err := models.ListDeployKeys(ctx.Repo.Repository.ID)
if err != nil {
ctx.Handle(500, "ListDeployKeys", err)
return
}
ctx.Data["Deploykeys"] = keys
if ctx.HasError() {
ctx.HTML(200, DEPLOY_KEYS)
return
+51 -53
View File
@@ -269,12 +269,12 @@ func SettingsSSHKeys(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["PageIsSettingsSSHKeys"] = true
var err error
ctx.Data["Keys"], err = models.ListPublicKeys(ctx.User.Id)
keys, err := models.ListPublicKeys(ctx.User.Id)
if err != nil {
ctx.Handle(500, "ssh.ListPublicKey", err)
ctx.Handle(500, "ListPublicKeys", err)
return
}
ctx.Data["Keys"] = keys
ctx.HTML(200, SETTINGS_SSH_KEYS)
}
@@ -283,66 +283,58 @@ func SettingsSSHKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["PageIsSettingsSSHKeys"] = true
var err error
ctx.Data["Keys"], err = models.ListPublicKeys(ctx.User.Id)
keys, err := models.ListPublicKeys(ctx.User.Id)
if err != nil {
ctx.Handle(500, "ssh.ListPublicKey", err)
ctx.Handle(500, "ListPublicKeys", err)
return
}
ctx.Data["Keys"] = keys
if ctx.HasError() {
ctx.HTML(200, SETTINGS_SSH_KEYS)
return
}
// Delete SSH key.
if ctx.Query("_method") == "DELETE" {
id := com.StrTo(ctx.Query("id")).MustInt64()
if id <= 0 {
return
}
if err = models.DeletePublicKey(&models.PublicKey{ID: id}); err != nil {
ctx.Handle(500, "DeletePublicKey", err)
content, err := models.CheckPublicKeyString(form.Content)
if err != nil {
if err == models.ErrKeyUnableVerify {
ctx.Flash.Info(ctx.Tr("form.unable_verify_ssh_key"))
} else {
log.Trace("SSH key deleted: %s", ctx.User.Name)
ctx.Redirect(setting.AppSubUrl + "/user/settings/ssh")
}
return
}
// Add new SSH key.
if ctx.Req.Method == "POST" {
if ctx.HasError() {
ctx.HTML(200, SETTINGS_SSH_KEYS)
return
}
content, err := models.CheckPublicKeyString(form.Content)
if err != nil {
if err == models.ErrKeyUnableVerify {
ctx.Flash.Info(ctx.Tr("form.unable_verify_ssh_key"))
} else {
ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error()))
ctx.Redirect(setting.AppSubUrl + "/user/settings/ssh")
return
}
}
if err = models.AddPublicKey(ctx.User.Id, form.Title, content); err != nil {
switch {
case models.IsErrKeyAlreadyExist(err):
ctx.RenderWithErr(ctx.Tr("settings.ssh_key_been_used"), SETTINGS_SSH_KEYS, &form)
case models.IsErrKeyNameAlreadyUsed(err):
ctx.RenderWithErr(ctx.Tr("settings.ssh_key_name_used"), SETTINGS_SSH_KEYS, &form)
default:
ctx.Handle(500, "AddPublicKey", err)
}
return
} else {
log.Trace("SSH key added: %s", ctx.User.Name)
ctx.Flash.Success(ctx.Tr("settings.add_key_success", form.Title))
ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error()))
ctx.Redirect(setting.AppSubUrl + "/user/settings/ssh")
return
}
}
ctx.HTML(200, SETTINGS_SSH_KEYS)
if err = models.AddPublicKey(ctx.User.Id, form.Title, content); err != nil {
ctx.Data["HasError"] = true
switch {
case models.IsErrKeyAlreadyExist(err):
ctx.Data["Err_Content"] = true
ctx.RenderWithErr(ctx.Tr("settings.ssh_key_been_used"), SETTINGS_SSH_KEYS, &form)
case models.IsErrKeyNameAlreadyUsed(err):
ctx.Data["Err_Title"] = true
ctx.RenderWithErr(ctx.Tr("settings.ssh_key_name_used"), SETTINGS_SSH_KEYS, &form)
default:
ctx.Handle(500, "AddPublicKey", err)
}
return
}
ctx.Flash.Success(ctx.Tr("settings.add_key_success", form.Title))
ctx.Redirect(setting.AppSubUrl + "/user/settings/ssh")
}
func DeleteSSHKey(ctx *middleware.Context) {
if err := models.DeletePublicKey(ctx.QueryInt64("id")); err != nil {
ctx.Flash.Error("DeletePublicKey: " + err.Error())
} else {
ctx.Flash.Success(ctx.Tr("settings.ssh_key_deletion_success"))
}
ctx.JSON(200, map[string]interface{}{
"redirect": setting.AppSubUrl + "/user/settings/ssh",
})
}
func SettingsSocial(ctx *middleware.Context) {
@@ -389,6 +381,12 @@ func SettingsApplicationsPost(ctx *middleware.Context, form auth.NewAccessTokenF
ctx.Data["PageIsSettingsApplications"] = true
if ctx.HasError() {
tokens, err := models.ListAccessTokens(ctx.User.Id)
if err != nil {
ctx.Handle(500, "ListAccessTokens", err)
return
}
ctx.Data["Tokens"] = tokens
ctx.HTML(200, SETTINGS_APPLICATIONS)
return
}
+7 -8
View File
@@ -1,9 +1,8 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="repo-wrapper">
{{template "repo/header_old" .}}
<div class="container clear">
{{template "repo/commits_table" .}}
</div>
{{template "base/head" .}}
<div class="repository commits">
{{template "repo/header" .}}
<div class="ui container">
{{template "repo/commits_table" .}}
</div>
</div>
{{template "ng/base/footer" .}}
{{template "base/footer" .}}
+66 -46
View File
@@ -1,48 +1,68 @@
<div id="commits-list">
<div class="panel panel-radius">
<div class="panel-header">
{{if not .IsDiffCompare}}
<form class="search pull-right" action="{{.RepoLink}}/commits/{{.BranchName}}/search" method="get" id="commits-search-form">
<input class="ipt ipt-radius" type="search" name="q" placeholder="{{.i18n.Tr "repo.commits.search"}}" value="{{.Keyword}}" />
<button class="btn btn-black btn-small btn-radius">{{.i18n.Tr "repo.commits.find"}}</button>
</form>
{{end}}
<h4>{{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}}</h4>
</div>
<table class="panel-body table commit-list table-striped">
<thead>
<tr>
<th class="author">{{.i18n.Tr "repo.commits.author"}}</th>
<th class="sha">SHA1</th>
<th class="message">{{.i18n.Tr "repo.commits.message"}}</th>
<th class="date">{{.i18n.Tr "repo.commits.date"}}</th>
</tr>
</thead>
<tbody>
{{ $username := .Username}}
{{ $reponame := .Reponame}}
{{$r := List .Commits}}
{{range $r}}
<tr>
<td class="author">
{{if .User}}
<img class="avatar-20" src="{{.User.AvatarLink}}" alt=""/>&nbsp;&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a>
{{else}}
<img class="avatar-20" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;&nbsp;{{.Author.Name}}
{{end}}
</td>
<td class="sha"><a rel="nofollow" class="label label-green" href="{{AppSubUrl}}/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td>
<td class="message"><span class="text-truncate">{{RenderCommitMessage .Summary $.RepoLink}}</span></td>
<td class="date">{{TimeSince .Author.When $.Lang}}</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{if and (not .IsSearchPage) (not .IsDiffCompare)}}
<ul class="pagination">
{{if .LastPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="{{.RepoLink}}/commits/{{.BranchName}}{{if .FileName}}/{{.FileName}}{{end}}?p={{.LastPageNum}}" rel="nofollow">&laquo; {{.i18n.Tr "repo.commits.newer"}}</a></li>{{end}}
{{if .NextPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="{{.RepoLink}}/commits/{{.BranchName}}{{if .FileName}}/{{.FileName}}{{end}}?p={{.NextPageNum}}" rel="nofollow">&raquo; {{.i18n.Tr "repo.commits.older"}}</a></li>{{end}}
</ul>
<h4 class="ui top attached header">
{{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}}
{{if .PageIsCommits}}
<div class="ui right">
<form action="{{.RepoLink}}/commits/{{.BranchName}}/search">
<div class="ui tiny search input">
<input name="q" placeholder="{{.i18n.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus>
</div>
<button class="ui black tiny button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.commits.find"}}</button>
</form>
</div>
{{else if .IsDiffCompare}}
<a href="{{$.RepoLink}}/commit/{{.BeforeCommitId}}" class="ui green sha label">{{ShortSha .BeforeCommitId}}</a> ... <a href="{{$.RepoLink}}/commit/{{.AfterCommitId}}" class="ui green sha label">{{ShortSha .AfterCommitId}}</a>
{{end}}
</h4>
<div class="ui attached table segment">
<table class="ui very basic striped commits table">
<thead>
<tr>
<th>{{.i18n.Tr "repo.commits.author"}}</th>
<th>SHA1</th>
<th>{{.i18n.Tr "repo.commits.message"}}</th>
<th>{{.i18n.Tr "repo.commits.date"}}</th>
</tr>
</thead>
<tbody>
{{ $username := .Username}}
{{ $reponame := .Reponame}}
{{ $r:= List .Commits}}
{{range $r}}
<tr>
<td class="author">
{{if .User}}
<img class="ui avatar image" src="{{.User.AvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a>
{{else}}
<img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{.Author.Name}}
{{end}}
</td>
<td class="sha"><a rel="nofollow" class="ui green sha label" href="{{AppSubUrl}}/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td>
<td class="message"><span class="text truncate">{{RenderCommitMessage .Summary $.RepoLink}}</span></td>
<td class="date">{{TimeSince .Author.When $.Lang}}</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{with .Page}}
{{if gt .TotalPages 1}}
<div class="center page buttons">
<div class="ui borderless pagination menu">
<a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.RepoLink}}/commits/{{$.BranchName}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Previous}}"{{end}}>
<i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
</a>
{{range .Pages}}
{{if eq .Num -1}}
<a class="disabled item">...</a>
{{else}}
<a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.RepoLink}}/commits/{{$.BranchName}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Num}}"{{end}}>{{.Num}}</a>
{{end}}
{{end}}
<a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.RepoLink}}/commits/{{$.BranchName}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Next}}"{{end}}>
{{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
</a>
</div>
</div>
{{end}}
{{end}}
+133 -131
View File
@@ -1,134 +1,136 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="repo-wrapper">
{{template "repo/header_old" .}}
<div class="container clear" id="diff-page">
{{if .IsDiffCompare }}
<div class="panel panel-info panel-radius compare-head-box">
<div class="panel-header">
<a class="pull-right btn btn-blue btn-header btn-medium btn-radius" rel="nofollow" href="{{EscapePound .SourcePath}}">{{.i18n.Tr "repo.diff.browse_source"}}</a>
<h4><a href="{{$.RepoLink}}/commit/{{.BeforeCommitId}}" class="label label-green">{{ShortSha .BeforeCommitId}}</a> ... <a href="{{$.RepoLink}}/commit/{{.AfterCommitId}}" class="label label-green">{{ShortSha .AfterCommitId}}</a></h4>
</div>
<div class="panel-body compare">
{{template "repo/commits_table" .}}
</div>
{{template "base/head" .}}
<div class="repository diff">
{{template "repo/header" .}}
<div class="ui container">
{{if .IsDiffCompare }}
{{template "repo/commits_table" .}}
{{else}}
<h4 class="ui top attached info header">
{{RenderCommitMessage .Commit.Message $.RepoLink}}
<div class="ui right">
<a class="ui blue tiny button" href="{{EscapePound .SourcePath}}">
{{.i18n.Tr "repo.diff.browse_source"}}
</a>
</div>
</h4>
<div class="ui attached info segment">
{{if .Author}}
<img class="ui avatar image" src="{{.Author.AvatarLink}}" />
<a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a>
{{else}}
<img class="ui avatar image" src="{{AvatarLink .Commit.Author.Email}}" />
<strong>{{.Commit.Author.Name}}</strong>
{{end}}
<span class="text grey" id="authored-time">{{TimeSince .Commit.Author.When $.Lang}}</span>
<div class="ui right">
<div class="ui horizontal list">
<div class="item">
{{.i18n.Tr "repo.diff.parent"}}
</div>
<div class="item">
{{range .Parents}}
<a class="ui blue sha label" href="{{$.RepoLink}}/commit/{{.}}">{{ShortSha .}}</a>
{{end}}
</div>
<div class="item">{{.i18n.Tr "repo.diff.commit"}}</div>
<div class="item"><span class="ui blue sha label">{{ShortSha .CommitId}}</span></div>
</div>
{{else}}
<div class="panel panel-info panel-radius diff-head-box">
<div class="panel-header">
<a class="pull-right btn btn-blue btn-header btn-medium btn-radius" rel="nofollow" href="{{EscapePound .SourcePath}}">{{.i18n.Tr "repo.diff.browse_source"}}</a>
<h4 class="commit-message">{{RenderCommitMessage .Commit.Message $.RepoLink}}</h4>
</div>
<div class="panel-body">
<span class="pull-right">
<ul class="list-unstyled">
<li class="inline">{{.i18n.Tr "repo.diff.parent"}}</li>
{{range .Parents}}
<li class="inline"><a href="{{$.RepoLink}}/commit/{{.}}"><span class="label label-blue">{{ShortSha .}}</span></a></li>
{{end}}
<li class="inline">{{.i18n.Tr "repo.diff.commit"}} <span class="label label-blue">{{ShortSha .CommitId}}</span></li>
</ul>
</span>
<p class="author">
{{if .Author}}
<img class="avatar-30" src="{{.Author.AvatarLink}}" />
<a href="{{AppSubUrl}}/{{.Author.Name}}"><strong>{{.Commit.Author.Name}}</strong></a>
{{else}}
<img class="avatar-30" src="{{AvatarLink .Commit.Author.Email}}" />
<strong>{{.Commit.Author.Name}}</strong>
{{end}}
<span class="text-grey" id="authored-time">{{TimeSince .Commit.Author.When $.Lang}}</span>
</p>
</div>
</div>
{{end}}
{{if .DiffNotAvailable}}
<h4>{{.i18n.Tr "repo.diff.data_not_available"}}</h4>
{{else}}
<div class="diff-detail-box diff-box">
<a class="pull-right btn btn-gray btn-header btn-radius text-black" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
<p class="showing">
<i class="fa fa-retweet"></i>
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
</p>
<ol class="detail-files collapse hide" id="diff-files">
{{range .Diff.Files}}
<li>
<div class="diff-counter count pull-right">
{{if not .IsBin}}
<span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
{{else}}
<span>{{$.i18n.Tr "repo.diff.bin"}}</span>
{{end}}
</div>
<!-- todo finish all file status, now modify, add, delete and rename -->
<span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}">&nbsp;</span>
<a class="file" href="#diff-{{.Index}}">{{.Name}}</a>
</li>
{{end}}
</ol>
</div>
{{range $i, $file := .Diff.Files}}
<div class="panel panel-radius diff-file-box diff-box file-content" id="diff-{{.Index}}">
<div class="panel-header">
<div class="diff-counter count pull-left">
{{if not $file.IsBin}}
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
{{else}}
{{$.i18n.Tr "repo.diff.bin"}}
{{end}}
</div>
{{if $file.IsDeleted}}
<a class="btn btn-gray btn-header btn-radius text-black pull-right" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
{{else}}
<a class="btn btn-gray btn-header btn-radius text-black pull-right" rel="nofollow" href="{{EscapePound $.SourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
{{end}}
<span class="file">{{$file.Name}}</span>
</div>
{{$isImage := (call $.IsImageFile $file.Name)}}
<div class="panel-body file-body file-code code-view code-diff">
{{if $isImage}}
<div class="text-center">
<img src="{{$.RawPath}}/{{EscapePound .Name}}">
</div>
{{else}}
<table>
<tbody>
{{range .Sections}}
{{range $k, $line := .Lines}}
<tr class="{{DiffLineTypeToStr .Type}}-code nl-{{$k}} ol-{{$k}}">
<td class="lines-num lines-num-old">
<span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
</td>
<td class="lines-num lines-num-new">
<span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
</td>
<td class="lines-code">
<pre>{{$line.Content}}</pre>
</td>
</tr>
{{end}}
{{end}}
</tbody>
</table>
{{end}}
</div>
</div>
<br>
{{end}}
{{end}}
</div>
</div>
{{end}}
{{if .DiffNotAvailable}}
<h4>{{.i18n.Tr "repo.diff.data_not_available"}}</h4>
{{else}}
<div class="diff-detail-box diff-box">
<div>
<i class="fa fa-retweet"></i>
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
<div class="ui right">
<a class="ui tiny basic black toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
</div>
</div>
<ol class="detail-files hide" id="diff-files">
{{range .Diff.Files}}
<li>
<div class="diff-counter count pull-right">
{{if not .IsBin}}
<span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
{{else}}
<span>{{$.i18n.Tr "repo.diff.bin"}}</span>
{{end}}
</div>
<!-- todo finish all file status, now modify, add, delete and rename -->
<span class="status {{DiffTypeToStr .Type}} poping up" data-content="{{DiffTypeToStr .Type}}" data-variation="inverted tiny" data-position="right center">&nbsp;</span>
<a class="file" href="#diff-{{.Index}}">{{.Name}}</a>
</li>
{{end}}
</ol>
</div>
{{range $i, $file := .Diff.Files}}
<div class="diff-file-box diff-box file-content" id="diff-{{.Index}}">
<h4 class="ui top attached normal header">
<div class="diff-counter count ui left">
{{if not $file.IsBin}}
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
{{else}}
{{$.i18n.Tr "repo.diff.bin"}}
{{end}}
</div>
<span class="file">{{$file.Name}}</span>
<div class="ui right">
{{if $file.IsDeleted}}
<a class="ui basic tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
{{else}}
<a class="ui basic tiny button" rel="nofollow" href="{{EscapePound $.SourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
{{end}}
</div>
</h4>
<div class="ui attached table segment">
{{$isImage := (call $.IsImageFile $file.Name)}}
{{if $isImage}}
<div class="center">
<img src="{{$.RawPath}}/{{EscapePound .Name}}">
</div>
{{else}}
<div class="file-body file-code code-view code-diff">
<table>
<tbody>
{{range .Sections}}
{{range $k, $line := .Lines}}
<tr class="{{DiffLineTypeToStr .Type}}-code nl-{{$k}} ol-{{$k}}">
<td class="lines-num lines-num-old">
<span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
</td>
<td class="lines-num lines-num-new">
<span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
</td>
<td class="lines-code">
<pre>{{$line.Content}}</pre>
</td>
</tr>
{{end}}
{{end}}
</tbody>
</table>
</div>
{{end}}
</div>
</div>
<br>
{{end}}
{{end}}
</div>
</div>
{{template "ng/base/footer" .}}
{{template "base/footer" .}}
+1 -1
View File
@@ -102,7 +102,7 @@
</div>
{{end}}
{{if or $.IsRepositoryAdmin (eq .Poster.Id $.SignedUserID)}}
<a class="edit-content item" href="#" data-type="comment"><i class="octicon octicon-pencil"></i></a>
<a class="edit-content item" href="#"><i class="octicon octicon-pencil"></i></a>
{{end}}
</div>
</div>
+4 -4
View File
@@ -53,12 +53,12 @@
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="field {{if .Err_Title}}error{{end}}">
<label>{{.i18n.Tr "repo.settings.title"}}</label>
<input name="title" value="{{.title}}" autofocus required>
<label for="title">{{.i18n.Tr "repo.settings.title"}}</label>
<input id="title" name="title" value="{{.title}}" autofocus required>
</div>
<div class="field {{if .Err_Content}}error{{end}}">
<label>{{.i18n.Tr "repo.settings.deploy_key_content"}}</label>
<textarea name="content" required>{{.content}}</textarea>
<label for="content">{{.i18n.Tr "repo.settings.deploy_key_content"}}</label>
<textarea id="content" name="content" required>{{.content}}</textarea>
</div>
<button class="ui green button">
{{.i18n.Tr "repo.settings.add_deploy_key"}}
+2
View File
@@ -6,7 +6,9 @@
<li {{if .PageIsSettingsPassword}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/password">{{.i18n.Tr "settings.password"}}</a></li>
<li {{if .PageIsSettingsEmails}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/email">{{.i18n.Tr "settings.emails"}}</a></li>
<li {{if .PageIsSettingsSSHKeys}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/ssh">{{.i18n.Tr "settings.ssh_keys"}}</a></li>
{{if .HasOAuthService}}
<li {{if .PageIsSettingsSocial}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/social">{{.i18n.Tr "settings.social"}}</a></li>
{{end}}
<li {{if .PageIsSettingsApplications}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/applications">{{.i18n.Tr "settings.applications"}}</a></li>
<li {{if .PageIsSettingsDelete}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/delete">{{.i18n.Tr "settings.delete"}}</a></li>
</ul>
+88 -59
View File
@@ -1,63 +1,92 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="setting-wrapper" class="main-wrapper">
<div id="user-profile-setting" class="container clear">
{{template "user/settings/nav" .}}
<div class="grid-4-5 left">
<div class="setting-content">
{{template "ng/base/alert" .}}
<div id="user-ssh-setting-content">
<div id="user-ssh-panel" class="panel panel-radius">
<div class="panel-header">
<a class="show-form-btn" data-target-form="#user-ssh-add-form">
<button class="btn btn-medium btn-black btn-radius right">{{.i18n.Tr "settings.add_key"}}</button>
</a>
<strong>{{.i18n.Tr "settings.manage_ssh_keys"}}</strong>
</div>
<ul class="panel-body setting-list">
<li>{{.i18n.Tr "settings.ssh_desc"}}</li>
{{range .Keys}}
<li class="ssh clear">
<span class="active-icon left label label-{{if .HasRecentActivity}}green{{else}}gray{{end}} label-radius"></span>
<i class="mega-octicon octicon-key left"></i>
<div class="ssh-content left">
<p><strong>{{.Name}}</strong></p>
<p class="print">{{.Fingerprint}}</p>
<p class="activity"><i>{{$.i18n.Tr "settings.add_on"}} <span title="{{DateFmtLong .Created}}">{{DateFmtShort .Created}}</span> — <i class="octicon octicon-info"></i>{{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} <span title="{{DateFmtLong .Updated}}">{{DateFmtShort .Updated}}</span>{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}}</i></p>
</div>
<form action="{{AppSubUrl}}/user/settings/ssh" method="post">
{{$.CsrfTokenHtml}}
<input name="_method" type="hidden" value="DELETE">
<input name="id" type="hidden" value="{{.ID}}">
<button class="right ssh-btn btn btn-red btn-radius btn-small">{{$.i18n.Tr "settings.delete_key"}}</button>
</form>
</li>
{{end}}
</ul>
</div>
<p>{{.i18n.Tr "settings.ssh_helper" "https://help.github.com/articles/generating-ssh-keys" "https://help.github.com/ssh-issues/" | Str2html}}</p>
<br>
<form class="panel panel-radius form form-align form-settings-add hide" id="user-ssh-add-form" action="{{AppSubUrl}}/user/settings/ssh" method="post">
{{.CsrfTokenHtml}}
<p class="panel-header"><strong>{{.i18n.Tr "settings.add_new_key"}}</strong></p>
<div class="panel-body">
<p class="field">
<label class="req" for="ssh-title">{{.i18n.Tr "settings.key_name"}}</label>
<input class="ipt ipt-radius" id="ssh-title" name="title" type="text" required />
</p>
<p class="field clear">
<label class="left req" for="ssh-key">{{.i18n.Tr "settings.key_content"}}</label>
<textarea class="ipt ipt-radius left" name="content" id="ssh-key" required></textarea>
</p>
<p class="field">
<label></label>
<button class="btn btn-green btn-radius" id="ssh-add-btn">{{.i18n.Tr "settings.add_key"}}</button>
</p>
</div>
</form>
</div>
{{template "base/head" .}}
<div class="user settings">
<div class="ui container">
<div class="ui grid">
{{template "user/settings/navbar" .}}
<div class="twelve wide column content">
{{template "base/alert" .}}
<h4 class="ui top attached header">
{{.i18n.Tr "settings.manage_ssh_keys"}}
<div class="ui right">
<div class="ui blue tiny show-panel button" data-panel="#add-ssh-key-panel">{{.i18n.Tr "settings.add_key"}}</div>
</div>
</h4>
<div class="ui attached segment">
<div class="ui key list">
<div class="item">
{{.i18n.Tr "settings.ssh_desc"}}
</div>
{{range .Keys}}
<div class="item ui grid">
<div class="one wide column">
<i class="ssh-key-state-indicator fa fa-circle{{if .HasRecentActivity}} active invert poping up{{else}}-o{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.key_state_desc"}}" data-variation="inverted"{{end}}></i>
</div>
<div class="one wide column">
<i class="mega-octicon octicon-key left"></i>
</div>
<div class="eleven wide column">
<strong>{{.Name}}</strong>
<div class="print meta">
{{.Fingerprint}}
</div>
<div class="activity meta">
<i>{{$.i18n.Tr "settings.add_on"}} <span>{{DateFmtShort .Created}}</span> — <i class="octicon octicon-info"></i> {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} <span>{{DateFmtShort .Updated}}</span>{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}}</i>
</div>
</div>
<div class="two wide column">
<button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
{{$.i18n.Tr "settings.delete_key"}}
</button>
</div>
</div>
{{end}}
</div>
</div>
<br>
<p>{{.i18n.Tr "settings.ssh_helper" "https://help.github.com/articles/generating-ssh-keys" "https://help.github.com/ssh-issues/" | Str2html}}</p>
<div {{if not .HasError}}class="hide"{{end}} id="add-ssh-key-panel">
<h4 class="ui top attached header">
{{.i18n.Tr "settings.add_new_key"}}
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="field {{if .Err_Title}}error{{end}}">
<label for="title">{{.i18n.Tr "settings.key_name"}}</label>
<input id="title" name="title" value="{{.title}}" autofocus required>
</div>
<div class="field {{if .Err_Content}}error{{end}}">
<label for="content">{{.i18n.Tr "settings.key_content"}}</label>
<textarea id="content" name="content" required>{{.content}}</textarea>
</div>
<button class="ui green button">
{{.i18n.Tr "settings.add_key"}}
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
{{template "ng/base/footer" .}}
<div class="ui small basic delete modal">
<div class="ui icon header">
<i class="trash icon"></i>
{{.i18n.Tr "settings.ssh_key_deletion"}}
</div>
<div class="content">
<p>{{.i18n.Tr "settings.ssh_key_deletion_desc"}}</p>
</div>
<div class="actions">
<div class="ui red basic inverted cancel button">
<i class="remove icon"></i>
{{.i18n.Tr "modal.no"}}
</div>
<div class="ui green basic inverted ok button">
<i class="checkmark icon"></i>
{{.i18n.Tr "modal.yes"}}
</div>
</div>
</div>
{{template "base/footer" .}}