From 11ca10ab2fa9c0e0c8036d33bd31f4815ceb490e Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Thu, 8 May 2014 21:01:47 +0800 Subject: [PATCH] issue assignee ui --- public/css/gogs.css | 22 ++++++++++++++++++++++ public/js/app.js | 19 ++++++++++++++++--- templates/issue/create.tmpl | 16 ++++++++++++++++ 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index e4dfda4c64..bf43375b7e 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1441,6 +1441,28 @@ html, body { margin-left: .8em; } +#issue .assignee,#issue .assignee ul{ + padding: 0; + margin: 0; + min-width: 300px; +} + +#issue .assignee li{ + padding: 4px 12px; + line-height: 30px; +} + +#issue .assignee li:hover{ + background-color: #e8f0ff; + cursor: pointer; +} + +#issue .assignee li img{ + width: 28px; + height: 28px; + margin-right: 12px; +} + /* wrapper and footer */ #wrapper { diff --git a/public/js/app.js b/public/js/app.js index 6093d23b94..d6c13a2931 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -532,7 +532,20 @@ function initIssue() { $('.issue-write a[data-toggle]').on("click", function () { $('.issue-preview-content').html("loading..."); }); - }()) + }()); + + // assignee + $('.assignee', '#issue').on('click', 'li', function () { + var uid = $(this).data("uid"); + $('#assignee').val(uid); + if (uid > 0) { + $('.clear-assignee').toggleShow(); + $('#assigned').text($(this).find("strong").text()) + } else { + $('.clear-assignee').toggleHide(); + $('#assigned').text($('#assigned').data("no-assigned")); + } + }); } @@ -580,7 +593,7 @@ function initRepoSetting() { }); $this.next().toggleShow(); $this.next().find('ul').html(html); - }else{ + } else { $this.next().toggleHide(); } } @@ -589,7 +602,7 @@ function initRepoSetting() { if (!$(this).val()) { $(this).next().toggleHide(); } - }).next().on("click",'li',function(){ + }).next().on("click", 'li', function () { $('#repo-collaborator').val($(this).text()); }); } diff --git a/templates/issue/create.tmpl b/templates/issue/create.tmpl index f6a65cc846..0306719c6e 100644 --- a/templates/issue/create.tmpl +++ b/templates/issue/create.tmpl @@ -14,6 +14,22 @@
+
+ No one will be assigned +    +
+ + +
+
Content with Markdown