mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-15 15:16:12 +00:00
refactor: wiki edit form (#38918)
1. the fragile `document.querySelector('.repository.wiki.new
.ui.form')!` is broken (again), rewrite to "data-global-init"
* regression from #37571 because a new form was added
3. use "form-fetch-action" and JSON response instead of
"RenderWithErrDeprecated"
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository wiki new">
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository wiki">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
@@ -9,8 +9,8 @@
|
||||
<a class="ui tiny primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<form class="ui form" action="?action={{if .PageIsWikiEdit}}_edit{{else}}_new{{end}}" method="post">
|
||||
<div class="field {{if .Err_Title}}error{{end}}">
|
||||
<form class="ui form form-fetch-action" action="?action={{Iif .PageIsWikiEdit "_edit" "_new"}}" method="post" data-global-init="initRepoWikiForm">
|
||||
<div class="field">
|
||||
<input name="title" value="{{.title}}" aria-label="{{ctx.Locale.Tr "repo.wiki.page_title"}}" placeholder="{{ctx.Locale.Tr "repo.wiki.page_title"}}" autofocus required>
|
||||
</div>
|
||||
<div class="help">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository wiki view">
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository wiki">
|
||||
{{template "repo/header" .}}
|
||||
{{$title := .title}}
|
||||
<div class="ui container">
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<div class="wiki-content-parts">
|
||||
{{if .WikiSidebarTocHTML}}
|
||||
<div class="render-content markup wiki-content-sidebar wiki-content-toc">
|
||||
<div class="render-content markup wiki-content-sidebar wiki-content-toc" data-global-init="initRepoWikiSidebarToc">
|
||||
{{.WikiSidebarTocHTML}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user