mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +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')
|
||||
disabled=saving
|
||||
label="admin.badges.mass_award.perform"}}
|
||||
{{#link-to 'adminBadges.index' class="btn btn-danger"}}
|
||||
{{d-icon "times"}}
|
||||
<span>{{i18n 'cancel'}}</span>
|
||||
{{/link-to}}
|
||||
</form>
|
||||
{{else}}
|
||||
<span class='badge-required'>{{I18n 'admin.badges.mass_award.no_badge_selected'}}</span>
|
||||
|
|
|
@ -64,7 +64,7 @@ class Admin::BadgesController < Admin::AdminController
|
|||
|
||||
head :ok
|
||||
rescue CSV::MalformedCSVError
|
||||
raise Discourse::InvalidParameters
|
||||
render_json_error I18n.t('badges.mass_award.errors.invalid_csv'), status: 400
|
||||
end
|
||||
|
||||
def badge_types
|
||||
|
|
|
@ -4128,6 +4128,9 @@ en:
|
|||
This document is CC-BY-SA. It was last updated May 31, 2013.
|
||||
|
||||
badges:
|
||||
mass_award:
|
||||
errors:
|
||||
invalid_csv: We couldn't read that CSV file. Please confirm it has one email per line.
|
||||
editor:
|
||||
name: Editor
|
||||
description: First post edit
|
||||
|
|
Loading…
Reference in New Issue
Block a user