Update look of repo/org tabs on homepage

This commit is contained in:
0ko 2024-03-07 19:01:11 +05:00
parent b9e27b64e6
commit 6739b4f590
3 changed files with 7 additions and 24 deletions

View file

@ -328,10 +328,9 @@ uname_holder = Username or Email address
password_holder = Password password_holder = Password
switch_dashboard_context = Switch Dashboard Context switch_dashboard_context = Switch Dashboard Context
my_repos = Repositories my_repos = Repositories
my_orgs = Organizations
show_more_repos = Show more repositories… show_more_repos = Show more repositories…
collaborative_repos = Collaborative Repositories collaborative_repos = Collaborative Repositories
my_orgs = My Organizations
my_mirrors = My Mirrors
view_home = View %s view_home = View %s
search_repos = Find a repository… search_repos = Find a repository…
filter = Other Filters filter = Other Filters

View file

@ -5,10 +5,7 @@ const data = {
isMirrorsEnabled: {{.MirrorsEnabled}}, isMirrorsEnabled: {{.MirrorsEnabled}},
isStarsEnabled: {{not .IsDisableStars}}, isStarsEnabled: {{not .IsDisableStars}},
textRepository: {{ctx.Locale.Tr "repository"}},
textOrganization: {{ctx.Locale.Tr "organization"}},
textMyRepos: {{ctx.Locale.Tr "home.my_repos"}}, textMyRepos: {{ctx.Locale.Tr "home.my_repos"}},
textNewRepo: {{ctx.Locale.Tr "new_repo"}},
textSearchRepos: {{ctx.Locale.Tr "home.search_repos"}}, textSearchRepos: {{ctx.Locale.Tr "home.search_repos"}},
textFilter: {{ctx.Locale.Tr "home.filter"}}, textFilter: {{ctx.Locale.Tr "home.filter"}},
textShowArchived: {{ctx.Locale.Tr "home.show_archived"}}, textShowArchived: {{ctx.Locale.Tr "home.show_archived"}},
@ -34,7 +31,6 @@ const data = {
textLastPage: {{ctx.Locale.Tr "admin.last_page"}}, textLastPage: {{ctx.Locale.Tr "admin.last_page"}},
textMyOrgs: {{ctx.Locale.Tr "home.my_orgs"}}, textMyOrgs: {{ctx.Locale.Tr "home.my_orgs"}},
textNewOrg: {{ctx.Locale.Tr "new_org"}},
textOrgVisibilityLimited: {{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}, textOrgVisibilityLimited: {{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}},
textOrgVisibilityPrivate: {{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}, textOrgVisibilityPrivate: {{ctx.Locale.Tr "org.settings.visibility.private_shortname"}},

View file

@ -340,21 +340,18 @@ export default sfc; // activate the IDE's Vue plugin
</script> </script>
<template> <template>
<div> <div>
<div v-if="!isOrganization" class="ui two item menu"> <div v-if="!isOrganization" class="ui secondary stackable menu">
<a :class="{item: true, active: tab === 'repos'}" @click="changeTab('repos')">{{ textRepository }}</a> <a :class="{item: true, active: tab === 'repos'}" @click="changeTab('repos')">{{ textMyRepos }} <span class="ui grey label gt-ml-3">{{ reposTotalCount }}</span></a>
<a :class="{item: true, active: tab === 'organizations'}" @click="changeTab('organizations')">{{ textOrganization }}</a> <a :class="{item: true, active: tab === 'organizations'}" @click="changeTab('organizations')">{{ textMyOrgs }} <span class="ui grey label gt-ml-3">{{ organizationsTotalCount }}</span></a>
</div> </div>
<div v-show="tab === 'repos'" class="ui tab active list dashboard-repos"> <div v-show="tab === 'repos'" class="ui tab active list dashboard-repos">
<h4 class="ui top attached header gt-df gt-ac"> <h4 v-if="isOrganization" class="ui top attached gt-mt-4 gt-df gt-ac">
<div class="gt-f1 gt-df gt-ac"> <div class="gt-f1 gt-df gt-ac">
{{ textMyRepos }} {{ textMyRepos }}
<span class="ui grey label gt-ml-3">{{ reposTotalCount }}</span> <span class="ui grey label gt-ml-3">{{ reposTotalCount }}</span>
</div> </div>
<a class="gt-df gt-ac muted" :href="subUrl + '/repo/create' + (isOrganization ? '?org=' + organizationId : '')" :data-tooltip-content="textNewRepo">
<svg-icon name="octicon-plus"/>
</a>
</h4> </h4>
<div class="ui attached segment repos-search"> <div class="ui top attached segment repos-search gt-rounded-top">
<div class="ui fluid action left icon input" :class="{loading: isLoading}"> <div class="ui fluid action left icon input" :class="{loading: isLoading}">
<input type="search" spellcheck="false" maxlength="255" @input="changeReposFilter(reposFilter)" v-model="searchQuery" ref="search" @keydown="reposFilterKeyControl" :placeholder="textSearchRepos"> <input type="search" spellcheck="false" maxlength="255" @input="changeReposFilter(reposFilter)" v-model="searchQuery" ref="search" @keydown="reposFilterKeyControl" :placeholder="textSearchRepos">
<i class="icon"><svg-icon name="octicon-search" :size="16"/></i> <i class="icon"><svg-icon name="octicon-search" :size="16"/></i>
@ -455,16 +452,7 @@ export default sfc; // activate the IDE's Vue plugin
</div> </div>
</div> </div>
<div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list dashboard-orgs"> <div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list dashboard-orgs">
<h4 class="ui top attached header gt-df gt-ac"> <div v-if="organizations.length" class="ui attached table segment gt-rounded">
<div class="gt-f1 gt-df gt-ac">
{{ textMyOrgs }}
<span class="ui grey label gt-ml-3">{{ organizationsTotalCount }}</span>
</div>
<a class="gt-df gt-ac muted" v-if="canCreateOrganization" :href="subUrl + '/org/create'" :data-tooltip-content="textNewOrg">
<svg-icon name="octicon-plus"/>
</a>
</h4>
<div v-if="organizations.length" class="ui attached table segment gt-rounded-bottom">
<ul class="repo-owner-name-list"> <ul class="repo-owner-name-list">
<li class="gt-df gt-ac gt-py-3" v-for="org in organizations" :key="org.name"> <li class="gt-df gt-ac gt-py-3" v-for="org in organizations" :key="org.name">
<a class="repo-list-link muted" :href="subUrl + '/' + encodeURIComponent(org.name)"> <a class="repo-list-link muted" :href="subUrl + '/' + encodeURIComponent(org.name)">