mirror of https://github.com/Siphonay/mastodon
Move admin action log type list generation to helper (#32178)
This commit is contained in:
parent
d82ffdccbb
commit
2e8b752c55
|
@ -35,4 +35,11 @@ module Admin::ActionLogsHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sorted_action_log_types
|
||||||
|
Admin::ActionLogFilter::ACTION_TYPE_MAP
|
||||||
|
.keys
|
||||||
|
.map { |key| [I18n.t("admin.action_logs.action_types.#{key}"), key] }
|
||||||
|
.sort_by(&:first)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
%strong= t('admin.action_logs.filter_by_action')
|
%strong= t('admin.action_logs.filter_by_action')
|
||||||
.input.select.optional
|
.input.select.optional
|
||||||
= form.select :action_type,
|
= form.select :action_type,
|
||||||
options_for_select(Admin::ActionLogFilter::ACTION_TYPE_MAP.keys.map { |key| [I18n.t("admin.action_logs.action_types.#{key}"), key] }, params[:action_type]),
|
options_for_select(sorted_action_log_types, params[:action_type]),
|
||||||
prompt: I18n.t('admin.accounts.moderation.all')
|
prompt: I18n.t('admin.accounts.moderation.all')
|
||||||
|
|
||||||
- if @action_logs.empty?
|
- if @action_logs.empty?
|
||||||
|
|
Loading…
Reference in New Issue