diff --git a/routers/repo/blame.go b/routers/repo/blame.go
index 00ef9a99e..d353f3b5d 100644
--- a/routers/repo/blame.go
+++ b/routers/repo/blame.go
@@ -118,29 +118,15 @@ func RefBlame(ctx *context.Context) {
ctx.Data["IsBlame"] = true
- if ctx.Repo.CanEnableEditor() {
- // Check LFS Lock
- lfsLock, err := ctx.Repo.Repository.GetTreePathLock(ctx.Repo.TreePath)
- if err != nil {
- ctx.ServerError("GetTreePathLock", err)
- return
- }
- if lfsLock != nil && lfsLock.OwnerID != ctx.User.ID {
- ctx.Data["CanDeleteFile"] = false
- ctx.Data["DeleteFileTooltip"] = ctx.Tr("repo.editor.this_file_locked")
- } else {
- ctx.Data["CanDeleteFile"] = true
- ctx.Data["DeleteFileTooltip"] = ctx.Tr("repo.editor.delete_this_file")
- }
- } else if !ctx.Repo.IsViewBranch {
- ctx.Data["DeleteFileTooltip"] = ctx.Tr("repo.editor.must_be_on_a_branch")
- } else if !ctx.Repo.CanWrite(models.UnitTypeCode) {
- ctx.Data["DeleteFileTooltip"] = ctx.Tr("repo.editor.must_have_write_access")
- }
-
ctx.Data["FileSize"] = blob.Size()
ctx.Data["FileName"] = blob.Name()
+ ctx.Data["NumLines"], err = blob.GetBlobLineCount()
+ if err != nil {
+ ctx.NotFound("GetBlobLineCount", err)
+ return
+ }
+
blameReader, err := git.CreateBlameReader(models.RepoPath(userName, repoName), commitID, fileName)
if err != nil {
ctx.NotFound("CreateBlameReader", err)
@@ -245,9 +231,9 @@ func renderBlame(ctx *context.Context, blameParts []git.BlamePart, commitNames m
//Line number
if len(part.Lines)-1 == index && len(blameParts)-1 != pi {
- lineNumbers.WriteString(fmt.Sprintf(`%d`, i, i))
+ lineNumbers.WriteString(fmt.Sprintf(``, i, i))
} else {
- lineNumbers.WriteString(fmt.Sprintf(`%d`, i, i))
+ lineNumbers.WriteString(fmt.Sprintf(``, i, i))
}
//Code line
diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl
index c2410e8c1..84e3e8c53 100644
--- a/templates/repo/blame.tmpl
+++ b/templates/repo/blame.tmpl
@@ -1,51 +1,37 @@
-
-
-