mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: configurable custom sidebar sections (#20057)
Allows users to configure their own custom sidebar sections with links withing Discourse instance. Links can be passed as relative path, for example "/tags" or full URL. Only path is saved in DB, so when Discourse domain is changed, links will be still valid. Feature is hidden behind SiteSetting.enable_custom_sidebar_sections. This hidden setting determines the group which members have access to this new feature.
This commit is contained in:
committed by
GitHub
parent
5d28cb709a
commit
84a87a703c
13
db/migrate/20230115233416_create_sidebar_sections.rb
Normal file
13
db/migrate/20230115233416_create_sidebar_sections.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateSidebarSections < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :sidebar_sections do |t|
|
||||
t.integer :user_id, null: false
|
||||
t.string :title, null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :sidebar_sections, %i[user_id title], unique: true
|
||||
end
|
||||
end
|
||||
11
db/migrate/20230117002110_create_sidebar_url.rb
Normal file
11
db/migrate/20230117002110_create_sidebar_url.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateSidebarUrl < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :sidebar_urls do |t|
|
||||
t.string :name, null: false
|
||||
t.string :value, null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSidebarSectionIdToSidebarSectionLinks < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :sidebar_section_links, :sidebar_section_id, :integer, index: true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user