mirror of
https://github.com/go-gitea/gitea
synced 2025-01-03 11:15:58 +01:00
Add support for single comments
Showing buttons in context Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
parent
3e5f3c349e
commit
61cc13499a
@ -363,7 +363,7 @@ type CodeCommentForm struct {
|
||||
Line int64
|
||||
TreePath string `form:"path" binding:"Required"`
|
||||
CommitSHA string `form:"commit_id" binding:"Required"`
|
||||
IsReview bool `form:"is_review" binding:"Required"`
|
||||
IsReview bool `form:"is_review"`
|
||||
}
|
||||
|
||||
// Validate validates the fields
|
||||
|
@ -477,7 +477,11 @@ func ViewPullFiles(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
ctx.Data["CodeComments"] = pathToLineToComment
|
||||
|
||||
ctx.Data["CurrentReview"], err = models.GetCurrentReview(ctx.User, issue)
|
||||
if err != nil && !models.IsErrReviewNotExist(err) {
|
||||
ctx.ServerError("GetCurrentReview", err)
|
||||
return
|
||||
}
|
||||
ctx.HTML(200, tplPullFiles)
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
<input type="hidden" name="line" value="2">
|
||||
<input type="hidden" name="path" value="README.md">
|
||||
<input type="hidden" name="commit_id" value="e324f1688f063d6fd9268fb8f02149c9eb1a867c">
|
||||
<input type="hidden" name="is_review" value="true">
|
||||
<input type="hidden" name="diff_start_cid">
|
||||
<input type="hidden" name="diff_end_cid">
|
||||
<input type="hidden" name="diff_base_cid">
|
||||
@ -23,10 +22,16 @@
|
||||
<div class="footer">
|
||||
<span class="markdown-info"><i class="octicon octicon-markdown"></i> {{$.i18n.Tr "repo.diff.comment.markdown_info"}}</span>
|
||||
<div class="ui right floated">
|
||||
<div class="ui submit tiny basic button btn-cancel">{{$.i18n.Tr "cancel"}}</div>
|
||||
<div class="ui submit tiny basic button btn-add-single">{{$.i18n.Tr "repo.diff.comment.add_single_comment"}}</div>
|
||||
<button type="submit" class="ui submit green tiny button btn-add-comment">{{$.i18n.Tr "repo.diff.comment.add_review_comment"}}</button>
|
||||
<div class="ui submit green tiny button btn-start-review">{{$.i18n.Tr "repo.diff.comment.start_review"}}</div>
|
||||
{{if $.CurrentReview}}
|
||||
<button name="is_review" value="true" type="submit"
|
||||
class="ui submit green tiny button btn-add-comment">{{$.i18n.Tr "repo.diff.comment.add_review_comment"}}</button>
|
||||
{{else}}
|
||||
<button name="is_review" value="true" type="submit"
|
||||
class="ui submit green tiny button btn-start-review">{{$.i18n.Tr "repo.diff.comment.start_review"}}</button>
|
||||
{{end}}
|
||||
<button type="submit"
|
||||
class="ui submit tiny basic button btn-add-single">{{$.i18n.Tr "repo.diff.comment.add_single_comment"}}</button>
|
||||
<button type="button" class="ui submit tiny basic button btn-cancel">{{$.i18n.Tr "cancel"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user