summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/base/footer.tmpl66
-rw-r--r--templates/base/head.tmpl10
-rw-r--r--templates/pwa/serviceworker_js.tmpl1
-rw-r--r--templates/repo/commit_page.tmpl2
-rw-r--r--templates/repo/issue/list.tmpl2
-rw-r--r--templates/repo/issue/view_content/add_reaction.tmpl10
-rw-r--r--templates/repo/issue/view_content/comments.tmpl8
-rw-r--r--templates/repo/issue/view_content/reactions.tmpl12
-rw-r--r--templates/repo/issue/view_title.tmpl2
-rw-r--r--templates/user/dashboard/feeds.tmpl14
-rw-r--r--templates/user/dashboard/issues.tmpl2
11 files changed, 32 insertions, 97 deletions
diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl
index 083f44a368..07cbba7069 100644
--- a/templates/base/footer.tmpl
+++ b/templates/base/footer.tmpl
@@ -36,72 +36,8 @@
{{end}}
{{if .RequireTribute}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.min.js"></script>
- <script>
- var issuesTribute = new Tribute({
- values: [
- {{ range .Assignees }}
- {key: '{{.Name}} {{.FullName}}', value: '{{.Name}}',
- name: '{{.Name}}', fullname: '{{.FullName}}', avatar: '{{.RelAvatarLink}}'},
- {{ end }}
- ],
- noMatchTemplate: function () { return null },
- menuItemTemplate: function (item) {
- var user = item.original;
- var item = $('<div/>')
- item.append($('<img/>', {'src': user.avatar}))
- item.append($('<span/>', {'class': 'name'}).text(user.name))
- if (user.fullname && user.fullname != '') {
- item.append($('<span/>', {'class': 'fullname'}).text(user.fullname))
- }
- return item.html();
- }
- });
- var content = document.getElementById('content');
- if (content != null) {
- issuesTribute.attach(content);
- }
- </script>
- <script>
- var emojiTribute = new Tribute({
- collection: [{
- trigger: ':',
- requireLeadingSpace: true,
- values: function (text, cb) {
- var array = emojify.emojiNames;
- var data = [];
- for(var j=0; j<array.length; j++) {
- if(array[j].indexOf(text) !== -1) {
- data.push(array[j]);
- if(data.length > 5) {
- break;
- }
- }
- }
- cb(data);
- },
- lookup: function (item) {
- return item;
- },
- selectTemplate: function (item) {
- if (typeof item === 'undefined') return null;
- return ':' + item.original + ':';
- },
- menuItemTemplate: function (item) {
- return '<img class="emoji" src="{{StaticUrlPrefix}}/vendor/plugins/emojify/images/' + item.original + '.png"/>' + item.original;
- }
- }]
- });
- var emojiInputs = document.querySelectorAll('.emoji-input');
- if (emojiInputs.length > 0) {
- emojiTribute.attach(emojiInputs);
- }
- var content = document.getElementById('content');
- if (content != null) {
- emojiTribute.attach(document.getElementById('content'));
- }
- </script>
{{end}}
- <script src="{{StaticUrlPrefix}}/vendor/plugins/emojify/emojify.custom.js"></script>
+
<script src="{{StaticUrlPrefix}}/fomantic/semantic.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>
{{template "custom/footer" .}}
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 2d7d737a00..0ecf6821c3 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
- <title>{{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>
+ <title>{{if .Title}}{{.Title | RenderEmojiPlain}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}} </title>
<link rel="manifest" href="{{AppSubUrl}}/manifest.json" crossorigin="use-credentials">
{{if UseServiceWorker}}
<script>
@@ -99,6 +99,14 @@
TimeoutStep: {{NotificationSettings.TimeoutStep}},
MaxTimeout: {{NotificationSettings.MaxTimeout}},
},
+ {{if .RequireTribute}}
+ tributeValues: [
+ {{ range .Assignees }}
+ {key: '{{.Name}} {{.FullName}}', value: '{{.Name}}',
+ name: '{{.Name}}', fullname: '{{.FullName}}', avatar: '{{.RelAvatarLink}}'},
+ {{ end }}
+ ],
+ {{end}}
};
</script>
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png">
diff --git a/templates/pwa/serviceworker_js.tmpl b/templates/pwa/serviceworker_js.tmpl
index b32f671532..edb8ba6e1d 100644
--- a/templates/pwa/serviceworker_js.tmpl
+++ b/templates/pwa/serviceworker_js.tmpl
@@ -12,7 +12,6 @@ var urlsToCache = [
'{{StaticUrlPrefix}}/js/datetimepicker.js',
'{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js',
'{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js',
- '{{StaticUrlPrefix}}/vendor/plugins/emojify/emojify.custom.js',
'{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js',
'{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js',
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl
index 1cfd0944d5..2e57207460 100644
--- a/templates/repo/commit_page.tmpl
+++ b/templates/repo/commit_page.tmpl
@@ -21,7 +21,7 @@
<a class="ui floated right blue tiny button" href="{{EscapePound .SourcePath}}">
{{.i18n.Tr "repo.diff.browse_source"}}
</a>
- <h3 class="has-emoji"><span class="message-wrapper"><span class="commit-summary" title="{{.Commit.Summary}}">{{RenderCommitMessage .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</span></span>{{template "repo/commit_status" .CommitStatus}}</h3>
+ <h3><span class="message-wrapper"><span class="commit-summary" title="{{.Commit.Summary}}">{{RenderCommitMessage .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</span></span>{{template "repo/commit_status" .CommitStatus}}</h3>
{{if IsMultilineCommitMessage .Commit.Message}}
<pre class="commit-body">{{RenderCommitBody .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
{{end}}
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 4fe0aaa00d..cebcb7da6b 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -211,7 +211,7 @@
</div>
{{end}}
<div class="ui {{if .IsClosed}}{{if .IsPull}}{{if .PullRequest.HasMerged}}purple{{else}}red{{end}}{{else}}red{{end}}{{else}}{{if .IsRead}}white{{else}}green{{end}}{{end}} label">#{{.Index}}</div>
- <a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Title}}</a>
+ <a class="title" href="{{$.Link}}/{{.Index}}">{{RenderEmoji .Title}}</a>
{{if .IsPull }}
{{if (index $.CommitStatus .PullRequest.ID)}}
diff --git a/templates/repo/issue/view_content/add_reaction.tmpl b/templates/repo/issue/view_content/add_reaction.tmpl
index 543f313f0a..e061560138 100644
--- a/templates/repo/issue/view_content/add_reaction.tmpl
+++ b/templates/repo/issue/view_content/add_reaction.tmpl
@@ -4,17 +4,11 @@
{{svg "octicon-plus-small" 16}}
{{svg "octicon-smiley" 16}}
</a>
- <div class="menu has-emoji">
+ <div class="menu">
<div class="header">{{ .ctx.i18n.Tr "repo.pick_reaction"}}</div>
<div class="divider"></div>
{{range $value := AllowedReactions}}
- {{if eq $value "hooray"}}
- <div class="item" data-content="hooray">:tada:</div>
- {{else if eq $value "laugh"}}
- <div class="item" data-content="laugh">:laughing:</div>
- {{else}}
- <div class="item" data-content="{{$value}}">:{{$value}}:</div>
- {{end}}
+ <div class="item reaction" data-content="{{$value}}">{{ReactionToEmoji $value}}</div>
{{end}}
</div>
</div>
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 635ad50e44..3859f496ec 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -404,8 +404,12 @@
</span>
</div>
<div class="ui attached segment">
- <div class="detail">
- <span class="text black has-emoji">{{.Content}}</span>
+ <div class="render-content markdown has-emoji">
+ {{if .RenderedContent}}
+ {{.RenderedContent|Str2html}}
+ {{else}}
+ <span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
+ {{end}}
</div>
</div>
</div>
diff --git a/templates/repo/issue/view_content/reactions.tmpl b/templates/repo/issue/view_content/reactions.tmpl
index b2aa9339d1..4978edf3ff 100644
--- a/templates/repo/issue/view_content/reactions.tmpl
+++ b/templates/repo/issue/view_content/reactions.tmpl
@@ -1,13 +1,7 @@
{{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}}
- {{len $value}}
+ <a class="ui label basic{{if $value.HasUser $.ctx.SignedUserID}} blue{{end}}{{if not $.ctx.IsSigned}} disabled{{end}}" 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 }}">
+ <span class="reaction">{{ReactionToEmoji $key}}</span>
+ <span class="reaction-count">{{len $value}}</span>
</a>
{{end}}
{{if AllowedReactions}}
diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl
index db048a119c..74ed1034d7 100644
--- a/templates/repo/issue/view_title.tmpl
+++ b/templates/repo/issue/view_title.tmpl
@@ -1,7 +1,7 @@
<div class="sixteen wide column title">
<div class="ui grid">
<h1 class="twelve wide column">
- <span class="index">#{{.Issue.Index}}</span> <span id="issue-title" class="has-emoji">{{.Issue.Title}}</span>
+ <span class="index">#{{.Issue.Index}}</span> <span id="issue-title">{{RenderEmoji .Issue.Title}}</span>
<div id="edit-title-input" class="ui input" style="display: none">
<input value="{{.Issue.Title}}" maxlength="255">
</div>
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl
index b97eda3ca5..a1b4218dc4 100644
--- a/templates/user/dashboard/feeds.tmpl
+++ b/templates/user/dashboard/feeds.tmpl
@@ -79,23 +79,23 @@
{{ $repoLink := .GetRepoLink}}
{{if $push.Commits}}
{{range $push.Commits}}
- <li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a class="commit-id" href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey has-emoji">{{.Message}}</span></li>
+ <li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a class="commit-id" href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey">{{.Message}}</span></li>
{{end}}
{{end}}
{{if and (gt $push.Len 1) $push.CompareURL}}<li><a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} ยป</a></li>{{end}}
</ul>
</div>
{{else if eq .GetOpType 6}}
- <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
+ <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji}}</span>
{{else if eq .GetOpType 7}}
- <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
+ <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji}}</span>
{{else if or (eq .GetOpType 10) (eq .GetOpType 21) (eq .GetOpType 22) (eq .GetOpType 23)}}
- <a href="{{.GetCommentLink}}" class="text truncate issue title has-emoji">{{.GetIssueTitle}}</a>
- <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
+ <a href="{{.GetCommentLink}}" class="text truncate issue title">{{.GetIssueTitle | RenderEmoji}}</a>
+ <p class="text light grey">{{index .GetIssueInfos 1 | RenderEmoji}}</p>
{{else if eq .GetOpType 11}}
- <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
+ <p class="text light grey">{{index .GetIssueInfos 1}}</p>
{{else if or (eq .GetOpType 12) (eq .GetOpType 13) (eq .GetOpType 14) (eq .GetOpType 15)}}
- <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
+ <span class="text truncate issue title">{{.GetIssueTitle | RenderEmoji}}</span>
{{end}}
<p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
</div>
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
index 780c8c1257..92e87da0ab 100644
--- a/templates/user/dashboard/issues.tmpl
+++ b/templates/user/dashboard/issues.tmpl
@@ -108,7 +108,7 @@
{{if .Repo}}
<li class="item">
<div class="ui label">{{.Repo.FullName}}#{{.Index}}</div>
- <a class="title has-emoji" href="{{.HTMLURL}}">{{.Title}}</a>
+ <a class="title" href="{{.HTMLURL}}">{{RenderEmoji .Title}}</a>
{{if .IsPull}}
{{if (index $.CommitStatus .PullRequest.ID)}}