mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00

Seperate template replacement from adding the initial "custom" prefix, so that server-side templates (namely e-mails) can also have overrides.
20 lines
606 B
JavaScript
20 lines
606 B
JavaScript
Meteor.startup(function () {
|
|
|
|
// loop over custom prefixes
|
|
Telescope.config.customPrefixes.forEach(function (prefix) {
|
|
|
|
// for each prefix, loop over all templates to find any replacements
|
|
Template.forEach(function (template) {
|
|
|
|
var templateName = template.viewName.replace("Template.", "");
|
|
|
|
// if current template name starts with the prefix, find original template and replace it
|
|
if (templateName.slice(0,prefix.length) === prefix) {
|
|
var oldTemplate = templateName.slice(prefix.length);
|
|
template.replaces(oldTemplate);
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
});
|