Skip to content

Commit 6791aae

Browse files
authored
Add hints for special Wiki pages (#17283)
* Add UI hints to create a Wiki sidebar and footer
1 parent 6ceef87 commit 6791aae

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@ wiki.page_already_exists = A wiki page with the same name already exists.
15851585
wiki.reserved_page = The wiki page name '%s' is reserved.
15861586
wiki.pages = Pages
15871587
wiki.last_updated = Last updated %s
1588+
wiki.page_name_desc = Enter a name for this Wiki page. Some special names are: 'Home', '_Sidebar' and '_Footer'.
15881589

15891590
activity = Activity
15901591
activity.period.filter_label = Period:

routers/web/repo/wiki.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,9 @@ func NewWiki(ctx *context.Context) {
627627
if !ctx.Repo.Repository.HasWiki() {
628628
ctx.Data["title"] = "Home"
629629
}
630+
if ctx.FormString("title") != "" {
631+
ctx.Data["title"] = ctx.FormString("title")
632+
}
630633

631634
ctx.HTML(http.StatusOK, tplWikiNew)
632635
}

templates/repo/wiki/new.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<div class="field {{if .Err_Title}}error{{end}}">
1717
<input name="title" value="{{.title}}" autofocus required>
1818
</div>
19+
<div class="help">
20+
{{.i18n.Tr "repo.wiki.page_name_desc"}}
21+
</div>
1922
<div class="ui top attached tabular menu previewtabs" data-write="write" data-preview="preview">
2023
<a class="active item" data-tab="write">{{.i18n.Tr "write"}}</a>
2124
<a class="item" data-tab="preview" data-url="{{$.Repository.APIURL}}/markdown" data-context="{{$.RepoLink}}">{{$.i18n.Tr "preview"}}</a>

0 commit comments

Comments
 (0)