1
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-01-04 09:17:43 +03:00

Add hint for public and private profile repo name

This commit is contained in:
changchaishi 2024-12-20 08:10:55 +00:00 committed by iknowright
parent ef826a1d0c
commit 6496b3c128
4 changed files with 24 additions and 0 deletions

View File

@ -1015,6 +1015,8 @@ new_repo_helper = A repository contains all project files, including revision hi
owner = Owner
owner_helper = Some organizations may not show up in the dropdown due to a maximum repository count limit.
repo_name = Repository Name
repo_name_public_profile_hint=.profile is a special repository that you can use to add a README.md to your personal or organization publiv profile. Make sure it's public and initialize it with a README to get started.
repo_name_private_profile_hint=.profile-private is a special repository that you can use to add a README.md to your organization member profile. Make sure it's private and initialize it with a README to get started.
repo_name_helper = Good repository names use short, memorable and unique keywords.
repo_size = Repository Size
template = Template

View File

@ -44,6 +44,8 @@
<div class="inline required field {{if .Err_RepoName}}error{{end}}">
<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" value="{{.repo_name}}" autofocus required maxlength="100">
<span id="repo_name_public_profile_hint" style="display:none" class="help">{{ctx.Locale.Tr "repo.repo_name_public_profile_hint"}}</span>
<span id="repo_name_private_profile_hint" style="display:none" class="help">{{ctx.Locale.Tr "repo.repo_name_private_profile_hint"}}</span>
<span class="help">{{ctx.Locale.Tr "repo.repo_name_helper"}}</span>
</div>
<div class="inline field">

View File

@ -0,0 +1,18 @@
const repoName = document.querySelector<HTMLInputElement>('#repo_name');
const repoPublicHint = document.querySelector<HTMLInputElement>('#repo_name_public_profile_hint');
const repoPrivateHint = document.querySelector<HTMLInputElement>('#repo_name_private_profile_hint');
export function initRepoCreate() {
repoName?.addEventListener('input', () => {
if (repoName?.value === '.profile') {
repoPublicHint.style.display = 'inline-block';
} else {
repoPublicHint.style.display = 'none';
}
if (repoName?.value === '.profile-private') {
repoPrivateHint.style.display = 'inline-block';
} else {
repoPrivateHint.style.display = 'none';
}
});
}

View File

@ -35,6 +35,7 @@ import {initRepoEllipsisButton, initCommitStatuses} from './features/repo-commit
import {initRepoTopicBar} from './features/repo-home.ts';
import {initAdminCommon} from './features/admin/common.ts';
import {initRepoTemplateSearch} from './features/repo-template.ts';
import {initRepoCreate} from './features/repo-create.ts';
import {initRepoCodeView} from './features/repo-code.ts';
import {initSshKeyFormParser} from './features/sshkey-helper.ts';
import {initUserSettings} from './features/user-settings.ts';
@ -173,6 +174,7 @@ onDomReady(() => {
initRepoActivityTopAuthorsChart,
initRepoArchiveLinks,
initRepoBranchButton,
initRepoCreate,
initRepoCodeView,
initBranchSelectorTabs,
initRepoEllipsisButton,