mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Code comments improvements (#15722)
- Right-align the Reply and Resolve buttons - Center Resolved text and add some padding - Add padding to inline comments - Indent the comment content to align with author name - Re-parent form to allow better button layout space. Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
		@@ -1,9 +1,4 @@
 | 
			
		||||
{{if and $.root.SignedUserID (not $.Repository.IsArchived)}}
 | 
			
		||||
	{{if $.hidden}}
 | 
			
		||||
		<button class="comment-form-reply ui green labeled icon tiny button">
 | 
			
		||||
			{{svg "octicon-reply" 16 "reply icon mr-2"}}{{$.root.i18n.Tr "repo.diff.comment.reply"}}
 | 
			
		||||
		</button>
 | 
			
		||||
	{{end}}
 | 
			
		||||
	<form class="ui form {{if $.hidden}}hide comment-form comment-form-reply{{end}}" action="{{$.root.Issue.HTMLURL}}/files/reviews/comments" method="post">
 | 
			
		||||
	{{$.root.CsrfTokenHtml}}
 | 
			
		||||
		<input type="hidden" name="origin" value="{{if $.root.PageIsPullFiles}}diff{{else}}timeline{{end}}">
 | 
			
		||||
@@ -26,7 +21,7 @@
 | 
			
		||||
			{{.i18n.Tr "loading"}}
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="field footer">
 | 
			
		||||
		<div class="field footer mx-3">
 | 
			
		||||
			<span class="markup-info">{{svg "octicon-markup"}} {{$.root.i18n.Tr "repo.diff.comment.markup_info"}}</span>
 | 
			
		||||
			<div class="ui right">
 | 
			
		||||
				{{if $.reply}}
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@
 | 
			
		||||
	{{if $resolved}}
 | 
			
		||||
		<div class="ui attached header resolved-placeholder df ac sb">
 | 
			
		||||
			<div class="ui grey text">
 | 
			
		||||
				{{svg "octicon-check" 16 "icon mr-2"}}
 | 
			
		||||
				<b>{{$resolveDoer.Name}}</b> {{$.i18n.Tr "repo.issues.review.resolved_by"}}
 | 
			
		||||
			</div>
 | 
			
		||||
			<div>
 | 
			
		||||
@@ -25,15 +26,22 @@
 | 
			
		||||
				{{template "repo/diff/comments" dict "root" $ "comments" .comments}}
 | 
			
		||||
			</ui>
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="df je ac fw mt-3">
 | 
			
		||||
			{{if and $.CanMarkConversation $isNotPending}}
 | 
			
		||||
				<button class="ui icon tiny basic button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
 | 
			
		||||
					{{if $resolved}}
 | 
			
		||||
						{{$.i18n.Tr "repo.issues.review.un_resolve_conversation"}}
 | 
			
		||||
					{{else}}
 | 
			
		||||
						{{$.i18n.Tr "repo.issues.review.resolve_conversation"}}
 | 
			
		||||
					{{end}}
 | 
			
		||||
				</button>
 | 
			
		||||
			{{end}}
 | 
			
		||||
			{{if and $.SignedUserID (not $.Repository.IsArchived)}}
 | 
			
		||||
				<button class="comment-form-reply ui green tiny labeled icon button ml-2 mr-0">
 | 
			
		||||
					{{svg "octicon-reply" 16 "reply icon mr-2"}}{{$.i18n.Tr "repo.diff.comment.reply"}}
 | 
			
		||||
				</button>
 | 
			
		||||
			{{end}}
 | 
			
		||||
		</div>
 | 
			
		||||
		{{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index .comments 0).ReviewID "root" $ "comment" (index .comments 0)}}
 | 
			
		||||
		{{if and $.CanMarkConversation $isNotPending}}
 | 
			
		||||
			<button class="ui icon tiny button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" >
 | 
			
		||||
				{{if $resolved}}
 | 
			
		||||
					{{$.i18n.Tr "repo.issues.review.un_resolve_conversation"}}
 | 
			
		||||
				{{else}}
 | 
			
		||||
					{{$.i18n.Tr "repo.issues.review.resolve_conversation"}}
 | 
			
		||||
				{{end}}
 | 
			
		||||
			</button>
 | 
			
		||||
		{{end}}
 | 
			
		||||
	</div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user