mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Make wiki title supports dashes and improve wiki name related features (#24143)
Close #7570 1. Clearly define the wiki path behaviors, see `services/wiki/wiki_path.go` and tests 2. Keep compatibility with old contents 3. Allow to use dashes in titles, eg: "2000-01-02 Meeting record" 4. Add a "Pages" link in the dropdown, otherwise users can't go to the Pages page easily. 5. Add a "View original git file" link in the Pages list, even if some file names are broken, users still have a chance to edit or remove it, without cloning the wiki repo to local. 6. Fix 500 error when the name contains prefix spaces. This PR also introduces the ability to support sub-directories, but it can't be done at the moment due to there are a lot of legacy wiki data, which use "%2F" in file names.   Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@@ -3,22 +3,21 @@
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
<h2 class="ui header gt-df gt-ac gt-sb">
|
||||
<div>
|
||||
{{.locale.Tr "repo.wiki.pages"}}
|
||||
</div>
|
||||
<div>
|
||||
<span>{{.locale.Tr "repo.wiki.pages"}}</span>
|
||||
<span>
|
||||
{{if and .CanWriteWiki (not .IsRepositoryMirror)}}
|
||||
<a class="ui green small button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</span>
|
||||
</h2>
|
||||
<table class="ui table">
|
||||
<table class="ui table wiki-pages-list">
|
||||
<tbody>
|
||||
{{range .Pages}}
|
||||
<tr>
|
||||
<td>
|
||||
{{svg "octicon-file"}}
|
||||
<a href="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</a>
|
||||
<a class="wiki-git-entry" href="{{$.RepoLink}}/wiki/{{.GitEntryName | PathEscape}}" data-tooltip-content="{{$.locale.Tr "repo.wiki.original_git_entry_tooltip"}}">{{svg "octicon-chevron-right"}}</a>
|
||||
</td>
|
||||
{{$timeSince := TimeSinceUnix .UpdatedUnix $.locale}}
|
||||
<td class="text right">{{$.locale.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td>
|
||||
|
@@ -5,34 +5,32 @@
|
||||
<div class="ui container">
|
||||
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw">
|
||||
<div class="gt-df gt-ac">
|
||||
<div class="choose page">
|
||||
<div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}">
|
||||
<div class="ui basic small button">
|
||||
<span class="text">
|
||||
{{.locale.Tr "repo.wiki.page"}}:
|
||||
<strong>{{$title}}</strong>
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}">
|
||||
<div class="ui basic small button">
|
||||
<span class="text">
|
||||
{{.locale.Tr "repo.wiki.page"}}:
|
||||
<strong>{{$title}}</strong>
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
</div>
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon gt-df gt-ac gt-jc gt-m-0">{{svg "octicon-filter" 16}}</i>
|
||||
<input name="search" placeholder="{{.locale.Tr "repo.wiki.filter_page"}}...">
|
||||
</div>
|
||||
<div class="menu">
|
||||
<div class="ui icon search input">
|
||||
<i class="icon gt-df gt-ac gt-jc gt-m-0">{{svg "octicon-filter" 16}}</i>
|
||||
<input name="search" placeholder="{{.locale.Tr "repo.wiki.filter_page"}}...">
|
||||
</div>
|
||||
<div class="scrolling menu">
|
||||
{{range .Pages}}
|
||||
<div class="item {{if eq $.Title .Name}}selected{{end}}" data-url="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="scrolling menu">
|
||||
<a class="item muted" href="{{.RepoLink}}/wiki/?action=_pages">{{.locale.Tr "repo.wiki.pages"}}</a>
|
||||
<div class="ui divider"></div>
|
||||
{{range .Pages}}
|
||||
<a class="item {{if eq $.Title .Name}}selected{{end}}" href="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gt-df gt-ac">
|
||||
<div class="ui action small input" id="clone-panel">
|
||||
{{template "repo/clone_buttons" .}}
|
||||
{{template "repo/clone_script" .}}
|
||||
</div>
|
||||
<div class="ui action small input gt-df gt-ac" id="clone-panel">
|
||||
{{template "repo/clone_buttons" .}}
|
||||
{{template "repo/clone_script" .}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui dividing header">
|
||||
|
Reference in New Issue
Block a user