mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 03:52:36 +02:00
Web editor: improve code quality
This commit is contained in:
1 parent
67fb0fe6a5
commit
f8a48ffaad
19 files changed
+75
-81
No files matched your search
@@ -3,7 +3,7 @@ Gogs - Go Git Service [
|
||||
|
||||
##### Current tip version: 0.9.84 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
|
||||
##### Current tip version: 0.9.85 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
|
||||
|
||||
| Web | UI | Preview |
|
||||
|:-------------:|:-------:|:-------:|
|
||||
|
||||
@@ -447,6 +447,7 @@ cannot_edit_binary_files = Cannot edit binary files
|
||||
filename_help = To add directory, just type it and press /. To remove a directory, go to the beginning of the field and press backspace.
|
||||
fork_before_edit = You must fork this before editing
|
||||
new_branch = new branch
|
||||
editor.file_delete_success = File '%s' has been deleted successfully!
|
||||
editor.commit_directly_to_this_branch = Commit directly to the <strong class="branch-name">%s</strong> branch.
|
||||
editor.create_new_branch = Create a <strong>new branch</strong> for this commit and start a pull request.
|
||||
editor.filename_cannot_be_empty = Filename cannot be empty.
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.9.84.0824"
|
||||
const APP_VER = "0.9.85.0824"
|
||||
|
||||
func init() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
|
||||
+3
-3
@@ -2260,7 +2260,7 @@ func (repo *Repository) GetForks() ([]*Repository, error) {
|
||||
//
|
||||
|
||||
// uploadRepoFiles uploads new files to repository.
|
||||
func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, treeName, message string, uuids []string) (err error) {
|
||||
func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, treePath, message string, uuids []string) (err error) {
|
||||
repoWorkingPool.CheckIn(com.ToStr(repo.ID))
|
||||
defer repoWorkingPool.CheckOut(com.ToStr(repo.ID))
|
||||
|
||||
@@ -2276,7 +2276,7 @@ func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, t
|
||||
repo.CheckoutNewBranch(oldBranchName, branchName)
|
||||
}
|
||||
|
||||
dirPath := path.Join(localPath, treeName)
|
||||
dirPath := path.Join(localPath, treePath)
|
||||
os.MkdirAll(dirPath, os.ModePerm)
|
||||
|
||||
// Copy uploaded files into repository.
|
||||
@@ -2298,7 +2298,7 @@ func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, t
|
||||
}
|
||||
|
||||
if len(message) == 0 {
|
||||
message = "Add files to '" + treeName + "'"
|
||||
message = "Add files to '" + treePath + "'"
|
||||
}
|
||||
|
||||
if err = git.AddChanges(localPath, true); err != nil {
|
||||
|
||||
@@ -173,7 +173,7 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) (
|
||||
}
|
||||
|
||||
// GetDiffPreview produces and returns diff result of a file which is not yet committed.
|
||||
func (repo *Repository) GetDiffPreview(branch, treeName, content string) (diff *Diff, err error) {
|
||||
func (repo *Repository) GetDiffPreview(branch, treePath, content string) (diff *Diff, err error) {
|
||||
repoWorkingPool.CheckIn(com.ToStr(repo.ID))
|
||||
defer repoWorkingPool.CheckOut(com.ToStr(repo.ID))
|
||||
|
||||
@@ -184,13 +184,13 @@ func (repo *Repository) GetDiffPreview(branch, treeName, content string) (diff *
|
||||
}
|
||||
|
||||
localPath := repo.LocalCopyPath()
|
||||
filePath := path.Join(localPath, treeName)
|
||||
filePath := path.Join(localPath, treePath)
|
||||
os.MkdirAll(filepath.Dir(filePath), os.ModePerm)
|
||||
if err = ioutil.WriteFile(filePath, []byte(content), 0666); err != nil {
|
||||
return nil, fmt.Errorf("WriteFile: %v", err)
|
||||
}
|
||||
|
||||
cmd := exec.Command("git", "diff", treeName)
|
||||
cmd := exec.Command("git", "diff", treePath)
|
||||
cmd.Dir = localPath
|
||||
cmd.Stderr = os.Stderr
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ func (f *NewWikiForm) Validate(ctx *macaron.Context, errs binding.Errors) bindin
|
||||
// \/ \/
|
||||
|
||||
type EditRepoFileForm struct {
|
||||
TreeName string `binding:"Required;MaxSize(500)"`
|
||||
TreePath string `binding:"Required;MaxSize(500)"`
|
||||
Content string `binding:"Required"`
|
||||
CommitSummary string `binding:"MaxSize(100)`
|
||||
CommitMessage string
|
||||
|
||||
@@ -4346,7 +4346,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\xbd\xfb\x72\xdb\x48\x92\x2f\xfc\x3f\x9e\x02\xed\x09\x87\xed\x08\x99\x1d\x3d\xb3\xdf\x25\x3a\xfa\xf2\xa9\xe5\xf6\x65\xd7\xb2\xb5\x96\x7a\xe6\x9b\xd3\xe1\x60\x83\x24\x44\x62\x4d\x02\x1c\x00\xb4\xac\x99\x98\x37\x38\x0f\x70\x9e\xef\x3c\xc9\xc9\xfc\x65\x66\x55\x16\x00\x4a\x76\xcf\xfa\x0f\x8b\xa8\xca\xba\x67\x65\xe5\xad\xb2\x8a\xfd\x7e\xbe\x2a\xbb\x65\xfe\x7d\x7e\x9a\xef\x8b\xaa\xde\x96\x5d\x97\x77\xe5\xf6\xfa\xe9\xa6\xe9\xfa\x72\x95\xbf\xa8\x7a\xfa\x6e\x3f\x56\xcb\x32\xcb\x36\xcd\xae\x24\xd0\x97\xf4\x27\x5b\x15\xdd\x66\xd1\x14\xed\x8a\x12\x9e\xd9\xef\xac\xfc\xb4\xdf\x36\x2d\x03\xfd\x2c\xbf\xb2\x4d\xb9\xdd\x73\x19\xfa\x93\x75\xd5\xba\x9e\x57\x35\x7d\x5e\xd2\xaf\xfc\x55\x2d\x29\xcd\xa1\xb7\xa4\xb7\x87\x5e\xd2\x0e\x7b\x4b\xfa\x65\x9f\xb5\xe5\xba\xa2\xde\xb4\x94\xf4\x4e\x7f\x66\x37\xe5\xa2\xab\x7a\x6e\xe9\x2f\xf2\x2b\xfb\x58\xb6\x5d\xd5\x70\xed\x7f\x96\x5f\xd9\xbe\x58\x33\xc0\x05\xfd\xc9\xfa\x72\xb7\xdf\x16\x28\x70\xa5\x3f\xb3\x6d\x51\xaf\x0f\x02\xf3\x5a\x7f\x66\xcb\xb6\xa4\xac\x79\x5d\xde\x50\xea\x19\x3e\x66\xb3\x59\x76\xa0\x49\x98\xef\xdb\xe6\xba\xda\x96\xf3\xa2\x5e\xcd\x77\x32\xcc\x5f\x28\x3d\xd7\xf4\x9c\xd2\x73\x4e\xc7\x10\xca\x15\x0d\x75\x5e\x74\x3a\x0e\x9a\x4b\x1a\x79\xd1\x65\xa8\xaa\x2e\x76\x56\x9a\x7f\x66\xe5\xae\xa8\xb6\x3c\x6b\xfc\x97\xfa\xdd\x75\x37\x0d\xa6\xf6\x42\x7f\xd2\x1c\xcc\xfb\xdb\x7d\x89\x29\x78\x7a\x45\xbf\xb2\x65\xb1\xef\x97\x9b\x82\xbb\x29\xbf\x32\x02\xda\x37\x34\x17\x4d\x7b\x0b\x38\xfb\xc8\x9a\x76\x5d\xd4\xd5\xdf\x8b\x5e\xe6\xe7\xad\xfb\xcc\x76\x55\xdb\x36\x3c\xb5\xe7\xf8\x91\xd1\xc8\xe7\x5c\x0f\xa5\xbc\xa1\x49\x70\xb5\x70\xce\xae\x5a\xb7\x32\x8b\x9c\x79\x8e\x2f\xae\x45\xf2\xb4\x26\xc9\x0a\xb5\x5d\x37\xed\x07\x4d\x7d\xce\x3f\x07\x55\x52\xe7\x34\x37\xed\x57\x51\xd3\x7a\x68\xee\x39\x3e\x12\x80\x2e\x2b\x56\x3b\x9a\xe1\x7d\x51\x97\x3c\x75\xa7\xfc\x45\xf3\x45\x5f\x59\xb1\x5c\x36\x87\xba\x9f\x77\x65\xdf\x57\xf5\x9a\xd7\xe0\x54\x92\xf2\x4b\x4d\xca\x5c\x5e\x48\xbb\x6d\x0e\x61\x95\x29\xfd\xaf\xf4\x99\x5f\xc8\xa7\xe4\xb9\x42\xc8\x0c\x25\xa9\xc9\xbe\xfa\x58\xf5\x55\x29\x8d\xd9\x47\xb6\x3f\x6c\xb7\x34\x9f\x7f\x3b\x94\x5d\xcf\x59\x17\xf4\x4d\x33\x20\xdf\x59\xd5\x75\x07\x94\x78\x85\x1f\x19\x2d\x6a\xbd\xc4\x70\xce\xf0\x23\xcb\x7e\xad\xea\xae\x2f\xb6\xdb\xf7\x99\xfe\x60\x60\xf9\x25\xf3\xd4\x57\x3d\x3a\xab\x89\xf9\x65\x5f\xee\x3b\x9e\xe8\xfc\x79\xd5\x76\xfd\xd3\xbe\x22\x54\x7b\x77\xa8\xb3\x55\xb3\xfc\x40\x48\xcc\x1b\x12\x5b\xe9\xd5\x75\x4e\x63\x7a\x44\x68\xdc\x1e\xea\x9a\x46\x91\xbf\x68\x68\x64\xd4\x4c\xb5\x2a\xf3\x67\x80\x3e\xc9\xf7\xdb\xb2\xe8\x08\xa4\x2c\x56\xf9\x77\x45\xde\x17\xed\xba\xec\xbf\x7f\x30\x5f\xd0\xe6\xf9\xf0\x20\xdf\xb4\xe5\xf5\xf7\x0f\x1e\x76\x0f\x7e\x78\x71\xa0\x62\xdb\xaa\x2e\xbb\xef\xbe\x2e\x7e\xc8\x97\x05\xe5\xd0\x58\x6f\xf3\x45\x79\xcd\x7b\x85\xda\xca\x09\x49\xeb\x35\xef\x93\xdb\x7e\xc3\x0d\xd2\x82\xd1\x8f\x2e\xe7\x8d\xfa\x55\xc6\xb3\x44\x1b\x79\xbe\x5a\x18\x51\x42\x87\x90\xdc\xd2\x2c\x9d\xdf\x5e\xfe\xe7\xeb\x93\xfc\x82\x28\xd3\xba\x2d\xf1\x9b\xfe\xa3\x12\x7f\xca\x69\xb4\x57\xd5\xb3\x9f\x66\x19\x95\xb5\x09\x79\x56\xf4\xc5\x82\xfb\x1e\x16\x89\x33\x65\x0f\x85\x3c\xec\x24\xa6\x75\xa0\x6b\x5d\x8f\xdd\xa9\x3b\x73\x72\x1f\x52\x1d\xba\x79\x43\x1d\x6f\x78\x07\x53\x7a\x98\xd9\x0b\x99\x33\xaa\x2a\x7f\xf5\xe6\xcd\xdb\x67\x3f\xe5\x65\xbd\xa6\x99\xc9\x6f\xaa\x7e\x93\x1f\xfa\xeb\xff\x77\xbe\x2e\xeb\xb2\x2d\xb6\xf3\x65\xc5\x93\xd2\x12\x5e\xe5\x34\x4b\x32\xc4\x59\xd6\x75\x5b\x22\x30\x2b\x6e\xe5\xf2\xf2\x75\x7e\x4e\x3f\xa9\x33\x54\x96\x3b\xd2\x6f\xb2\xee\x6f\x5b\x9e\xa8\xd0\xe0\xd5\xa6\xcc\x81\xb3\x00\x6a\xae\x87\xf3\x92\xaf\xb4\xaf\xb3\xfc\xbb\x45\xfb\x83\xeb\x5f\xb1\xe8\x9a\xed\xa1\xd7\x92\x37\x9b\xb2\xc6\x42\x11\x2a\xb5\x3d\x51\x2b\xa3\xfd\xb3\xac\x6c\xdb\x39\xd1\xcd\xfe\x96\x97\x47\xfb\x72\xac\x15\xa9\x8c\x50\xb9\x6e\x7a\x5a\xfe\x1c\xe5\xa4\x8a\xaa\xfe\x58\x6c\xab\x15\x2d\x52\x9c\xc8\xb4\x2c\x12\x57\x0d\xad\x37\x97\x26\x8c\x6e\x6e\x30\x45\xb4\xc1\x88\xac\xe7\x0f\x66\x0f\x40\x67\x1f\x3c\x7d\x30\xcb\xea\x66\x2e\x44\x80\x29\xf2\xaa\xea\x8a\x05\x51\x67\x39\x2d\x5a\x23\x76\x7f\x65\xbc\x93\xae\x28\x44\x9e\x40\xf0\x9a\xf0\x09\x04\xc2\xcf\x48\x59\x10\x99\x06\x2d\x51\x2a\xe2\xc7\x6e\x24\x27\xe0\x85\x50\x9d\x90\x30\x1a\x73\x66\x0b\x6d\x58\x79\xba\xdf\x6f\xab\xa5\x34\xfd\x42\xf2\x22\x82\xf2\x79\xac\x93\xe2\xe1\x80\x60\x96\xe7\xd0\x8c\x7a\xcd\x54\x29\x4f\xc8\x3b\xca\x6f\x4a\xda\x71\x9b\xc3\x5a\xce\xa4\x6d\x73\x58\x7d\x85\xc3\xc1\x56\x2e\x92\xe0\xfc\x5d\x43\x1d\x06\x56\x05\x80\xd8\xc4\x29\x11\x14\x66\x01\xda\x72\xd7\xf4\x3c\x71\x5a\x8c\xc9\xdc\x4d\x45\x99\x34\xd2\xae\xf8\x48\x87\x5b\xdf\xc8\x56\x5e\xd1\x56\x5d\x72\xc5\xb3\x8c\xc8\xca\x5c\xb7\x13\xd1\x1f\xd9\x52\x96\x96\xe2\x2e\xa0\x76\x07\xda\x85\x1b\xaa\x8c\x27\x9e\xf9\x10\xaa\x72\xaa\x9f\x18\x12\xd5\x03\xea\x40\x3b\xbe\xa1\x33\x93\x17\xfa\x19\x7e\xe8\xb7\xaf\x9f\x7a\x55\x5c\x5f\x53\xaf\x3a\xda\x4d\x2f\xf3\xe5\xb6\xa1\xad\xf8\xcb\xbb\xd7\x1d\x6f\xb4\xcd\x7c\xdf\xb4\xe0\x3f\x28\xeb\x82\x7e\x86\x34\x37\xd1\x0c\x51\x1f\x76\x0b\xfa\xba\xd9\x54\xcb\x8d\x4c\x3b\x97\xe0\xfd\x41\xa9\xdLine truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\xbd\xfb\x72\xdb\x48\x92\x2f\xfc\x3f\x9e\x02\xed\x09\x87\xed\x08\x99\x1d\x3d\xb3\xdf\x25\x3a\xfa\xf2\xa9\xe5\xf6\x65\xd7\xb2\xb5\x96\x7a\xe6\x9b\xd3\xe1\x60\x83\x24\x44\x62\x4d\x02\x1c\x00\xb4\xac\x99\x98\x37\x38\x0f\x70\x9e\xef\x3c\xc9\xc9\xfc\x65\x66\x55\x16\x00\x4a\x76\xcf\xfa\x0f\x8b\xa8\xca\xba\x67\x65\xe5\xad\xb2\x8a\xfd\x7e\xbe\x2a\xbb\x65\xfe\x7d\x7e\x9a\xef\x8b\xaa\xde\x96\x5d\x97\x77\xe5\xf6\xfa\xe9\xa6\xe9\xfa\x72\x95\xbf\xa8\x7a\xfa\x6e\x3f\x56\xcb\x32\xcb\x36\xcd\xae\x24\xd0\x97\xf4\x27\x5b\x15\xdd\x66\xd1\x14\xed\x8a\x12\x9e\xd9\xef\xac\xfc\xb4\xdf\x36\x2d\x03\xfd\x2c\xbf\xb2\x4d\xb9\xdd\x73\x19\xfa\x93\x75\xd5\xba\x9e\x57\x35\x7d\x5e\xd2\xaf\xfc\x55\x2d\x29\xcd\xa1\xb7\xa4\xb7\x87\x5e\xd2\x0e\x7b\x4b\xfa\x65\x9f\xb5\xe5\xba\xa2\xde\xb4\x94\xf4\x4e\x7f\x66\x37\xe5\xa2\xab\x7a\x6e\xe9\x2f\xf2\x2b\xfb\x58\xb6\x5d\xd5\x70\xed\x7f\x96\x5f\xd9\xbe\x58\x33\xc0\x05\xfd\xc9\xfa\x72\xb7\xdf\x16\x28\x70\xa5\x3f\xb3\x6d\x51\xaf\x0f\x02\xf3\x5a\x7f\x66\xcb\xb6\xa4\xac\x79\x5d\xde\x50\xea\x19\x3e\x66\xb3\x59\x76\xa0\x49\x98\xef\xdb\xe6\xba\xda\x96\xf3\xa2\x5e\xcd\x77\x32\xcc\x5f\x28\x3d\xd7\xf4\x9c\xd2\x73\x4e\xc7\x10\xca\x15\x0d\x75\x5e\x74\x3a\x0e\x9a\x4b\x1a\x79\xd1\x65\xa8\xaa\x2e\x76\x56\x9a\x7f\x66\xe5\xae\xa8\xb6\x3c\x6b\xfc\x97\xfa\xdd\x75\x37\x0d\xa6\xf6\x42\x7f\xd2\x1c\xcc\xfb\xdb\x7d\x89\x29\x78\x7a\x45\xbf\xb2\x65\xb1\xef\x97\x9b\x82\xbb\x29\xbf\x32\x02\xda\x37\x34\x17\x4d\x7b\x0b\x38\xfb\xc8\x9a\x76\x5d\xd4\xd5\xdf\x8b\x5e\xe6\xe7\xad\xfb\xcc\x76\x55\xdb\x36\x3c\xb5\xe7\xf8\x91\xd1\xc8\xe7\x5c\x0f\xa5\xbc\xa1\x49\x70\xb5\x70\xce\xae\x5a\xb7\x32\x8b\x9c\x79\x8e\x2f\xae\x45\xf2\xb4\x26\xc9\x0a\xb5\x5d\x37\xed\x07\x4d\x7d\xce\x3f\x07\x55\x52\xe7\x34\x37\xed\x57\x51\xd3\x7a\x68\xee\x39\x3e\x12\x80\x2e\x2b\x56\x3b\x9a\xe1\x7d\x51\x97\x3c\x75\xa7\xfc\x45\xf3\x45\x5f\x59\xb1\x5c\x36\x87\xba\x9f\x77\x65\xdf\x57\xf5\x9a\xd7\xe0\x54\x92\xf2\x4b\x4d\xca\x5c\x5e\x48\xbb\x6d\x0e\x61\x95\x29\xfd\xaf\xf4\x99\x5f\xc8\xa7\xe4\xb9\x42\xc8\x0c\x25\xa9\xc9\xbe\xfa\x58\xf5\x55\x29\x8d\xd9\x47\xb6\x3f\x6c\xb7\x34\x9f\x7f\x3b\x94\x5d\xcf\x59\x17\xf4\x4d\x33\x20\xdf\x59\xd5\x75\x07\x94\x78\x85\x1f\x19\x2d\x6a\xbd\xc4\x70\xce\xf0\x23\xcb\x7e\xad\xea\xae\x2f\xb6\xdb\xf7\x99\xfe\x60\x60\xf9\x25\xf3\xd4\x57\x3d\x3a\xab\x89\xf9\x65\x5f\xee\x3b\x9e\xe8\xfc\x79\xd5\x76\xfd\xd3\xbe\x22\x54\x7b\x77\xa8\xb3\x55\xb3\xfc\x40\x48\xcc\x1b\x12\x5b\xe9\xd5\x75\x4e\x63\x7a\x44\x68\xdc\x1e\xea\x9a\x46\x91\xbf\x68\x68\x64\xd4\x4c\xb5\x2a\xf3\x67\x80\x3e\xc9\xf7\xdb\xb2\xe8\x08\xa4\x2c\x56\xf9\x77\x45\xde\x17\xed\xba\xec\xbf\x7f\x30\x5f\xd0\xe6\xf9\xf0\x20\xdf\xb4\xe5\xf5\xf7\x0f\x1e\x76\x0f\x7e\x78\x71\xa0\x62\xdb\xaa\x2e\xbb\xef\xbe\x2e\x7e\xc8\x97\x05\xe5\xd0\x58\x6f\xf3\x45\x79\xcd\x7b\x85\xda\xca\x09\x49\xeb\x35\xef\x93\xdb\x7e\xc3\x0d\xd2\x82\xd1\x8f\x2e\xe7\x8d\xfa\x55\xc6\xb3\x44\x1b\x79\xbe\x5a\x18\x51\x42\x87\x90\xdc\xd2\x2c\x9d\xdf\x5e\xfe\xe7\xeb\x93\xfc\x82\x28\xd3\xba\x2d\xf1\x9b\xfe\xa3\x12\x7f\xca\x69\xb4\x57\xd5\xb3\x9f\x66\x19\x95\xb5\x09\x79\x56\xf4\xc5\x82\xfb\x1e\x16\x89\x33\x65\x0f\x85\x3c\xec\x24\xa6\x75\xa0\x6b\x5d\x8f\xdd\xa9\x3b\x73\x72\x1f\x52\x1d\xba\x79\x43\x1d\x6f\x78\x07\x53\x7a\x98\xd9\x0b\x99\x33\xaa\x2a\x7f\xf5\xe6\xcd\xdb\x67\x3f\xe5\x65\xbd\xa6\x99\xc9\x6f\xaa\x7e\x93\x1f\xfa\xeb\xff\x77\xbe\x2e\xeb\xb2\x2d\xb6\xf3\x65\xc5\x93\xd2\x12\x5e\xe5\x34\x4b\x32\xc4\x59\xd6\x75\x5b\x22\x30\x2b\x6e\xe5\xf2\xf2\x75\x7e\x4e\x3f\xa9\x33\x54\x96\x3b\xd2\x6f\xb2\xee\x6f\x5b\x9e\xa8\xd0\xe0\xd5\xa6\xcc\x81\xb3\x00\x6a\xae\x87\xf3\x92\xaf\xb4\xaf\xb3\xfc\xbb\x45\xfb\x83\xeb\x5f\xb1\xe8\x9a\xed\xa1\xd7\x92\x37\x9b\xb2\xc6\x42\x11\x2a\xb5\x3d\x51\x2b\xa3\xfd\xb3\xac\x6c\xdb\x39\xd1\xcd\xfe\x96\x97\x47\xfb\x72\xac\x15\xa9\x8c\x50\xb9\x6e\x7a\x5a\xfe\x1c\xe5\xa4\x8a\xaa\xfe\x58\x6c\xab\x15\x2d\x52\x9c\xc8\xb4\x2c\x12\x57\x0d\xad\x37\x97\x26\x8c\x6e\x6e\x30\x45\xb4\xc1\x88\xac\xe7\x0f\x66\x0f\x40\x67\x1f\x3c\x7d\x30\xcb\xea\x66\x2e\x44\x80\x29\xf2\xaa\xea\x8a\x05\x51\x67\x39\x2d\x5a\x23\x76\x7f\x65\xbc\x93\xae\x28\x44\x9e\x40\xf0\x9a\xf0\x09\x04\xc2\xcf\x48\x59\x10\x99\x06\x2d\x51\x2a\xe2\xc7\x6e\x24\x27\xe0\x85\x50\x9d\x90\x30\x1a\x73\x66\x0b\x6d\x58\x79\xba\xdf\x6f\xab\xa5\x34\xfd\x42\xf2\x22\x82\xf2\x79\xac\x93\xe2\xe1\x80\x60\x96\xe7\xd0\x8c\x7a\xcd\x54\x29\x4f\xc8\x3b\xca\x6f\x4a\xda\x71\x9b\xc3\x5a\xce\xa4\x6d\x73\x58\x7d\x85\xc3\xc1\x56\x2e\x92\xe0\xfc\x5d\x43\x1d\x06\x56\x05\x80\xd8\xc4\x29\x11\x14\x66\x01\xda\x72\xd7\xf4\x3c\x71\x5a\x8c\xc9\xdc\x4d\x45\x99\x34\xd2\xae\xf8\x48\x87\x5b\xdf\xc8\x56\x5e\xd1\x56\x5d\x72\xc5\xb3\x8c\xc8\xca\x5c\xb7\x13\xd1\x1f\xd9\x52\x96\x96\xe2\x2e\xa0\x76\x07\xda\x85\x1b\xaa\x8c\x27\x9e\xf9\x10\xaa\x72\xaa\x9f\x18\x12\xd5\x03\xea\x40\x3b\xbe\xa1\x33\x93\x17\xfa\x19\x7e\xe8\xb7\xaf\x9f\x7a\x55\x5c\x5f\x53\xaf\x3a\xda\x4d\x2f\xf3\xe5\xb6\xa1\xad\xf8\xcb\xbb\xd7\x1d\x6f\xb4\xcd\x7c\xdf\xb4\xe0\x3f\x28\xeb\x82\x7e\x86\x34\x37\xd1\x0c\x51\x1f\x76\x0b\xfa\xba\xd9\x54\xcb\x8d\x4c\x3b\x97\xe0\xfd\x41\xa9\xdLine truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4361,7 +4361,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 55343, mode: os.FileMode(420), modTime: time.Unix(1471250630, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 55413, mode: os.FileMode(420), modTime: time.Unix(1472097943, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
@@ -41,14 +41,14 @@ type Repository struct {
|
||||
GitRepo *git.Repository
|
||||
BranchName string
|
||||
TagName string
|
||||
TreeName string
|
||||
TreePath string
|
||||
CommitID string
|
||||
RepoLink string
|
||||
CloneLink models.CloneLink
|
||||
CommitsCount int64
|
||||
Mirror *models.Mirror
|
||||
|
||||
PullRequest *PullRequest
|
||||
PullRequest *PullRequest
|
||||
}
|
||||
|
||||
// IsOwner returns true if current user is the owner of repository.
|
||||
@@ -384,7 +384,7 @@ func RepoRef() macaron.Handler {
|
||||
if ctx.Repo.GitRepo.IsBranchExist(refName) ||
|
||||
ctx.Repo.GitRepo.IsTagExist(refName) {
|
||||
if i < len(parts)-1 {
|
||||
ctx.Repo.TreeName = strings.Join(parts[i+1:], "/")
|
||||
ctx.Repo.TreePath = strings.Join(parts[i+1:], "/")
|
||||
}
|
||||
hasMatched = true
|
||||
break
|
||||
@@ -392,7 +392,7 @@ func RepoRef() macaron.Handler {
|
||||
}
|
||||
if !hasMatched && len(parts[0]) == 40 {
|
||||
refName = parts[0]
|
||||
ctx.Repo.TreeName = strings.Join(parts[1:], "/")
|
||||
ctx.Repo.TreePath = strings.Join(parts[1:], "/")
|
||||
}
|
||||
|
||||
if ctx.Repo.GitRepo.IsBranchExist(refName) {
|
||||
|
||||
+1
-1
@@ -779,7 +779,7 @@ function initEditor() {
|
||||
});
|
||||
if ($(this).val())
|
||||
parts.push($(this).val());
|
||||
$('#tree-name').val(parts.join('/'));
|
||||
$('#tree_path').val(parts.join('/'));
|
||||
}).trigger('keyup');
|
||||
|
||||
var $editArea = $('.repository.editor textarea#edit_area');
|
||||
|
||||
@@ -19,7 +19,7 @@ func GetRawFile(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreeName)
|
||||
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath)
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
ctx.Status(404)
|
||||
|
||||
@@ -25,9 +25,9 @@ const (
|
||||
|
||||
func RefCommits(ctx *context.Context) {
|
||||
switch {
|
||||
case len(ctx.Repo.TreeName) == 0:
|
||||
case len(ctx.Repo.TreePath) == 0:
|
||||
Commits(ctx)
|
||||
case ctx.Repo.TreeName == "search":
|
||||
case ctx.Repo.TreePath == "search":
|
||||
SearchCommits(ctx)
|
||||
default:
|
||||
FileHistory(ctx)
|
||||
@@ -104,7 +104,7 @@ func SearchCommits(ctx *context.Context) {
|
||||
func FileHistory(ctx *context.Context) {
|
||||
ctx.Data["IsRepoToolbarCommits"] = true
|
||||
|
||||
fileName := ctx.Repo.TreeName
|
||||
fileName := ctx.Repo.TreePath
|
||||
if len(fileName) == 0 {
|
||||
Commits(ctx)
|
||||
return
|
||||
|
||||
@@ -25,7 +25,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error {
|
||||
if !isTextFile {
|
||||
_, isImageFile := base.IsImageFile(buf)
|
||||
if !isImageFile {
|
||||
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename=\""+path.Base(ctx.Repo.TreeName)+"\"")
|
||||
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename=\""+path.Base(ctx.Repo.TreePath)+"\"")
|
||||
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
|
||||
}
|
||||
} else if !ctx.QueryBool("render") {
|
||||
@@ -42,11 +42,11 @@ func ServeBlob(ctx *context.Context, blob *git.Blob) error {
|
||||
return err
|
||||
}
|
||||
|
||||
return ServeData(ctx, ctx.Repo.TreeName, dataRc)
|
||||
return ServeData(ctx, ctx.Repo.TreePath, dataRc)
|
||||
}
|
||||
|
||||
func SingleDownload(ctx *context.Context) {
|
||||
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreeName)
|
||||
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath)
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
ctx.Handle(404, "GetBlobByPath", nil)
|
||||
|
||||
+35
-37
@@ -32,15 +32,14 @@ func editFile(ctx *context.Context, isNewFile bool) {
|
||||
ctx.Data["RequireSimpleMDE"] = true
|
||||
|
||||
branchLink := ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchName
|
||||
treeName := ctx.Repo.TreeName
|
||||
|
||||
var treeNames []string
|
||||
if len(treeName) > 0 {
|
||||
treeNames = strings.Split(treeName, "/")
|
||||
if len(ctx.Repo.TreePath) > 0 {
|
||||
treeNames = strings.Split(ctx.Repo.TreePath, "/")
|
||||
}
|
||||
|
||||
if !isNewFile {
|
||||
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(treeName)
|
||||
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(ctx.Repo.TreePath)
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
ctx.Handle(404, "GetTreeEntryByPath", err)
|
||||
@@ -83,7 +82,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
|
||||
buf = append(buf, d...)
|
||||
if err, content := template.ToUTF8WithErr(buf); err != nil {
|
||||
if err != nil {
|
||||
log.Error(4, "Convert content encoding: %s", err)
|
||||
log.Error(4, "ToUTF8WithErr: %v", err)
|
||||
}
|
||||
ctx.Data["FileContent"] = string(buf)
|
||||
} else {
|
||||
@@ -93,7 +92,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
|
||||
treeNames = append(treeNames, "") // Append empty string to allow user name the new file.
|
||||
}
|
||||
|
||||
ctx.Data["TreeName"] = treeName
|
||||
ctx.Data["TreePath"] = ctx.Repo.TreePath
|
||||
ctx.Data["TreeNames"] = treeNames
|
||||
ctx.Data["BranchLink"] = branchLink
|
||||
ctx.Data["commit_summary"] = ""
|
||||
@@ -125,7 +124,7 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
oldBranchName := ctx.Repo.BranchName
|
||||
branchName := oldBranchName
|
||||
branchLink := ctx.Repo.RepoLink + "/src/" + branchName
|
||||
oldTreeName := ctx.Repo.TreeName
|
||||
oldTreePath := ctx.Repo.TreePath
|
||||
content := form.Content
|
||||
commitChoice := form.CommitChoice
|
||||
lastCommit := form.LastCommit
|
||||
@@ -135,16 +134,14 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
branchName = form.NewBranchName
|
||||
}
|
||||
|
||||
treeName := form.TreeName
|
||||
treeName = strings.Trim(treeName, " ")
|
||||
treeName = strings.Trim(treeName, "/")
|
||||
form.TreePath = strings.Trim(form.TreePath, " /")
|
||||
|
||||
var treeNames []string
|
||||
if len(treeName) > 0 {
|
||||
treeNames = strings.Split(treeName, "/")
|
||||
if len(form.TreePath) > 0 {
|
||||
treeNames = strings.Split(form.TreePath, "/")
|
||||
}
|
||||
|
||||
ctx.Data["TreeName"] = treeName
|
||||
ctx.Data["TreePath"] = form.TreePath
|
||||
ctx.Data["TreeNames"] = treeNames
|
||||
ctx.Data["BranchLink"] = branchLink
|
||||
ctx.Data["FileContent"] = content
|
||||
@@ -162,24 +159,24 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
return
|
||||
}
|
||||
|
||||
if len(treeName) == 0 {
|
||||
ctx.Data["Err_Filename"] = true
|
||||
if len(form.TreePath) == 0 {
|
||||
ctx.Data["Err_TreePath"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.filename_cannot_be_empty"), EDIT, &form)
|
||||
return
|
||||
}
|
||||
|
||||
if oldBranchName != branchName {
|
||||
if _, err := ctx.Repo.Repository.GetBranch(branchName); err == nil {
|
||||
ctx.Data["Err_Branchname"] = true
|
||||
ctx.Data["Err_NewBranchName"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.branch_already_exists", branchName), EDIT, &form)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var treepath string
|
||||
var newTreePath string
|
||||
for index, part := range treeNames {
|
||||
treepath = path.Join(treepath, part)
|
||||
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(treepath)
|
||||
newTreePath = path.Join(newTreePath, part)
|
||||
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(newTreePath)
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
// Means there is no item with that name, so we're good
|
||||
@@ -191,13 +188,13 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
}
|
||||
if index != len(treeNames)-1 {
|
||||
if !entry.IsDir() {
|
||||
ctx.Data["Err_Filename"] = true
|
||||
ctx.Data["Err_TreePath"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.directory_is_a_file", part), EDIT, &form)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if entry.IsDir() {
|
||||
ctx.Data["Err_Filename"] = true
|
||||
ctx.Data["Err_TreePath"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.filename_is_a_directory", part), EDIT, &form)
|
||||
return
|
||||
}
|
||||
@@ -205,11 +202,11 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
}
|
||||
|
||||
if !isNewFile {
|
||||
_, err := ctx.Repo.Commit.GetTreeEntryByPath(oldTreeName)
|
||||
_, err := ctx.Repo.Commit.GetTreeEntryByPath(oldTreePath)
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
ctx.Data["Err_Filename"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.file_editing_no_longer_exists", oldTreeName), EDIT, &form)
|
||||
ctx.Data["Err_TreePath"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.file_editing_no_longer_exists", oldTreePath), EDIT, &form)
|
||||
} else {
|
||||
ctx.Handle(500, "GetTreeEntryByPath", err)
|
||||
}
|
||||
@@ -223,7 +220,7 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
if file == treeName {
|
||||
if file == form.TreePath {
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.file_changed_while_editing", ctx.Repo.RepoLink+"/compare/"+lastCommit+"..."+ctx.Repo.CommitID), EDIT, &form)
|
||||
return
|
||||
}
|
||||
@@ -231,9 +228,9 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
}
|
||||
}
|
||||
|
||||
if oldTreeName != treeName {
|
||||
if oldTreePath != form.TreePath {
|
||||
// We have a new filename (rename or completely new file) so we need to make sure it doesn't already exist, can't clobber.
|
||||
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(treeName)
|
||||
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(form.TreePath)
|
||||
if err != nil {
|
||||
if !git.IsErrNotExist(err) {
|
||||
ctx.Handle(500, "GetTreeEntryByPath", err)
|
||||
@@ -241,8 +238,8 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
}
|
||||
}
|
||||
if entry != nil {
|
||||
ctx.Data["Err_Filename"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.file_already_exists", treeName), EDIT, &form)
|
||||
ctx.Data["Err_TreePath"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.file_already_exists", form.TreePath), EDIT, &form)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -252,9 +249,9 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
message = strings.TrimSpace(form.CommitSummary)
|
||||
} else {
|
||||
if isNewFile {
|
||||
message = ctx.Tr("repo.editor.add", treeName)
|
||||
message = ctx.Tr("repo.editor.add", form.TreePath)
|
||||
} else {
|
||||
message = ctx.Tr("repo.editor.update", treeName)
|
||||
message = ctx.Tr("repo.editor.update", form.TreePath)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,18 +264,18 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
||||
LastCommitID: lastCommit,
|
||||
OldBranch: oldBranchName,
|
||||
NewBranch: branchName,
|
||||
OldTreeName: oldTreeName,
|
||||
NewTreeName: treeName,
|
||||
OldTreeName: oldTreePath,
|
||||
NewTreeName: form.TreePath,
|
||||
Message: message,
|
||||
Content: content,
|
||||
IsNewFile: isNewFile,
|
||||
}); err != nil {
|
||||
ctx.Data["Err_Filename"] = true
|
||||
ctx.Data["Err_TreePath"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.failed_to_update_file", err), EDIT, &form)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/src/" + branchName + "/" + treeName)
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/src/" + branchName + "/" + form.TreePath)
|
||||
}
|
||||
|
||||
func EditFilePost(ctx *context.Context, form auth.EditRepoFileForm) {
|
||||
@@ -290,7 +287,7 @@ func NewFilePost(ctx *context.Context, form auth.EditRepoFileForm) {
|
||||
}
|
||||
|
||||
func DiffPreviewPost(ctx *context.Context, form auth.EditPreviewDiffForm) {
|
||||
treeName := ctx.Repo.TreeName
|
||||
treeName := ctx.Repo.TreePath
|
||||
content := form.Content
|
||||
|
||||
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(treeName)
|
||||
@@ -325,7 +322,7 @@ func DiffPreviewPost(ctx *context.Context, form auth.EditPreviewDiffForm) {
|
||||
|
||||
func DeleteFilePost(ctx *context.Context, form auth.DeleteRepoFileForm) {
|
||||
branchName := ctx.Repo.BranchName
|
||||
treeName := ctx.Repo.TreeName
|
||||
treeName := ctx.Repo.TreePath
|
||||
|
||||
if ctx.HasError() {
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/src/" + branchName + "/" + treeName)
|
||||
@@ -342,5 +339,6 @@ func DeleteFilePost(ctx *context.Context, form auth.DeleteRepoFileForm) {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Flash.Success(ctx.Tr("repo.editor.file_delete_success", treeName))
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/src/" + branchName)
|
||||
}
|
||||
+4
-10
@@ -331,6 +331,8 @@ func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleFiles
|
||||
func NewIssue(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.issues.new")
|
||||
ctx.Data["PageIsIssueList"] = true
|
||||
ctx.Data["RequireHighlightJS"] = true
|
||||
ctx.Data["RequireSimpleMDE"] = true
|
||||
setTemplateIfExists(ctx, ISSUE_TEMPLATE_KEY, IssueTemplateCandidates)
|
||||
renderAttachmentSettings(ctx)
|
||||
|
||||
@@ -339,10 +341,6 @@ func NewIssue(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["RequireHighlightJS"] = true
|
||||
ctx.Data["RequireSimpleMDE"] = true
|
||||
ctx.Data["RepoName"] = ctx.Repo.Repository.Name
|
||||
|
||||
ctx.HTML(200, ISSUE_NEW)
|
||||
}
|
||||
|
||||
@@ -403,7 +401,6 @@ func ValidateRepoMetas(ctx *context.Context, form auth.CreateIssueForm) ([]int64
|
||||
func NewIssuePost(ctx *context.Context, form auth.CreateIssueForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.issues.new")
|
||||
ctx.Data["PageIsIssueList"] = true
|
||||
ctx.Data["RepoName"] = ctx.Repo.Repository.Name
|
||||
ctx.Data["RequireHighlightJS"] = true
|
||||
ctx.Data["RequireSimpleMDE"] = true
|
||||
renderAttachmentSettings(ctx)
|
||||
@@ -493,6 +490,8 @@ func UploadIssueAttachment(ctx *context.Context) {
|
||||
}
|
||||
|
||||
func ViewIssue(ctx *context.Context) {
|
||||
ctx.Data["RequireHighlightJS"] = true
|
||||
ctx.Data["RequireSimpleMDE"] = true
|
||||
ctx.Data["RequireDropzone"] = true
|
||||
renderAttachmentSettings(ctx)
|
||||
|
||||
@@ -637,11 +636,6 @@ func ViewIssue(ctx *context.Context) {
|
||||
ctx.Data["Issue"] = issue
|
||||
ctx.Data["IsIssueOwner"] = ctx.Repo.IsWriter() || (ctx.IsSigned && issue.IsPoster(ctx.User.ID))
|
||||
ctx.Data["SignInLink"] = setting.AppSubUrl + "/user/login?redirect_to=" + ctx.Data["Link"].(string)
|
||||
|
||||
ctx.Data["RequireHighlightJS"] = true
|
||||
ctx.Data["RequireSimpleMDE"] = true
|
||||
ctx.Data["RepoName"] = ctx.Repo.Repository.Name
|
||||
|
||||
ctx.HTML(200, ISSUE_VIEW)
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ func UploadFile(ctx *context.Context) {
|
||||
repoName := ctx.Repo.Repository.Name
|
||||
branchName := ctx.Repo.BranchName
|
||||
branchLink := ctx.Repo.RepoLink + "/src/" + branchName
|
||||
treeName := ctx.Repo.TreeName
|
||||
treeName := ctx.Repo.TreePath
|
||||
|
||||
treeNames := []string{""}
|
||||
if len(treeName) > 0 {
|
||||
|
||||
@@ -56,7 +56,7 @@ func Home(ctx *context.Context) {
|
||||
uploadFileLink := ctx.Repo.RepoLink + "/upload/" + branchName
|
||||
|
||||
// Get tree path
|
||||
treename := ctx.Repo.TreeName
|
||||
treename := ctx.Repo.TreePath
|
||||
|
||||
if len(treename) > 0 {
|
||||
if treename[len(treename)-1] == '/' {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
0.9.84.0824
|
||||
0.9.85.0824
|
||||
@@ -8,7 +8,7 @@
|
||||
<input type="hidden" name="last_commit" value="{{.last_commit}}">
|
||||
<div class="ui secondary menu">
|
||||
<div class="fitted item treepath">
|
||||
<div class="ui breadcrumb field {{if .Err_Filename}}error{{end}}">
|
||||
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
|
||||
<a class="section" href="{{EscapePound $.BranchLink}}">{{.Repository.Name}}</a>
|
||||
{{ $n := len .TreeNames}}
|
||||
{{ $l := Subtract $n 1}}
|
||||
@@ -22,8 +22,8 @@
|
||||
{{end}}
|
||||
{{end}}
|
||||
<!-- <button class="clipboard-tree-name octicon octicon-clippy poping up" type="button" data-content="{{.i18n.Tr "repo.copy_file_path_to_clipboard"}}" data-position="bottom center" data-variation="tiny inverted"></button> -->
|
||||
<span class="repo-edit-file-cancel">{{.i18n.Tr "repo.or"}} <a href="{{EscapePound $.BranchLink}}{{if not .IsNewFile}}/{{EscapePound $.TreeName}}{{end}}">{{.i18n.Tr "repo.cancel_lower"}}</a></span>
|
||||
<input type="hidden" id="tree-name" name="tree_name" value="{{.TreeName}}" required>
|
||||
<span class="repo-edit-file-cancel">{{.i18n.Tr "repo.or"}} <a href="{{EscapePound $.BranchLink}}{{if not .IsNewFile}}/{{EscapePound .TreePath}}{{end}}">{{.i18n.Tr "repo.cancel_lower"}}</a></span>
|
||||
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,11 +32,11 @@
|
||||
<a class="active item" data-tab="write"><i class="octicon octicon-code"></i> {{if .IsNewFile}}{{.i18n.Tr "repo.new_file"}}{{else}}{{.i18n.Tr "repo.edit_file"}}{{end}}</a>
|
||||
{{if not .IsNewFile}}
|
||||
<a class="item" data-tab="preview" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}" data-preview-file-modes="{{.PreviewableFileModes}}"><i class="octicon octicon-eye"></i> {{.i18n.Tr "repo.release.preview"}}</a>
|
||||
<a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName}}/{{.TreeName}}" data-context="{{.BranchLink}}"><i class="octicon octicon-diff"></i> {{.i18n.Tr "repo.preview_changes"}}</a>
|
||||
<a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName}}/{{.TreePath}}" data-context="{{.BranchLink}}"><i class="octicon octicon-diff"></i> {{.i18n.Tr "repo.preview_changes"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="ui bottom attached active tab segment" data-tab="write">
|
||||
<textarea id="edit_area" name="content" data-id="repo-{{.Repository.Name}}-{{.TreeName}}"
|
||||
<textarea id="edit_area" name="content" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
|
||||
data-url="{{AppSubUrl}}/api/v1/markdown"
|
||||
data-context="{{.RepoLink}}"
|
||||
data-markdown-file-exts="{{.MarkdownFileExts}}"
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="commit-form">
|
||||
<h3>{{.i18n.Tr "repo.commit_changes"}}</h3>
|
||||
<div class="field">
|
||||
<input name="commit_summary" placeholder="{{if .IsNewFile}}{{.i18n.Tr "repo.add"}} '{{.TreeName}}/<filename>'{{else}}{{.i18n.Tr "repo.update"}} '{{.TreeName}}'{{end}}" value="{{.commit_summary}}">
|
||||
<input name="commit_summary" placeholder="{{if .IsNewFile}}{{.i18n.Tr "repo.add"}} '{{.TreePath}}/<filename>'{{else}}{{.i18n.Tr "repo.update"}} '{{.TreePath}}'{{end}}" value="{{.commit_summary}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<textarea name="commit_message" placeholder="{{.i18n.Tr "repo.default_commit_message"}}" rows="5">{{.commit_message}}</textarea>
|
||||
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}hide{{end}}">
|
||||
<div class="new-branch-name-input{{if .Err_Branchname}} error{{end}}">
|
||||
<div class="new-branch-name-input{{if .Err_NewBranchName}} error{{end}}">
|
||||
<i class="octicon octicon-git-branch" height="16" width="10"></i>
|
||||
<input type="text" name="new_branch_name" value="{{.new_branch_name}}" class="form-control input-contrast mr-2 js-quick-pull-new-branch-name" placeholder="New branch name…">
|
||||
<span class="text-muted js-quick-pull-normalization-info"></span>
|
||||
@@ -91,7 +91,7 @@
|
||||
<button type="submit" class="ui green button">
|
||||
{{.i18n.Tr "repo.commit_changes"}}
|
||||
</button>
|
||||
<a class="ui button red" href="{{EscapePound $.BranchLink}}/{{EscapePound $.TreeName}}">{{.i18n.Tr "repo.cancel"}}</a>
|
||||
<a class="ui button red" href="{{EscapePound $.BranchLink}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<div class="repository file list">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<p id="repo-desc">
|
||||
{{if .Repository.DescriptionHtml}}<span class="description has-emoji">{{.Repository.DescriptionHtml}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
|
||||
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
|
||||
|
||||
Reference in new issue
Block a user