X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=41c3c44a4bc7d4a3cabbff304f2043c03136333e;hb=6eff7e3d6c01e5733285cd6934af29b2161dc9e7;hp=375410720a5a2d9c73daa7793dfd81f9c73444f7;hpb=a5d6c10d06e7e78761393b3670984f91d8e51f7a;p=mkws-moved-to-github.git diff --git a/src/mkws-team.js b/src/mkws-team.js index 3754107..41c3c44 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -668,7 +668,7 @@ function team($, teamName) { var source = node.html(); if (!source) { - source = mkws.defaultTemplate(name); + source = defaultTemplate(name); } template = Handlebars.compile(source); @@ -681,6 +681,87 @@ function team($, teamName) { that.loadTemplate = loadTemplate; + function defaultTemplate(name) + { + if (name === 'Record') { + return '\ +\ + \ + \ + \ + \ + {{#if md-date}}\ + \ + \ + \ + \ + {{/if}}\ + {{#if md-author}}\ + \ + \ + \ + \ + {{/if}}\ + {{#if md-electronic-url}}\ + \ + \ + \ + \ + {{/if}}\ + {{#if-any location having="md-subject"}}\ + \ + \ + \ + \ + {{/if-any}}\ + \ + \ + \ + \ +
{{translate "Title"}}\ + {{md-title}}\ + {{#if md-title-remainder}}\ + ({{md-title-remainder}})\ + {{/if}}\ + {{#if md-title-responsibility}}\ + {{md-title-responsibility}}\ + {{/if}}\ +
{{translate "Date"}}{{md-date}}
{{translate "Author"}}{{md-author}}
{{translate "Links"}}\ + {{#each md-electronic-url}}\ + Link{{index1}}\ + {{/each}}\ +
{{translate "Subject"}}\ + {{#first location having="md-subject"}}\ + {{#if md-subject}}\ + {{#commaList md-subject}}\ + {{this}}{{/commaList}}\ + {{/if}}\ + {{/first}}\ +
{{translate "Locations"}}\ + {{#commaList location}}\ + {{attr "@name"}}{{/commaList}}\ +
\ +'; + } else if (name === "Summary") { + return '\ +\ + {{md-title}}\ +\ +{{#if md-title-remainder}}\ + {{md-title-remainder}}\ +{{/if}}\ +{{#if md-title-responsibility}}\ + {{md-title-responsibility}}\ +{{/if}}\ +'; + } + + var s = "There is no default '" + name +"' template!"; + alert(s); + return s; + } + + // The following PubSub code is modified from the jQuery manual: // https://api.jquery.com/jQuery.Callbacks/ //