Add titles to warning presets in admin UI (#13252)
parent
aeebbe90dc
commit
f556f79b77
@ -0,0 +1,10 @@ |
||||
.announcements-list__item |
||||
= link_to edit_admin_warning_preset_path(warning_preset), class: 'announcements-list__item__title' do |
||||
= warning_preset.title.presence || truncate(warning_preset.text) |
||||
|
||||
.announcements-list__item__action-bar |
||||
.announcements-list__item__meta |
||||
= truncate(warning_preset.text) |
||||
|
||||
%div |
||||
= table_link_to 'trash', t('admin.warning_presets.delete'), admin_warning_preset_path(warning_preset), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, warning_preset) |
@ -0,0 +1,15 @@ |
||||
require Rails.root.join('lib', 'mastodon', 'migration_helpers') |
||||
|
||||
class AddTitleToAccountWarningPresets < ActiveRecord::Migration[5.2] |
||||
include Mastodon::MigrationHelpers |
||||
|
||||
disable_ddl_transaction! |
||||
|
||||
def up |
||||
safety_assured { add_column_with_default :account_warning_presets, :title, :string, default: '', allow_null: false } |
||||
end |
||||
|
||||
def down |
||||
remove_column :account_warning_presets, :title |
||||
end |
||||
end |
Loading…
Reference in new issue