|
|
@ -50,6 +50,7 @@ func Home(ctx *context.Context) { |
|
|
|
treeLink := branchLink |
|
|
|
treeLink := branchLink |
|
|
|
rawLink := ctx.Repo.RepoLink + "/raw/" + branchName |
|
|
|
rawLink := ctx.Repo.RepoLink + "/raw/" + branchName |
|
|
|
editLink := ctx.Repo.RepoLink + "/edit/" + branchName |
|
|
|
editLink := ctx.Repo.RepoLink + "/edit/" + branchName |
|
|
|
|
|
|
|
deleteLink := ctx.Repo.RepoLink + "/delete/" + branchName |
|
|
|
forkLink := setting.AppSubUrl + "/repo/fork/" + strconv.FormatInt(ctx.Repo.Repository.ID, 10) |
|
|
|
forkLink := setting.AppSubUrl + "/repo/fork/" + strconv.FormatInt(ctx.Repo.Repository.ID, 10) |
|
|
|
newFileLink := ctx.Repo.RepoLink + "/new/" + branchName |
|
|
|
newFileLink := ctx.Repo.RepoLink + "/new/" + branchName |
|
|
|
uploadFileLink := ctx.Repo.RepoLink + "/upload/" + branchName |
|
|
|
uploadFileLink := ctx.Repo.RepoLink + "/upload/" + branchName |
|
|
@ -150,7 +151,16 @@ func Home(ctx *context.Context) { |
|
|
|
default: |
|
|
|
default: |
|
|
|
ctx.Data["FileEditLinkTooltip"] = ctx.Tr("repo.cannot_edit_binary_files") |
|
|
|
ctx.Data["FileEditLinkTooltip"] = ctx.Tr("repo.cannot_edit_binary_files") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ctx.Repo.IsWriter() && ctx.Repo.IsViewBranch { |
|
|
|
|
|
|
|
ctx.Data["FileDeleteLink"] = deleteLink + "/" + treename |
|
|
|
|
|
|
|
ctx.Data["FileDeleteLinkTooltip"] = ctx.Tr("repo.delete_this_file") |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if ! ctx.Repo.IsViewBranch { |
|
|
|
|
|
|
|
ctx.Data["FileDeleteLinkTooltip"] = ctx.Tr("repo.must_be_on_branch") |
|
|
|
|
|
|
|
} else if ! ctx.Repo.IsWriter() { |
|
|
|
|
|
|
|
ctx.Data["FileDeleteLinkTooltip"] = ctx.Tr("repo.must_be_writer") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Directory and file list.
|
|
|
|
// Directory and file list.
|
|
|
|