From 6f8ad46c12fc274d0ba5afe60259caca1774cee0 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Mon, 17 Jan 2022 16:30:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/course.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/repo/course.go b/routers/repo/course.go index b8f39817b..013ee20da 100644 --- a/routers/repo/course.go +++ b/routers/repo/course.go @@ -19,8 +19,9 @@ const ( func CreateCourse(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("new_course") + org, _ := models.GetUserByName(setting.Course.OrgName) - ctx.Data["Owner"] = setting.Course.OrgName + ctx.Data["Owner"] = org ctx.HTML(200, tplCreateCourse) From 3f2c50e27156d754be2429816606c23f61173782 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 17 Jan 2022 16:36:28 +0800 Subject: [PATCH 2/2] fix issue --- options/locale/locale_en-US.ini | 2 + options/locale/locale_zh-CN.ini | 3 + templates/repo/createCourse.tmpl | 98 ++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 templates/repo/createCourse.tmpl diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 1756b9533..17f639866 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -348,6 +348,8 @@ modify = Update [form] UserName = Username Alias = Repository name +courseAlias = Course Name +courseAdress = Course Path RepoPath = Repository path RepoAdress = Repository Adress Email = Email address diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index d034b1722..93afc66c4 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -353,6 +353,8 @@ modify=更新 UserName=用户名 RepoName=项目路径 Alias=项目名称 +courseAlias=课程名称 +courseAdress=课程地址 RepoPath=项目路径 RepoAdress=项目地址 Email=邮箱地址 @@ -802,6 +804,7 @@ generate_from=生成自 repo_desc=项目描述 repo_lang=项目语言 repo_gitignore_helper=选择 .gitignore 模板。 +repo_label_helpe=输入完成后回车键完成标签确定。 issue_labels=任务标签 issue_labels_helper=选择一个任务标签集 license=授权许可 diff --git a/templates/repo/createCourse.tmpl b/templates/repo/createCourse.tmpl new file mode 100644 index 000000000..5ce7d010b --- /dev/null +++ b/templates/repo/createCourse.tmpl @@ -0,0 +1,98 @@ +{{template "base/head" .}} +
+
+
+
+ {{.CsrfTokenHtml}} +

+ {{.i18n.Tr "new_course"}} +

+
+ {{template "base/alert" .}} +
+ + + {{.i18n.Tr "form.reponame_dash_dot_error"}} +
+ +
+ +
+ +
+
/
+
+ +
+
+ {{.i18n.Tr "form.repoadd_dash_dot_error"}} + + +
+ + +
+ +
+ + +
+
+ + + {{.i18n.Tr "cancel"}} +
+
+
+
+
+
+{{template "base/footer" .}} + + \ No newline at end of file