Skip to content

Commit

Permalink
Add plugin outlet in admin theme list (#5837)
Browse files Browse the repository at this point in the history
This will be used by discourse-theme-creator to add avatars next to each theme.
  • Loading branch information
davidtaylorhq authored and ZogStriP committed May 18, 2018
1 parent b9dfb0b commit c168639
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Expand Up @@ -5,6 +5,7 @@
{{#each sortedThemes as |theme|}}
<li>
{{#link-to 'adminCustomizeThemes.show' theme replace=true}}
{{plugin-outlet name="admin-customize-themes-list-item" connectorTagName='span' args=(hash theme=theme)}}
{{theme.name}}
{{#if theme.user_selectable}}
{{d-icon "user"}}
Expand Down
1 change: 1 addition & 0 deletions app/models/theme.rb
Expand Up @@ -8,6 +8,7 @@ class Theme < ActiveRecord::Base

@cache = DistributedCache.new('theme')

belongs_to :user
belongs_to :color_scheme
has_many :theme_fields, dependent: :destroy
has_many :theme_settings, dependent: :destroy
Expand Down
2 changes: 2 additions & 0 deletions app/serializers/theme_serializer.rb
Expand Up @@ -58,6 +58,8 @@ def about_url
class ThemeSerializer < ChildThemeSerializer
attributes :color_scheme, :color_scheme_id, :user_selectable, :remote_theme_id, :settings

has_one :user, serializer: UserNameSerializer, embed: :object

has_many :theme_fields, serializer: ThemeFieldSerializer, embed: :objects
has_many :child_themes, serializer: ChildThemeSerializer, embed: :objects
has_one :remote_theme, serializer: RemoteThemeSerializer, embed: :objects
Expand Down

0 comments on commit c168639

Please sign in to comment.