* Fix it so that all edit forms show an error banner if the form has validation errors. Previously forms had to manually call `error_messages_for`, which not all forms did. * Fix it so that the full validation error message is shown next to each input attribute that had errors. Also update the styling of these error messages to look better.
21 lines
987 B
Plaintext
21 lines
987 B
Plaintext
<div id="form-content">
|
|
<%= edit_form_for(@wiki_page, url: wiki_page_path(@wiki_page.id)) do |f| %>
|
|
<%= f.input :title, error: false, input_html: { data: { autocomplete: "tag" } }, hint: "Change to rename this wiki page. Update any wikis linking to this page first." %>
|
|
|
|
<% if !@wiki_page.tag&.artist? || @wiki_page.other_names.present? %>
|
|
<%= f.input :other_names_string, as: :string, label: "Other names (#{link_to_wiki "help", "help:translated_tags"})".html_safe, hint: "Names used for this tag on other sites such as Pixiv. Separate with spaces." %>
|
|
<% end %>
|
|
|
|
<%= f.input :body, as: :dtext %>
|
|
|
|
<% if policy(@wiki_page).can_edit_locked? %>
|
|
<%= f.input :is_locked, label: "Locked", hint: "Locked wikis can only be edited by Builders." %>
|
|
<% end %>
|
|
|
|
<%= f.input :is_deleted, label: "Deleted", hint: "Check to mark this wiki page as deleted." %>
|
|
|
|
<%= f.submit "Submit" %>
|
|
<%= dtext_preview_button "wiki_page_body" %>
|
|
<% end %>
|
|
</div>
|