aboutsummaryrefslogtreecommitdiffstats
path: root/templates/user/dashboard/repolist.tmpl
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-05-16 21:07:01 +0100
committerGitHub <noreply@github.com>2020-05-16 23:07:01 +0300
commitc86bc8e061b91d3d3778d9b97ba16e373250d8f6 (patch)
tree560fc03cd8647efb79a7c0cb4f5ee5e77b5f52d6 /templates/user/dashboard/repolist.tmpl
parentc3d9a5f8464e0921fc4063d903ecf2063fa152fa (diff)
downloadgitea-c86bc8e061b91d3d3778d9b97ba16e373250d8f6.tar.gz
gitea-c86bc8e061b91d3d3778d9b97ba16e373250d8f6.zip
Add paging and archive/private repository filtering to dashboard list (#11321)
* Add archived options to SearchRepository Signed-off-by: Andrew Thornton <art27@cantab.net> * Add only-private search Signed-off-by: Andrew Thornton <art27@cantab.net> * Add filter options and paging to dashboard repository page Signed-off-by: Andrew Thornton <art27@cantab.net> * swagger generate Signed-off-by: Andrew Thornton <art27@cantab.net> * fix-swagger-again Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @mrsdizzie also remember state Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'templates/user/dashboard/repolist.tmpl')
-rw-r--r--templates/user/dashboard/repolist.tmpl63
1 files changed, 60 insertions, 3 deletions
diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl
index 63019e58e8..dc1507403c 100644
--- a/templates/user/dashboard/repolist.tmpl
+++ b/templates/user/dashboard/repolist.tmpl
@@ -35,9 +35,46 @@
{{end}}
</h4>
<div class="ui attached secondary segment repos-search">
- <div class="ui fluid icon input" :class="{loading: isLoading}">
+ <div class="ui fluid right action left icon input" :class="{loading: isLoading}">
<input @input="searchRepos(reposFilter)" v-model="searchQuery" ref="search" placeholder="{{.i18n.Tr "home.search_repos"}}">
<i class="search icon"></i>
+ <div class="ui dropdown button" title="{{.i18n.Tr "home.filter"}}">
+ <i class="icon filter"></i>
+ <div class="menu">
+ <div class="item">
+ <a @click="toggleArchivedFilter()">
+ <div class="ui checkbox" id="archivedFilterCheckbox" title="{{.i18n.Tr "home.show_both_archived_unarchived"}}" v-if="archivedFilter === 'both'">
+ <input type="checkbox">
+ <label><i class="archive icon archived-icon"></i>{{.i18n.Tr "home.show_archived"}}</label>
+ </div>
+ <div class="ui checkbox" id="archivedFilterCheckbox" title="{{.i18n.Tr "home.show_only_unarchived"}}" v-if="archivedFilter === 'unarchived'">
+ <input type="checkbox">
+ <label><i class="archive icon archived-icon"></i>{{.i18n.Tr "home.show_archived"}}</label>
+ </div>
+ <div class="ui checkbox" id="archivedFilterCheckbox" title="{{.i18n.Tr "home.show_only_archived"}}" v-if="archivedFilter === 'archived'">
+ <input type="checkbox">
+ <label><i class="archive icon archived-icon"></i>{{.i18n.Tr "home.show_archived"}}</label>
+ </div>
+ </a>
+ </div>
+ <div class="item">
+ <a @click="togglePrivateFilter()">
+ <div class="ui checkbox" id="privateFilterCheckbox" title="{{.i18n.Tr "home.show_both_private_public"}}" v-if="privateFilter === 'both'">
+ <input type="checkbox">
+ <label><svg class="svg octicon-lock" width="16" height="16" aria-hidden="true"><use xlink:href="#octicon-lock" /></svg>{{.i18n.Tr "home.show_private"}}</label>
+ </div>
+ <div class="ui checkbox" id="privateFilterCheckbox" title="{{.i18n.Tr "home.show_only_public"}}" v-if="privateFilter === 'public'">
+ <input type="checkbox">
+ <label><svg class="svg octicon-lock" width="16" height="16" aria-hidden="true"><use xlink:href="#octicon-lock" /></svg>{{.i18n.Tr "home.show_private"}}</label>
+ </div>
+ <div class="ui checkbox" id="privateFilterCheckbox" title="{{.i18n.Tr "home.show_only_private"}}" v-if="privateFilter === 'private'">
+ <input type="checkbox">
+ <label><svg class="svg octicon-lock" width="16" height="16" aria-hidden="true"><use xlink:href="#octicon-lock" /></svg>{{.i18n.Tr "home.show_private"}}</label>
+ </div>
+ </a>
+ </div>
+ </div>
+ </div>
</div>
<div class="ui secondary tiny pointing borderless menu center aligned grid repos-filter">
<a class="item" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')">
@@ -64,7 +101,7 @@
</div>
<div class="ui attached table segment">
<ul class="repo-owner-name-list">
- <li v-for="repo in repos" :class="{'private': repo.private}" v-show="showRepo(repo, reposFilter)">
+ <li v-for="repo in repos" :class="{'private': repo.private}" v-show="showRepo(repo)">
<a :href="suburl + '/' + repo.full_name">
<svg :class="'svg ' + repoClass(repo)" width="16" height="16" aria-hidden="true"><use :xlink:href="'#' + repoClass(repo)" /></svg>
<strong class="text truncate item-name">${repo.full_name}</strong>
@@ -75,7 +112,27 @@
</a>
</li>
<li v-if="showMoreReposLink">
- <a :href="moreReposLink">{{.i18n.Tr "home.show_more_repos"}}</a>
+ <div class="center">
+ <div class="ui borderless pagination menu narrow">
+ <a class="item navigation" :class="{'disabled': page === 1}"
+ @click="changePage(1)" title="{{$.i18n.Tr "admin.first_page"}}">
+ <i class="angle double left icon"></i>
+ </a>
+ <a class="item navigation" :class="{'disabled': page === 1}"
+ @click="changePage(page - 1)" title="{{$.i18n.Tr "repo.issues.previous"}}">
+ <i class="left arrow icon"></i>
+ </a>
+ <a class="active item">${page}</a>
+ <a class="item navigation" :class="{'disabled': page === finalPage}"
+ @click="changePage(page + 1)" title="{{$.i18n.Tr "repo.issues.next"}}">
+ <i class="icon right arrow"></i>
+ </a>
+ <a class="item navigation" :class="{'disabled': page === finalPage}"
+ @click="changePage(finalPage)" title="{{$.i18n.Tr "admin.last_page"}}">
+ <i class="angle double right icon"></i>
+ </a>
+ </div>
+ </div>
</li>
</ul>
</div>