Skip to content

Commit eefec9b

Browse files
committed
Fix some places which doesn't repsect org full name setting
1 parent 0fe5e2b commit eefec9b

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

templates/admin/org/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<tr>
5353
<td>{{.ID}}</td>
5454
<td>
55-
<a href="{{.HomeLink}}">{{.Name}}</a>
55+
<a href="{{.HomeLink}}">{{if and DefaultShowFullName .FullName}}{{.FullName}}({{.Name}}){{else}}{{.Name}}{{end}}</a>
5656
{{if .Visibility.IsPrivate}}
5757
<span class="text gold">{{svg "octicon-lock"}}</span>
5858
{{end}}

templates/base/head_script.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ If you introduce mistakes in it, Gitea JavaScript code wouldn't run correctly.
1313
assetVersionEncoded: encodeURIComponent('{{AssetVersion}}'), // will be used in URL construction directly
1414
assetUrlPrefix: '{{AssetUrlPrefix}}',
1515
runModeIsProd: {{.RunModeIsProd}},
16+
defaultShowFullName: {{DefaultShowFullName}},
1617
customEmojis: {{CustomEmojis}},
1718
csrfToken: '{{.CsrfToken}}',
1819
pageData: {{.PageData}},

templates/user/dashboard/repolist.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ data.teamId = {{.Team.ID}};
4545
{{end}}
4646

4747
{{if not .ContextUser.IsOrganization}}
48-
data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'num_repos': {{.NumRepos}}, 'org_visibility': {{.Visibility}}},{{end}}];
48+
data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'full_name': {{.FullName}}, 'num_repos': {{.NumRepos}}, 'org_visibility': {{.Visibility}}},{{end}}];
4949
data.isOrganization = false;
5050
data.organizationsTotalCount = {{.UserOrgsCount}};
5151
data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}};

web_src/js/components/DashboardRepoList.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import $ from 'jquery';
44
import {SvgIcon} from '../svg.ts';
55
import {GET} from '../modules/fetch.ts';
66
7-
const {appSubUrl, assetUrlPrefix, pageData} = window.config;
7+
const {appSubUrl, assetUrlPrefix, pageData, defaultShowFullName} = window.config;
88
99
// make sure this matches templates/repo/commit_status.tmpl
1010
const commitStatus = {
@@ -64,6 +64,7 @@ const sfc = {
6464
canCreateOrganization: false,
6565
organizationsTotalCount: 0,
6666
organizationId: 0,
67+
defaultShowFullName,
6768
6869
subUrl: appSubUrl,
6970
...pageData.dashboardRepoList,
@@ -471,7 +472,7 @@ export default sfc; // activate the IDE's Vue plugin
471472
<li class="tw-flex tw-items-center tw-py-2" v-for="org in organizations" :key="org.name">
472473
<a class="repo-list-link muted" :href="subUrl + '/' + encodeURIComponent(org.name)">
473474
<svg-icon name="octicon-organization" :size="16" class-name="repo-list-icon"/>
474-
<div class="text truncate">{{ org.name }}</div>
475+
<div class="text truncate">{{ defaultShowFullName && org.full_name ? org.full_name : org.name }}</div>
475476
<div><!-- div to prevent underline of label on hover -->
476477
<span class="ui tiny basic label" v-if="org.org_visibility !== 'public'">
477478
{{ org.org_visibility === 'limited' ? textOrgVisibilityLimited: textOrgVisibilityPrivate }}

web_src/js/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type Config = {
1212
assetVersionEncoded: string,
1313
assetUrlPrefix: string,
1414
runModeIsProd: boolean,
15+
defaultShowFullName: boolean,
1516
customEmojis: Record<string, string>,
1617
csrfToken: string,
1718
pageData: Record<string, any>,

0 commit comments

Comments
 (0)