Skip to content

Commit b5c26fa

Browse files
yp05327wxiaoguangGiteaBot
authored
Add markdown preview to Submit Review Textarea (#24672)
Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/2909352c-b2ab-4d77-b410-9f08c2f5a154) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/9448fa75-e29b-4f95-a30f-03c73c083a83) --------- Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: Giteabot <[email protected]>
1 parent a96c73f commit b5c26fa

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

templates/repo/diff/new_review.tmpl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
<form class="ui form" action="{{.Link}}/reviews/submit" method="post">
1010
{{.CsrfTokenHtml}}
1111
<input type="hidden" name="commit_id" value="{{.AfterCommitID}}">
12-
<div class="header gt-df gt-ac gt-pb-3">
12+
<div class="field gt-df gt-ac">
1313
<div class="gt-f1">{{$.locale.Tr "repo.diff.review.header"}}</div>
14-
<a class="muted close gt-px-3">{{svg "octicon-x" 16}}</a>
14+
<a class="muted close">{{svg "octicon-x" 16}}</a>
1515
</div>
16-
<div class="ui field">
16+
<div class="field">
1717
{{template "shared/combomarkdowneditor" (dict
1818
"locale" $.locale
19+
"MarkdownPreviewUrl" (print .Repository.Link "/markup")
20+
"MarkdownPreviewContext" .RepoLink
1921
"TextareaName" "content"
2022
"TextareaPlaceholder" ($.locale.Tr "repo.diff.review.placeholder")
2123
"DropzoneParentContainer" "form"

web_src/css/code/linebutton.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
.code-line-menu {
66
width: auto !important;
7+
border: none !important; /* the border is provided by tippy, not using the `.ui.menu` border */
78
}
89

910
.code-line-button {

web_src/css/modules/tippy.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
color: var(--color-tooltip-text);
3030
}
3131

32-
.tippy-box[data-theme="menu"] .ui.menu {
33-
border: none;
34-
}
35-
3632
.tippy-content {
3733
position: relative;
3834
padding: 1rem;

0 commit comments

Comments
 (0)