diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/diff/box.tmpl | 37 | ||||
-rw-r--r-- | templates/repo/diff/comment_form.tmpl | 3 | ||||
-rw-r--r-- | templates/repo/diff/conversation.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/diff/new_comment.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/diff/section_split.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/diff/section_unified.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 2 |
7 files changed, 33 insertions, 33 deletions
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index ef152fa58b..8533f9b910 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -144,28 +144,25 @@ {{end}} {{if not $.Repository.IsArchived}} - <div id="pull_review_add_comment" class="hide"> - {{template "repo/diff/new_comment" dict "root" .}} + <div class="hide" id="edit-content-form"> + <div class="ui comment form"> + <div class="ui top attached tabular menu"> + <a class="active write item">{{$.i18n.Tr "write"}}</a> + <a class="preview item" data-url="{{$.Repository.APIURL}}/markdown" data-context="{{$.RepoLink}}">{{$.i18n.Tr "preview"}}</a> </div> - <div class="hide" id="edit-content-form"> - <div class="ui comment form"> - <div class="ui top attached tabular menu"> - <a class="active write item">{{$.i18n.Tr "write"}}</a> - <a class="preview item" data-url="{{$.Repository.APIURL}}/markdown" data-context="{{$.RepoLink}}">{{$.i18n.Tr "preview"}}</a> - </div> - <div class="ui bottom attached active write tab segment"> - <textarea class="review-textarea" tabindex="1" name="content"></textarea> - </div> - <div class="ui bottom attached tab preview segment markdown"> - {{$.i18n.Tr "loading"}} - </div> - <div class="text right edit buttons"> - <div class="ui basic blue cancel button" tabindex="3">{{.i18n.Tr "repo.issues.cancel"}}</div> - <div class="ui green save button" tabindex="2">{{.i18n.Tr "repo.issues.save"}}</div> - </div> - </div> + <div class="ui bottom attached active write tab segment"> + <textarea class="review-textarea" tabindex="1" name="content"></textarea> + </div> + <div class="ui bottom attached tab preview segment markdown"> + {{$.i18n.Tr "loading"}} + </div> + <div class="text right edit buttons"> + <div class="ui basic blue cancel button" tabindex="3">{{.i18n.Tr "repo.issues.cancel"}}</div> + <div class="ui green save button" tabindex="2">{{.i18n.Tr "repo.issues.save"}}</div> </div> - {{end}} + </div> + </div> + {{end}} {{if .IsSplitStyle}} <script> diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index 33626f31d3..b12beeab82 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -6,6 +6,7 @@ {{end}} <form class="ui form {{if $.hidden}}hide comment-form comment-form-reply{{end}}" action="{{$.root.Issue.HTMLURL}}/files/reviews/comments" method="post"> {{$.root.CsrfTokenHtml}} + <input type="hidden" name="origin" value="{{if $.root.PageIsPullFiles}}diff{{else}}timeline{{end}}"> <input type="hidden" name="latest_commit_id" value="{{$.root.AfterCommitID}}"/> <input type="hidden" name="side" value="{{if $.Side}}{{$.Side}}{{end}}"> <input type="hidden" name="line" value="{{if $.Line}}{{$.Line}}{{end}}"> @@ -29,7 +30,7 @@ <span class="markdown-info">{{svg "octicon-markdown"}} {{$.root.i18n.Tr "repo.diff.comment.markdown_info"}}</span> <div class="ui right"> {{if $.reply}} - <button class="ui submit green tiny button btn-reply" onclick="window.submitReply(this);">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button> + <button class="ui submit green tiny button btn-reply" type="submit">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button> <input type="hidden" name="reply" value="{{$.reply}}"> {{else}} {{if $.root.CurrentReview}} diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl index 98898eee60..4dd7de0fc1 100644 --- a/templates/repo/diff/conversation.tmpl +++ b/templates/repo/diff/conversation.tmpl @@ -1,7 +1,7 @@ {{$resolved := (index .comments 0).IsResolved}} {{$resolveDoer := (index .comments 0).ResolveDoer}} {{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}} -<div class="conversation-holder"> +<div class="conversation-holder" data-path="{{(index .comments 0).TreePath}}" data-side="{{if lt (index .comments 0).Line 0}}left{{else}}right{{end}}" data-idx="{{(index .comments 0).UnsignedLine}}"> {{if $resolved}} <div class="ui attached header resolved-placeholder"> <span class="ui grey text left"><b>{{$resolveDoer.Name}}</b> {{$.i18n.Tr "repo.issues.review.resolved_by"}}</span> @@ -23,7 +23,7 @@ </div> {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index .comments 0).ReviewID "root" $ "comment" (index .comments 0)}} {{if and $.CanMarkConversation $isNotPending}} - <button class="ui icon tiny button resolve-conversation" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" > + <button class="ui icon tiny button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" > {{if $resolved}} {{$.i18n.Tr "repo.issues.review.un_resolve_conversation"}} {{else}} diff --git a/templates/repo/diff/new_comment.tmpl b/templates/repo/diff/new_comment.tmpl index d8b6ccb9dd..6a71539ab0 100644 --- a/templates/repo/diff/new_comment.tmpl +++ b/templates/repo/diff/new_comment.tmpl @@ -1,3 +1,5 @@ -<div class="field comment-code-cloud"> - {{template "repo/diff/comment_form_datahandler" .}} +<div class="conversation-holder"> + <div class="field comment-code-cloud"> + {{template "repo/diff/comment_form_datahandler" .}} + </div> </div> diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl index 7e62bf3e1a..2f959ac2da 100644 --- a/templates/repo/diff/section_split.tmpl +++ b/templates/repo/diff/section_split.tmpl @@ -1,7 +1,7 @@ {{$file := .file}} {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} - <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}"> + <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}"> {{if eq .GetType 4}} <td class="lines-num lines-num-old"> {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} @@ -24,14 +24,14 @@ {{else}} <td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}"></span></td> <td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span>{{end}}</td> - <td class="lines-code lines-code-old halfwidth">{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles (not (eq .GetType 2))}}<a class="ui primary button add-code-comment add-code-comment-left" data-path="{{$file.Name}}" data-side="left" data-idx="{{$line.LeftIdx}}">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></td> + <td class="lines-code lines-code-old halfwidth">{{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 2))}}<a class="ui primary button add-code-comment add-code-comment-left{{if (not $line.CanComment)}} invisible{{end}}" data-path="{{$file.Name}}" data-side="left" data-idx="{{$line.LeftIdx}}" data-new-comment-url="{{$.root.Issue.HTMLURL}}/files/reviews/new_comment">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></td> <td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}"></span></td> <td class="lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span>{{end}}</td> - <td class="lines-code lines-code-new halfwidth">{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles (not (eq .GetType 3))}}<a class="ui primary button add-code-comment add-code-comment-right" data-path="{{$file.Name}}" data-side="right" data-idx="{{$line.RightIdx}}">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></td> + <td class="lines-code lines-code-new halfwidth">{{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 3))}}<a class="ui primary button add-code-comment add-code-comment-right{{if (not $line.CanComment)}} invisible{{end}}" data-path="{{$file.Name}}" data-side="right" data-idx="{{$line.RightIdx}}" data-new-comment-url="{{$.root.Issue.HTMLURL}}/files/reviews/new_comment">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></td> {{end}} </tr> {{if gt (len $line.Comments) 0}} - <tr class="add-code-comment"> + <tr class="add-comment" data-line-type="{{DiffLineTypeToStr .GetType}}"> <td class="lines-num"></td> <td class="lines-type-marker"></td> <td class="add-comment-left"> diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index 5376e77630..96e193df73 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -2,7 +2,7 @@ {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} {{if or $.root.AfterCommitID (ne .GetType 4)}} - <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}"> + <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}"> {{if eq .GetType 4}} <td colspan="2" class="lines-num"> {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} @@ -29,11 +29,11 @@ {{if eq .GetType 4}} <td class="chroma lines-code blob-hunk"><code class="code-inner">{{$section.GetComputedInlineDiffFor $line}}</code></td> {{else}} - <td class="chroma lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}<a class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}" data-path="{{$file.Name}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{$section.GetComputedInlineDiffFor $line}}</code></td> + <td class="chroma lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">{{if and $.root.SignedUserID $.root.PageIsPullFiles}}<a class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} invisible{{end}}" data-path="{{$file.Name}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}" data-new-comment-url="{{$.root.Issue.HTMLURL}}/files/reviews/new_comment">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{$section.GetComputedInlineDiffFor $line}}</code></td> {{end}} </tr> {{if gt (len $line.Comments) 0}} - <tr> + <tr class="add-comment" data-line-type="{{DiffLineTypeToStr .GetType}}"> <td colspan="2" class="lines-num"></td> <td class="add-comment-left add-comment-right" colspan="2"> {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index bc5d7dde12..8f5426b83e 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -530,7 +530,7 @@ {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index $comms 0).ReviewID "root" $ "comment" (index $comms 0)}} {{if and $.CanMarkConversation $isNotPending}} - <button class="ui tiny button resolve-conversation" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $comms 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" > + <button class="ui tiny button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $comms 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" > {{if $resolved}} {{$.i18n.Tr "repo.issues.review.un_resolve_conversation"}} {{else}} |