mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 00:08:53 +08:00
UX: Make Uncategorized category less confusing
* Adds warnings to the "Edit Category" dialog * Doesn't hide the "Security" tab on the "Edit Category" dialog anymore. Instead, it shows an explanation why permissions can't be changed. * Makes the category name translatable * Hides the category name from the edit dialog (it can be customized by overriding the translation) * Creates a translation override if the category has been renamed in the past
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
class MigrateUncategorizedCategoryName < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
execute <<~SQL
|
||||
INSERT INTO translation_overrides (locale, translation_key, value, created_at, updated_at)
|
||||
SELECT '#{I18n.locale}', 'uncategorized_category_name', name, now(), now()
|
||||
FROM categories
|
||||
WHERE id = #{SiteSetting.uncategorized_category_id} AND LOWER(name) <> 'uncategorized';
|
||||
SQL
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user