]> source.dussan.org Git - gitea.git/commit
Save and view issue/comment content history (#16909)
authorwxiaoguang <wxiaoguang@gmail.com>
Sun, 10 Oct 2021 22:40:03 +0000 (06:40 +0800)
committerGitHub <noreply@github.com>
Sun, 10 Oct 2021 22:40:03 +0000 (18:40 -0400)
commitc5c88f2f18d99a188357e0bcb837f94c9c41e79a
treeccdd155112a7ebedc93f0eb0310db860fd38b2d2
parentff9a8a22312a653702342ce0a4073ae8fde2b1d4
Save and view issue/comment content history (#16909)

* issue content history

* Use timeutil.TimeStampNow() for content history time instead of issue/comment.UpdatedUnix (which are not updated in time)

* i18n for frontend

* refactor

* clean up

* fix refactor

* re-format

* temp refactor

* follow db refactor

* rename IssueContentHistory to ContentHistory, remove empty model tags

* fix html

* use avatar refactor to generate avatar url

* add unit test, keep at most 20 history revisions.

* re-format

* syntax nit

* Add issue content history table

* Update models/migrations/v197.go

Co-authored-by: 6543 <6543@obermui.de>
* fix merge

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
17 files changed:
models/db/unit_tests.go
models/issue.go
models/issue_comment.go
models/issues/content_history.go [new file with mode: 0644]
models/issues/content_history_test.go [new file with mode: 0644]
models/issues/main_test.go [new file with mode: 0644]
models/migrations/migrations.go
models/migrations/v198.go [new file with mode: 0644]
options/locale/locale_en-US.ini
routers/web/repo/issue_content_history.go [new file with mode: 0644]
routers/web/web.go
services/comments/comments.go
templates/repo/issue/view_content.tmpl
templates/repo/issue/view_content/sidebar.tmpl
web_src/js/features/issue-content-history.js [new file with mode: 0644]
web_src/js/index.js
web_src/js/svg.js