mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-14 01:35:55 +09:00
#1601 support delete issue comment
This commit is contained in:
1 parent
2295fafb34
commit
899e799459
14 files changed
+113
-27
No files matched your search
@@ -24,6 +24,10 @@ govet:
|
||||
go tool vet -composites=false -methods=false -structtags=false .
|
||||
|
||||
build-dev: $(GENERATED) govet
|
||||
go install $(BUILD_FLAGS) -tags '$(TAGS)'
|
||||
cp '$(GOPATH)/bin/gogs' .
|
||||
|
||||
build-dev-race: $(GENERATED) govet
|
||||
go install $(BUILD_FLAGS) -race -tags '$(TAGS)'
|
||||
cp '$(GOPATH)/bin/gogs' .
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Gogs - Go Git Service [
|
||||
|
||||
##### Current tip version: 0.9.54 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
|
||||
##### Current tip version: 0.9.55 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
|
||||
|
||||
| Web | UI | Preview |
|
||||
|:-------------:|:-------:|:-------:|
|
||||
|
||||
+4
-1
@@ -464,7 +464,10 @@ func runWeb(ctx *cli.Context) error {
|
||||
m.Post("/content", repo.UpdateIssueContent)
|
||||
})
|
||||
})
|
||||
m.Post("/comments/:id", repo.UpdateCommentContent)
|
||||
m.Group("/comments/:id", func() {
|
||||
m.Post("", repo.UpdateCommentContent)
|
||||
m.Post("/delete", repo.DeleteComment)
|
||||
})
|
||||
m.Group("/labels", func() {
|
||||
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel)
|
||||
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel)
|
||||
|
||||
@@ -466,7 +466,8 @@ issues.next = Next
|
||||
issues.open_title = Open
|
||||
issues.closed_title = Closed
|
||||
issues.num_comments = %d comments
|
||||
issues.commented_at = `commented <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.commented_at = `commented <a href="#%s">%s</a>`
|
||||
issues.delete_comment_confirm = Are you sure you want to delete this comment?
|
||||
issues.no_content = There is no content yet.
|
||||
issues.close_issue = Close
|
||||
issues.close_comment_issue = Comment and close
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.9.54.0724"
|
||||
const APP_VER = "0.9.55.0726"
|
||||
|
||||
func init() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
|
||||
@@ -345,3 +345,29 @@ func UpdateComment(c *Comment) error {
|
||||
_, err := x.Id(c.ID).AllCols().Update(c)
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCommentByID deletes a comment by given ID.
|
||||
func DeleteCommentByID(id int64) error {
|
||||
comment, err := GetCommentByID(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sess := x.NewSession()
|
||||
defer sessionRelease(sess)
|
||||
if err = sess.Begin(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err = sess.Id(comment.ID).Delete(new(Comment)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if comment.Type == COMMENT_TYPE_COMMENT {
|
||||
if _, err = sess.Exec("UPDATE `issue` SET num_comments = num_comments - 1 WHERE id = ?", comment.IssueID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
}
|
||||
@@ -4346,7 +4346,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\xbd\xeb\x72\xdc\x48\xae\x27\xfe\x9d\x4f\xc1\xf6\x84\xc3\x76\x84\x54\x1d\x3d\x7d\xfe\xff\xdd\xe8\x68\xbb\x57\x96\xda\x97\x73\x2c\x4b\x47\x92\xbb\x77\xb6\xc3\xc1\x66\x15\xa9\x2a\x8e\xab\xc8\x1a\x92\x25\x59\x33\x31\x6f\xb0\x0f\xb0\xcf\xb7\x4f\xb2\xc0\x0f\x40\x5e\x48\x96\x64\xf7\x1c\x7f\xb0\x58\x99\xc8\x1b\x12\x89\x04\x90\x48\x64\xbe\xdd\x66\x45\xd9\x2d\xd2\xe7\xe9\x51\xba\xcd\xab\x7a\x5d\x76\x5d\xda\x95\xeb\xeb\xc3\x55\xd3\xf5\x65\x91\xbe\xae\x7a\xfa\xdd\xde\x54\x8b\x32\x49\x56\xcd\xa6\x24\xd0\x37\xf4\x27\x29\xf2\x6e\x35\x6f\xf2\xb6\xa0\x84\x13\xfb\x4e\xca\xcf\xdb\x75\xd3\x32\xd0\xcf\xf2\x95\xac\xca\xf5\x96\xcb\xd0\x9f\xa4\xab\x96\x75\x56\xd5\xf4\xf3\x92\xbe\xd2\xb7\xb5\xa4\x34\xbb\xde\x92\xce\x76\xbd\xa4\xed\xb6\x96\xf4\x61\x9b\xb4\xe5\xb2\xa2\xde\xb4\x94\x74\xa1\x9f\xc9\x6d\x39\xef\xaa\x9e\x5b\xfa\x55\xbe\x92\x9b\xb2\xed\xaa\x86\x6b\xff\x45\xbe\x92\x6d\xbe\x64\x80\x73\xfa\x93\xf4\xe5\x66\xbb\xce\x51\xe0\x4a\x3f\x93\x75\x5e\x2f\x77\x02\xf3\x4e\x3f\x93\x45\x5b\x52\x56\x56\x97\xb7\x94\x7a\x8c\x1f\xb3\xd9\x2c\xd9\x11\x12\xb2\x6d\xdb\x5c\x57\xeb\x32\xcb\xeb\x22\xdb\xc8\x30\x3f\x50\x7a\xaa\xe9\x29\xa5\xa7\x9c\x8e\x21\x94\x05\x0d\x35\xcb\x3b\x1d\x07\xe1\x92\x46\x9e\x77\x09\xaa\xaa\xf3\x8d\x95\xe6\xcf\xa4\xdc\xe4\xd5\x9a\xb1\xc6\x7f\xa9\xdf\x5d\x77\xdb\x00\xb5\xe7\xfa\x49\x38\xc8\xfa\xbb\x6d\x09\x14\x1c\x5e\xd1\x57\xb2\xc8\xb7\xfd\x62\x95\x73\x37\xe5\x2b\x21\xa0\x6d\x43\xb8\x68\xda\x3b\xc0\xd9\x8f\xa4\x69\x97\x79\x5d\xfd\x3d\xef\x05\x3f\x67\xc1\xcf\x64\x53\xb5\x6d\xc3\xa8\x3d\xc5\x47\x42\x23\xcf\xb8\x1e\x4a\x79\x4f\x48\x08\x6a\xe1\x9c\x4d\xb5\x6c\x05\x8b\x9c\x79\x8a\x5f\x5c\x8b\xe4\x69\x4d\x92\xe5\x6a\xbb\x6e\xda\x4f\x9a\xfa\x8a\x3f\x07\x55\x52\xe7\x34\x37\xee\x57\x5e\xd3\x7c\x68\xee\x29\x7e\x44\x00\x5d\x92\x17\x1b\xc2\xf0\x36\xaf\x4b\x46\xdd\x11\xff\x22\x7c\xd1\xaf\x24\x5f\x2c\x9a\x5d\xdd\x67\x5d\xd9\xf7\x55\xbd\xe4\x39\x38\x92\xa4\xf4\x52\x93\x92\x20\xcf\xa5\xdd\x35\x3b\x37\xcb\x94\xfe\x17\xfa\x99\x9e\xcb\x4f\xc9\x0b\x0a\x21\xd3\x95\xa4\x26\xfb\xea\xa6\xea\xab\x52\x1a\xb3\x1f\xc9\x76\xb7\x5e\x13\x3e\xff\xb6\x2b\xbb\x9e\xb3\xce\xe9\x37\x61\x40\x7e\x27\x55\xd7\xed\x50\xe2\x2d\x3e\x12\x9a\xd4\x7a\x81\xe1\x1c\xe3\x23\x49\x7e\xab\xea\xae\xcf\xd7\xeb\x8f\x89\x7e\x30\xb0\x7c\x09\x9e\xfa\xaa\x47\x67\x35\x31\xbd\xec\xcb\x6d\xc7\x88\x4e\x5f\x55\x6d\xd7\x1f\xf6\x15\x91\xda\xc5\xae\x4e\x8a\x66\xf1\x89\x88\x98\x17\x24\x96\xd2\xdb\xeb\x94\xc6\xf4\x84\xc8\xb8\xdd\xd5\x35\x8d\x22\x7d\xdd\xd0\xc8\xa8\x99\xaa\x28\xd3\x13\x40\x1f\xa4\xdb\x75\x99\x77\x04\x52\xe6\x45\xfa\x63\x9e\xf6\x79\xbb\x2c\xfb\xe7\x8f\xb2\x39\x2d\x9e\x4f\x8f\xd2\x55\x5b\x5e\x3f\x7f\xf4\xb8\x7b\xf4\xe2\xf5\x8e\x8a\xad\xab\xba\xec\x7e\xfc\x36\x7f\x91\x2e\x72\xca\xa1\xb1\xde\xa5\xf3\xf2\x9a\xd7\x0a\xb5\x95\x12\x91\xd6\x4b\x5e\x27\x77\xfd\x8a\x1b\xa4\x09\xa3\x8f\x2e\xe5\x85\xfa\x4d\xc2\x58\xa2\x85\x9c\x15\x73\x63\x4a\xe8\x10\x92\x5b\xc2\xd2\xe9\xdd\xe5\x7f\xbe\x3b\x48\xcf\x89\x33\x2d\xdb\x12\xdf\xf4\x1f\x95\xf8\x3e\xa5\xd1\x5e\x55\x27\x2f\x67\x09\x95\x35\x84\x9c\xe4\x7d\x3e\xe7\xbe\xbb\x49\xe2\x4c\x59\x43\x2e\x0f\x2b\x89\x79\x1d\xf8\x5a\xd7\x63\x75\xea\xca\x9c\x5c\x87\x54\x87\x2e\x5e\x57\xc7\x7b\x5e\xc1\x94\xee\x30\x7b\x2e\x38\xa3\xaa\xd2\xb7\xef\xdf\x9f\x9d\xbc\x4c\xcb\x7a\x49\x98\x49\x6f\xab\x7e\x95\xee\xfa\xeb\xff\x9e\x2d\xcb\xba\x6c\xf3\x75\xb6\xa8\x18\x29\x2d\xd1\x55\x4a\x58\x92\x21\xce\x92\xae\x5b\x13\x83\x29\xb8\x95\xcb\xcb\x77\xe9\x29\x7d\x52\x67\xa8\x2c\x77\xa4\x5f\x25\xdd\xdf\xd6\x8c\x28\xd7\xe0\xd5\xaa\x4c\x41\xb3\x00\x6a\xae\x87\x78\x49\x0b\xed\xeb\x2c\xfd\x71\xde\xbe\x08\xfa\x97\xcf\xbb\x66\xbd\xeb\xb5\xe4\xed\xaa\xac\x31\x51\x44\x4a\x6d\x4f\xdc\xca\x78\xff\x2c\x29\xdb\x36\x23\xbe\xd9\xdf\xf1\xf4\x68\x5f\xf6\xb5\x22\x95\x11\x29\xd7\x4d\x4f\xd3\x9f\xa2\x9c\x54\x51\xd5\x37\xf9\xba\x2a\x68\x92\x3c\x22\xe3\xb2\x48\x2c\x1a\x9a\x6f\x2e\x4d\x14\xdd\xdc\x02\x45\xb4\xc0\x88\xad\xa7\x8f\x66\x8f\xc0\x67\x1f\x1d\x3e\x9a\x25\x75\x93\x09\x13\x60\x8e\x5c\x54\x5d\x3e\x27\xee\x2c\xbb\x45\x6b\xcc\xee\x2f\x4c\x77\xd2\x15\x85\x48\x23\x08\x9e\x13\xde\x81\xc0\xf8\x99\x28\x73\x62\xd3\xe0\x25\xca\x45\xc2\xb1\x1b\xcb\x71\x74\x21\x5c\xc7\x25\x8c\xc6\x9c\xd8\x44\x1b\x55\x1e\x6d\xb7\xeb\x6a\x21\x4d\xbf\x96\x3c\x4f\xa0\xbc\x1f\x2b\x52\x42\x38\x10\x98\xe5\x05\x64\x46\xbd\x66\xae\x94\x46\xec\x1d\xe5\x57\x25\xad\xb8\xd5\x6e\x29\x7b\xd2\xba\xd9\x15\xdf\x60\x73\xb0\x99\xf3\x2c\x38\xbd\x68\xa8\xc3\xa0\x2a\x07\xe0\x9b\x38\x22\x86\xc2\x22\x40\x5b\x6e\x9a\x9e\x11\xa7\xc5\x98\xcd\xdd\x56\x94\x49\x23\xed\xf2\x1b\xda\xdc\xfa\x46\x96\x72\x41\x4b\x75\xc1\x15\xcf\x12\x62\x2b\x99\x2e\x27\xe2\x3f\xb2\xa4\x2c\x2d\xa6\x5d\x40\x6d\x76\xb4\x0a\x57\x54\x19\x23\x9e\xe5\x10\xaa\x72\xaa\x9f\x18\x12\xd5\x03\xee\x40\x2b\xbe\xa1\x3d\x93\x27\xfa\x04\x1f\xfa\x3b\xac\x9f\x7a\x95\x5f\x5f\x53\xaf\x3a\x5a\x4d\x6f\xd2\xc5\xba\xa1\xa5\xf8\xe1\xe2\x5d\xc7\x0b\x6d\x95\x6d\x9b\x16\xf2\x07\x65\x9d\xd3\xa7\x4b\x0b\x10\xcd\x10\xf5\x6e\x33\xa7\x5f\xb7\xab\x6a\xb1\x12\xb4\x73\x09\x5e\x1f\x94\x4a\x4d\xec\x3a\x9a\xc2\x83\x94\x96\x16\x8d\x80\x5Line truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\xbd\xeb\x72\xdc\x48\xae\x27\xfe\x9d\x4f\xc1\xf6\x84\xc3\x76\x84\x54\x1d\x3d\x7d\xfe\xff\xdd\xe8\x68\xbb\x57\x96\xda\x97\x73\x2c\x4b\x47\x92\xbb\x77\xb6\xc3\xc1\x66\x15\xa9\x2a\x8e\xab\xc8\x1a\x92\x25\x59\x33\x31\x6f\xb0\x0f\xb0\xcf\xb7\x4f\xb2\xc0\x0f\x40\x5e\x48\x96\x64\xf7\x1c\x7f\xb0\x58\x99\xc8\x1b\x12\x89\x04\x90\x48\x64\xbe\xdd\x66\x45\xd9\x2d\xd2\xe7\xe9\x51\xba\xcd\xab\x7a\x5d\x76\x5d\xda\x95\xeb\xeb\xc3\x55\xd3\xf5\x65\x91\xbe\xae\x7a\xfa\xdd\xde\x54\x8b\x32\x49\x56\xcd\xa6\x24\xd0\x37\xf4\x27\x29\xf2\x6e\x35\x6f\xf2\xb6\xa0\x84\x13\xfb\x4e\xca\xcf\xdb\x75\xd3\x32\xd0\xcf\xf2\x95\xac\xca\xf5\x96\xcb\xd0\x9f\xa4\xab\x96\x75\x56\xd5\xf4\xf3\x92\xbe\xd2\xb7\xb5\xa4\x34\xbb\xde\x92\xce\x76\xbd\xa4\xed\xb6\x96\xf4\x61\x9b\xb4\xe5\xb2\xa2\xde\xb4\x94\x74\xa1\x9f\xc9\x6d\x39\xef\xaa\x9e\x5b\xfa\x55\xbe\x92\x9b\xb2\xed\xaa\x86\x6b\xff\x45\xbe\x92\x6d\xbe\x64\x80\x73\xfa\x93\xf4\xe5\x66\xbb\xce\x51\xe0\x4a\x3f\x93\x75\x5e\x2f\x77\x02\xf3\x4e\x3f\x93\x45\x5b\x52\x56\x56\x97\xb7\x94\x7a\x8c\x1f\xb3\xd9\x2c\xd9\x11\x12\xb2\x6d\xdb\x5c\x57\xeb\x32\xcb\xeb\x22\xdb\xc8\x30\x3f\x50\x7a\xaa\xe9\x29\xa5\xa7\x9c\x8e\x21\x94\x05\x0d\x35\xcb\x3b\x1d\x07\xe1\x92\x46\x9e\x77\x09\xaa\xaa\xf3\x8d\x95\xe6\xcf\xa4\xdc\xe4\xd5\x9a\xb1\xc6\x7f\xa9\xdf\x5d\x77\xdb\x00\xb5\xe7\xfa\x49\x38\xc8\xfa\xbb\x6d\x09\x14\x1c\x5e\xd1\x57\xb2\xc8\xb7\xfd\x62\x95\x73\x37\xe5\x2b\x21\xa0\x6d\x43\xb8\x68\xda\x3b\xc0\xd9\x8f\xa4\x69\x97\x79\x5d\xfd\x3d\xef\x05\x3f\x67\xc1\xcf\x64\x53\xb5\x6d\xc3\xa8\x3d\xc5\x47\x42\x23\xcf\xb8\x1e\x4a\x79\x4f\x48\x08\x6a\xe1\x9c\x4d\xb5\x6c\x05\x8b\x9c\x79\x8a\x5f\x5c\x8b\xe4\x69\x4d\x92\xe5\x6a\xbb\x6e\xda\x4f\x9a\xfa\x8a\x3f\x07\x55\x52\xe7\x34\x37\xee\x57\x5e\xd3\x7c\x68\xee\x29\x7e\x44\x00\x5d\x92\x17\x1b\xc2\xf0\x36\xaf\x4b\x46\xdd\x11\xff\x22\x7c\xd1\xaf\x24\x5f\x2c\x9a\x5d\xdd\x67\x5d\xd9\xf7\x55\xbd\xe4\x39\x38\x92\xa4\xf4\x52\x93\x92\x20\xcf\xa5\xdd\x35\x3b\x37\xcb\x94\xfe\x17\xfa\x99\x9e\xcb\x4f\xc9\x0b\x0a\x21\xd3\x95\xa4\x26\xfb\xea\xa6\xea\xab\x52\x1a\xb3\x1f\xc9\x76\xb7\x5e\x13\x3e\xff\xb6\x2b\xbb\x9e\xb3\xce\xe9\x37\x61\x40\x7e\x27\x55\xd7\xed\x50\xe2\x2d\x3e\x12\x9a\xd4\x7a\x81\xe1\x1c\xe3\x23\x49\x7e\xab\xea\xae\xcf\xd7\xeb\x8f\x89\x7e\x30\xb0\x7c\x09\x9e\xfa\xaa\x47\x67\x35\x31\xbd\xec\xcb\x6d\xc7\x88\x4e\x5f\x55\x6d\xd7\x1f\xf6\x15\x91\xda\xc5\xae\x4e\x8a\x66\xf1\x89\x88\x98\x17\x24\x96\xd2\xdb\xeb\x94\xc6\xf4\x84\xc8\xb8\xdd\xd5\x35\x8d\x22\x7d\xdd\xd0\xc8\xa8\x99\xaa\x28\xd3\x13\x40\x1f\xa4\xdb\x75\x99\x77\x04\x52\xe6\x45\xfa\x63\x9e\xf6\x79\xbb\x2c\xfb\xe7\x8f\xb2\x39\x2d\x9e\x4f\x8f\xd2\x55\x5b\x5e\x3f\x7f\xf4\xb8\x7b\xf4\xe2\xf5\x8e\x8a\xad\xab\xba\xec\x7e\xfc\x36\x7f\x91\x2e\x72\xca\xa1\xb1\xde\xa5\xf3\xf2\x9a\xd7\x0a\xb5\x95\x12\x91\xd6\x4b\x5e\x27\x77\xfd\x8a\x1b\xa4\x09\xa3\x8f\x2e\xe5\x85\xfa\x4d\xc2\x58\xa2\x85\x9c\x15\x73\x63\x4a\xe8\x10\x92\x5b\xc2\xd2\xe9\xdd\xe5\x7f\xbe\x3b\x48\xcf\x89\x33\x2d\xdb\x12\xdf\xf4\x1f\x95\xf8\x3e\xa5\xd1\x5e\x55\x27\x2f\x67\x09\x95\x35\x84\x9c\xe4\x7d\x3e\xe7\xbe\xbb\x49\xe2\x4c\x59\x43\x2e\x0f\x2b\x89\x79\x1d\xf8\x5a\xd7\x63\x75\xea\xca\x9c\x5c\x87\x54\x87\x2e\x5e\x57\xc7\x7b\x5e\xc1\x94\xee\x30\x7b\x2e\x38\xa3\xaa\xd2\xb7\xef\xdf\x9f\x9d\xbc\x4c\xcb\x7a\x49\x98\x49\x6f\xab\x7e\x95\xee\xfa\xeb\xff\x9e\x2d\xcb\xba\x6c\xf3\x75\xb6\xa8\x18\x29\x2d\xd1\x55\x4a\x58\x92\x21\xce\x92\xae\x5b\x13\x83\x29\xb8\x95\xcb\xcb\x77\xe9\x29\x7d\x52\x67\xa8\x2c\x77\xa4\x5f\x25\xdd\xdf\xd6\x8c\x28\xd7\xe0\xd5\xaa\x4c\x41\xb3\x00\x6a\xae\x87\x78\x49\x0b\xed\xeb\x2c\xfd\x71\xde\xbe\x08\xfa\x97\xcf\xbb\x66\xbd\xeb\xb5\xe4\xed\xaa\xac\x31\x51\x44\x4a\x6d\x4f\xdc\xca\x78\xff\x2c\x29\xdb\x36\x23\xbe\xd9\xdf\xf1\xf4\x68\x5f\xf6\xb5\x22\x95\x11\x29\xd7\x4d\x4f\xd3\x9f\xa2\x9c\x54\x51\xd5\x37\xf9\xba\x2a\x68\x92\x3c\x22\xe3\xb2\x48\x2c\x1a\x9a\x6f\x2e\x4d\x14\xdd\xdc\x02\x45\xb4\xc0\x88\xad\xa7\x8f\x66\x8f\xc0\x67\x1f\x1d\x3e\x9a\x25\x75\x93\x09\x13\x60\x8e\x5c\x54\x5d\x3e\x27\xee\x2c\xbb\x45\x6b\xcc\xee\x2f\x4c\x77\xd2\x15\x85\x48\x23\x08\x9e\x13\xde\x81\xc0\xf8\x99\x28\x73\x62\xd3\xe0\x25\xca\x45\xc2\xb1\x1b\xcb\x71\x74\x21\x5c\xc7\x25\x8c\xc6\x9c\xd8\x44\x1b\x55\x1e\x6d\xb7\xeb\x6a\x21\x4d\xbf\x96\x3c\x4f\xa0\xbc\x1f\x2b\x52\x42\x38\x10\x98\xe5\x05\x64\x46\xbd\x66\xae\x94\x46\xec\x1d\xe5\x57\x25\xad\xb8\xd5\x6e\x29\x7b\xd2\xba\xd9\x15\xdf\x60\x73\xb0\x99\xf3\x2c\x38\xbd\x68\xa8\xc3\xa0\x2a\x07\xe0\x9b\x38\x22\x86\xc2\x22\x40\x5b\x6e\x9a\x9e\x11\xa7\xc5\x98\xcd\xdd\x56\x94\x49\x23\xed\xf2\x1b\xda\xdc\xfa\x46\x96\x72\x41\x4b\x75\xc1\x15\xcf\x12\x62\x2b\x99\x2e\x27\xe2\x3f\xb2\xa4\x2c\x2d\xa6\x5d\x40\x6d\x76\xb4\x0a\x57\x54\x19\x23\x9e\xe5\x10\xaa\x72\xaa\x9f\x18\x12\xd5\x03\xee\x40\x2b\xbe\xa1\x3d\x93\x27\xfa\x04\x1f\xfa\x3b\xac\x9f\x7a\x95\x5f\x5f\x53\xaf\x3a\x5a\x4d\x6f\xd2\xc5\xba\xa1\xa5\xf8\xe1\xe2\x5d\xc7\x0b\x6d\x95\x6d\x9b\x16\xf2\x07\x65\x9d\xd3\xa7\x4b\x0b\x10\xcd\x10\xf5\x6e\x33\xa7\x5f\xb7\xab\x6a\xb1\x12\xb4\x73\x09\x5e\x1f\x94\x4a\x4d\xec\x3a\x9a\xc2\x83\x94\x96\x16\x8d\x80\x5Line truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4361,7 +4361,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 51461, mode: os.FileMode(420), modTime: time.Unix(1469428651, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 51522, mode: os.FileMode(420), modTime: time.Unix(1469471710, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
@@ -105,6 +105,19 @@ func (ctx *Context) Handle(status int, title string, err error) {
|
||||
ctx.HTML(status, base.TplName(fmt.Sprintf("status/%d", status)))
|
||||
}
|
||||
|
||||
// HandleError use error check function to determine if server should
|
||||
// response as client input error or server internal error.
|
||||
// It responses with given status code for client error,
|
||||
// or error context description for logging purpose of server error.
|
||||
func (ctx *Context) HandleError(title string, errck func(error) bool, err error, status int) {
|
||||
if errck(err) {
|
||||
ctx.Error(status, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Handle(500, title, err)
|
||||
}
|
||||
|
||||
func (ctx *Context) HandleText(status int, title string) {
|
||||
if (status/100 == 4) || (status/100 == 5) {
|
||||
log.Error(4, "%s", title)
|
||||
|
||||
+4
-1
@@ -1452,7 +1452,10 @@ footer .ui.language .menu {
|
||||
.repository.view.issue .comment-list .comment .actions .item {
|
||||
float: left;
|
||||
}
|
||||
.repository.view.issue .comment-list .comment .actions a.item {
|
||||
.repository.view.issue .comment-list .comment .actions .item.tag {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.repository.view.issue .comment-list .comment .actions .item.action {
|
||||
margin-top: 6px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
+14
-1
@@ -342,7 +342,7 @@ function initRepository() {
|
||||
|
||||
// Edit issue or comment content
|
||||
$('.edit-content').click(function () {
|
||||
var $segment = $(this).parent().parent().next();
|
||||
var $segment = $(this).parent().parent().parent().next();
|
||||
var $edit_content_zone = $segment.find('.edit-content-zone');
|
||||
var $render_content = $segment.find('.render-content');
|
||||
var $raw_content = $segment.find('.raw-content');
|
||||
@@ -404,6 +404,19 @@ function initRepository() {
|
||||
return false;
|
||||
});
|
||||
|
||||
// Delete comment
|
||||
$('.delete-comment').click(function () {
|
||||
var $this = $(this);
|
||||
if (confirm($this.data('locale'))) {
|
||||
$.post($this.data('url'), {
|
||||
"_csrf": csrf
|
||||
}).success(function() {
|
||||
$('#' + $this.data('comment-id')).remove();
|
||||
})
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// Change status
|
||||
var $status_btn = $('#status-button');
|
||||
$('#content').keyup(function () {
|
||||
|
||||
@@ -393,10 +393,13 @@
|
||||
.actions {
|
||||
.item {
|
||||
float: left;
|
||||
}
|
||||
a.item {
|
||||
margin-top: 6px;
|
||||
margin-left: 10px;
|
||||
&.tag {
|
||||
margin-right: 5px;
|
||||
}
|
||||
&.action {
|
||||
margin-top: 6px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content {
|
||||
|
||||
+26
-11
@@ -803,11 +803,7 @@ func UpdateIssueAssignee(ctx *context.Context) {
|
||||
func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
|
||||
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
|
||||
if err != nil {
|
||||
if models.IsErrIssueNotExist(err) {
|
||||
ctx.Handle(404, "GetIssueByIndex", err)
|
||||
} else {
|
||||
ctx.Handle(500, "GetIssueByIndex", err)
|
||||
}
|
||||
ctx.HandleError("GetIssueByIndex", models.IsErrIssueNotExist, err, 404)
|
||||
return
|
||||
}
|
||||
if issue.IsPull {
|
||||
@@ -899,11 +895,7 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
|
||||
func UpdateCommentContent(ctx *context.Context) {
|
||||
comment, err := models.GetCommentByID(ctx.ParamsInt64(":id"))
|
||||
if err != nil {
|
||||
if models.IsErrCommentNotExist(err) {
|
||||
ctx.Error(404, "GetCommentByID")
|
||||
} else {
|
||||
ctx.Handle(500, "GetCommentByID", err)
|
||||
}
|
||||
ctx.HandleError("GetCommentByID", models.IsErrCommentNotExist, err, 404)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -922,7 +914,7 @@ func UpdateCommentContent(ctx *context.Context) {
|
||||
})
|
||||
return
|
||||
}
|
||||
if err := models.UpdateComment(comment); err != nil {
|
||||
if err = models.UpdateComment(comment); err != nil {
|
||||
ctx.Handle(500, "UpdateComment", err)
|
||||
return
|
||||
}
|
||||
@@ -932,6 +924,29 @@ func UpdateCommentContent(ctx *context.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
func DeleteComment(ctx *context.Context) {
|
||||
comment, err := models.GetCommentByID(ctx.ParamsInt64(":id"))
|
||||
if err != nil {
|
||||
ctx.HandleError("GetCommentByID", models.IsErrCommentNotExist, err, 404)
|
||||
return
|
||||
}
|
||||
|
||||
if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.IsAdmin()) {
|
||||
ctx.Error(403)
|
||||
return
|
||||
} else if comment.Type != models.COMMENT_TYPE_COMMENT {
|
||||
ctx.Error(204)
|
||||
return
|
||||
}
|
||||
|
||||
if err = models.DeleteCommentByID(comment.ID); err != nil {
|
||||
ctx.Handle(500, "DeleteCommentByID", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Status(200)
|
||||
}
|
||||
|
||||
func Labels(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.labels")
|
||||
ctx.Data["PageIsIssueList"] = true
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
0.9.54.0724
|
||||
0.9.55.0726
|
||||
@@ -20,7 +20,9 @@
|
||||
<span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
|
||||
<div class="ui right actions">
|
||||
{{if .IsIssueOwner}}
|
||||
<a class="edit-content item" href="#"><i class="octicon octicon-pencil"></i></a>
|
||||
<div class="item action">
|
||||
<a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -52,7 +54,7 @@
|
||||
|
||||
<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF -->
|
||||
{{if eq .Type 0}}
|
||||
<div class="comment">
|
||||
<div class="comment" id="{{.HashTag}}">
|
||||
<a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
|
||||
<img src="{{.Poster.AvatarLink}}">
|
||||
</a>
|
||||
@@ -72,7 +74,10 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{if or $.IsRepositoryAdmin (eq .Poster.ID $.SignedUserID)}}
|
||||
<a class="edit-content item" href="#"><i class="octicon octicon-pencil"></i></a>
|
||||
<div class="item action">
|
||||
<a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a>
|
||||
<a class="delete-comment" href="#" data-comment-id={{.HashTag}} data-url="{{$.RepoLink}}/comments/{{.ID}}/delete" data-locale="{{$.i18n.Tr "repo.issues.delete_comment_confirm"}}"><i class="octicon octicon-x"></i></a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user