mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add site setting to show more detailed 404 errors. (#8014)
If the setting is turned on, then the user will receive information about the subject: if it was deleted or requires some special access to a group (only if the group is public). Otherwise, the user will receive a generic #404 error message. For now, this change affects only the topics and categories controller. This commit also tries to refactor some of the code related to error handling. To make error pages more consistent (design-wise), the actual error page will be rendered server-side.
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
<h1 class="page-not-found"><%= t 'page_not_found.title' %></h1>
|
||||
<div class="page-not-found">
|
||||
<h1 class="title"><%= @title %></h1>
|
||||
|
||||
<%- if @group&.allow_membership_requests %>
|
||||
<a href="<%= group_path @group.name %>" class='btn btn-primary'><%= SvgSprite.raw_svg('user-plus') %> <%= I18n.t('not_in_group.request_membership') %></a>
|
||||
<%- elsif @group&.public_admission %>
|
||||
<a href="<%= group_path @group.name %>" class='btn btn-primary'><%= SvgSprite.raw_svg('user-plus') %> <%= I18n.t('not_in_group.join_group') %></a>
|
||||
<%- end %>
|
||||
</div>
|
||||
|
||||
<%= build_plugin_html 'server:not-found-before-topics' %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user