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:
Gerhard Schlager
2019-03-04 21:15:38 +01:00
parent 68e4aba369
commit ccb48bef75
10 changed files with 58 additions and 23 deletions

View File

@ -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