mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Show git-notes (#6984)
* Show git-notes
* Make git-notes heading text localizable
* Refactor git-notes data fetching to a separate function
* Display the author and time of git notes
* Move note bubble inside the commit bubble
* Revert "Move note bubble inside the commit bubble"
This reverts commit c0951fe0e3.
* Add test for git-notes
* testing ui
* Polish CSS
* Apply suggestions from code review
Co-Authored-By: Lauris BH <lauris@nix.lv>
			
			
This commit is contained in:
		
				
					committed by
					
						 Lauris BH
						Lauris BH
					
				
			
			
				
	
			
			
			
						parent
						
							d5a98a2969
						
					
				
				
					commit
					a98e085031
				
			| @@ -15,6 +15,7 @@ import ( | ||||
| 	"code.gitea.io/gitea/modules/git" | ||||
| 	"code.gitea.io/gitea/modules/log" | ||||
| 	"code.gitea.io/gitea/modules/setting" | ||||
| 	"code.gitea.io/gitea/modules/templates" | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| @@ -246,6 +247,15 @@ func Diff(ctx *context.Context) { | ||||
| 	ctx.Data["Parents"] = parents | ||||
| 	ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 | ||||
| 	ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", "commit", commitID) | ||||
|  | ||||
| 	note := &git.Note{} | ||||
| 	err = git.GetNote(ctx.Repo.GitRepo, commitID, note) | ||||
| 	if err == nil { | ||||
| 		ctx.Data["Note"] = string(templates.ToUTF8WithFallback(note.Message)) | ||||
| 		ctx.Data["NoteCommit"] = note.Commit | ||||
| 		ctx.Data["NoteAuthor"] = models.ValidateCommitWithEmail(note.Commit) | ||||
| 	} | ||||
|  | ||||
| 	if commit.ParentCount() > 0 { | ||||
| 		ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", "commit", parents[0]) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user