parent
5a7e78f0fc
commit
625204c8bd
|
@ -10,14 +10,12 @@ Discourse.SiteContentType = Discourse.Model.extend({});
|
||||||
|
|
||||||
Discourse.SiteContentType.reopenClass({
|
Discourse.SiteContentType.reopenClass({
|
||||||
findAll: function() {
|
findAll: function() {
|
||||||
var promise = new Em.Deferred();
|
return Discourse.ajax("/admin/site_content_types").then(function(data) {
|
||||||
Discourse.ajax("/admin/site_content_types").then(function(data) {
|
|
||||||
var contentTypes = Em.A();
|
var contentTypes = Em.A();
|
||||||
data.forEach(function (ct) {
|
data.forEach(function (ct) {
|
||||||
contentTypes.pushObject(Discourse.SiteContentType.create(ct));
|
contentTypes.pushObject(Discourse.SiteContentType.create(ct));
|
||||||
});
|
});
|
||||||
promise.resolve(contentTypes);
|
return contentTypes;
|
||||||
});
|
});
|
||||||
return promise;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,7 +14,6 @@ Discourse.AdminSiteContentEditRoute = Discourse.Route.extend({
|
||||||
|
|
||||||
model: function(params) {
|
model: function(params) {
|
||||||
var list = this.controllerFor('adminSiteContents').get('model');
|
var list = this.controllerFor('adminSiteContents').get('model');
|
||||||
var model;
|
|
||||||
|
|
||||||
// ember routing is fun ... this is what happens
|
// ember routing is fun ... this is what happens
|
||||||
//
|
//
|
||||||
|
@ -28,14 +27,10 @@ Discourse.AdminSiteContentEditRoute = Discourse.Route.extend({
|
||||||
// we could avoid this hack if Ember just compared .serialize(model) with .serialize(context)
|
// we could avoid this hack if Ember just compared .serialize(model) with .serialize(context)
|
||||||
//
|
//
|
||||||
// alternatively we could use some sort of identity map
|
// alternatively we could use some sort of identity map
|
||||||
|
//
|
||||||
|
// see also: https://github.com/emberjs/ember.js/issues/3005
|
||||||
|
|
||||||
list.forEach(function(orig){
|
return list.findProperty("content_type", params.content_type);
|
||||||
if(orig.get("content_type") === params.content_type){
|
|
||||||
model = orig;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return model;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
renderTemplate: function() {
|
renderTemplate: function() {
|
||||||
|
|
|
@ -22,10 +22,14 @@ Discourse.EditCategoryController = Discourse.ObjectController.extend(Discourse.M
|
||||||
}.observes('description'),
|
}.observes('description'),
|
||||||
|
|
||||||
title: function() {
|
title: function() {
|
||||||
if (this.get('id')) return I18n.t("category.edit_long");
|
if (this.get('id')) {
|
||||||
if (this.get('isUncategorized')) return I18n.t("category.edit_uncategorized");
|
return I18n.t("category.edit_long") + ": " + this.get('model.name');
|
||||||
return I18n.t("category.create");
|
}
|
||||||
}.property('id'),
|
if (this.get('isUncategorized')){
|
||||||
|
return I18n.t("category.edit_uncategorized");
|
||||||
|
}
|
||||||
|
return I18n.t("category.create") + " : " + this.get('model.name');
|
||||||
|
}.property('id', 'model.name'),
|
||||||
|
|
||||||
titleChanged: function() {
|
titleChanged: function() {
|
||||||
this.set('controllers.modal.title', this.get('title'));
|
this.set('controllers.modal.title', this.get('title'));
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
{{#each permissions}}
|
{{#each permissions}}
|
||||||
<li>
|
<li>
|
||||||
<span class="name"><span class="badge-group">{{group_name}}</span></span>
|
<span class="name"><span class="badge-group">{{group_name}}</span></span>
|
||||||
|
{{{i18n "category.can"}}}
|
||||||
<span class="permission">{{permission.description}}</span>
|
<span class="permission">{{permission.description}}</span>
|
||||||
<a {{action removePermission this}}><i class="icon icon-remove-sign"></i></a>
|
<a {{action removePermission this}}><i class="icon icon-remove-sign"></i></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -876,6 +876,7 @@ en:
|
||||||
other: "Are you sure you want to delete all those posts?"
|
other: "Are you sure you want to delete all those posts?"
|
||||||
|
|
||||||
category:
|
category:
|
||||||
|
can: 'can… '
|
||||||
none: '(no category)'
|
none: '(no category)'
|
||||||
edit: 'edit'
|
edit: 'edit'
|
||||||
edit_long: "Edit Category"
|
edit_long: "Edit Category"
|
||||||
|
@ -998,9 +999,9 @@ en:
|
||||||
browser_update: 'Unfortunately, <a href="http://www.discourse.org/faq/#browser">your browser is too old to work on this Discourse forum</a>. Please <a href="http://browsehappy.com">upgrade your browser</a>.'
|
browser_update: 'Unfortunately, <a href="http://www.discourse.org/faq/#browser">your browser is too old to work on this Discourse forum</a>. Please <a href="http://browsehappy.com">upgrade your browser</a>.'
|
||||||
|
|
||||||
permission_types:
|
permission_types:
|
||||||
full: "Create Topics, Create Posts and Read"
|
full: "CREATE / REPLY / SEE"
|
||||||
create_post: "Create Posts and Read"
|
create_post: "REPLY / SEE"
|
||||||
readonly: "Read Only"
|
readonly: "SEE"
|
||||||
|
|
||||||
# This section is exported to the javascript for i18n in the admin section
|
# This section is exported to the javascript for i18n in the admin section
|
||||||
admin_js:
|
admin_js:
|
||||||
|
|
Loading…
Reference in New Issue