mirror of
https://github.com/discourse/discourse.git
synced 2025-06-15 04:21:37 +08:00
Use HTMLBars API for inserting partials and views
This commit is contained in:
@ -316,7 +316,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class='display-row' {{bind-attr class=":display-row blocked:highlight-danger"}}>
|
<div {{bind-attr class=":display-row blocked:highlight-danger"}}>
|
||||||
<div class='field'>{{i18n 'admin.user.blocked'}}</div>
|
<div class='field'>{{i18n 'admin.user.blocked'}}</div>
|
||||||
<div class='value'>{{blocked}}</div>
|
<div class='value'>{{blocked}}</div>
|
||||||
<div class='controls'>
|
<div class='controls'>
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
Ember.Handlebars.registerHelper('custom-html', function(name, contextString, options) {
|
Ember.HTMLBars._registerHelper('custom-html', function(params, hash, options, env) {
|
||||||
var html = Discourse.HTML.getCustomHTML(name);
|
const name = params[0];
|
||||||
|
const html = Discourse.HTML.getCustomHTML(name);
|
||||||
if (html) { return html; }
|
if (html) { return html; }
|
||||||
|
|
||||||
var container = (options || contextString).data.view.container;
|
const contextString = params[1];
|
||||||
|
const container = (env || contextString).data.view.container;
|
||||||
if (container.lookup('template:' + name)) {
|
if (container.lookup('template:' + name)) {
|
||||||
return Ember.Handlebars.helpers.partial.apply(this, arguments);
|
return env.helpers.partial.helperFunction.apply(this, arguments);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -123,16 +123,5 @@ Ember.HTMLBars._registerHelper('plugin-outlet', function(params, hash, options,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (options.fn) {
|
|
||||||
// If a block is passed, render its content.
|
|
||||||
return Ember.Handlebars.helpers.view.call(this,
|
|
||||||
[Ember.View.extend({
|
|
||||||
isVirtual: true,
|
|
||||||
tagName: '',
|
|
||||||
template: function() {
|
|
||||||
return options.hash.template;
|
|
||||||
}.property()
|
|
||||||
})],
|
|
||||||
hash, options, env);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user