Move "Content" under "customize" in admin.
This commit is contained in:
@@ -1,11 +1,3 @@
|
||||
/**
|
||||
Our data model for interacting with custom site content
|
||||
|
||||
@class SiteContent
|
||||
@extends Discourse.Model
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.SiteContent = Discourse.Model.extend({
|
||||
|
||||
markdown: Em.computed.equal('format', 'markdown'),
|
||||
@@ -13,14 +5,8 @@ Discourse.SiteContent = Discourse.Model.extend({
|
||||
html: Em.computed.equal('format', 'html'),
|
||||
css: Em.computed.equal('format', 'css'),
|
||||
|
||||
/**
|
||||
Save the content
|
||||
|
||||
@method save
|
||||
@return {jqXHR} a jQuery Promise object
|
||||
**/
|
||||
save: function() {
|
||||
return Discourse.ajax("/admin/site_contents/" + this.get('content_type'), {
|
||||
return Discourse.ajax("/admin/customize/site_contents/" + this.get('content_type'), {
|
||||
type: 'PUT',
|
||||
data: {content: this.get('content')}
|
||||
});
|
||||
@@ -31,7 +17,7 @@ Discourse.SiteContent = Discourse.Model.extend({
|
||||
Discourse.SiteContent.reopenClass({
|
||||
|
||||
find: function(type) {
|
||||
return Discourse.ajax("/admin/site_contents/" + type).then(function (data) {
|
||||
return Discourse.ajax("/admin/customize/site_contents/" + type).then(function (data) {
|
||||
return Discourse.SiteContent.create(data.site_content);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,21 +1,11 @@
|
||||
/**
|
||||
Our data model that represents types of editing site content
|
||||
|
||||
@class SiteContentType
|
||||
@extends Discourse.Model
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.SiteContentType = Discourse.Model.extend({});
|
||||
Discourse.SiteContentType = Discourse.Model.extend();
|
||||
|
||||
Discourse.SiteContentType.reopenClass({
|
||||
findAll: function() {
|
||||
return Discourse.ajax("/admin/site_content_types").then(function(data) {
|
||||
var contentTypes = Em.A();
|
||||
data.forEach(function (ct) {
|
||||
contentTypes.pushObject(Discourse.SiteContentType.create(ct));
|
||||
return Discourse.ajax("/admin/customize/site_content_types").then(function(data) {
|
||||
return data.map(function(ct) {
|
||||
return Discourse.SiteContentType.create(ct);
|
||||
});
|
||||
return contentTypes;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user