From 8d567999c97dd51aa25a626e9d6e71705bb1c47c Mon Sep 17 00:00:00 2001
From: Beniamin <106469071+redve-dev@users.noreply.github.com>
Date: Sun, 27 Aug 2023 22:20:04 +0200
Subject: [PATCH 1/2] implement spaces replacing
---
options/locale/locale_en-US.ini | 1 +
templates/repo/create.tmpl | 44 ++++++++++++++++++++++++++++++---
2 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 31d47ad6af202..88fde9a1c5d05 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -1006,6 +1006,7 @@ delete_preexisting_content = Delete files in %s
delete_preexisting_success = Deleted unadopted files in %s
blame_prior = View blame prior to this change
author_search_tooltip = Shows a maximum of 30 users
+repo_renamed_as = This is my template
transfer.accept = Accept Transfer
transfer.accept_desc = Transfer to "%s"
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl
index 0fcdf13f1e383..39923f5455d51 100644
--- a/templates/repo/create.tmpl
+++ b/templates/repo/create.tmpl
@@ -21,18 +21,15 @@
- {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
{{.ContextUser.ShortName 40}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
+
+
{{.locale.Tr "repo.repo_name_helper"}}
+
@@ -220,9 +249,16 @@
-
From e45988f5c8472f9cdaae2da327363e83592a2041 Mon Sep 17 00:00:00 2001
From: Beniamin <106469071+redve-dev@users.noreply.github.com>
Date: Fri, 1 Sep 2023 17:06:12 +0200
Subject: [PATCH 2/2] fix formatting
---
templates/repo/create.tmpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl
index 39923f5455d51..963f52d5dd2c7 100644
--- a/templates/repo/create.tmpl
+++ b/templates/repo/create.tmpl
@@ -66,7 +66,7 @@
document.getElementById("repo_name").addEventListener("input", function(event) {
var repo_name = this.value;
var bubble = document.getElementById("info_bubble");
- if ( repo_name.includes(' ') ) {
+ if (repo_name.includes(' ')) {
repo_name = repo_name.replace(/ /g, char_in_repo_name);
bubble.style.display = "inline-block";
bubble.innerHTML = {{.locale.Tr "repo.repo_renamed_as"}}+`: "${repo_name}"`