projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Templates are specified by class rather then ID, like other elements.
[mkws-moved-to-github.git]
/
tools
/
htdocs
/
mkws.js
diff --git
a/tools/htdocs/mkws.js
b/tools/htdocs/mkws.js
index
d41cba3
..
1d0b793
100644
(file)
--- a/
tools/htdocs/mkws.js
+++ b/
tools/htdocs/mkws.js
@@
-174,6
+174,7
@@
function team($, teamName) {
"last": $.now()
};
var m_paz; // will be initialised below
"last": $.now()
};
var m_paz; // will be initialised below
+ var m_template = {};
var debug = function (s) {
var debug = function (s) {
@@
-762,17
+763,23
@@
function team($, teamName) {
function loadTemplate(name)
{
function loadTemplate(name)
{
- var template = mkws['template' + name];
+ var template = m_template[name];
if (template === undefined) {
if (template === undefined) {
- var source = $("#mkwsTemplate" + name).html();
+ // Fall back to generic template if there is no team-specific one
+ var node = $(".mkwsTemplate_" + name + ".mkwsTeam_" + m_teamName)
+ if (!node.length) {
+ node = $(".mkwsTemplate_" + name + ".mkwsTeam_ALL")
+ }
+
+ var source = node.html();
if (!source) {
source = defaultTemplate(name);
}
template = Handlebars.compile(source);
debug("compiled template '" + name + "'");
if (!source) {
source = defaultTemplate(name);
}
template = Handlebars.compile(source);
debug("compiled template '" + name + "'");
- mkws['template' + name] = template;
+ m_template[name] = template;
}
return template;
}
return template;