From 6791aae8de53972e0eeb83dc22ce2020531a81c5 Mon Sep 17 00:00:00 2001 From: n <67550725+n194@users.noreply.github.com> Date: Fri, 3 Dec 2021 16:28:54 +0900 Subject: [PATCH] Add hints for special Wiki pages (#17283) * Add UI hints to create a Wiki sidebar and footer --- options/locale/locale_en-US.ini | 1 + routers/web/repo/wiki.go | 3 +++ templates/repo/wiki/new.tmpl | 3 +++ 3 files changed, 7 insertions(+) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 0a3c0c064..94d351f0c 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1585,6 +1585,7 @@ wiki.page_already_exists = A wiki page with the same name already exists. wiki.reserved_page = The wiki page name '%s' is reserved. wiki.pages = Pages wiki.last_updated = Last updated %s +wiki.page_name_desc = Enter a name for this Wiki page. Some special names are: 'Home', '_Sidebar' and '_Footer'. activity = Activity activity.period.filter_label = Period: diff --git a/routers/web/repo/wiki.go b/routers/web/repo/wiki.go index 82f56a8c4..44914a3e3 100644 --- a/routers/web/repo/wiki.go +++ b/routers/web/repo/wiki.go @@ -627,6 +627,9 @@ func NewWiki(ctx *context.Context) { if !ctx.Repo.Repository.HasWiki() { ctx.Data["title"] = "Home" } + if ctx.FormString("title") != "" { + ctx.Data["title"] = ctx.FormString("title") + } ctx.HTML(http.StatusOK, tplWikiNew) } diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl index 6cfa79837..5b8cdc816 100644 --- a/templates/repo/wiki/new.tmpl +++ b/templates/repo/wiki/new.tmpl @@ -16,6 +16,9 @@
+
+ {{.i18n.Tr "repo.wiki.page_name_desc"}} +