mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-12 08:41:23 -05:00
18 lines
676 B
CoffeeScript
18 lines
676 B
CoffeeScript
window.Discourse.AdminCustomizeController = Ember.Controller.extend
|
|
newCustomization: ->
|
|
item = Discourse.SiteCustomization.create(name: 'New Style')
|
|
@get('content').pushObject(item)
|
|
@set('content.selectedItem', item)
|
|
|
|
selectStyle: (style)-> @set('content.selectedItem', style)
|
|
|
|
save: -> @get('content.selectedItem').save()
|
|
|
|
delete: ->
|
|
bootbox.confirm Em.String.i18n("admin.customize.delete_confirm"), Em.String.i18n("no_value"), Em.String.i18n("yes_value"), (result) =>
|
|
if result
|
|
selected = @get('content.selectedItem')
|
|
selected.delete()
|
|
@set('content.selectedItem', null)
|
|
@get('content').removeObject(selected)
|
|
|