mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add reactions to issues/PR and comments (#2856)
This commit is contained in:
18
templates/repo/issue/view_content/add_reaction.tmpl
Normal file
18
templates/repo/issue/view_content/add_reaction.tmpl
Normal file
@@ -0,0 +1,18 @@
|
||||
{{if .ctx.IsSigned}}
|
||||
<div class="item action ui pointing top right select-reaction dropdown" data-action-url="{{ .ActionURL }}">
|
||||
<a class="add-reaction">
|
||||
<i class="octicon octicon-plus-small" style="width: 10px"></i>
|
||||
<i class="octicon octicon-smiley"></i>
|
||||
</a>
|
||||
<div class="menu has-emoji">
|
||||
<div class="header">{{ .ctx.i18n.Tr "repo.pick_reaction"}}</div>
|
||||
<div class="divider"></div>
|
||||
<div class="item" data-content="+1">:+1:</div>
|
||||
<div class="item" data-content="-1">:-1:</div>
|
||||
<div class="item" data-content="laugh">:laughing:</div>
|
||||
<div class="item" data-content="confused">:confused:</div>
|
||||
<div class="item" data-content="heart">:heart:</div>
|
||||
<div class="item" data-content="hooray">:tada:</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
@@ -22,6 +22,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) }}
|
||||
{{if or $.IsRepositoryAdmin (eq .Poster.ID $.SignedUserID)}}
|
||||
<div class="item action">
|
||||
<a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a>
|
||||
@@ -41,6 +42,12 @@
|
||||
<div class="raw-content hide">{{.Content}}</div>
|
||||
<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}"></div>
|
||||
</div>
|
||||
{{$reactions := .Reactions.GroupByType}}
|
||||
{{if $reactions}}
|
||||
<div class="ui attached segment reactions">
|
||||
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions }}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .Attachments}}
|
||||
<div class="ui bottom attached segment">
|
||||
<div class="ui small images">
|
||||
|
15
templates/repo/issue/view_content/reactions.tmpl
Normal file
15
templates/repo/issue/view_content/reactions.tmpl
Normal file
@@ -0,0 +1,15 @@
|
||||
{{range $key, $value := .Reactions}}
|
||||
<a class="ui label basic{{if $value.HasUser $.ctx.SignedUserID}} blue{{end}}{{if not $.ctx.IsSigned}} disabled{{end}} has-emoji" data-title="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ $.ctx.i18n.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}" data-content="{{ $key }}" data-action-url="{{ $.ActionURL }}">
|
||||
{{if eq $key "hooray"}}
|
||||
:tada:
|
||||
{{else}}
|
||||
{{if eq $key "laugh"}}
|
||||
:laughing:
|
||||
{{else}}
|
||||
:{{$key}}:
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{len $value}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.ctx "ActionURL" .ActionURL }}
|
Reference in New Issue
Block a user