From d078aa30d6e6f40978ea68e9ae6eee53dc028ada Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 30 Jan 2017 13:57:47 +0800 Subject: [PATCH] feat: add search repository on dashboard. (#773) --- options/locale/locale_en-US.ini | 1 + options/locale/locale_zh-HK.ini | 1 + options/locale/locale_zh-TW.ini | 1 + public/js/index.js | 9 +++++++++ templates/base/head.tmpl | 1 + templates/user/dashboard/dashboard.tmpl | 11 +++++++---- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 30caaa0e83..71130403ed 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -142,6 +142,7 @@ collaborative_repos = Collaborative Repositories my_orgs = My Organizations my_mirrors = My Mirrors view_home = View %s +search_repos = Find a repository ... issues.in_your_repos = In your repositories diff --git a/options/locale/locale_zh-HK.ini b/options/locale/locale_zh-HK.ini index 0111f1fcd5..9b7179ba93 100644 --- a/options/locale/locale_zh-HK.ini +++ b/options/locale/locale_zh-HK.ini @@ -133,6 +133,7 @@ collaborative_repos=參與協作的儲存庫 my_orgs=我的組織 my_mirrors=我的鏡像 view_home=訪問 %s +search_repos = 搜尋儲存庫 ... issues.in_your_repos=屬於該用戶儲存庫的 diff --git a/options/locale/locale_zh-TW.ini b/options/locale/locale_zh-TW.ini index 0111f1fcd5..9b7179ba93 100644 --- a/options/locale/locale_zh-TW.ini +++ b/options/locale/locale_zh-TW.ini @@ -133,6 +133,7 @@ collaborative_repos=參與協作的儲存庫 my_orgs=我的組織 my_mirrors=我的鏡像 view_home=訪問 %s +search_repos = 搜尋儲存庫 ... issues.in_your_repos=屬於該用戶儲存庫的 diff --git a/public/js/index.js b/public/js/index.js index 8674993261..8ccbfc175b 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1464,4 +1464,13 @@ function selectRange($list, $select, $from) { $(function () { if ($('.user.signin').length > 0) return; $('form').areYouSure(); + + $("#search_repo").on('change paste keyup',function(){ + var value = $(this).val(); + if(!value){ + $('.list-search-style').html(''); + } else{ + $('.list-search-style').html('.search-list li:not([data-title*="' + value + '"]) {display: none;}'); + } + }); }); diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 300df5e648..18805953b4 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -45,6 +45,7 @@ {{if .RequireDropzone}} {{end}} +
diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index d234397269..28ac4dfecf 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -15,6 +15,9 @@ {{.i18n.Tr "mirror"}}
+
+ +

{{.i18n.Tr "home.my_repos"}} {{.ContextUser.NumRepos}}
@@ -25,9 +28,9 @@