If a distribution has no legacy record, it shouldn't get a menu
entry in the MFHD menus. A magic id of '-1' is used to indicate
this case, so we need to check for that when populating
mfhdDetails via the TPAC.
Also, entryNum must be an int, not a string, because it is
incremented prior to display. Removing the quotes solves this
display issue.
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Ben Shum <bshum@biblio.org>
<script>
window.mfhdDetails = [
[% FOR summary IN ctx.mfhd_summaries %]
+ [% IF summary.sre_id != -1 %]
{
'id' : '[% summary.sre_id %]',
'label' : '[% summary.location | replace("'", "\\'") %]',
- 'entryNum' : '[% loop.index %]',
+ 'entryNum' : [% loop.index %],
'owning_lib' : '[% summary.owning_lib %]'
},
+ [% END %]
[% END %]
];
</script>