FEATURE: Export customizations as JSON files

This commit is contained in:
riking
2015-05-16 18:15:42 -07:00
parent 7ab8827c7e
commit 1e53c179a3
6 changed files with 40 additions and 1 deletions
@@ -84,7 +84,11 @@ Discourse.SiteCustomization = Discourse.Model.extend({
destroy: function() {
if (!this.id) return;
return Discourse.ajax("/admin/site_customizations/" + this.id, { type: 'DELETE' });
}
},
download_url: function() {
return Discourse.getURL('/admin/site_customizations/' + this.id);
}.property('id')
});
var SiteCustomizations = Ember.ArrayProxy.extend({
@@ -14,6 +14,7 @@
<div {{bind-attr class=":current-style view.maximized:maximized"}}>
<div class='wrapper'>
{{text-field class="style-name" value=selectedItem.name}}
<a class="btn export" download target="_blank" href={{selectedItem.download_url}}>{{fa-icon "download"}} {{i18n 'admin.export_json.button_text'}}</a>
<div class='admin-controls'>
<ul class="nav nav-pills">