UX: warn that something must be selected with safe mode
This commit is contained in:
parent
4f28c71b50
commit
dfe9f70747
|
@ -14,6 +14,7 @@ class SafeModeController < ApplicationController
|
||||||
if safe_mode.length > 0
|
if safe_mode.length > 0
|
||||||
redirect_to path("/?safe_mode=#{safe_mode.join("%2C")}")
|
redirect_to path("/?safe_mode=#{safe_mode.join("%2C")}")
|
||||||
else
|
else
|
||||||
|
flash[:must_select] = true
|
||||||
redirect_to safe_mode_path
|
redirect_to safe_mode_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,24 +6,29 @@
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>
|
<label>
|
||||||
<%= check_box_tag 'no_customizations', true, true %>
|
<%= check_box_tag 'no_customizations', true, !flash[:must_select]%>
|
||||||
<%= t 'safe_mode.no_customizations' %>
|
<%= t 'safe_mode.no_customizations' %>
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>
|
<label>
|
||||||
<%= check_box_tag 'only_official', true, true %>
|
<%= check_box_tag 'only_official', true, !flash[:must_select] %>
|
||||||
<%= t 'safe_mode.only_official' %>
|
<%= t 'safe_mode.only_official' %>
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>
|
<label>
|
||||||
<%= check_box_tag 'no_plugins', true, true %>
|
<%= check_box_tag 'no_plugins', true, !flash[:must_select] %>
|
||||||
<%= t 'safe_mode.no_plugins' %>
|
<%= t 'safe_mode.no_plugins' %>
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<%= submit_tag t('safe_mode.enter'), class: 'btn btn-danger' %>
|
<%= submit_tag t('safe_mode.enter'), class: 'btn btn-danger' %>
|
||||||
|
<%- if flash[:must_select] %>
|
||||||
|
<span class='safe-mode-warning'>
|
||||||
|
<i class='fa fa-warning'></i> <%= t 'safe_mode.must_select' %>
|
||||||
|
</span>
|
||||||
|
<%- end %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3503,6 +3503,7 @@ en:
|
||||||
only_official: "Disable unofficial plugins"
|
only_official: "Disable unofficial plugins"
|
||||||
no_plugins: "Disable all plugins"
|
no_plugins: "Disable all plugins"
|
||||||
enter: "Enter Safe Mode"
|
enter: "Enter Safe Mode"
|
||||||
|
must_select: "You must select at least one option to enter safe mode."
|
||||||
wizard:
|
wizard:
|
||||||
title: "Discourse Setup"
|
title: "Discourse Setup"
|
||||||
step:
|
step:
|
||||||
|
|
Loading…
Reference in New Issue