diff --git a/models/issue.go b/models/issue.go index 41f94c346..615f54686 100644 --- a/models/issue.go +++ b/models/issue.go @@ -940,6 +940,17 @@ func CreateComment(userId, repoId, issueId int64, commitId, line string, cmtType return comment, sess.Commit() } +// UpdateComment update comment +func UpdateComment(comment *Comment) error { + _, err := x.Id(comment.Id).AllCols().Update(comment) + + if err != nil { + return err + } + + return err +} + // GetCommentById returns the comment with the given id func GetCommentById(commentId int64) (*Comment, error) { c := &Comment{Id: commentId} diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css index 9e02a8136..c2c759025 100644 --- a/public/ng/css/gogs.css +++ b/public/ng/css/gogs.css @@ -1696,6 +1696,9 @@ The register and sign-in page style background-color: #FFF8D2 !important; border-color: #F0DB88 !important; } +.diff-file-box .code-diff tbody tr.add-comment td { + padding: 10px; +} .diff-file-box .code-diff tbody tr.add-comment:hover td, .diff-file-box .code-diff tbody tr.comment:hover td, .diff-file-box .code-diff tbody tr.add-comment:hover pre, diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js index c8bded524..3a68a79cd 100644 --- a/public/ng/js/gogs.js +++ b/public/ng/js/gogs.js @@ -240,7 +240,7 @@ var Gogs = {}; function prepareToForm() { $('.add-comment').hide('fast', function(){ $(this).remove(); }); - $('button.answer').show(); + $('button.answer').hide(); } $(document).on('click', '.code-diff .lines-num span', function (e) { @@ -270,38 +270,73 @@ var Gogs = {}; var elem = (commentTr.length > 0) ? commentTr : $(this).parents('tr'); var url = commit[1] + '/commit/comment/' + commit[2]; elem.after( - $('
{{.Poster.Name}} {{TimeSince .Created $.Lang}} - - {{if eq $.Repository.Owner.Id .Poster.Id}} - {{$.i18n.Tr "repo.owner"}} - {{end}} - {{if $.SignedUser}} - {{if eq $.SignedUser.Id .Poster.Id}} - - - {{end}} - {{end}} - + + {{if eq $.Repository.Owner.Id .Poster.Id}} + {{$.i18n.Tr "repo.owner"}} + {{end}} + {{if $.SignedUser}} + {{if eq $.SignedUser.Id .Poster.Id}} + + + {{end}} + {{end}} +