diff options
author | harry <harryzhxu@gmail.com> | 2017-12-11 14:03:04 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-12-11 14:03:04 +0800 |
commit | 03ec35ed79e38b907de8812e3f7cccc422cb5937 (patch) | |
tree | 8a430543964c8defd61b10fa099ca865b60272e3 /templates | |
parent | f2e20c81b66e6a937ecdb686f8d1011371433365 (diff) | |
download | gitea-03ec35ed79e38b907de8812e3f7cccc422cb5937.tar.gz gitea-03ec35ed79e38b907de8812e3f7cccc422cb5937.zip |
Mention completion for issue editor. (#3136)
* new issue mention
* Mention completion on new issue and view issue page.
* Code format.
* Require tribute in pull request page.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base/footer.tmpl | 26 | ||||
-rw-r--r-- | templates/base/head.tmpl | 4 |
2 files changed, 30 insertions, 0 deletions
diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index ed0dd58b95..7df892c1ca 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -58,6 +58,32 @@ {{if .RequireDropzone}} <script src="{{AppSubUrl}}/vendor/plugins/dropzone/dropzone.js"></script> {{end}} +{{if .RequireTribute}} + <script src="{{AppSubUrl}}/vendor/plugins/tribute/tribute.min.js"></script> + + {{if .Assignees}} + <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 itemStr = '<img src="' + user.avatar + '"/><span class="name">' + user.name + '</span>'; + if (user.fullname && user.fullname != '') { + itemStr += '<span class="fullname">' + user.fullname + '</span>'; + } + return itemStr; + } + }) + issuesTribute.attach(document.getElementById('content')) + </script> + {{end}} +{{end}} <script src="{{AppSubUrl}}/vendor/plugins/autolink/autolink.js"></script> <script src="{{AppSubUrl}}/vendor/plugins/emojify/emojify.min.js"></script> <script src="{{AppSubUrl}}/vendor/plugins/clipboard/clipboard.min.js"></script> diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index a7d31d6557..93e819847d 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -74,6 +74,10 @@ <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/gitgraph/gitgraph.css"> {{end}} +{{if .RequireTribute}} + <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/tribute/tribute.css"> +{{end}} + <!-- Stylesheet --> <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.css"> <link rel="stylesheet" href="{{AppSubUrl}}/css/index.css?v={{MD5 AppVer}}"> |