Skip to content

Commit 7ebe55d

Browse files
committed
move code to Vue SFC
1 parent d3adc0d commit 7ebe55d

File tree

6 files changed

+434
-459
lines changed

6 files changed

+434
-459
lines changed

templates/user/dashboard/repolist.tmpl

+1-145
Original file line numberDiff line numberDiff line change
@@ -51,148 +51,4 @@ data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}}
5151
window.config.pageData.dashboardRepoList = data;
5252
</script>
5353

54-
<div id="dashboard-repo-list" class="six wide column">
55-
<repo-search></repo-search>
56-
</div>
57-
58-
<template id="dashboard-repo-list-template">
59-
<div>
60-
<div v-if="!isOrganization" class="ui two item tabable menu">
61-
<a :class="{item: true, active: tab === 'repos'}" @click="changeTab('repos')">${textRepository}</a>
62-
<a :class="{item: true, active: tab === 'organizations'}" @click="changeTab('organizations')">${textOrganization}</a>
63-
</div>
64-
<div v-show="tab === 'repos'" class="ui tab active list dashboard-repos">
65-
<h4 class="ui top attached header gt-df gt-ac">
66-
<div class="gt-f1 gt-df gt-ac">
67-
${textMyRepos}
68-
<span class="ui grey label gt-ml-3">${reposTotalCount}</span>
69-
</div>
70-
<a class="tooltip" :href="subUrl + '/repo/create'" :data-content="textNewRepo" data-position="left center">
71-
<svg-icon name="octicon-plus"></svg-icon>
72-
<span class="sr-only">${textNewRepo}</span>
73-
</a>
74-
</h4>
75-
<div class="ui attached segment repos-search">
76-
<div class="ui fluid right action left icon input" :class="{loading: isLoading}">
77-
<input @input="changeReposFilter(reposFilter)" v-model="searchQuery" ref="search" :placeholder="textSearchRepos">
78-
<i class="icon gt-df gt-ac gt-jc"><svg-icon name="octicon-search" :size="16"></svg-icon></i>
79-
<div class="ui dropdown icon button" :title="textFilter">
80-
<i class="icon gt-df gt-ac gt-jc gt-m-0"><svg-icon name="octicon-filter" :size="16"></svg-icon></i>
81-
<div class="menu">
82-
<a class="item" @click="toggleArchivedFilter()">
83-
<div class="ui checkbox" ref="checkboxArchivedFilter" :title="checkboxArchivedFilterTitle">
84-
<!--the "hidden" is necessary to make the checkbox work without Fomantic UI js,
85-
otherwise if the "input" handles click event for intermediate status, it breaks the internal state-->
86-
<input type="checkbox" class="hidden" v-bind.prop="checkboxArchivedFilterProps">
87-
<label>
88-
<svg-icon name="octicon-archive" :size="16" class-name="gt-mr-2"></svg-icon>
89-
${textShowArchived}
90-
</label>
91-
</div>
92-
</a>
93-
<a class="item" @click="togglePrivateFilter()">
94-
<div class="ui checkbox" ref="checkboxPrivateFilter" :title="checkboxPrivateFilterTitle">
95-
<input type="checkbox" class="hidden" v-bind.prop="checkboxPrivateFilterProps">
96-
<label>
97-
<svg-icon name="octicon-lock" :size="16" class-name="gt-mr-2"></svg-icon>
98-
${textShowPrivate}
99-
</label>
100-
</div>
101-
</a>
102-
</div>
103-
</div>
104-
</div>
105-
<div class="ui secondary tiny pointing borderless menu center grid repos-filter">
106-
<a class="item" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')">
107-
${textAll}
108-
<div v-show="reposFilter === 'all'" class="ui circular mini grey label">${repoTypeCount}</div>
109-
</a>
110-
<a class="item" :class="{active: reposFilter === 'sources'}" @click="changeReposFilter('sources')">
111-
${textSources}
112-
<div v-show="reposFilter === 'sources'" class="ui circular mini grey label">${repoTypeCount}</div>
113-
</a>
114-
<a class="item" :class="{active: reposFilter === 'forks'}" @click="changeReposFilter('forks')">
115-
${textForks}
116-
<div v-show="reposFilter === 'forks'" class="ui circular mini grey label">${repoTypeCount}</div>
117-
</a>
118-
<a class="item" :class="{active: reposFilter === 'mirrors'}" @click="changeReposFilter('mirrors')" v-if="isMirrorsEnabled">
119-
${textMirrors}
120-
<div v-show="reposFilter === 'mirrors'" class="ui circular mini grey label">${repoTypeCount}</div>
121-
</a>
122-
<a class="item" :class="{active: reposFilter === 'collaborative'}" @click="changeReposFilter('collaborative')">
123-
${textCollaborative}
124-
<div v-show="reposFilter === 'collaborative'" class="ui circular mini grey label">${repoTypeCount}</div>
125-
</a>
126-
</div>
127-
</div>
128-
<div v-if="repos.length" class="ui attached table segment gt-rounded-bottom">
129-
<ul class="repo-owner-name-list">
130-
<li v-for="repo in repos" :class="{'private': repo.private || repo.internal}">
131-
<a class="repo-list-link gt-df gt-ac gt-sb" :href="repo.link">
132-
<div class="item-name gt-df gt-ac gt-f1 gt-mr-2">
133-
<component v-bind:is="repoIcon(repo)" size="16" class="gt-mr-2"></component>
134-
<div class="text gt-bold truncate gt-ml-1">${repo.full_name}</div>
135-
<span v-if="repo.archived">
136-
<svg-icon name="octicon-archive" :size="16" class-name="gt-ml-2"></svg-icon>
137-
</span>
138-
</div>
139-
<div class="text light grey gt-df gt-ac" v-if="isStarsEnabled">
140-
${repo.stars_count}
141-
<svg-icon name="octicon-star" :size="16" class-name="gt-ml-2"></svg-icon>
142-
</div>
143-
</a>
144-
</li>
145-
</ul>
146-
<div v-if="showMoreReposLink" class="center gt-py-3 gt-border-secondary-top">
147-
<div class="ui borderless pagination menu narrow">
148-
<a class="item navigation gt-py-2" :class="{'disabled': page === 1}"
149-
@click="changePage(1)" :title="textFirstPage">
150-
<svg-icon name="gitea-double-chevron-left" :size="16" class-name="gt-mr-2"></svg-icon>
151-
</a>
152-
<a class="item navigation gt-py-2" :class="{'disabled': page === 1}"
153-
@click="changePage(page - 1)" :title="textPreviousPage">
154-
<svg-icon name="octicon-chevron-left" :size="16" clsas-name="gt-mr-2"></svg-icon>
155-
</a>
156-
<a class="active item gt-py-2">${page}</a>
157-
<a class="item navigation" :class="{'disabled': page === finalPage}"
158-
@click="changePage(page + 1)" :title="textNextPage">
159-
<svg-icon name="octicon-chevron-right" :size="16" class-name="gt-ml-2"></svg-icon>
160-
</a>
161-
<a class="item navigation gt-py-2" :class="{'disabled': page === finalPage}"
162-
@click="changePage(finalPage)" :title="textLastPage">
163-
<svg-icon name="gitea-double-chevron-right" :size="16" class-name="gt-ml-2"></svg-icon>
164-
</a>
165-
</div>
166-
</div>
167-
</div>
168-
</div>
169-
<div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list dashboard-orgs">
170-
<h4 class="ui top attached header gt-df gt-ac">
171-
<div class="gt-f1 gt-df gt-ac">
172-
${textMyOrgs}
173-
<span class="ui grey label gt-ml-3">${organizationsTotalCount}</span>
174-
</div>
175-
<a v-if="canCreateOrganization" class="tooltip" :href="subUrl + '/org/create'" :data-content="textNewOrg" data-position="left center">
176-
<svg-icon name="octicon-plus"></svg-icon>
177-
<span class="sr-only">${textNewOrg}</span>
178-
</a>
179-
</h4>
180-
<div v-if="organizations.length" class="ui attached table segment gt-rounded-bottom">
181-
<ul class="repo-owner-name-list">
182-
<li v-for="org in organizations">
183-
<a class="repo-list-link gt-df gt-ac gt-sb" :href="subUrl + '/' + encodeURIComponent(org.name)">
184-
<div class="text truncate item-name gt-f1">
185-
<svg-icon name="octicon-organization" :size="16" class-name="gt-mr-2"></svg-icon>
186-
<strong>${org.name}</strong>
187-
</div>
188-
<div class="text light grey gt-df gt-ac">
189-
${org.num_repos}
190-
<svg-icon name="octicon-repo" :size="16" class-name="gt-ml-2 gt-mt-1"></svg-icon>
191-
</div>
192-
</a>
193-
</li>
194-
</ul>
195-
</div>
196-
</div>
197-
</div>
198-
</template>
54+
<div id="dashboard-repo-list" class="six wide column"></div>

0 commit comments

Comments
 (0)