mirror of
https://github.com/discourse/discourse.git
synced 2025-04-09 20:00:49 +08:00
UX: Return a friendlier error when the CSV is invalid. Added a cancel button to return to the /badges view
This commit is contained in:
parent
e4a85e2a80
commit
d3091edcea
@ -21,6 +21,10 @@
|
|||||||
action=(action 'massAward')
|
action=(action 'massAward')
|
||||||
disabled=saving
|
disabled=saving
|
||||||
label="admin.badges.mass_award.perform"}}
|
label="admin.badges.mass_award.perform"}}
|
||||||
|
{{#link-to 'adminBadges.index' class="btn btn-danger"}}
|
||||||
|
{{d-icon "times"}}
|
||||||
|
<span>{{i18n 'cancel'}}</span>
|
||||||
|
{{/link-to}}
|
||||||
</form>
|
</form>
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class='badge-required'>{{I18n 'admin.badges.mass_award.no_badge_selected'}}</span>
|
<span class='badge-required'>{{I18n 'admin.badges.mass_award.no_badge_selected'}}</span>
|
||||||
|
@ -64,7 +64,7 @@ class Admin::BadgesController < Admin::AdminController
|
|||||||
|
|
||||||
head :ok
|
head :ok
|
||||||
rescue CSV::MalformedCSVError
|
rescue CSV::MalformedCSVError
|
||||||
raise Discourse::InvalidParameters
|
render_json_error I18n.t('badges.mass_award.errors.invalid_csv'), status: 400
|
||||||
end
|
end
|
||||||
|
|
||||||
def badge_types
|
def badge_types
|
||||||
|
@ -4128,6 +4128,9 @@ en:
|
|||||||
This document is CC-BY-SA. It was last updated May 31, 2013.
|
This document is CC-BY-SA. It was last updated May 31, 2013.
|
||||||
|
|
||||||
badges:
|
badges:
|
||||||
|
mass_award:
|
||||||
|
errors:
|
||||||
|
invalid_csv: We couldn't read that CSV file. Please confirm it has one email per line.
|
||||||
editor:
|
editor:
|
||||||
name: Editor
|
name: Editor
|
||||||
description: First post edit
|
description: First post edit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user