* optimize * CI.restart() Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net>tags/v1.11.0-rc1
"LoadTimes": func(startTime time.Time) string { | "LoadTimes": func(startTime time.Time) string { | ||||
return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms" | return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms" | ||||
}, | }, | ||||
"AllowedReactions": func() []string { | |||||
return setting.UI.Reactions | |||||
}, | |||||
"AvatarLink": base.AvatarLink, | "AvatarLink": base.AvatarLink, | ||||
"Safe": Safe, | "Safe": Safe, | ||||
"SafeJS": SafeJS, | "SafeJS": SafeJS, |
} | } | ||||
} | } | ||||
ctx.Data["IssueWatch"] = iw | ctx.Data["IssueWatch"] = iw | ||||
ctx.Data["AllowedReactions"] = setting.UI.Reactions | |||||
issue.RenderedContent = string(markdown.Render([]byte(issue.Content), ctx.Repo.RepoLink, | issue.RenderedContent = string(markdown.Render([]byte(issue.Content), ctx.Repo.RepoLink, | ||||
ctx.Repo.Repository.ComposeMetas())) | ctx.Repo.Repository.ComposeMetas())) |
ctx.Data["NumCommits"] = compareInfo.Commits.Len() | ctx.Data["NumCommits"] = compareInfo.Commits.Len() | ||||
ctx.Data["NumFiles"] = compareInfo.NumFiles | ctx.Data["NumFiles"] = compareInfo.NumFiles | ||||
ctx.Data["AllowedReactions"] = setting.UI.Reactions | |||||
return compareInfo | return compareInfo | ||||
} | } | ||||
{{$reactions := .Reactions.GroupByType}} | {{$reactions := .Reactions.GroupByType}} | ||||
{{if $reactions}} | {{if $reactions}} | ||||
<div class="ui attached segment reactions"> | <div class="ui attached segment reactions"> | ||||
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions "AllowedReactions" $.AllowedReactions }} | |||||
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}} | |||||
</div> | </div> | ||||
{{end}} | {{end}} | ||||
</div> | </div> |
{{end}} | {{end}} | ||||
{{if not $.Repository.IsArchived}} | {{if not $.Repository.IsArchived}} | ||||
<div class="ui right actions"> | <div class="ui right actions"> | ||||
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "AllowedReactions" $.AllowedReactions}} | |||||
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}} | |||||
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" .Issue "delete" false "diff" false }} | {{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" .Issue "delete" false "diff" false }} | ||||
</div> | </div> | ||||
{{end}} | {{end}} | ||||
{{$reactions := .Issue.Reactions.GroupByType}} | {{$reactions := .Issue.Reactions.GroupByType}} | ||||
{{if $reactions}} | {{if $reactions}} | ||||
<div class="ui attached segment reactions"> | <div class="ui attached segment reactions"> | ||||
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions "AllowedReactions" $.AllowedReactions}} | |||||
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions}} | |||||
</div> | </div> | ||||
{{end}} | {{end}} | ||||
{{if .Issue.Attachments}} | {{if .Issue.Attachments}} |
<div class="menu has-emoji"> | <div class="menu has-emoji"> | ||||
<div class="header">{{ .ctx.i18n.Tr "repo.pick_reaction"}}</div> | <div class="header">{{ .ctx.i18n.Tr "repo.pick_reaction"}}</div> | ||||
<div class="divider"></div> | <div class="divider"></div> | ||||
{{range $value := .AllowedReactions}} | |||||
{{range $value := AllowedReactions}} | |||||
{{if eq $value "hooray"}} | {{if eq $value "hooray"}} | ||||
<div class="item" data-content="hooray">:tada:</div> | <div class="item" data-content="hooray">:tada:</div> | ||||
{{else if eq $value "laugh"}} | {{else if eq $value "laugh"}} |
{{end}} | {{end}} | ||||
</div> | </div> | ||||
{{end}} | {{end}} | ||||
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) "AllowedReactions" $.AllowedReactions}} | |||||
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}} | |||||
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "diff" false }} | {{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "diff" false }} | ||||
</div> | </div> | ||||
{{end}} | {{end}} | ||||
{{$reactions := .Reactions.GroupByType}} | {{$reactions := .Reactions.GroupByType}} | ||||
{{if $reactions}} | {{if $reactions}} | ||||
<div class="ui attached segment 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 "AllowedReactions" $.AllowedReactions}} | |||||
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} | |||||
</div> | </div> | ||||
{{end}} | {{end}} | ||||
{{if .Attachments}} | {{if .Attachments}} |
{{len $value}} | {{len $value}} | ||||
</a> | </a> | ||||
{{end}} | {{end}} | ||||
{{if $.AllowedReactions}} | |||||
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.ctx "ActionURL" .ActionURL "AllowedReactions" $.AllowedReactions}} | |||||
{{if AllowedReactions}} | |||||
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.ctx "ActionURL" .ActionURL}} | |||||
{{end}} | {{end}} |