mirror of
https://github.com/go-gitea/gitea.git
synced 2025-09-21 09:44:35 +03:00
Add hint for public and private profile repo name
This commit is contained in:
@@ -1015,6 +1015,8 @@ new_repo_helper = A repository contains all project files, including revision hi
|
|||||||
owner = Owner
|
owner = Owner
|
||||||
owner_helper = Some organizations may not show up in the dropdown due to a maximum repository count limit.
|
owner_helper = Some organizations may not show up in the dropdown due to a maximum repository count limit.
|
||||||
repo_name = Repository Name
|
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_name_helper = Good repository names use short, memorable and unique keywords.
|
||||||
repo_size = Repository Size
|
repo_size = Repository Size
|
||||||
template = Template
|
template = Template
|
||||||
|
@@ -44,6 +44,8 @@
|
|||||||
<div class="inline required field {{if .Err_RepoName}}error{{end}}">
|
<div class="inline required field {{if .Err_RepoName}}error{{end}}">
|
||||||
<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
|
<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">
|
<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>
|
<span class="help">{{ctx.Locale.Tr "repo.repo_name_helper"}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="inline field">
|
<div class="inline field">
|
||||||
|
18
web_src/js/features/repo-create.ts
Normal file
18
web_src/js/features/repo-create.ts
Normal 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';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
@@ -35,6 +35,7 @@ import {initRepoEllipsisButton, initCommitStatuses} from './features/repo-commit
|
|||||||
import {initRepoTopicBar} from './features/repo-home.ts';
|
import {initRepoTopicBar} from './features/repo-home.ts';
|
||||||
import {initAdminCommon} from './features/admin/common.ts';
|
import {initAdminCommon} from './features/admin/common.ts';
|
||||||
import {initRepoTemplateSearch} from './features/repo-template.ts';
|
import {initRepoTemplateSearch} from './features/repo-template.ts';
|
||||||
|
import {initRepoCreate} from './features/repo-create.ts';
|
||||||
import {initRepoCodeView} from './features/repo-code.ts';
|
import {initRepoCodeView} from './features/repo-code.ts';
|
||||||
import {initSshKeyFormParser} from './features/sshkey-helper.ts';
|
import {initSshKeyFormParser} from './features/sshkey-helper.ts';
|
||||||
import {initUserSettings} from './features/user-settings.ts';
|
import {initUserSettings} from './features/user-settings.ts';
|
||||||
@@ -173,6 +174,7 @@ onDomReady(() => {
|
|||||||
initRepoActivityTopAuthorsChart,
|
initRepoActivityTopAuthorsChart,
|
||||||
initRepoArchiveLinks,
|
initRepoArchiveLinks,
|
||||||
initRepoBranchButton,
|
initRepoBranchButton,
|
||||||
|
initRepoCreate,
|
||||||
initRepoCodeView,
|
initRepoCodeView,
|
||||||
initBranchSelectorTabs,
|
initBranchSelectorTabs,
|
||||||
initRepoEllipsisButton,
|
initRepoEllipsisButton,
|
||||||
|
Reference in New Issue
Block a user